From 24bffbf262fb39daead23c45f51ff006c422ea73 Mon Sep 17 00:00:00 2001 From: Salvatore Larosa Date: Fri, 31 May 2013 23:46:53 +0200 Subject: [PATCH] [pyqgis-console] shows info messages also for temporary scripts --- python/console/console_editor.py | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/python/console/console_editor.py b/python/console/console_editor.py index b36e280f956..e2dfb53d7c4 100644 --- a/python/console/console_editor.py +++ b/python/console/console_editor.py @@ -558,24 +558,19 @@ class Editor(QsciScintilla): '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()