Skip to content

Commit

Permalink
[pyqgis-console] shows info messages also for temporary scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
slarosa committed May 31, 2013
1 parent af0f61e commit 24bffbf
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions python/console/console_editor.py
Expand Up @@ -558,24 +558,19 @@ def runScriptCode(self):
'Hey, type something to run!')
msgEditorUnsaved = QCoreApplication.translate('PythonConsole',
'You have to save the file before running it.')
if not autoSave:
if filename is None:
if not self.isModified():
self.parent.pc.callWidgetMessageBarEditor(msgEditorBlank, 0, True)
return
else:
self.parent.pc.callWidgetMessageBarEditor(msgEditorUnsaved, 0, True)
return
if self.isModified():
self.parent.pc.callWidgetMessageBarEditor(msgEditorUnsaved, 0, True)
if filename is None:
if not self.isModified():
self.parent.pc.callWidgetMessageBarEditor(msgEditorBlank, 0, True)
return
else:
if self.syntaxCheck(fromContextMenu=False):
self._runSubProcess(filename)
else:
if self.syntaxCheck(fromContextMenu=False):
if self.isModified() and not autoSave:
self.parent.pc.callWidgetMessageBarEditor(msgEditorUnsaved, 0, True)
return
if self.syntaxCheck(fromContextMenu=False):
if autoSave:
tmpFile = self.createTempFile()
self._runSubProcess(tmpFile, True)
else:
self._runSubProcess(filename)

def runSelectedCode(self):
cmd = self.selectedText()
Expand Down

0 comments on commit 24bffbf

Please sign in to comment.