Skip to content

Commit

Permalink
Add a help button to the Processing History dialog
Browse files Browse the repository at this point in the history
connected to the docs
  • Loading branch information
DelazJ authored and nyalldawson committed Jun 6, 2019
1 parent 26e8e22 commit a749cd9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion python/plugins/processing/gui/HistoryDialog.py
Expand Up @@ -25,7 +25,7 @@
import warnings

from qgis.core import QgsApplication
from qgis.gui import QgsGui
from qgis.gui import QgsGui, QgsHelp
from qgis.PyQt import uic
from qgis.PyQt.QtCore import Qt, QCoreApplication
from qgis.PyQt.QtWidgets import QAction, QPushButton, QDialogButtonBox, QStyle, QMessageBox, QFileDialog, QMenu, QTreeWidgetItem
Expand Down Expand Up @@ -57,6 +57,10 @@ def __init__(self):
self.clearButton.setToolTip(self.tr('Clear history'))
self.buttonBox.addButton(self.clearButton, QDialogButtonBox.ActionRole)

self.helpButton = QPushButton(self.tr('Help'))
self.helpButton.setToolTip(self.tr('Show help'))
self.buttonBox.addButton(self.helpButton, QDialogButtonBox.HelpRole)

self.saveButton = QPushButton(QCoreApplication.translate('HistoryDialog', 'Save As…'))
self.saveButton.setToolTip(self.tr('Save history'))
self.buttonBox.addButton(self.saveButton, QDialogButtonBox.ActionRole)
Expand All @@ -65,6 +69,7 @@ def __init__(self):
self.tree.currentItemChanged.connect(self.changeText)
self.clearButton.clicked.connect(self.clearLog)
self.saveButton.clicked.connect(self.saveLog)
self.helpButton.clicked.connect(self.openHelp)

self.tree.setContextMenuPolicy(Qt.CustomContextMenu)
self.tree.customContextMenuRequested.connect(self.showPopupMenu)
Expand Down Expand Up @@ -94,6 +99,9 @@ def saveLog(self):

ProcessingLog.saveLog(fileName)

def openHelp(self):
QgsHelp.openHelp("processing/history.html")

def fillTree(self):
self.tree.clear()
entries = ProcessingLog.getLogEntries()
Expand Down

0 comments on commit a749cd9

Please sign in to comment.