mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -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():
|
if not self.isModified():
|
||||||
self.parent.pc.callWidgetMessageBarEditor(msgEditorBlank, 0, True)
|
self.parent.pc.callWidgetMessageBarEditor(msgEditorBlank, 0, True)
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.isModified() and not autoSave:
|
if self.isModified() and not autoSave:
|
||||||
self.parent.pc.callWidgetMessageBarEditor(msgEditorUnsaved, 0, True)
|
self.parent.pc.callWidgetMessageBarEditor(msgEditorUnsaved, 0, True)
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.syntaxCheck(fromContextMenu=False):
|
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()
|
tmpFile = self.createTempFile()
|
||||||
filename = tmpFile
|
filename = tmpFile
|
||||||
|
|
||||||
self.parent.pc.shell.runCommand("execfile(r'{0}')".format(filename))
|
self.parent.pc.shell.runCommand("execfile(r'{0}')".format(filename))
|
||||||
|
|
||||||
def runSelectedCode(self):
|
def runSelectedCode(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user