From f8468b40435f68e535ae178f03294b519cd6caac Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Thu, 5 Dec 2013 20:22:31 +0100 Subject: [PATCH] Drop KDE4Support in kde-workspace/kwin REVIEW: 114316 --- kcmkwin/kwindecoration/CMakeLists.txt | 1 - kcmkwin/kwindecoration/buttons.cpp | 4 +- .../kwindecoration/buttonsconfigdialog.cpp | 27 ++-- kcmkwin/kwindecoration/buttonsconfigdialog.h | 6 +- kcmkwin/kwindecoration/configdialog.cpp | 28 ++-- kcmkwin/kwindecoration/configdialog.h | 7 +- kcmkwin/kwindecoration/decoration.ui | 18 +-- kcmkwin/kwindecoration/kwindecoration.cpp | 17 ++- kcmkwin/kwindesktop/CMakeLists.txt | 1 - kcmkwin/kwindesktop/main.cpp | 14 +- kcmkwin/kwindesktop/main.ui | 38 +++--- kcmkwin/kwinrules/CMakeLists.txt | 1 - kcmkwin/kwinrules/detectwidget.cpp | 20 +-- kcmkwin/kwinrules/detectwidget.h | 6 +- kcmkwin/kwinrules/main.cpp | 35 ++--- kcmkwin/kwinrules/ruleslist.ui | 35 +++-- kcmkwin/kwinrules/ruleswidget.cpp | 57 +++++--- kcmkwin/kwinrules/ruleswidget.h | 8 +- kcmkwin/kwinrules/ruleswidgetbase.ui | 122 ++++++++---------- kcmkwin/kwinscreenedges/CMakeLists.txt | 3 +- kcmkwin/kwinscreenedges/main.ui | 11 +- .../kwinscreenedges/screenpreviewwidget.cpp | 7 +- kcmkwin/kwinscripts/CMakeLists.txt | 1 - kcmkwin/kwinscripts/module.ui | 7 +- kcmkwin/kwintabbox/CMakeLists.txt | 1 - kcmkwin/kwintabbox/layoutpreview.cpp | 3 +- kcmkwin/kwintabbox/main.cpp | 16 ++- kcmkwin/kwintabbox/main.ui | 92 ++++++++----- 28 files changed, 313 insertions(+), 273 deletions(-) diff --git a/kcmkwin/kwindecoration/CMakeLists.txt b/kcmkwin/kwindecoration/CMakeLists.txt index 40cb985334..77f9b05f94 100644 --- a/kcmkwin/kwindecoration/CMakeLists.txt +++ b/kcmkwin/kwindecoration/CMakeLists.txt @@ -33,7 +33,6 @@ target_link_libraries(kcm_kwindecoration KF5::KCompletion KF5::KI18n KF5::KNewStuff - KF5::KDE4Support ) install(TARGETS kcm_kwindecoration DESTINATION ${PLUGIN_INSTALL_DIR} ) diff --git a/kcmkwin/kwindecoration/buttons.cpp b/kcmkwin/kwindecoration/buttons.cpp index 9d876d3bc1..2947eaf173 100644 --- a/kcmkwin/kwindecoration/buttons.cpp +++ b/kcmkwin/kwindecoration/buttons.cpp @@ -36,13 +36,13 @@ #include #include #include +#include #include #include #include #include #include -#include #ifdef KWIN_BUILD_KAPPMENU #include @@ -616,7 +616,7 @@ void ButtonDropSite::paintEvent(QPaintEvent* /*pe*/) QColor c1(palette().color(QPalette::Mid)); p.fillRect(r, c1); p.setPen(palette().color(QPalette::WindowText)); - p.setFont(KGlobalSettings::windowTitleFont()); + p.setFont(QFontDatabase::systemFont(QFontDatabase::TitleFont)); p.drawText(r.adjusted(4, 0, -4, 0), Qt::AlignLeft | Qt::AlignVCenter, i18n("KDE")); offset = geometry().width() - 3 - rightoffset; diff --git a/kcmkwin/kwindecoration/buttonsconfigdialog.cpp b/kcmkwin/kwindecoration/buttonsconfigdialog.cpp index 8745dabeb7..f401bb3aa2 100644 --- a/kcmkwin/kwindecoration/buttonsconfigdialog.cpp +++ b/kcmkwin/kwindecoration/buttonsconfigdialog.cpp @@ -21,6 +21,7 @@ along with this program. If not, see . #include "kwindecoration.h" #include +#include #include #include @@ -35,27 +36,30 @@ KWinDecorationButtonsConfigForm::KWinDecorationButtonsConfigForm(QWidget* parent } KWinDecorationButtonsConfigDialog::KWinDecorationButtonsConfigDialog(DecorationButtons const *buttons, bool showTooltips, QWidget* parent, Qt::WFlags flags) - : KDialog(parent, flags) + : QDialog(parent, flags) + , m_ui(new KWinDecorationButtonsConfigForm(this)) , m_showTooltip(showTooltips) , m_buttons(buttons) { - m_ui = new KWinDecorationButtonsConfigForm(this); setWindowTitle(i18n("Buttons")); - setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Default | KDialog::Reset); - enableButton(KDialog::Reset, false); + m_buttonBox = new QDialogButtonBox(this); + m_buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults | QDialogButtonBox::Reset); + m_buttonBox->button(QDialogButtonBox::RestoreDefaults)->setEnabled(false); + QVBoxLayout* layout = new QVBoxLayout; + layout->addWidget(m_buttonBox); layout->addWidget(m_ui); m_ui->buttonPositionWidget->setEnabled(buttons->customPositions()); - QWidget* main = new QWidget(this); - main->setLayout(layout); - setMainWidget(main); + setLayout(layout); connect(m_ui->buttonPositionWidget, SIGNAL(changed()), this, SLOT(changed())); connect(m_ui->showToolTipsCheckBox, SIGNAL(stateChanged(int)), this, SLOT(changed())); connect(m_ui->useCustomButtonPositionsCheckBox, SIGNAL(stateChanged(int)), this, SLOT(changed())); - connect(this, SIGNAL(defaultClicked()), this, SLOT(slotDefaultClicked())); - connect(this, SIGNAL(resetClicked()), this, SLOT(slotResetClicked())); + connect(m_buttonBox->button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked(bool)), this, SLOT(slotDefaultClicked())); + connect(m_buttonBox->button(QDialogButtonBox::Reset), SIGNAL(clicked(bool)), this, SLOT(slotResetClicked())); + connect(m_buttonBox, SIGNAL(accepted()), SLOT(accept())); + connect(m_buttonBox, SIGNAL(rejected()), SLOT(reject())); slotResetClicked(); } @@ -86,7 +90,7 @@ QList KWinDecorationButtonsConfigDialog::b void KWinDecorationButtonsConfigDialog::changed() { - enableButton(KDialog::Reset, true); + m_buttonBox->button(QDialogButtonBox::RestoreDefaults)->setEnabled(true); } void KWinDecorationButtonsConfigDialog::slotDefaultClicked() @@ -105,7 +109,8 @@ void KWinDecorationButtonsConfigDialog::slotResetClicked() m_ui->buttonPositionWidget->setButtonsLeft(m_buttons->leftButtons()); m_ui->buttonPositionWidget->setButtonsRight(m_buttons->rightButtons()); changed(); - enableButton(KDialog::Reset, false); + + m_buttonBox->button(QDialogButtonBox::Reset)->setEnabled(false); } } // namespace KWin diff --git a/kcmkwin/kwindecoration/buttonsconfigdialog.h b/kcmkwin/kwindecoration/buttonsconfigdialog.h index f5740a03a5..740a32ba87 100644 --- a/kcmkwin/kwindecoration/buttonsconfigdialog.h +++ b/kcmkwin/kwindecoration/buttonsconfigdialog.h @@ -21,10 +21,11 @@ along with this program. If not, see . #define KWINDECORATIONBUTTONSCONFIGDIALOG_H #include -#include +#include #include "ui_buttons.h" +class QDialogButtonBox; namespace KWin { @@ -38,7 +39,7 @@ public: explicit KWinDecorationButtonsConfigForm(QWidget* parent); }; -class KWinDecorationButtonsConfigDialog : public KDialog +class KWinDecorationButtonsConfigDialog : public QDialog { Q_OBJECT public: @@ -59,6 +60,7 @@ private: KWinDecorationButtonsConfigForm* m_ui; bool m_showTooltip; DecorationButtons const *m_buttons; + QDialogButtonBox* m_buttonBox; }; } // namespace KWin diff --git a/kcmkwin/kwindecoration/configdialog.cpp b/kcmkwin/kwindecoration/configdialog.cpp index 4820eb0faa..b06eb1ce72 100644 --- a/kcmkwin/kwindecoration/configdialog.cpp +++ b/kcmkwin/kwindecoration/configdialog.cpp @@ -23,9 +23,11 @@ along with this program. If not, see . #include #include -#include #include #include +#include +#include +#include namespace KWin { @@ -69,7 +71,7 @@ KWinDecorationConfigForm::KWinDecorationConfigForm(QWidget* parent) KWinDecorationConfigDialog::KWinDecorationConfigDialog(QString deco, const QList& borderSizes, KDecorationDefines::BorderSize size, QWidget* parent, Qt::WFlags flags) - : KDialog(parent, flags) + : QDialog(parent, flags) , m_borderSizes(borderSizes) , m_kwinConfig(KSharedConfig::openConfig("kwinrc")) , m_pluginObject(0) @@ -77,10 +79,15 @@ KWinDecorationConfigDialog::KWinDecorationConfigDialog(QString deco, const QList { m_ui = new KWinDecorationConfigForm(this); setWindowTitle(i18n("Decoration Options")); - setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Default | KDialog::Reset); - enableButton(KDialog::Reset, false); + + m_buttons = new QDialogButtonBox(this); + m_buttons->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults | QDialogButtonBox::Reset); + m_buttons->button(QDialogButtonBox::Reset)->setEnabled(false); QVBoxLayout* layout = new QVBoxLayout; layout->addWidget(m_ui); + layout->addWidget(m_buttons); + connect(m_buttons, SIGNAL(accepted()), SLOT(accept())); + connect(m_buttons, SIGNAL(rejected()), SLOT(reject())); KLibrary library(styleToConfigLib(deco)); if (library.load()) { @@ -88,15 +95,16 @@ KWinDecorationConfigDialog::KWinDecorationConfigDialog(QString deco, const QList if (alloc_ptr != NULL) { allocatePlugin = (QObject * (*)(KConfigGroup & conf, QWidget * parent))alloc_ptr; KConfigGroup config(m_kwinConfig, "Style"); - m_pluginConfigWidget = new KVBox(this); + m_pluginConfigWidget = new QWidget(this); + m_pluginConfigWidget->setLayout(new QVBoxLayout); m_pluginObject = (QObject*)(allocatePlugin(config, m_pluginConfigWidget)); // connect required signals and slots together... connect(this, SIGNAL(accepted()), this, SLOT(slotAccepted())); connect(m_pluginObject, SIGNAL(changed()), this, SLOT(slotSelectionChanged())); connect(this, SIGNAL(pluginSave(KConfigGroup&)), m_pluginObject, SLOT(save(KConfigGroup&))); - connect(this, SIGNAL(defaultClicked()), m_pluginObject, SLOT(defaults())); - connect(this, SIGNAL(defaultClicked()), SLOT(slotDefault())); + connect(m_buttons->button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked(bool)), m_pluginObject, SLOT(defaults())); + connect(m_buttons->button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked(bool)), SLOT(slotDefault())); } } @@ -116,9 +124,7 @@ KWinDecorationConfigDialog::KWinDecorationConfigDialog(QString deco, const QList m_ui->borderLabel->hide(); } - QWidget* main = new QWidget(this); - main->setLayout(layout); - setMainWidget(main); + setLayout(layout); } KWinDecorationConfigDialog::~KWinDecorationConfigDialog() @@ -153,7 +159,7 @@ void KWinDecorationConfigDialog::slotAccepted() void KWinDecorationConfigDialog::slotSelectionChanged() { - enableButton(KDialog::Reset, true); + m_buttons->button(QDialogButtonBox::Reset)->setEnabled(true); } QString KWinDecorationConfigDialog::styleToConfigLib(const QString& styleLib) const diff --git a/kcmkwin/kwindecoration/configdialog.h b/kcmkwin/kwindecoration/configdialog.h index c2ace175b5..2f53b4a601 100644 --- a/kcmkwin/kwindecoration/configdialog.h +++ b/kcmkwin/kwindecoration/configdialog.h @@ -20,11 +20,13 @@ along with this program. If not, see . #ifndef KWINDECORATIONCONFIGDIALOG_H #define KWINDECORATIONCONFIGDIALOG_H #include -#include +#include #include +#include #include "ui_config.h" #include "ui_auroraeconfig.h" +class QDialogButtonBox; namespace KWin { @@ -47,7 +49,7 @@ public: explicit KWinDecorationConfigForm(QWidget* parent); }; -class KWinDecorationConfigDialog : public KDialog, public KDecorationDefines +class KWinDecorationConfigDialog : public QDialog, public KDecorationDefines { Q_OBJECT public: @@ -78,6 +80,7 @@ private: QObject*(*allocatePlugin)(KConfigGroup& conf, QWidget* parent); QObject* m_pluginObject; QWidget* m_pluginConfigWidget; + QDialogButtonBox* m_buttons; }; } // namespace KWin diff --git a/kcmkwin/kwindecoration/decoration.ui b/kcmkwin/kwindecoration/decoration.ui index ecdfaf4bf3..f8d3b634d6 100644 --- a/kcmkwin/kwindecoration/decoration.ui +++ b/kcmkwin/kwindecoration/decoration.ui @@ -13,7 +13,7 @@ - + Search @@ -53,21 +53,21 @@ - + Configure Decoration... - + Configure Buttons... - + Get New Decorations... @@ -78,21 +78,11 @@ - - QDeclarativeView - QGraphicsView -
QtDeclarative/QDeclarativeView
-
KLineEdit QLineEdit
klineedit.h
- - KPushButton - QPushButton -
kpushbutton.h
-
searchEdit diff --git a/kcmkwin/kwindecoration/kwindecoration.cpp b/kcmkwin/kwindecoration/kwindecoration.cpp index 682ed4d120..93992c6a53 100644 --- a/kcmkwin/kwindecoration/kwindecoration.cpp +++ b/kcmkwin/kwindecoration/kwindecoration.cpp @@ -367,12 +367,17 @@ void KWinDecorationModule::slotConfigureDecoration() bool reload = false; if (index.data(DecorationModel::TypeRole).toInt() == DecorationModelData::AuroraeDecoration || index.data(DecorationModel::TypeRole).toInt() == DecorationModelData::QmlDecoration) { - QPointer< KDialog > dlg = new KDialog(this); - dlg->setCaption(i18n("Decoration Options")); - dlg->setButtons(KDialog::Ok | KDialog::Cancel); + QPointer dlg = new QDialog(this); + dlg->setWindowTitle(i18n("Decoration Options")); KWinAuroraeConfigForm *form = new KWinAuroraeConfigForm(dlg); form->enableNoSideBorderSupport(index.data(DecorationModel::TypeRole).toInt() == DecorationModelData::QmlDecoration); - dlg->setMainWidget(form); + setLayout(new QVBoxLayout); + QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, dlg.data()); + connect(buttons, SIGNAL(accepted()), dlg, SLOT(accept())); + connect(buttons, SIGNAL(rejected()), dlg, SLOT(reject())); + layout()->addWidget(form); + layout()->addWidget(buttons); + form->borderSizesCombo->setCurrentIndex(index.data(DecorationModel::BorderSizeRole).toInt()); form->buttonSizesCombo->setCurrentIndex(index.data(DecorationModel::ButtonSizeRole).toInt()); form->closeWindowsDoubleClick->setChecked(index.data(DecorationModel::CloseOnDblClickRole).toBool()); @@ -400,7 +405,7 @@ void KWinDecorationModule::slotConfigureDecoration() configManager->updateWidgets(); } } - if (dlg->exec() == KDialog::Accepted) { + if (dlg->exec() == QDialog::Accepted) { m_model->setData(index, form->borderSizesCombo->currentIndex(), DecorationModel::BorderSizeRole); m_model->setData(index, form->buttonSizesCombo->currentIndex(), DecorationModel::ButtonSizeRole); m_model->setData(index, form->closeWindowsDoubleClick->isChecked(), DecorationModel::CloseOnDblClickRole); @@ -419,7 +424,7 @@ void KWinDecorationModule::slotConfigureDecoration() static_cast(index.data(DecorationModel::BorderSizeRole).toInt()); QPointer< KWinDecorationConfigDialog > configDialog = new KWinDecorationConfigDialog(name, borderSizes, size, this); - if (configDialog->exec() == KDialog::Accepted) { + if (configDialog->exec() == QDialog::Accepted) { m_model->setData(index, configDialog->borderSize(), DecorationModel::BorderSizeRole); reload = true; } diff --git a/kcmkwin/kwindesktop/CMakeLists.txt b/kcmkwin/kwindesktop/CMakeLists.txt index 9c0c500a00..001c12c522 100644 --- a/kcmkwin/kwindesktop/CMakeLists.txt +++ b/kcmkwin/kwindesktop/CMakeLists.txt @@ -13,7 +13,6 @@ target_link_libraries(kcm_kwindesktop KF5::KI18n KF5::KWindowSystem KF5::XmlGui - KF5::KDE4Support ${X11_LIBRARIES} ) diff --git a/kcmkwin/kwindesktop/main.cpp b/kcmkwin/kwindesktop/main.cpp index 6756870cda..3d835a1d23 100644 --- a/kcmkwin/kwindesktop/main.cpp +++ b/kcmkwin/kwindesktop/main.cpp @@ -43,6 +43,7 @@ along with this program. If not, see . #include #include +#include K_PLUGIN_FACTORY(KWinDesktopConfigFactory, registerPlugin();) @@ -575,17 +576,20 @@ void KWinDesktopConfig::slotConfigureEffectClicked() return; } KCModuleProxy* proxy = new KCModuleProxy(effect); - QPointer< KDialog > configDialog = new KDialog(this); + QPointer configDialog = new QDialog(this); configDialog->setWindowTitle(m_ui->effectComboBox->currentText()); - configDialog->setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Default); - connect(configDialog, SIGNAL(defaultClicked()), proxy, SLOT(defaults())); + configDialog->setLayout(new QVBoxLayout); + QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::RestoreDefaults, configDialog); + connect(buttons, SIGNAL(accepted()), configDialog, SLOT(accept())); + connect(buttons, SIGNAL(rejected()), configDialog, SLOT(reject())); + connect(buttons->button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked(bool)), proxy, SLOT(defaults())); QWidget *showWidget = new QWidget(configDialog); QVBoxLayout *layout = new QVBoxLayout; showWidget->setLayout(layout); layout->addWidget(proxy); - layout->insertSpacing(-1, KDialog::marginHint()); - configDialog->setMainWidget(showWidget); + configDialog->layout()->addWidget(showWidget); + configDialog->layout()->addWidget(buttons); if (configDialog->exec() == QDialog::Accepted) { proxy->save(); diff --git a/kcmkwin/kwindesktop/main.ui b/kcmkwin/kwindesktop/main.ui index 4a6f65cc5e..73ccac96db 100644 --- a/kcmkwin/kwindesktop/main.ui +++ b/kcmkwin/kwindesktop/main.ui @@ -11,7 +11,16 @@ - + + 0 + + + 0 + + + 0 + + 0 @@ -50,7 +59,7 @@ - + Here you can set how many virtual desktops you want on your KDE desktop. @@ -79,7 +88,7 @@ - + true @@ -169,7 +178,7 @@ - + 0 @@ -179,7 +188,7 @@ - + 0 @@ -189,7 +198,7 @@ - + @@ -225,7 +234,7 @@ - + msec @@ -286,21 +295,6 @@ - - KIntSpinBox - QSpinBox -
knuminput.h
-
- - KPushButton - QPushButton -
kpushbutton.h
-
- - KComboBox - QComboBox -
kcombobox.h
-
KWin::DesktopNamesWidget QWidget diff --git a/kcmkwin/kwinrules/CMakeLists.txt b/kcmkwin/kwinrules/CMakeLists.txt index 43f0e24201..f608f9452c 100644 --- a/kcmkwin/kwinrules/CMakeLists.txt +++ b/kcmkwin/kwinrules/CMakeLists.txt @@ -25,7 +25,6 @@ set(kcm_libs KF5::KI18n KF5::KWindowSystem KF5::XmlGui - KF5::KDE4Support ${X11_LIBRARIES} ) diff --git a/kcmkwin/kwinrules/detectwidget.cpp b/kcmkwin/kwinrules/detectwidget.cpp index 1086fb41c6..723bdee7bb 100644 --- a/kcmkwin/kwinrules/detectwidget.cpp +++ b/kcmkwin/kwinrules/detectwidget.cpp @@ -16,18 +16,16 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "detectwidget.h" #include "../../cursor.h" -#include #include #include #include #include #include #include -//Added by qt3to4: +#include #include #include #include @@ -49,15 +47,21 @@ DetectWidget::DetectWidget(QWidget* parent) } DetectDialog::DetectDialog(QWidget* parent, const char* name) - : KDialog(parent), + : QDialog(parent), grabber() { setObjectName(name); setModal(true); - setButtons(Ok | Cancel); + setLayout(new QVBoxLayout); widget = new DetectWidget(this); - setMainWidget(widget); + layout()->addWidget(widget); + + QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel, this); + layout()->addWidget(buttons); + + connect(buttons, SIGNAL(accepted()), SLOT(accept())); + connect(buttons, SIGNAL(rejected()), SLOT(reject())); } void DetectDialog::detect(WId window, int secs) @@ -117,7 +121,7 @@ void DetectDialog::executeDialog() adjustSize(); if (width() < 4*height()/3) resize(4*height()/3, height()); - emit detectionDone(exec() == KDialog::Accepted); + emit detectionDone(exec() == QDialog::Accepted); } QByteArray DetectDialog::selectedClass() const @@ -172,7 +176,7 @@ void DetectDialog::selectWindow() // use a dialog, so that all user input is blocked // use WX11BypassWM and moving away so that it's not actually visible // grab only mouse, so that keyboard can be used e.g. for switching windows - grabber.reset(new KDialog(0, Qt::X11BypassWindowManagerHint)); + grabber.reset(new QDialog(0, Qt::X11BypassWindowManagerHint)); grabber->move(-1000, -1000); grabber->setModal(true); grabber->show(); diff --git a/kcmkwin/kwinrules/detectwidget.h b/kcmkwin/kwinrules/detectwidget.h index 3e995f1292..4fdd3614f2 100644 --- a/kcmkwin/kwinrules/detectwidget.h +++ b/kcmkwin/kwinrules/detectwidget.h @@ -20,7 +20,7 @@ #ifndef __DETECTWIDGET_H__ #define __DETECTWIDGET_H__ -#include +#include #include #include @@ -43,7 +43,7 @@ public: }; class DetectDialog - : public KDialog, public QAbstractNativeEventFilter + : public QDialog, public QAbstractNativeEventFilter { Q_OBJECT public: @@ -76,7 +76,7 @@ private: QByteArray extrarole; QByteArray machine; DetectWidget* widget; - QScopedPointer grabber; + QScopedPointer grabber; KWindowInfo info; }; diff --git a/kcmkwin/kwinrules/main.cpp b/kcmkwin/kwinrules/main.cpp index a2b3919988..c36dc236b6 100644 --- a/kcmkwin/kwinrules/main.cpp +++ b/kcmkwin/kwinrules/main.cpp @@ -16,8 +16,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include +#include +#include #include #include #include @@ -241,21 +241,26 @@ static int edit(Window wid, bool whole_app) extern "C" KDE_EXPORT int kdemain(int argc, char* argv[]) { - KCmdLineArgs::init(argc, argv, "kwin_rules_dialog", "kcmkwinrules", ki18n("KWin"), "1.0" , - ki18n("KWin helper utility")); - - KCmdLineOptions options; - options.add("wid ", ki18n("WId of the window for special window settings.")); - options.add("whole-app", ki18n("Whether the settings should affect all windows of the application.")); - KCmdLineArgs::addCmdLineOptions(options); - KApplication app; - KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); + QApplication app(argc, argv); + app.setApplicationDisplayName(i18n("KWin")); + app.setApplicationName("kwin_rules_dialog"); + app.setApplicationVersion("1.0"); + bool whole_app = false; bool id_ok = false; - Window id = args->getOption("wid").toULongLong(&id_ok); - bool whole_app = args->isSet("whole-app"); - args->clear(); + Window id = None; + { + QCommandLineParser parser; + parser.setApplicationDescription(i18n("KWin helper utility")); + parser.addOption(QCommandLineOption("wid", i18n("WId of the window for special window settings."), "wid")); + parser.addOption(QCommandLineOption("whole-app", i18n("Whether the settings should affect all windows of the application."))); + parser.process(app); + + id = parser.value("wid").toULongLong(&id_ok); + whole_app = parser.isSet("whole-app"); + } + if (!id_ok || id == None) { - KCmdLineArgs::usageError(i18n("This helper utility is not supposed to be called directly.")); + printf("%s\n", qPrintable(i18n("This helper utility is not supposed to be called directly."))); return 1; } return KWin::edit(id, whole_app); diff --git a/kcmkwin/kwinrules/ruleslist.ui b/kcmkwin/kwinrules/ruleslist.ui index e268fa4e63..e82d1e694d 100644 --- a/kcmkwin/kwinrules/ruleslist.ui +++ b/kcmkwin/kwinrules/ruleslist.ui @@ -11,28 +11,37 @@ - + + 0 + + + 0 + + + 0 + + 0 - + - + &New... - + &Modify... - + Delete @@ -42,14 +51,14 @@ - + Move &Up - + Move &Down @@ -108,18 +117,6 @@ - - - KListWidget - QListWidget -
klistwidget.h
-
- - KPushButton - QPushButton -
kpushbutton.h
-
-
kdialog.h diff --git a/kcmkwin/kwinrules/ruleswidget.cpp b/kcmkwin/kwinrules/ruleswidget.cpp index 6600e14c39..ea322abbf3 100644 --- a/kcmkwin/kwinrules/ruleswidget.cpp +++ b/kcmkwin/kwinrules/ruleswidget.cpp @@ -57,6 +57,11 @@ RulesWidget::RulesWidget(QWidget* parent) : detect_dlg(NULL) { Q_UNUSED(parent); + QRegularExpressionValidator* validator = new QRegularExpressionValidator(QRegularExpression("[0-9\-+,xX:]*"), this); + maxsize->setValidator(validator); + minsize->setValidator(validator); + position->setValidator(validator); + Ui::RulesWidgetBase::size->setValidator(validator); setupUi(this); QString enableDesc = @@ -410,11 +415,11 @@ static NET::WindowType comboToType(int val) } #define CHECKBOX_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, setChecked, setChecked( false )) -#define LINEEDIT_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, setText, setText( "" )) +#define LINEEDIT_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, setText, setText( QString() )) #define COMBOBOX_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, setCurrentIndex, setCurrentIndex( 0 )) #define SPINBOX_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, setValue, setValue(0)) #define CHECKBOX_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, setChecked, setChecked( false )) -#define LINEEDIT_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, setText, setText( "" )) +#define LINEEDIT_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, setText, setText( QString() )) #define COMBOBOX_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, setCurrentIndex, setCurrentIndex( 0 )) #define SPINBOX_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, setValue, setValue(0)) @@ -770,16 +775,21 @@ void RulesWidget::shortcutEditClicked() } RulesDialog::RulesDialog(QWidget* parent, const char* name) - : KDialog(parent) + : QDialog(parent) { setObjectName(name); setModal(true); - setCaption(i18n("Edit Window-Specific Settings")); - setButtons(Ok | Cancel); + setWindowTitle(i18n("Edit Window-Specific Settings")); setWindowIcon(QIcon::fromTheme("preferences-system-windows-actions")); + setLayout(new QVBoxLayout); widget = new RulesWidget(this); - setMainWidget(widget); + layout()->addWidget(widget); + + QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); + connect(buttons, SIGNAL(accepted()), SLOT(accept())); + connect(buttons, SIGNAL(rejected()), SLOT(reject())); + layout()->addWidget(buttons); } // window is set only for Alt+F3/Window-specific settings, because the dialog @@ -814,7 +824,7 @@ void RulesDialog::accept() if (!widget->finalCheck()) return; rules = widget->rules(); - KDialog::accept(); + QDialog::accept(); } EditShortcut::EditShortcut(QWidget* parent) @@ -833,19 +843,25 @@ void EditShortcut::editShortcut() void EditShortcut::clearShortcut() { - shortcut->setText(QLatin1String("")); + shortcut->clear(); } EditShortcutDialog::EditShortcutDialog(QWidget* parent, const char* name) - : KDialog(parent) + : QDialog(parent) + , widget(new EditShortcut(this)) { setObjectName(name); setModal(true); - setCaption(i18n("Edit Shortcut")); - setButtons(Ok | Cancel); + setWindowTitle(i18n("Edit Shortcut")); - widget = new EditShortcut(this); - setMainWidget(widget); + setLayout(new QVBoxLayout); + + QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); + connect(buttons, SIGNAL(accepted()), SLOT(accept())); + connect(buttons, SIGNAL(rejected()), SLOT(reject())); + + layout()->addWidget(buttons); + layout()->addWidget(widget); } void EditShortcutDialog::setShortcut(const QString& cut) @@ -859,13 +875,20 @@ QString EditShortcutDialog::shortcut() const } ShortcutDialog::ShortcutDialog(const QKeySequence& cut, QWidget* parent) - : KDialog(parent) + : QDialog(parent) , widget(new KKeySequenceWidget(this)) { widget->setKeySequence(cut); // It's a global shortcut so don't allow multikey shortcuts widget->setMultiKeyShortcutsAllowed(false); - setMainWidget(widget); + + QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Close, this); + connect(buttons, SIGNAL(accepted()), SLOT(accept())); + connect(buttons, SIGNAL(rejected()), SLOT(reject())); + + setLayout(new QVBoxLayout); + layout()->addWidget(widget); + layout()->addWidget(buttons); } void ShortcutDialog::accept() @@ -880,11 +903,11 @@ void ShortcutDialog::accept() || (seq[0] & Qt::KeyboardModifierMask) == 0) { // clear widget->clearKeySequence(); - KDialog::accept(); + QDialog::accept(); return; } } - KDialog::accept(); + QDialog::accept(); } QKeySequence ShortcutDialog::shortcut() const diff --git a/kcmkwin/kwinrules/ruleswidget.h b/kcmkwin/kwinrules/ruleswidget.h index 78ea28c513..7e0e7b4cad 100644 --- a/kcmkwin/kwinrules/ruleswidget.h +++ b/kcmkwin/kwinrules/ruleswidget.h @@ -22,7 +22,7 @@ #include -#include +#include #include #include @@ -112,7 +112,7 @@ private: }; class RulesDialog - : public KDialog + : public QDialog { Q_OBJECT public: @@ -139,7 +139,7 @@ protected Q_SLOTS: }; class EditShortcutDialog - : public KDialog + : public QDialog { Q_OBJECT public: @@ -152,7 +152,7 @@ private: // slightly duped from utils.cpp class ShortcutDialog - : public KDialog + : public QDialog { Q_OBJECT public: diff --git a/kcmkwin/kwinrules/ruleswidgetbase.ui b/kcmkwin/kwinrules/ruleswidgetbase.ui index ecf0d99b84..847a8a469e 100644 --- a/kcmkwin/kwinrules/ruleswidgetbase.ui +++ b/kcmkwin/kwinrules/ruleswidgetbase.ui @@ -6,7 +6,7 @@ 0 0 - 486 + 584 588 @@ -57,7 +57,7 @@ - + Unimportant @@ -84,7 +84,7 @@ - + false @@ -147,7 +147,7 @@ - + false @@ -189,7 +189,7 @@ - + Unimportant @@ -213,7 +213,7 @@ - + false @@ -266,7 +266,7 @@ - + false @@ -313,7 +313,7 @@ - + &Detect Window Properties @@ -497,7 +497,7 @@ - + false @@ -534,14 +534,14 @@ - + false x,y - + 0123456789-+,xX: @@ -554,7 +554,7 @@ - + false @@ -591,14 +591,14 @@ - + false width,height - + 0123456789-+,xX: @@ -618,7 +618,7 @@ - + false @@ -669,7 +669,7 @@ - + false @@ -740,7 +740,7 @@ - + false @@ -777,7 +777,7 @@ - + false @@ -804,7 +804,7 @@ - + false @@ -841,7 +841,7 @@ - + false @@ -872,7 +872,7 @@ - + false @@ -923,7 +923,7 @@ - + false @@ -974,7 +974,7 @@ - + false @@ -1025,7 +1025,7 @@ - + false @@ -1047,7 +1047,7 @@ - + false @@ -1127,7 +1127,7 @@ to unconditionally popup in the middle of your screen. - + false @@ -1178,7 +1178,7 @@ to unconditionally popup in the middle of your screen. - + false @@ -1207,14 +1207,14 @@ to unconditionally popup in the middle of your screen. - + false width,height - + 0123456789-+,xX: @@ -1227,7 +1227,7 @@ to unconditionally popup in the middle of your screen. - + false @@ -1249,14 +1249,14 @@ to unconditionally popup in the middle of your screen. - + false width,height - + 0123456789-+,xX: @@ -1282,7 +1282,7 @@ like your complete screen area. - + false @@ -1327,7 +1327,7 @@ like your complete screen area. - + false @@ -1378,7 +1378,7 @@ like your complete screen area. - + false @@ -1425,7 +1425,7 @@ like your complete screen area. - + false @@ -1526,7 +1526,7 @@ like your complete screen area. - + false @@ -1548,7 +1548,7 @@ like your complete screen area. - + false @@ -1632,7 +1632,7 @@ like your complete screen area. - + false @@ -1669,7 +1669,7 @@ like your complete screen area. - + false @@ -1706,7 +1706,7 @@ like your complete screen area. - + false @@ -1747,7 +1747,7 @@ like your complete screen area. - + false @@ -1803,7 +1803,7 @@ like your complete screen area. - + false @@ -1852,7 +1852,7 @@ like your complete screen area. - + false @@ -1910,7 +1910,7 @@ like your complete screen area. - + false @@ -1946,7 +1946,7 @@ like your complete screen area. - + false @@ -2033,7 +2033,7 @@ like your complete screen area. - + false @@ -2099,7 +2099,7 @@ from getting focused on a mouse click. - + false @@ -2148,7 +2148,7 @@ while it's active! - + false @@ -2198,7 +2198,7 @@ while it's active! - + false @@ -2220,7 +2220,7 @@ while it's active! - + false @@ -2342,7 +2342,7 @@ while it's active! - + false @@ -2396,7 +2396,7 @@ while it's active! - + false @@ -2418,7 +2418,7 @@ while it's active! - + false @@ -2461,14 +2461,14 @@ but this may sometimes fail or superact. - + false - + false @@ -2496,16 +2496,6 @@ but this may sometimes fail or superact. - - KRestrictedLine - KLineEdit -
krestrictedline.h
-
- - KPushButton - QPushButton -
kpushbutton.h
-
KLineEdit QLineEdit diff --git a/kcmkwin/kwinscreenedges/CMakeLists.txt b/kcmkwin/kwinscreenedges/CMakeLists.txt index 2e9cde727a..d3345bee4c 100644 --- a/kcmkwin/kwinscreenedges/CMakeLists.txt +++ b/kcmkwin/kwinscreenedges/CMakeLists.txt @@ -7,7 +7,7 @@ set( screenpreviewwidget.cpp ) kde4_add_ui_files( kcm_kwinscreenedges_PART_SRCS main.ui ) -kde4_add_plugin( kcm_kwinscreenedges ${kcm_kwinscreenedges_PART_SRCS} ) +add_library( kcm_kwinscreenedges MODULE ${kcm_kwinscreenedges_PART_SRCS} ) target_link_libraries( kcm_kwinscreenedges ${X11_LIBRARIES} Qt5::DBus KF5::KCompletion @@ -16,7 +16,6 @@ target_link_libraries( kcm_kwinscreenedges ${X11_LIBRARIES} KF5::KI18n KF5::KService KF5::Plasma - KF5::KDE4Support ) install( TARGETS kcm_kwinscreenedges DESTINATION ${PLUGIN_INSTALL_DIR} ) diff --git a/kcmkwin/kwinscreenedges/main.ui b/kcmkwin/kwinscreenedges/main.ui index 9b7238481d..33e21c5d26 100644 --- a/kcmkwin/kwinscreenedges/main.ui +++ b/kcmkwin/kwinscreenedges/main.ui @@ -6,7 +6,7 @@ 0 0 - 461 + 488 511 @@ -202,7 +202,7 @@
- + ms @@ -234,7 +234,7 @@ - + true @@ -289,11 +289,6 @@ QComboBox
kcombobox.h
- - KIntSpinBox - QSpinBox -
knuminput.h
-
KWin::Monitor QWidget diff --git a/kcmkwin/kwinscreenedges/screenpreviewwidget.cpp b/kcmkwin/kwinscreenedges/screenpreviewwidget.cpp index d9e5cd2ae4..d0a08fc2b5 100644 --- a/kcmkwin/kwinscreenedges/screenpreviewwidget.cpp +++ b/kcmkwin/kwinscreenedges/screenpreviewwidget.cpp @@ -25,9 +25,10 @@ #include #include -#include +#include #include +#include class ScreenPreviewWidgetPrivate @@ -147,10 +148,10 @@ void ScreenPreviewWidget::paintEvent(QPaintEvent *event) void ScreenPreviewWidget::dropEvent(QDropEvent *e) { - if (!KUrl::List::canDecode(e->mimeData())) + if (!e->mimeData()->hasUrls()) return; - const KUrl::List uris(KUrl::List::fromMimeData(e->mimeData())); + QList uris(KUrlMimeData::urlsFromMimeData(e->mimeData())); if (!uris.isEmpty()) { // TODO: Download remote file if (uris.first().isLocalFile()) diff --git a/kcmkwin/kwinscripts/CMakeLists.txt b/kcmkwin/kwinscripts/CMakeLists.txt index baa5ba9723..ff997e58d4 100644 --- a/kcmkwin/kwinscripts/CMakeLists.txt +++ b/kcmkwin/kwinscripts/CMakeLists.txt @@ -16,7 +16,6 @@ target_link_libraries(kcm_kwin_scripts KF5::KIOCore KF5::KI18n KF5::Plasma - KF5::KDE4Support KF5::KNewStuff ) diff --git a/kcmkwin/kwinscripts/module.ui b/kcmkwin/kwinscripts/module.ui index 1dc0592ed4..21040a1130 100644 --- a/kcmkwin/kwinscripts/module.ui +++ b/kcmkwin/kwinscripts/module.ui @@ -43,7 +43,7 @@ - + Get New Script... @@ -69,11 +69,6 @@ - - KPushButton - QPushButton -
kpushbutton.h
-
KPluginSelector QWidget diff --git a/kcmkwin/kwintabbox/CMakeLists.txt b/kcmkwin/kwintabbox/CMakeLists.txt index 15e5975eb7..c52f0dc100 100644 --- a/kcmkwin/kwintabbox/CMakeLists.txt +++ b/kcmkwin/kwintabbox/CMakeLists.txt @@ -32,7 +32,6 @@ target_link_libraries(kcm_kwintabbox KF5::Plasma KF5::XmlGui KF5::KNewStuff - KF5::KDE4Support ${XCB_XCB_LIBRARY}) install(TARGETS kcm_kwintabbox DESTINATION ${PLUGIN_INSTALL_DIR} ) diff --git a/kcmkwin/kwintabbox/layoutpreview.cpp b/kcmkwin/kwintabbox/layoutpreview.cpp index 536488f0d8..4cff8734dd 100644 --- a/kcmkwin/kwintabbox/layoutpreview.cpp +++ b/kcmkwin/kwintabbox/layoutpreview.cpp @@ -24,7 +24,6 @@ along with this program. If not, see . #include #include #include -#include #include #include #include @@ -82,7 +81,7 @@ QPixmap TabBoxImageProvider::requestPixmap(const QString &id, QSize *size, const s = requestedSize; } *size = s; - QPixmap icon(KIcon(m_model->data(m_model->index(index), Qt::UserRole+3).toString()).pixmap(s)); + QPixmap icon(QIcon::fromTheme(m_model->data(m_model->index(index), Qt::UserRole+3).toString()).pixmap(s)); if (parts.size() > 2) { KIconEffect *effect = KIconLoader::global()->iconEffect(); KIconLoader::States state = KIconLoader::DefaultState; diff --git a/kcmkwin/kwintabbox/main.cpp b/kcmkwin/kwintabbox/main.cpp index d6cf9e80f7..819c4dac70 100644 --- a/kcmkwin/kwintabbox/main.cpp +++ b/kcmkwin/kwintabbox/main.cpp @@ -23,13 +23,13 @@ along with this program. If not, see . #include #include #include +#include #include #include // KDE #include #include -#include #include //#include #include @@ -63,7 +63,7 @@ KWinTabBoxConfig::KWinTabBoxConfig(QWidget* parent, const QVariantList& args) , m_config(KSharedConfig::openConfig("kwinrc")) , m_layoutPreview(NULL) { - KTabWidget* tabWidget = new KTabWidget(this); + QTabWidget* tabWidget = new QTabWidget(this); m_primaryTabBoxUi = new KWinTabBoxConfigForm(tabWidget); m_alternativeTabBoxUi = new KWinTabBoxConfigForm(tabWidget); tabWidget->addTab(m_primaryTabBoxUi, i18n("Main")); @@ -504,9 +504,13 @@ void KWinTabBoxConfig::configureEffectClicked() m_layoutPreview->setLayout(ui->effectCombo->itemData(effect, Qt::UserRole+1).toString(), ui->effectCombo->itemText(effect)); m_layoutPreview->show(); } else { - QPointer< KDialog > configDialog = new KDialog(this); - configDialog->setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Default); + QPointer configDialog = new QDialog(this); + configDialog->setLayout(new QVBoxLayout); configDialog->setWindowTitle(ui->effectCombo->currentText()); + QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::RestoreDefaults, configDialog); + connect(buttonBox, SIGNAL(accepted()), configDialog, SLOT(accept())); + connect(buttonBox, SIGNAL(rejected()), configDialog, SLOT(reject())); + KCModuleProxy* proxy = new KCModuleProxy(effect == CoverSwitch ? "coverswitch_config" : "flipswitch_config"); connect(configDialog, SIGNAL(defaultClicked()), proxy, SLOT(defaults())); @@ -514,8 +518,8 @@ void KWinTabBoxConfig::configureEffectClicked() QVBoxLayout *layout = new QVBoxLayout; showWidget->setLayout(layout); layout->addWidget(proxy); - layout->insertSpacing(-1, KDialog::marginHint()); - configDialog->setMainWidget(showWidget); + configDialog->layout()->addWidget(showWidget); + configDialog->layout()->addWidget(buttonBox); if (configDialog->exec() == QDialog::Accepted) { proxy->save(); diff --git a/kcmkwin/kwintabbox/main.ui b/kcmkwin/kwintabbox/main.ui index ad1080dd22..9baa26d80f 100644 --- a/kcmkwin/kwintabbox/main.ui +++ b/kcmkwin/kwintabbox/main.ui @@ -6,7 +6,7 @@ 0 0 - 630 + 658 418 @@ -123,7 +123,16 @@ false - + + 0 + + + 0 + + + 0 + + 0 @@ -175,7 +184,16 @@ false - + + 0 + + + 0 + + + 0 + + 0 @@ -227,7 +245,16 @@ false - + + 0 + + + 0 + + + 0 + + 0 @@ -279,7 +306,16 @@ false - + + 0 + + + 0 + + + 0 + + 0 @@ -417,18 +453,10 @@
- - - KKeySequenceWidget::GlobalShortcuts - - + - - - KKeySequenceWidget::GlobalShortcuts - - + @@ -447,18 +475,10 @@ - - - KKeySequenceWidget::GlobalShortcuts - - + - - - KKeySequenceWidget::GlobalShortcuts - - + @@ -475,11 +495,20 @@ - + + 0 + + + 0 + + + 0 + + 0 - + 0 @@ -492,7 +521,7 @@ - + 0 @@ -538,7 +567,7 @@ - + Get New Window Switcher Layout @@ -582,11 +611,6 @@ QComboBox
kcombobox.h
- - KPushButton - QPushButton -
kpushbutton.h
-
highlightWindowCheck