compile
[kdegraphics.git] / okular / core / chooseenginedialog.cpp
blob657c95d28b4309618e44954ab4464b8bb8a80c16
1 /***************************************************************************
2 * Copyright (C) 2006 by Pino Toscano <toscano.pino@tiscali.it> *
3 * *
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>
15 #include <klocale.h>
17 #include "ui_chooseenginewidget.h"
19 ChooseEngineDialog::ChooseEngineDialog( const QStringList &generators, const KMimeType::Ptr &mime, QWidget * parent )
20 : KDialog( 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()
40 delete m_widget;
43 int ChooseEngineDialog::selectedGenerator() const
45 return m_widget->engineList->currentIndex();