From e06f06e37fdc65198c037ab92f669f3ce78949c9 Mon Sep 17 00:00:00 2001 From: jblum Date: Thu, 9 Oct 2008 00:03:45 +0000 Subject: [PATCH] must check for exists, then ro git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9759 221aa14e-8319-0410-a670-987f0aec2ac5 --- grc/src/gui/ActionHandler.py | 2 +- 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 cc41e937..66b652d2 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 e2e627a2..00d81106 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): """ -- 2.47.2