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. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#include <qcombobox.h>
|
|
|
|
#include <qlabel.h>
|
|
|
|
#include <klocale.h>
|
|
|
|
|
2006-04-10 19:50:00 +00:00
|
|
|
#include "ui_chooseenginewidget.h"
|
2006-03-30 18:06:18 +00:00
|
|
|
|
|
|
|
#include "chooseenginedialog.h"
|
|
|
|
|
|
|
|
ChooseEngineDialog::ChooseEngineDialog( const QStringList &generators, const QString &mime, QWidget * parent )
|
2006-06-13 08:45:56 +00:00
|
|
|
: KDialog( parent )
|
2006-03-30 18:06:18 +00:00
|
|
|
{
|
2006-06-13 08:45:56 +00:00
|
|
|
setCaption( i18n( "Generator Selection" ) );
|
|
|
|
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(
|
2006-04-10 19:50:00 +00:00
|
|
|
i18n("More than one generator found for mimetype \"%1\", please select which one to use:", mime)
|
2006-03-30 18:06:18 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
int ChooseEngineDialog::selectedGenerator() const
|
|
|
|
{
|
|
|
|
return m_widget->engineList->currentIndex();
|
|
|
|
}
|