Skip to content

Commit

Permalink
[processing] Add Toolbox action to the main window toolbar
Browse files Browse the repository at this point in the history
I realise this adds another toolbar button... but I'd strongly
argue that the toolbox is used FAR FAR more often than many of the
other toolbar actions!
  • Loading branch information
nyalldawson committed Jan 24, 2018
1 parent c41b2dd commit d60f00d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/gui/qgisinterface.sip.in
Expand Up @@ -342,6 +342,14 @@ Get access to the native Add ArcGIS MapServer action.
virtual QAction *actionPasteLayerStyle() = 0;
virtual QAction *actionOpenTable() = 0;
virtual QAction *actionOpenFieldCalculator() = 0;

virtual QAction *actionOpenStatisticalSummary() = 0;
%Docstring
Statistical summary action.

.. versionadded:: 3.0
%End

virtual QAction *actionToggleEditing() = 0;
virtual QAction *actionSaveActiveLayerEdits() = 0;
virtual QAction *actionAllEdits() = 0;
Expand Down
2 changes: 2 additions & 0 deletions python/plugins/processing/ProcessingPlugin.py
Expand Up @@ -196,6 +196,7 @@ def initGui(self):
QgsApplication.getThemeIcon("/processingAlgorithm.svg"))
self.iface.registerMainWindowAction(self.toolboxAction, 'Ctrl+Alt+T')
self.toolboxAction.toggled.connect(self.openToolbox)
self.iface.attributesToolBar().insertAction(self.iface.actionOpenStatisticalSummary(), self.toolboxAction)
self.menu.addAction(self.toolboxAction)

self.modelerAction = QAction(
Expand Down Expand Up @@ -249,6 +250,7 @@ def openProcessingOptions(self):
def unload(self):
self.toolbox.setVisible(False)
self.iface.removeDockWidget(self.toolbox)
self.iface.attributesToolBar().removeAction(self.toolboxAction)

self.resultsDock.setVisible(False)
self.iface.removeDockWidget(self.resultsDock)
Expand Down
1 change: 1 addition & 0 deletions src/app/qgisapp.h
Expand Up @@ -492,6 +492,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
QAction *actionPasteLayerStyle() { return mActionPasteStyle; }
QAction *actionOpenTable() { return mActionOpenTable; }
QAction *actionOpenFieldCalculator() { return mActionOpenFieldCalc; }
QAction *actionStatisticalSummary() { return mActionStatisticalSummary; }
QAction *actionToggleEditing() { return mActionToggleEditing; }
QAction *actionSaveActiveLayerEdits() { return mActionSaveLayerEdits; }
QAction *actionAllEdits() { return mActionAllEdits; }
Expand Down
1 change: 1 addition & 0 deletions src/app/qgisappinterface.cpp
Expand Up @@ -641,6 +641,7 @@ QAction *QgisAppInterface::actionCopyLayerStyle() { return qgis->actionCopyLayer
QAction *QgisAppInterface::actionPasteLayerStyle() { return qgis->actionPasteLayerStyle(); }
QAction *QgisAppInterface::actionOpenTable() { return qgis->actionOpenTable(); }
QAction *QgisAppInterface::actionOpenFieldCalculator() { return qgis->actionOpenFieldCalculator(); }
QAction *QgisAppInterface::actionOpenStatisticalSummary() { return qgis->actionStatisticalSummary(); }
QAction *QgisAppInterface::actionToggleEditing() { return qgis->actionToggleEditing(); }
QAction *QgisAppInterface::actionSaveActiveLayerEdits() { return qgis->actionSaveActiveLayerEdits(); }
QAction *QgisAppInterface::actionAllEdits() { return qgis->actionAllEdits(); }
Expand Down
1 change: 1 addition & 0 deletions src/app/qgisappinterface.h
Expand Up @@ -445,6 +445,7 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
QAction *actionPasteLayerStyle() override;
QAction *actionOpenTable() override;
QAction *actionOpenFieldCalculator() override;
QAction *actionOpenStatisticalSummary() override;
QAction *actionToggleEditing() override;
QAction *actionSaveActiveLayerEdits() override;
QAction *actionAllEdits() override;
Expand Down
7 changes: 7 additions & 0 deletions src/gui/qgisinterface.h
Expand Up @@ -314,6 +314,13 @@ class GUI_EXPORT QgisInterface : public QObject
virtual QAction *actionPasteLayerStyle() = 0;
virtual QAction *actionOpenTable() = 0;
virtual QAction *actionOpenFieldCalculator() = 0;

/**
* Statistical summary action.
* \since QGIS 3.0
*/
virtual QAction *actionOpenStatisticalSummary() = 0;

virtual QAction *actionToggleEditing() = 0;
virtual QAction *actionSaveActiveLayerEdits() = 0;
virtual QAction *actionAllEdits() = 0;
Expand Down

0 comments on commit d60f00d

Please sign in to comment.