From 29b5537a81743feb8113496a432c79532d1a071d Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Fri, 16 Jan 2015 16:40:38 +0300 Subject: [PATCH] fix action handling --- src/dlangide/ui/commands.d | 4 ++-- src/dlangide/ui/frame.d | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/dlangide/ui/commands.d b/src/dlangide/ui/commands.d index a0906cd..6afc58e 100644 --- a/src/dlangide/ui/commands.d +++ b/src/dlangide/ui/commands.d @@ -22,7 +22,7 @@ __gshared Action ACTION_FILE_OPEN = new Action(IDEActions.FileOpen, "MENU_FILE_O __gshared Action ACTION_FILE_SAVE = new Action(IDEActions.FileSave, "MENU_FILE_SAVE"c, "document-save", KeyCode.KEY_S, KeyFlag.Control); __gshared Action ACTION_FILE_EXIT = new Action(IDEActions.FileExit, "MENU_FILE_EXIT"c, "document-close"c, KeyCode.KEY_X, KeyFlag.Alt); __gshared Action ACTION_EDIT_COPY = new Action(EditorActions.Copy, "Copy"d, "edit-copy"c, KeyCode.KEY_C, KeyFlag.Control); -__gshared Action ACTION_EDIT_PASTE = new Action(EditorActions.Copy, "Paste"d, "edit-paste"c, KeyCode.KEY_V, KeyFlag.Control); -__gshared Action ACTION_EDIT_CUT = new Action(EditorActions.Copy, "Cut"d, "edit-cut"c, KeyCode.KEY_X, KeyFlag.Control); +__gshared Action ACTION_EDIT_PASTE = new Action(EditorActions.Paste, "Paste"d, "edit-paste"c, KeyCode.KEY_V, KeyFlag.Control); +__gshared Action ACTION_EDIT_CUT = new Action(EditorActions.Cut, "Cut"d, "edit-cut"c, KeyCode.KEY_X, KeyFlag.Control); __gshared Action ACTION_EDIT_UNDO = new Action(EditorActions.Undo, "Undo"d, "edit-undo"c, KeyCode.KEY_Z, KeyFlag.Control); __gshared Action ACTION_EDIT_REDO = new Action(EditorActions.Redo, "Redo"d, "edit-redo"c, KeyCode.KEY_Z, KeyFlag.Control|KeyFlag.Shift); diff --git a/src/dlangide/ui/frame.d b/src/dlangide/ui/frame.d index 053e910..0302a63 100644 --- a/src/dlangide/ui/frame.d +++ b/src/dlangide/ui/frame.d @@ -117,9 +117,8 @@ class IDEFrame : AppFrame { return res; } - override bool onMenuItemClick(MenuItem item) { - Log.d("mainMenu.onMenuItemListener", item.label); - const Action a = item.action; + /// override to handle specific actions + override bool handleAction(const Action a) { if (a) { switch (a.id) { case IDEActions.FileExit: @@ -145,8 +144,8 @@ class IDEFrame : AppFrame { return handleAction(a); } } - return false; - } + return false; + } bool loadWorkspace(string path) { // testing workspace loader