Skip to content
Permalink
Browse files

[pyqgis-console] Follow up 7096a73

  • Loading branch information
slarosa committed Apr 21, 2013
1 parent 7096a73 commit b70934af494c2ac5a42b0c338ad64f81d38ab4dd
Showing with 23 additions and 14 deletions.
  1. +1 −1 python/console/console.py
  2. +22 −13 python/console/console_editor.py
@@ -481,7 +481,7 @@ def qtGui(self):

def toggleEditor(self, checked):
self.widgetEditor.show() if checked else self.widgetEditor.hide()
self.tabEditorWidget.checkToRestoreTabs()
self.tabEditorWidget.enableToolBarEditor(checked)

def toggleObjectListWidget(self, checked):
self.listClassMethod.show() if checked else self.listClassMethod.hide()
@@ -309,9 +309,13 @@ def contextMenuEvent(self, e):
action = menu.exec_(self.mapToGlobal(e.pos()))

def objectListEditor(self):
listObj = self.parent.pc.splitterObj
listObj.hide() if listObj.isVisible() else listObj.show()
self.parent.pc.objectListButton.setChecked(False)
listObj = self.parent.pc.listClassMethod
if listObj.isVisible():
listObj.hide()
self.parent.pc.objectListButton.setChecked(False)
else:
listObj.show()
self.parent.pc.objectListButton.setChecked(True)

def codepad(self):
import urllib2, urllib
@@ -348,8 +352,8 @@ def codepad(self):
self.parent.pc.callWidgetMessageBarEditor(msgText + str(e.args))

def hideEditor(self):
Ed = self.parent.pc.widgetEditor
Ed.hide()
self.parent.pc.widgetEditor.hide()
self.parent.pc.listClassMethod.hide()
self.parent.pc.showEditorButton.setChecked(False)

def commentEditorCode(self, commentCheck):
@@ -599,6 +603,11 @@ def __init__(self, parent):
tabScripts = self.settings.value("pythonConsole/tabScripts")
self.restoreTabList = tabScripts.toList()

if self.restoreTabList:
self.topFrame.show()
else:
self.newTabEditor(filename=None)

self.setDocumentMode(True)
self.setMovable(True)
#self.setTabsClosable(True)
@@ -629,12 +638,10 @@ def __init__(self, parent):
self.setCornerWidget(self.newTabButton, Qt.TopLeftCorner)
self.connect(self.newTabButton, SIGNAL('clicked()'), self.newTabEditor)

def checkToRestoreTabs(self):
if self.restoreTabList:
self.topFrame.show()
else:
self.newTabEditor(filename=None)
self.parent.toolBarEditor.setEnabled(True)
def enableToolBarEditor(self, enable):
if self.topFrame.isVisible():
enable = False
self.parent.toolBarEditor.setEnabled(enable)

def newTabEditor(self, tabName=None, filename=None):
nr = self.count()
@@ -722,14 +729,16 @@ def restoreTabs(self):
if os.path.exists(pathFile):
tabName = pathFile.split('/')[-1]
self.newTabEditor(tabName, pathFile)
else:
self.newTabEditor(filename=None)
self.topFrame.close()
self.parent.toolBarEditor.setEnabled(True)
self.enableToolBarEditor(True)

def closeRestore(self):
self.parent.updateTabListScript('empty')
self.topFrame.close()
self.newTabEditor(filename=None)
self.parent.toolBarEditor.setEnabled(True)
self.enableToolBarEditor(True)

def showFileTabMenu(self):
self.fileTabMenu.clear()

0 comments on commit b70934a

Please sign in to comment.
You can’t perform that action at this time.