From dfc55420e7acaf8a38e348fe5900e70b76c383d7 Mon Sep 17 00:00:00 2001 From: Michael Jansen Date: Mon, 10 Nov 2008 00:03:17 +0000 Subject: [PATCH] - Only record single key global shortcuts - print a debug message when ignoring the entered shortcuts because of conflicts. svn path=/trunk/KDE/kdebase/workspace/; revision=882188 --- kcmkwin/kwinrules/ruleswidget.cpp | 2 ++ utils.cpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/kcmkwin/kwinrules/ruleswidget.cpp b/kcmkwin/kwinrules/ruleswidget.cpp index 8ca752b9ed..9b6b690a6d 100644 --- a/kcmkwin/kwinrules/ruleswidget.cpp +++ b/kcmkwin/kwinrules/ruleswidget.cpp @@ -778,6 +778,8 @@ ShortcutDialog::ShortcutDialog( const QKeySequence& cut, QWidget* parent ) , widget( new KKeySequenceWidget( this )) { widget->setKeySequence( cut ); + // It's a global shortcut so don't allow multikey shortcuts + widget->setMultiKeyShortcutsAllowed(false); setMainWidget( widget ); } diff --git a/utils.cpp b/utils.cpp index 9f57b9cf28..0926216da8 100644 --- a/utils.cpp +++ b/utils.cpp @@ -417,6 +417,8 @@ ShortcutDialog::ShortcutDialog( const QKeySequence& cut ) // To not check for conflicting shortcuts. The widget would use a message // box which brings down kwin. widget->setCheckForConflictsAgainst(KKeySequenceWidget::None); + // It's a global shortcut so don't allow multikey shortcuts + widget->setMultiKeyShortcutsAllowed(false); // Listen to changed shortcuts connect( @@ -462,8 +464,9 @@ void ShortcutDialog::done( int r ) void ShortcutDialog::keySequenceChanged(const QKeySequence &seq) { // Check if the key sequence is used currently - QStringList conflicting = KGlobalAccel::findActionNameSystemwide(seq); + QList conflicting = KGlobalAccel::getGlobalShortcutsByKey(seq); if (!conflicting.isEmpty()) { + kDebug() << "TODO: Display conflicting shortcuts to user"; // TODO: Inform the user somehow instead of just ignoring his wish widget->setKeySequence(shortcut()); }