Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Dedicated method allowing to add plugins to the Mesh menu
  • Loading branch information
DelazJ committed Jan 20, 2022
1 parent 53529ef commit 0ef51fe
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 0 deletions.
10 changes: 10 additions & 0 deletions python/gui/auto_generated/qgisinterface.sip.in
Expand Up @@ -1111,6 +1111,16 @@ Add action to the Web menu
virtual void removePluginWebMenu( const QString &name, QAction *action ) = 0;
%Docstring
Remove action from the Web menu
%End

virtual void addPluginToMeshMenu( const QString &name, QAction *action ) = 0;
%Docstring
Add action to the Mesh menu
%End

virtual void removePluginMeshMenu( const QString &name, QAction *action ) = 0;
%Docstring
Remove action from the Mesh menu
%End

virtual void addDockWidget( Qt::DockWidgetArea area, QDockWidget *dockwidget ) = 0;
Expand Down
7 changes: 7 additions & 0 deletions src/app/qgisapp.h
Expand Up @@ -678,6 +678,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
QMenu *databaseMenu() { return mDatabaseMenu; }
QMenu *rasterMenu() { return mRasterMenu; }
QMenu *vectorMenu() { return mVectorMenu; }
QMenu *meshMenu() { return mMeshMenu; }
QMenu *webMenu() { return mWebMenu; }
#ifdef Q_OS_MAC
QMenu *firstRightStandardMenu() { return mWindowMenu; }
Expand Down Expand Up @@ -1482,6 +1483,12 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
void addPluginToWebMenu( const QString &name, QAction *action );
//! Remove the action to the submenu with the given name under the Web menu
void removePluginWebMenu( const QString &name, QAction *action );
//! Find the QMenu with the given name within the Mesh menu (ie the user visible text on the menu item)
QMenu *getMeshMenu( const QString &menuName );
//! Add the action to the submenu with the given name under the Mesh menu
void addPluginToMeshMenu( const QString &name, QAction *action );
//! Remove the action to the submenu with the given name under the Mesh menu
void removePluginMeshMenu( const QString &name, QAction *action );
//! Add "add layer" action to layer menu
void insertAddLayerAction( QAction *action );
//! Remove "add layer" action to layer menu
Expand Down
10 changes: 10 additions & 0 deletions src/app/qgisappinterface.cpp
Expand Up @@ -269,6 +269,16 @@ void QgisAppInterface::removePluginWebMenu( const QString &name, QAction *action
qgis->removePluginWebMenu( name, action );
}

void QgisAppInterface::addPluginToMeshMenu( const QString &name, QAction *action )
{
qgis->addPluginToMeshMenu( name, action );
}

void QgisAppInterface::removePluginMeshMenu( const QString &name, QAction *action )
{
qgis->removePluginMeshMenu( name, action );
}

int QgisAppInterface::addToolBarIcon( QAction *qAction )
{
return qgis->addPluginToolBarIcon( qAction );
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgisappinterface.h
Expand Up @@ -131,6 +131,8 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
void removePluginVectorMenu( const QString &name, QAction *action ) override;
void addPluginToWebMenu( const QString &name, QAction *action ) override;
void removePluginWebMenu( const QString &name, QAction *action ) override;
void addPluginToMeshMenu( const QString &name, QAction *action ) override;
void removePluginMeshMenu( const QString &name, QAction *action ) override;
void insertAddLayerAction( QAction *action ) override;
void removeAddLayerAction( QAction *action ) override;
void addDockWidget( Qt::DockWidgetArea area, QDockWidget *dockwidget ) override;
Expand Down
6 changes: 6 additions & 0 deletions src/gui/qgisinterface.h
Expand Up @@ -947,6 +947,12 @@ class GUI_EXPORT QgisInterface : public QObject
//! Remove action from the Web menu
virtual void removePluginWebMenu( const QString &name, QAction *action ) = 0;

//! Add action to the Mesh menu
virtual void addPluginToMeshMenu( const QString &name, QAction *action ) = 0;

//! Remove action from the Mesh menu
virtual void removePluginMeshMenu( const QString &name, QAction *action ) = 0;

/**
* Adds a \a dock widget to the main window, in the specified dock \a area.
*
Expand Down

0 comments on commit 0ef51fe

Please sign in to comment.