summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2014-10-06 05:39:24 (GMT)
committerMontel Laurent <montel@kde.org>2014-10-06 05:39:24 (GMT)
commit5557598b470e9a68f2b33e7c33673fb45d399220 (patch)
tree3c82e6f52a2c148ee71ba4625b2ce26770474594
parenta92c9c31a582e831b38edaf5964441d5871f8277 (diff)
Port to QDialog
-rw-r--r--core/chooseenginedialog.cpp23
-rw-r--r--core/chooseenginedialog_p.h4
-rw-r--r--generators/dvi/psgs.cpp1
3 files changed, 19 insertions, 9 deletions
diff --git a/core/chooseenginedialog.cpp b/core/chooseenginedialog.cpp
index 358b946..8f433cc 100644
--- a/core/chooseenginedialog.cpp
+++ b/core/chooseenginedialog.cpp
@@ -13,20 +13,31 @@
#include <QtWidgets/QLabel>
#include <klocale.h>
+#include <KConfigGroup>
+#include <QDialogButtonBox>
+#include <QPushButton>
+#include <QVBoxLayout>
#include "ui_chooseenginewidget.h"
ChooseEngineDialog::ChooseEngineDialog( const QStringList &generators, const QMimeType &mime, QWidget * parent )
- : KDialog( parent )
+ : QDialog( parent )
{
- setCaption( i18n( "Backend Selection" ) );
- setButtons( Ok | Cancel );
- setDefaultButton( Ok );
+ setWindowTitle( i18n( "Backend Selection" ) );
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ setLayout(mainLayout);
+ QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
+ okButton->setDefault(true);
+ okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
+ connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+ connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ okButton->setDefault(true);
QWidget *main = new QWidget( this );
- setMainWidget( main );
m_widget = new Ui_ChooseEngineWidget();
m_widget->setupUi( main );
-
+ mainLayout->addWidget(main);
+ mainLayout->addWidget(buttonBox);
m_widget->engineList->addItems(generators);
m_widget->description->setText(
diff --git a/core/chooseenginedialog_p.h b/core/chooseenginedialog_p.h
index 1eb0356..0d55ff5 100644
--- a/core/chooseenginedialog_p.h
+++ b/core/chooseenginedialog_p.h
@@ -12,13 +12,13 @@
#include <QtCore/QStringList>
-#include <kdialog.h>
+#include <QDialog>
#include <QMimeType>
#include <QMimeDatabase>
class Ui_ChooseEngineWidget;
-class ChooseEngineDialog : public KDialog
+class ChooseEngineDialog : public QDialog
{
public:
ChooseEngineDialog( const QStringList &generators, const QMimeType &mime, QWidget * parent = 0 );
diff --git a/generators/dvi/psgs.cpp b/generators/dvi/psgs.cpp
index a6df727..969123e 100644
--- a/generators/dvi/psgs.cpp
+++ b/generators/dvi/psgs.cpp
@@ -351,4 +351,3 @@ QString ghostscript_interface::locateEPSfile(const QString &filename, const KUrl
return QString::fromLocal8Bit(proc.readLine().trimmed());
}
-#include "psgs.moc"