Skip to content
Permalink
Browse files

[pyqgis-console] disables tab widget editor if restore tabs is prompt…

…ed and adds tab tooltip
  • Loading branch information
slarosa committed Apr 20, 2013
1 parent 6488725 commit cfa3f57515d23e7ff29bdad1a194f9dfa2db358d
Showing with 11 additions and 2 deletions.
  1. +1 −1 python/console/console.py
  2. +10 −1 python/console/console_editor.py
@@ -331,7 +331,7 @@ def __init__(self, parent=None):
self.toolBarEditor = QToolBar()
self.toolBarEditor.setStyleSheet('QToolBar{background-color: rgb(200, 200, 200);\
border-right: 1px solid rgb(155, 155, 155);}')
self.toolBarEditor.setEnabled(True)
self.toolBarEditor.setEnabled(False)
self.toolBarEditor.setFocusPolicy(Qt.NoFocus)
self.toolBarEditor.setContextMenuPolicy(Qt.DefaultContextMenu)
self.toolBarEditor.setLayoutDirection(Qt.LeftToRight)
@@ -570,9 +570,11 @@ def __init__(self, parent):
self.settings = QSettings()
tabScripts = self.settings.value("pythonConsole/tabScripts")
self.restoreTabList = tabScripts.toList()
self.newTabEditor(filename=None)

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

self.setDocumentMode(True)
self.setMovable(True)
@@ -615,6 +617,10 @@ def newTabEditor(self, tabName=None, filename=None):
self.iconTab = QgsApplication.getThemeIcon('console/iconTabEditorConsole.png')
self.addTab(self.tab, self.iconTab, tabName)
self.setCurrentWidget(self.tab)
if filename:
self.setTabToolTip(self.currentIndex(), unicode(filename))
else:
self.setTabToolTip(self.currentIndex(), tabName)

def tabModified(self, tab, modified):
index = self.indexOf(tab)
@@ -685,10 +691,13 @@ def restoreTabs(self):
tabName = pathFile.split('/')[-1]
self.newTabEditor(tabName, pathFile)
self.topFrame.close()
self.parent.toolBarEditor.setEnabled(True)

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

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

0 comments on commit cfa3f57

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