summaryrefslogtreecommitdiff
path: root/muse2
diff options
context:
space:
mode:
authorRobert Jonsson <spamatica@gmail.com>2013-03-04 19:44:48 +0000
committerRobert Jonsson <spamatica@gmail.com>2013-03-04 19:44:48 +0000
commit0cbda2ef8898f4e6333407c64e662d6e087878fa (patch)
treea7e5b99664df29a2f0a3c23ee0bff2bc9a377e3c /muse2
parent8c3f10f97d58e596a2ecd1c5c2280d2b6b7f5e11 (diff)
print shortcuts for tools
Diffstat (limited to 'muse2')
-rw-r--r--muse2/ChangeLog2
-rw-r--r--muse2/muse/shortcuts.h12
-rw-r--r--muse2/muse/widgets/canvas.cpp8
-rw-r--r--muse2/muse/widgets/tools.cpp21
-rw-r--r--muse2/muse/widgets/tools.h2
5 files changed, 37 insertions, 8 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog
index 528a6350..c2f1d2c5 100644
--- a/muse2/ChangeLog
+++ b/muse2/ChangeLog
@@ -1,3 +1,5 @@
+05.03.2013:
+ - Added shortcut printout of tools in tool menu (rj)
03.02.2013:
- Generalized theming somewhat more and added a basic Ardour complementary theme (rj)
28.02.2013:
diff --git a/muse2/muse/shortcuts.h b/muse2/muse/shortcuts.h
index 309e9f9f..465d479e 100644
--- a/muse2/muse/shortcuts.h
+++ b/muse2/muse/shortcuts.h
@@ -257,12 +257,12 @@ enum {
SHRT_INCREASE_LEN,
SHRT_DECREASE_LEN,
- SHRT_TOOL_1,//Shift+1 Pointer
- SHRT_TOOL_2,//Shift+2 Pen
- SHRT_TOOL_3,//Shift+3 Rubber
- SHRT_TOOL_4,//Shift+4
- SHRT_TOOL_5,//Shift+5
- SHRT_TOOL_6,//Shift+6
+ //SHRT_TOOL_1,//Shift+1 Pointer
+ //SHRT_TOOL_2,//Shift+2 Pen
+ //SHRT_TOOL_3,//Shift+3 Rubber
+ //SHRT_TOOL_4,//Shift+4
+ //SHRT_TOOL_5,//Shift+5
+ //SHRT_TOOL_6,//Shift+6
SHRT_TRANSPOSE, //Default: undefined
//Shortcuts to be in pianoroll & drumeditor
diff --git a/muse2/muse/widgets/canvas.cpp b/muse2/muse/widgets/canvas.cpp
index 51612884..f29e4d63 100644
--- a/muse2/muse/widgets/canvas.cpp
+++ b/muse2/muse/widgets/canvas.cpp
@@ -48,6 +48,7 @@
#include "part.h"
#include "fastlog.h"
#include "menutitleitem.h"
+#include "shortcuts.h"
#define ABS(x) ((x) < 0) ? -(x) : (x)
@@ -1644,7 +1645,12 @@ QMenu* Canvas::genCanvasPopup(QMenu* menu)
if ((canvasTools & (1 << i))==0)
continue;
QAction* act = r_menu->addAction(QIcon(**toolList[i].icon), tr(toolList[i].tip));
- act->setData(TOOLS_ID_BASE + i);
+
+ if (MusEGui::toolShortcuts.contains(1 << i)) {
+ act->setShortcut(MusEGui::shortcuts[MusEGui::toolShortcuts[1 << i]].key);
+ }
+ //
+ act->setData(TOOLS_ID_BASE + i);
act->setCheckable(true);
act->setChecked((1 << i) == _tool);
if (!act0)
diff --git a/muse2/muse/widgets/tools.cpp b/muse2/muse/widgets/tools.cpp
index 0bac4b10..8a62d2a9 100644
--- a/muse2/muse/widgets/tools.cpp
+++ b/muse2/muse/widgets/tools.cpp
@@ -27,6 +27,7 @@
#include "icons.h"
#include "action.h"
+#include "shortcuts.h"
namespace MusEGui {
@@ -78,6 +79,9 @@ ToolB toolList[] = {
{&cursorIcon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "cursor"), infoCursor}
};
+QMap<int,int> toolShortcuts;
+
+
const unsigned gNumberOfTools = sizeof(toolList) / sizeof(ToolB);
//---------------------------------------------------------
@@ -122,7 +126,22 @@ EditToolBar::EditToolBar(QWidget* parent, int tools, const char*)
// Note: Does not take ownership.
addActions(action->actions());
- connect(action, SIGNAL(selected(QAction*)), SLOT(toolChanged(QAction*)));
+ connect(action, SIGNAL(selected(QAction*)), SLOT(toolChanged(QAction*)));
+
+ toolShortcuts[PointerTool] = SHRT_TOOL_CURSOR;
+ toolShortcuts[PencilTool] = SHRT_TOOL_PENCIL;
+ toolShortcuts[RubberTool] = SHRT_TOOL_RUBBER;
+ toolShortcuts[CutTool] = SHRT_TOOL_SCISSORS;
+ toolShortcuts[GlueTool] = SHRT_TOOL_GLUE;
+ toolShortcuts[RangeTool] = SHRT_TOOL_RANGE;
+ toolShortcuts[PanTool] = SHRT_TOOL_PAN;
+ toolShortcuts[ZoomTool] = SHRT_TOOL_ZOOM;
+ //toolShortcuts[ScoreTool] = SHRT_TOOL_
+ //toolShortcuts[QuantTool] = SHRT_TOOL_
+ toolShortcuts[DrawTool] = SHRT_TOOL_LINEDRAW;
+ toolShortcuts[MuteTool] = SHRT_TOOL_MUTE;
+ toolShortcuts[AutomationTool] = SHRT_TOOL_LINEDRAW;
+ toolShortcuts[CursorTool] = SHRT_TOOL_CURSOR;
}
//---------------------------------------------------------
diff --git a/muse2/muse/widgets/tools.h b/muse2/muse/widgets/tools.h
index 598a5955..06acd54f 100644
--- a/muse2/muse/widgets/tools.h
+++ b/muse2/muse/widgets/tools.h
@@ -51,6 +51,8 @@ enum Tool {
CursorTool=8192
};
+extern QMap<int,int> toolShortcuts;
+
const int arrangerTools = PointerTool | PencilTool | RubberTool | CutTool | GlueTool | MuteTool |
AutomationTool | PanTool | ZoomTool;