summaryrefslogtreecommitdiff
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
parentcd2b45a71582e6480eeef33540b27586d3b3ca73 (diff)
shortcut fix
-rw-r--r--muse2/ChangeLog3
-rw-r--r--muse2/muse/arranger/pcanvas.cpp5
-rw-r--r--muse2/muse/shortcuts.cpp2
-rw-r--r--muse2/muse/widgets/shortcutcapturedialog.cpp15
4 files changed, 17 insertions, 8 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog
index b0e5b6f1..35cc42b5 100644
--- a/muse2/ChangeLog
+++ b/muse2/ChangeLog
@@ -1,6 +1,9 @@
18.02.2011:
- Disable saveAs dialog for rec when project dialog isn't used (rj)
- changed the default setting for move single rec with track, default is to NOT move (rj)
+ - fixed (hopefully) bug in shortcut editor, global shortcuts were not always
+ taken into account when checking if a shortcut was in use (rj)
+ - added shortcut F for linedraw, applicable to automation drawing in arranger and pianoroll (rj)
15.02.2011:
- Automation fixes, better detection, not perfect (rj)
14.02.2011:
diff --git a/muse2/muse/arranger/pcanvas.cpp b/muse2/muse/arranger/pcanvas.cpp
index 479fa78e..189c7b76 100644
--- a/muse2/muse/arranger/pcanvas.cpp
+++ b/muse2/muse/arranger/pcanvas.cpp
@@ -1180,7 +1180,10 @@ void PartCanvas::keyPress(QKeyEvent* event)
emit setUsedTool(CutTool);
return;
}
- else if (key == shortcuts[SHRT_TOOL_GLUE].key) {
+ else if (key == shortcuts[SHRT_TOOL_LINEDRAW].key) {
+ emit setUsedTool(AutomationTool);
+ return;
+ } else if (key == shortcuts[SHRT_TOOL_GLUE].key) {
emit setUsedTool(GlueTool);
return;
}
diff --git a/muse2/muse/shortcuts.cpp b/muse2/muse/shortcuts.cpp
index 558feaa4..c0edc0ac 100644
--- a/muse2/muse/shortcuts.cpp
+++ b/muse2/muse/shortcuts.cpp
@@ -207,7 +207,7 @@ void initShortCuts()
defShrt(SHRT_TOOL_PENCIL, Qt::Key_D, "Tool: Pencil", ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "pencil_tool");
defShrt(SHRT_TOOL_RUBBER, Qt::Key_R, "Tool: Eraser", ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "eraser_tool");
// piano roll & drum editor
- defShrt(SHRT_TOOL_LINEDRAW, 0, "Tool: Line Draw", PROLL_SHRT + DEDIT_SHRT, "line_draw_tool");
+ defShrt(SHRT_TOOL_LINEDRAW, Qt::Key_F, "Tool: Line Draw", ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "line_draw_tool");
// arranger
defShrt(SHRT_TOOL_SCISSORS, Qt::Key_S, "Tool: Scissor", ARRANG_SHRT, "scissor_tool");
defShrt(SHRT_TOOL_GLUE, Qt::Key_G, "Tool: Glue", ARRANG_SHRT, "glue_tool");
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);