From: Kevin A. <ka...@us...> - 2004-05-09 03:58:15
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15756/tools/resourceEditor Modified Files: resourceEditor.py Log Message: added auto-save on run Index: resourceEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/resourceEditor.py,v retrieving revision 1.190 retrieving revision 1.191 diff -C2 -d -r1.190 -r1.191 *** resourceEditor.py 6 May 2004 20:13:29 -0000 1.190 --- resourceEditor.py 9 May 2004 03:58:03 -0000 1.191 *************** *** 207,216 **** pass else: ! if self.documentPath is None: # if the user cancels out of the Save As then go back to editing if not self.on_menuFileSaveAs_select(None): return else: ! self.saveFile(self.documentPath) self.openFile(path) --- 207,216 ---- pass else: ! if self.filename is None: # if the user cancels out of the Save As then go back to editing if not self.on_menuFileSaveAs_select(None): return else: ! self.saveFile() self.openFile(path) *************** *** 1473,1476 **** --- 1473,1492 ---- def runScript(self, useInterpreter): + # KEA 2004-05-08 + # auto-save code taken from codeEditor + if self.filename is None: + save = self.saveChanges() + if save == "Cancel" or save == "No": + # don't do anything, just go back to editing + return + else: + if not self.on_menuFileSaveAs_select(None): + # they didn't actually save, just go back + # to editing + return + elif self.documentChanged: + # auto-save + self.saveFile() + if self.filename is None: # KEA 2002-03-25 *************** *** 1515,1530 **** def on_fileRun_command(self, event): ! # KEA 2001-12-14 ! # we should prompt to save the .rsrc.py file if needed ! # or in the case of a new file, do a save as before attempting ! # to do a run ! self.runScript(0) def on_fileRunWithInterpreter_command(self, event): ! # KEA 2001-12-14 ! # we should prompt to save the .rsrc.py file if needed ! # or in the case of a new file, do a save as before attempting ! # to do a run ! self.runScript(1) def copyWidgetDescriptionToClipboard(self, name): --- 1531,1538 ---- def on_fileRun_command(self, event): ! self.runScript(False) def on_fileRunWithInterpreter_command(self, event): ! self.runScript(True) def copyWidgetDescriptionToClipboard(self, name): |