]> git.gag.com Git - debian/gnuradio/commitdiff
must check for exists, then ro
authorjblum <jblum@221aa14e-8319-0410-a670-987f0aec2ac5>
Thu, 9 Oct 2008 00:03:45 +0000 (00:03 +0000)
committerjblum <jblum@221aa14e-8319-0410-a670-987f0aec2ac5>
Thu, 9 Oct 2008 00:03:45 +0000 (00:03 +0000)
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9759 221aa14e-8319-0410-a670-987f0aec2ac5

grc/src/gui/ActionHandler.py
grc/src/gui/NotebookPage.py

index cc41e937c02ff3bb4b7fa299624969d53cb8bf22..66b652d25ed5dd18dec914c0c6932ad1f1114903 100644 (file)
@@ -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
index e2e627a2d5fda11f11a1f95a88f62ddd382835f3..00d8110686d648645417756b4a42cdc2c6a8f886 100644 (file)
@@ -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):
                """