mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Auto save Python script file
This commit is contained in:
parent
ed286eb198
commit
d0d2511d13
@ -561,13 +561,20 @@ class Editor(QsciScintilla):
|
||||
if not self.isModified():
|
||||
self.parent.pc.callWidgetMessageBarEditor(msgEditorBlank, 0, True)
|
||||
return
|
||||
|
||||
if self.isModified() and not autoSave:
|
||||
self.parent.pc.callWidgetMessageBarEditor(msgEditorUnsaved, 0, True)
|
||||
return
|
||||
|
||||
if self.syntaxCheck(fromContextMenu=False):
|
||||
if autoSave:
|
||||
if autoSave and filename:
|
||||
self.parent.save(filename)
|
||||
|
||||
if autoSave and not filename:
|
||||
# Create a new temp file if the file isn't already saved.
|
||||
tmpFile = self.createTempFile()
|
||||
filename = tmpFile
|
||||
|
||||
self.parent.pc.shell.runCommand("execfile(r'{0}')".format(filename))
|
||||
|
||||
def runSelectedCode(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user