From 9f2c38c66ff162d76f6db9e9e8b05d6bc9c575fe Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 26 Feb 2014 14:27:42 +0100 Subject: [PATCH] port away of kdialog --- src/shell/CMakeLists.txt | 1 - src/shell/interactiveconsole.cpp | 18 +++++++++--------- src/shell/interactiveconsole.h | 4 ++-- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/shell/CMakeLists.txt b/src/shell/CMakeLists.txt index 829aff5e2..27e2c6c34 100644 --- a/src/shell/CMakeLists.txt +++ b/src/shell/CMakeLists.txt @@ -28,7 +28,6 @@ set(scripting_SRC scripting/configgroup.cpp scripting/desktopscriptengine.cpp scripting/i18n.cpp - #scripting/layouttemplatepackagestructure.cpp scripting/panel.cpp scripting/rect.cpp scripting/scriptengine.cpp diff --git a/src/shell/interactiveconsole.cpp b/src/shell/interactiveconsole.cpp index 904415aed..25a2a46f9 100644 --- a/src/shell/interactiveconsole.cpp +++ b/src/shell/interactiveconsole.cpp @@ -61,7 +61,7 @@ static const QString s_autosaveFileName("interactiveconsoleautosave.js"); static const QString s_kwinService = "org.kde.kwin.Scripting"; InteractiveConsole::InteractiveConsole(Plasma::Corona *corona, QWidget *parent) - : KDialog(parent), + : QDialog(parent), m_corona(corona), m_splitter(new QSplitter(Qt::Vertical, this)), m_editorPart(0), @@ -80,9 +80,9 @@ InteractiveConsole::InteractiveConsole(Plasma::Corona *corona, QWidget *parent) addAction(m_saveAction); addAction(m_clearAction); - setWindowTitle(KDialog::makeStandardCaption(i18n("Desktop Shell Scripting Console"))); + setWindowTitle(i18n("Desktop Shell Scripting Console")); setAttribute(Qt::WA_DeleteOnClose); - setButtons(KDialog::None); + //setButtons(QDialog::None); QWidget *widget = new QWidget(m_splitter); QVBoxLayout *editorLayout = new QVBoxLayout(widget); @@ -177,11 +177,11 @@ InteractiveConsole::InteractiveConsole(Plasma::Corona *corona, QWidget *parent) outputLayout->addWidget(m_output); m_splitter->addWidget(widget); - setMainWidget(m_splitter); + QVBoxLayout *l = new QVBoxLayout(this); + l->addWidget(m_splitter); - setInitialSize(QSize(700, 500)); KConfigGroup cg(KSharedConfig::openConfig(), "InteractiveConsole"); - restoreDialogSize(cg); + restoreGeometry(cg.readEntry("Geometry", QByteArray())); m_splitter->setStretchFactor(0, 10); m_splitter->restoreState(cg.readEntry("SplitterState", QByteArray())); @@ -200,7 +200,7 @@ InteractiveConsole::InteractiveConsole(Plasma::Corona *corona, QWidget *parent) InteractiveConsole::~InteractiveConsole() { KConfigGroup cg(KSharedConfig::openConfig(), "InteractiveConsole"); - saveDialogSize(cg); + cg.writeEntry("Geometry", saveGeometry()); cg.writeEntry("SplitterState", m_splitter->saveState()); qDebug(); } @@ -259,13 +259,13 @@ void InteractiveConsole::showEvent(QShowEvent *) void InteractiveConsole::closeEvent(QCloseEvent *event) { onClose(); - KDialog::closeEvent(event); + QDialog::closeEvent(event); } void InteractiveConsole::reject() { onClose(); - KDialog::reject(); + QDialog::reject(); } void InteractiveConsole::onClose() diff --git a/src/shell/interactiveconsole.h b/src/shell/interactiveconsole.h index 7a2d181ef..39fbc3d56 100644 --- a/src/shell/interactiveconsole.h +++ b/src/shell/interactiveconsole.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include @@ -47,7 +47,7 @@ namespace Plasma class ScriptEngine; -class InteractiveConsole : public KDialog +class InteractiveConsole : public QDialog { Q_OBJECT