Changeset 9751
- Timestamp:
- 10/08/08 14:17:18
- Files:
-
- gnuradio/trunk/grc/src/gui/ActionHandler.py (modified) (2 diffs)
- gnuradio/trunk/grc/src/gui/MainWindow.py (modified) (2 diffs)
- gnuradio/trunk/grc/src/gui/NotebookPage.py (modified) (1 diff)
- gnuradio/trunk/grc/todo.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gnuradio/trunk/grc/src/gui/ActionHandler.py
r9668 r9751 329 329 self.main_window.close_page() 330 330 elif state == Actions.FLOW_GRAPH_SAVE: 331 if not self.get_page().get_file_path(): self.handle_states(Actions.FLOW_GRAPH_SAVE_AS) 331 #read-only or undefines file path, do save-as 332 if self.get_page().get_read_only() or not self.get_page().get_file_path(): 333 self.handle_states(Actions.FLOW_GRAPH_SAVE_AS) 334 #otherwise try to save 332 335 else: 333 336 try: … … 339 342 elif state == Actions.FLOW_GRAPH_SAVE_AS: 340 343 file_path = SaveFlowGraphFileDialog(self.get_page().get_file_path()).run() 341 if file_path !=None:344 if file_path is not None: 342 345 self.get_page().set_file_path(file_path) 343 346 self.handle_states(Actions.FLOW_GRAPH_SAVE) 344 347 elif state == Actions.FLOW_GRAPH_SCREEN_CAPTURE: 345 348 file_path = SaveImageFileDialog(self.get_page().get_file_path()).run() 346 if file_path !=None:349 if file_path is not None: 347 350 pixmap = self.get_flow_graph().get_drawing_area().pixmap 348 351 width, height = pixmap.get_size() gnuradio/trunk/grc/src/gui/MainWindow.py
r9705 r9751 247 247 (self.get_page().get_file_path() or NEW_FLOGRAPH_TITLE), 248 248 (self.get_page().get_saved() and ' ' or '*'), #blank must be non empty 249 (self.get_page().get_read_only() and ' (read-only)' or ''), 249 250 ) 250 251 ) … … 263 264 (title or NEW_FLOGRAPH_TITLE), 264 265 (page.get_saved() and ' ' or '*'), #blank must be non empty 266 (page.get_read_only() and ' (ro)' or ''), 265 267 ) 266 268 ) gnuradio/trunk/grc/src/gui/NotebookPage.py
r9525 r9751 136 136 return self._flow_graph 137 137 138 def get_read_only(self): 139 """ 140 Get the read-only state of the file. 141 Always false for empty path. 142 @return true for read-only 143 """ 144 if not self.get_file_path(): return False 145 return not os.access(self.get_file_path(), os.W_OK) 146 138 147 def get_file_path(self): 139 148 """ gnuradio/trunk/grc/todo.txt
r9745 r9751 33 33 -dont generate py files in .grc file dir 34 34 -save/restore cwd 35 -check for .grc file readonly, ro message in window, no save option36 35 37 36 ##################################################
