summaryrefslogtreecommitdiff
path: root/grc/gui/ActionHandler.py
diff options
context:
space:
mode:
Diffstat (limited to 'grc/gui/ActionHandler.py')
-rw-r--r--grc/gui/ActionHandler.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py
index dc5f3e287d..5d48485238 100644
--- a/grc/gui/ActionHandler.py
+++ b/grc/gui/ActionHandler.py
@@ -571,16 +571,23 @@ class ActionHandler:
dup_file_name = '.'.join(dup_file_path.split('.')[:-1]) + "_copy" # Assuming .grc extension at the end of file_path
dup_file_path_temp = dup_file_name+'.grc'
count = 1
- while (os.path.exists(dup_file_path_temp)):
+ while os.path.exists(dup_file_path_temp):
dup_file_path_temp = dup_file_name+'('+str(count)+').grc'
count += 1
- ParseXML.to_file(flow_graph.export_data(), dup_file_path_temp)
- Messages.send("Successfully copied to " + dup_file_path_temp)
+ dup_file_path_user = SaveFlowGraphFileDialog(dup_file_path_temp).run()
+ if dup_file_path_user is not None:
+ ParseXML.to_file(flow_graph.export_data(), dup_file_path_user)
+ Messages.send('Saved Copy to: "' + dup_file_path_user + '"\n')
except IOError:
- Messages.send_fail_save("Can not create a copy of the flowgraph")
+ Messages.send_fail_save("Can not create a copy of the flowgraph\n")
elif action == Actions.FLOW_GRAPH_DUPLICATE:
- curr_flow_graph = main.get_flow_graph()
- main.new_page(flow_graph = curr_flow_graph)
+ flow_graph = main.get_flow_graph()
+ main.new_page()
+ curr_page = main.get_page()
+ new_flow_graph = main.get_flow_graph()
+ new_flow_graph.import_data(flow_graph.export_data())
+ flow_graph_update(new_flow_graph)
+ curr_page.set_saved(False)
elif action == Actions.FLOW_GRAPH_SCREEN_CAPTURE:
file_path, background_transparent = SaveScreenShotDialog(page.get_file_path()).run()
if file_path is not None: