Skip to content
Permalink
Browse files

[processing] automatically open results viewer panel when items added

  • Loading branch information
nirvn committed Feb 12, 2018
1 parent 207a947 commit 4ada4989e559d0e6f32319031b180f7abe62574e
Showing with 11 additions and 3 deletions.
  1. +0 −2 python/plugins/processing/ProcessingPlugin.py
  2. +11 −1 python/plugins/processing/gui/ResultsDock.py
@@ -180,8 +180,6 @@ def initGui(self):
self.iface.addDockWidget(Qt.RightDockWidgetArea, self.resultsDock)
self.resultsDock.hide()

resultsList.resultAdded.connect(self.resultsDock.fillTree)

self.menu = QMenu(self.iface.mainWindow().menuBar())
self.menu.setObjectName('processing')
self.menu.setTitle(self.tr('Pro&cessing'))
@@ -32,6 +32,7 @@
from qgis.PyQt.QtCore import (QUrl,
QFileInfo,
QDir)
from qgis.gui import QgsDockWidget
from qgis.PyQt.QtGui import QDesktopServices
from qgis.PyQt.QtWidgets import QTreeWidgetItem

@@ -42,12 +43,14 @@
os.path.join(pluginPath, 'ui', 'resultsdockbase.ui'))


class ResultsDock(BASE, WIDGET):
class ResultsDock(QgsDockWidget, WIDGET):

def __init__(self):
super(ResultsDock, self).__init__(None)
self.setupUi(self)

resultsList.resultAdded.connect(self.addResult)

self.treeResults.currentItemChanged.connect(self.updateDescription)
self.treeResults.itemDoubleClicked.connect(self.openResult)

@@ -56,6 +59,13 @@ def __init__(self):

self.fillTree()

def addResult(self):
self.fillTree()

# Automatically open the panel for users to see output
self.setUserVisible(True)
self.treeResults.setCurrentItem(self.treeResults.topLevelItem(0))

def fillTree(self):
self.treeResults.blockSignals(True)
self.treeResults.clear()

0 comments on commit 4ada498

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