2006-03-30 18:06:18 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2006 by Pino Toscano <toscano.pino@tiscali.it> *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
2007-07-10 22:52:25 +00:00
|
|
|
#include "chooseenginedialog_p.h"
|
2007-04-19 18:30:20 +00:00
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
#include <QtGui/QComboBox>
|
|
|
|
#include <QtGui/QLabel>
|
|
|
|
|
2006-03-30 18:06:18 +00:00
|
|
|
#include <klocale.h>
|
|
|
|
|
2006-04-10 19:50:00 +00:00
|
|
|
#include "ui_chooseenginewidget.h"
|
2006-03-30 18:06:18 +00:00
|
|
|
|
2006-07-07 14:28:21 +00:00
|
|
|
ChooseEngineDialog::ChooseEngineDialog( const QStringList &generators, const KMimeType::Ptr &mime, QWidget * parent )
|
2006-06-13 08:45:56 +00:00
|
|
|
: KDialog( parent )
|
2006-03-30 18:06:18 +00:00
|
|
|
{
|
2006-11-10 20:48:28 +00:00
|
|
|
setCaption( i18n( "Backend Selection" ) );
|
2006-06-13 08:45:56 +00:00
|
|
|
setButtons( Ok | Cancel );
|
2006-06-14 18:22:13 +00:00
|
|
|
setDefaultButton( Ok );
|
2006-03-30 18:06:18 +00:00
|
|
|
QWidget *main = new QWidget( this );
|
|
|
|
setMainWidget( main );
|
|
|
|
m_widget = new Ui_ChooseEngineWidget();
|
|
|
|
m_widget->setupUi( main );
|
|
|
|
|
|
|
|
m_widget->engineList->addItems(generators);
|
|
|
|
|
|
|
|
m_widget->description->setText(
|
2007-08-23 10:48:47 +00:00
|
|
|
i18n( "<qt>More than one backend found for the MIME type:<br />"
|
2007-07-15 18:48:31 +00:00
|
|
|
"<b>%1</b> (%2).<br /><br />"
|
2007-08-23 10:48:47 +00:00
|
|
|
"Please select which one to use:</qt>", mime->comment(), mime->name() ) );
|
2006-03-30 18:06:18 +00:00
|
|
|
}
|
|
|
|
|
2007-03-30 15:35:01 +00:00
|
|
|
ChooseEngineDialog::~ChooseEngineDialog()
|
|
|
|
{
|
|
|
|
delete m_widget;
|
|
|
|
}
|
|
|
|
|
2006-03-30 18:06:18 +00:00
|
|
|
int ChooseEngineDialog::selectedGenerator() const
|
|
|
|
{
|
|
|
|
return m_widget->engineList->currentIndex();
|
|
|
|
}
|