1 /***************************************************************************
2 * Copyright (C) 2006 by Pino Toscano <toscano.pino@tiscali.it> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 ***************************************************************************/
10 #include "chooseenginedialog_p.h"
12 #include <QtGui/QComboBox>
13 #include <QtGui/QLabel>
17 #include "ui_chooseenginewidget.h"
19 ChooseEngineDialog::ChooseEngineDialog( const QStringList
&generators
, const KMimeType::Ptr
&mime
, QWidget
* parent
)
22 setCaption( i18n( "Backend Selection" ) );
23 setButtons( Ok
| Cancel
);
24 setDefaultButton( Ok
);
25 QWidget
*main
= new QWidget( this );
26 setMainWidget( main
);
27 m_widget
= new Ui_ChooseEngineWidget();
28 m_widget
->setupUi( main
);
30 m_widget
->engineList
->addItems(generators
);
32 m_widget
->description
->setText(
33 i18n( "<qt>More than one backend found for the MIME type:<br />"
34 "<b>%1</b> (%2).<br /><br />"
35 "Please select which one to use:</qt>", mime
->comment(), mime
->name() ) );
38 ChooseEngineDialog::~ChooseEngineDialog()
43 int ChooseEngineDialog::selectedGenerator() const
45 return m_widget
->engineList
->currentIndex();