From b75e16ff8b20957512b660640eb6567c0395b89d Mon Sep 17 00:00:00 2001 From: Kartik Patel <kartikpatel1995@gmail.com> Date: Wed, 25 Jan 2017 16:03:25 +0530 Subject: grc: Add 'Create Duplicate' feature --- grc/gui/ActionHandler.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'grc/gui/ActionHandler.py') diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py index b9f534fdf0..cab484d04d 100644 --- a/grc/gui/ActionHandler.py +++ b/grc/gui/ActionHandler.py @@ -30,7 +30,6 @@ from .FileDialogs import (OpenFlowGraphFileDialog, SaveFlowGraphFileDialog, from .MainWindow import MainWindow from .ParserErrorsDialog import ParserErrorsDialog from .PropsDialog import PropsDialog - from ..core import ParseXML, Messages gobject.threads_init() @@ -130,7 +129,7 @@ class ActionHandler: action.set_sensitive(False) # set all actions disabled for action in ( Actions.APPLICATION_QUIT, Actions.FLOW_GRAPH_NEW, - Actions.FLOW_GRAPH_OPEN, Actions.FLOW_GRAPH_SAVE_AS, + Actions.FLOW_GRAPH_OPEN, Actions.FLOW_GRAPH_SAVE_AS, Actions.FLOW_GRAPH_DUPLICATE, Actions.FLOW_GRAPH_CLOSE, Actions.ABOUT_WINDOW_DISPLAY, Actions.FLOW_GRAPH_SCREEN_CAPTURE, Actions.HELP_WINDOW_DISPLAY, Actions.TYPES_WINDOW_DISPLAY, Actions.TOGGLE_BLOCKS_WINDOW, @@ -561,6 +560,9 @@ class ActionHandler: Preferences.add_recent_file(file_path) main.tool_bar.refresh_submenus() main.menu_bar.refresh_submenus() + elif action == Actions.FLOW_GRAPH_DUPLICATE: + curr_flow_graph = main.get_flow_graph() + main.new_page(flow_graph = curr_flow_graph) elif action == Actions.FLOW_GRAPH_SCREEN_CAPTURE: file_path, background_transparent = SaveScreenShotDialog(page.get_file_path()).run() if file_path is not None: -- cgit v1.2.3