summaryrefslogtreecommitdiff
path: root/grc/src/gui/ActionHandler.py
diff options
context:
space:
mode:
authorjblum2008-10-08 20:17:18 +0000
committerjblum2008-10-08 20:17:18 +0000
commit5bc7e8d906438a9b3809d4ce3be4a5c016a13bbf (patch)
treeab215a9c3a8d29af386878f94f39589a08470996 /grc/src/gui/ActionHandler.py
parent55ef8d97a4de54f41df8fe9fa53397ab813a8af8 (diff)
downloadgnuradio-5bc7e8d906438a9b3809d4ce3be4a5c016a13bbf.tar.gz
gnuradio-5bc7e8d906438a9b3809d4ce3be4a5c016a13bbf.tar.bz2
gnuradio-5bc7e8d906438a9b3809d4ce3be4a5c016a13bbf.zip
read-only aware
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9751 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'grc/src/gui/ActionHandler.py')
-rw-r--r--grc/src/gui/ActionHandler.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/grc/src/gui/ActionHandler.py b/grc/src/gui/ActionHandler.py
index 7558d16ae..cc41e937c 100644
--- a/grc/src/gui/ActionHandler.py
+++ b/grc/src/gui/ActionHandler.py
@@ -328,7 +328,10 @@ class ActionHandler:
elif state == Actions.FLOW_GRAPH_CLOSE:
self.main_window.close_page()
elif state == Actions.FLOW_GRAPH_SAVE:
- if not self.get_page().get_file_path(): self.handle_states(Actions.FLOW_GRAPH_SAVE_AS)
+ #read-only or undefines file path, do save-as
+ if self.get_page().get_read_only() or not self.get_page().get_file_path():
+ self.handle_states(Actions.FLOW_GRAPH_SAVE_AS)
+ #otherwise try to save
else:
try:
ParseXML.to_file(self.get_flow_graph().export_data(), self.get_page().get_file_path())
@@ -338,12 +341,12 @@ class ActionHandler:
self.get_page().set_saved(False)
elif state == Actions.FLOW_GRAPH_SAVE_AS:
file_path = SaveFlowGraphFileDialog(self.get_page().get_file_path()).run()
- if file_path != None:
+ if file_path is not None:
self.get_page().set_file_path(file_path)
self.handle_states(Actions.FLOW_GRAPH_SAVE)
elif state == Actions.FLOW_GRAPH_SCREEN_CAPTURE:
file_path = SaveImageFileDialog(self.get_page().get_file_path()).run()
- if file_path != None:
+ if file_path is not None:
pixmap = self.get_flow_graph().get_drawing_area().pixmap
width, height = pixmap.get_size()
pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, 0, 8, width, height)