diff options
author | jblum | 2008-10-09 00:03:45 +0000 |
---|---|---|
committer | jblum | 2008-10-09 00:03:45 +0000 |
commit | e06f06e37fdc65198c037ab92f669f3ce78949c9 (patch) | |
tree | f0b67392685b0ff223b21a15afc297173e610a69 /grc/src/gui | |
parent | 5bc7e8d906438a9b3809d4ce3be4a5c016a13bbf (diff) | |
download | gnuradio-e06f06e37fdc65198c037ab92f669f3ce78949c9.tar.gz gnuradio-e06f06e37fdc65198c037ab92f669f3ce78949c9.tar.bz2 gnuradio-e06f06e37fdc65198c037ab92f669f3ce78949c9.zip |
must check for exists, then ro
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9759 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'grc/src/gui')
-rw-r--r-- | grc/src/gui/ActionHandler.py | 2 | ||||
-rw-r--r-- | grc/src/gui/NotebookPage.py | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/grc/src/gui/ActionHandler.py b/grc/src/gui/ActionHandler.py index cc41e937c..66b652d25 100644 --- a/grc/src/gui/ActionHandler.py +++ b/grc/src/gui/ActionHandler.py @@ -328,7 +328,7 @@ class ActionHandler: elif state == Actions.FLOW_GRAPH_CLOSE: self.main_window.close_page() elif state == Actions.FLOW_GRAPH_SAVE: - #read-only or undefines file path, do save-as + #read-only or undefined 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 diff --git a/grc/src/gui/NotebookPage.py b/grc/src/gui/NotebookPage.py index e2e627a2d..00d811068 100644 --- a/grc/src/gui/NotebookPage.py +++ b/grc/src/gui/NotebookPage.py @@ -142,7 +142,8 @@ class NotebookPage(gtk.HBox): @return true for read-only """ if not self.get_file_path(): return False - return not os.access(self.get_file_path(), os.W_OK) + return os.path.exists(self.get_file_path()) and \ + not os.access(self.get_file_path(), os.W_OK) def get_file_path(self): """ |