Skip to content

Commit

Permalink
[pyqgis-console] restore previously loaded scripts only when editor i…
Browse files Browse the repository at this point in the history
…s instanced
  • Loading branch information
slarosa committed Oct 8, 2014
1 parent 149ad59 commit 5a01b98
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions python/console/console.py
Expand Up @@ -539,8 +539,6 @@ def __init__(self, parent=None):
self.findPrevButton.clicked.connect(self._findPrev)
self.lineEditFind.textChanged.connect(self._textFindChanged)

self.tabEditorWidget.restoreTabsOrAddNew()

def _findText(self):
self.tabEditorWidget.currentWidget().newEditor.findText(True)

Expand Down Expand Up @@ -586,7 +584,9 @@ def qtGui(self):

def toggleEditor(self, checked):
self.splitterObj.show() if checked else self.splitterObj.hide()
self.tabEditorWidget.enableToolBarEditor(checked)
if not self.tabEditorWidget:
self.tabEditorWidget.enableToolBarEditor(checked)
self.tabEditorWidget.restoreTabsOrAddNew()

def toggleObjectListWidget(self, checked):
self.listClassMethod.show() if checked else self.listClassMethod.hide()
Expand Down Expand Up @@ -679,8 +679,7 @@ def openHelp(self):
QgsContextHelp.run( "PythonConsole" )

def openSettings(self):
options = optionsDialog(self)
if options.exec_():
if optionsDialog(self).exec_():
self.shell.refreshSettingsShell()
self.shellOut.refreshSettingsOutput()
self.tabEditorWidget.refreshSettingsEditor()
Expand Down

0 comments on commit 5a01b98

Please sign in to comment.