From f9da3fb0eb76dc9bb66c06b745a310d09689161f Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Mon, 21 Mar 2016 10:28:21 +0100 Subject: [PATCH] [Window Rules] Fix simple shortcut not being transfered to text field The dialog only had a "Close" button but the text was only transfered in accepted() Also fix the position of the QDialogButtonBox which is swapped and so the buttons appear at the top. BUG: 360521 FIXED-IN: 5.6.1 Differential Revision: https://phabricator.kde.org/D1173 --- kcmkwin/kwinrules/ruleswidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kcmkwin/kwinrules/ruleswidget.cpp b/kcmkwin/kwinrules/ruleswidget.cpp index 49ece61c56..44b569679e 100644 --- a/kcmkwin/kwinrules/ruleswidget.cpp +++ b/kcmkwin/kwinrules/ruleswidget.cpp @@ -878,8 +878,8 @@ EditShortcutDialog::EditShortcutDialog(QWidget* parent, const char* name) connect(buttons, SIGNAL(accepted()), SLOT(accept())); connect(buttons, SIGNAL(rejected()), SLOT(reject())); - layout()->addWidget(buttons); layout()->addWidget(widget); + layout()->addWidget(buttons); } void EditShortcutDialog::setShortcut(const QString& cut) @@ -900,7 +900,7 @@ ShortcutDialog::ShortcutDialog(const QKeySequence& cut, QWidget* parent) // It's a global shortcut so don't allow multikey shortcuts widget->setMultiKeyShortcutsAllowed(false); - QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Close, this); + QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); connect(buttons, SIGNAL(accepted()), SLOT(accept())); connect(buttons, SIGNAL(rejected()), SLOT(reject()));