okular
chooseenginedialog.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "chooseenginedialog_p.h"
00011
00012 #include <QtGui/QComboBox>
00013 #include <QtGui/QLabel>
00014
00015 #include <klocale.h>
00016
00017 #include "ui_chooseenginewidget.h"
00018
00019 ChooseEngineDialog::ChooseEngineDialog( const QStringList &generators, const KMimeType::Ptr &mime, QWidget * parent )
00020 : KDialog( parent )
00021 {
00022 setCaption( i18n( "Backend Selection" ) );
00023 setButtons( Ok | Cancel );
00024 setDefaultButton( Ok );
00025 QWidget *main = new QWidget( this );
00026 setMainWidget( main );
00027 m_widget = new Ui_ChooseEngineWidget();
00028 m_widget->setupUi( main );
00029
00030 m_widget->engineList->addItems(generators);
00031
00032 m_widget->description->setText(
00033 i18n( "<qt>More than one backend found for the MIME type:<br />"
00034 "<b>%1</b> (%2).<br /><br />"
00035 "Please select which one to use:</qt>", mime->comment(), mime->name() ) );
00036 }
00037
00038 ChooseEngineDialog::~ChooseEngineDialog()
00039 {
00040 delete m_widget;
00041 }
00042
00043 int ChooseEngineDialog::selectedGenerator() const
00044 {
00045 return m_widget->engineList->currentIndex();
00046 }