summaryrefslogtreecommitdiff
path: root/muse2/muse/widgets/shortcutcapturedialog.cpp
diff options
context:
space:
mode:
authorRobert Jonsson <spamatica@gmail.com>2011-02-18 15:42:54 +0000
committerRobert Jonsson <spamatica@gmail.com>2011-02-18 15:42:54 +0000
commit8e4d18fdcc12c7202e287cc8a2ec2214667c8844 (patch)
tree021c61e2de7e9001b6b0f4958ffadae8cf9287e3 /muse2/muse/widgets/shortcutcapturedialog.cpp
parentcd2b45a71582e6480eeef33540b27586d3b3ca73 (diff)
shortcut fix
Diffstat (limited to 'muse2/muse/widgets/shortcutcapturedialog.cpp')
-rw-r--r--muse2/muse/widgets/shortcutcapturedialog.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/muse2/muse/widgets/shortcutcapturedialog.cpp b/muse2/muse/widgets/shortcutcapturedialog.cpp
index 73534811..8ca70a05 100644
--- a/muse2/muse/widgets/shortcutcapturedialog.cpp
+++ b/muse2/muse/widgets/shortcutcapturedialog.cpp
@@ -53,7 +53,7 @@ void ShortcutCaptureDialog::keyPressEvent(QKeyEvent* e)
bool ispunct = keychar.isPunct();
bool issymbol = keychar.isSymbol();
//printf("Key:%x, alt:%d, ctrl:%d shift:%d ispunct:%d issymbol:%d text:%s\n",
- // e->key(), alt, ctrl, shift, ispunct, issymbol, e->text().toLatin1().constData());
+ // e->key(), alt, ctrl, shift, ispunct, issymbol, e->text().toLatin1().constData());
temp_key += (shift ? (int)Qt::SHIFT : 0); // (int) Tim
temp_key += (ctrl ? (int)Qt::CTRL : 0); //
@@ -76,11 +76,14 @@ void ShortcutCaptureDialog::keyPressEvent(QKeyEvent* e)
// Check against conflicting shortcuts
for (int i=0; i < SHRT_NUM_OF_ELEMENTS; i++) {
- if (shortcuts[i].key == key && (shortcuts[i].type & (shortcuts[shortcutindex].type | GLOBAL_SHRT | INVIS_SHRT))) {
- msgString = tr("Shortcut conflicts with ") + QString(shortcuts[i].descr);
- conflict = true;
- break;
- }
+ if (shortcuts[i].key == key && // use the same key
+ (( shortcuts[i].type & (shortcuts[shortcutindex].type | INVIS_SHRT)) ||
+ shortcuts[i].type & GLOBAL_SHRT ||
+ shortcuts[shortcutindex].type & GLOBAL_SHRT)) { // affect the same scope
+ msgString = tr("Shortcut conflicts with ") + QString(shortcuts[i].descr);
+ conflict = true;
+ break;
+ }
}
}
messageLabel->setText(msgString);