Skip to content
Permalink
Browse files

Merge pull request #1578 from alexbruy/layer-submenu

move all "Add Layer" actions to submenu
  • Loading branch information
jef-n committed Sep 9, 2014
2 parents b9fc2b5 + e037697 commit 47613da521c8f622ecf939dbf4a8091ee20b5b9e
@@ -337,6 +337,9 @@ class QgisInterface : QObject
/** \note added in 2.0
*/
virtual QMenu *newLayerMenu() = 0;
/** \note added in 2.5
*/
virtual QMenu *addLayerMenu() = 0;
virtual QMenu *settingsMenu() = 0;
virtual QMenu *pluginMenu() = 0;
virtual QMenu *rasterMenu() = 0;
@@ -8145,12 +8145,12 @@ QMenu* QgisApp::getWebMenu( QString menuName )

void QgisApp::insertAddLayerAction( QAction *action )
{
mLayerMenu->insertAction( mActionAddLayerSeparator, action );
mAddLayerMenu->insertAction( mActionAddLayerSeparator, action );
}

void QgisApp::removeAddLayerAction( QAction *action )
{
mLayerMenu->removeAction( action );
mAddLayerMenu->removeAction( action );
}

void QgisApp::addPluginToDatabaseMenu( QString name, QAction* action )
@@ -394,6 +394,8 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
QMenu *layerMenu() { return mLayerMenu; }
//! @note added in 2.0
QMenu *newLayerMenu() { return mNewLayerMenu; }
//! @note added in 2.5
QMenu *addLayerMenu() { return mAddLayerMenu; }
QMenu *settingsMenu() { return mSettingsMenu; }
QMenu *pluginMenu() { return mPluginMenu; }
QMenu *databaseMenu() { return mDatabaseMenu; }
@@ -449,6 +449,7 @@ QMenu *QgisAppInterface::editMenu() { return qgis->editMenu(); }
QMenu *QgisAppInterface::viewMenu() { return qgis->viewMenu(); }
QMenu *QgisAppInterface::layerMenu() { return qgis->layerMenu(); }
QMenu *QgisAppInterface::newLayerMenu() { return qgis->newLayerMenu(); }
QMenu *QgisAppInterface::addLayerMenu() { return qgis->addLayerMenu(); }
QMenu *QgisAppInterface::settingsMenu() { return qgis->settingsMenu(); }
QMenu *QgisAppInterface::pluginMenu() { return qgis->pluginMenu(); }
QMenu *QgisAppInterface::rasterMenu() { return qgis->rasterMenu(); }
@@ -298,6 +298,8 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
virtual QMenu *layerMenu();
//! @note added in 2.0
virtual QMenu *newLayerMenu();
//! @note added in 2.5
virtual QMenu *addLayerMenu();
virtual QMenu *settingsMenu();
virtual QMenu *pluginMenu();
virtual QMenu *rasterMenu();
@@ -389,6 +389,9 @@ class GUI_EXPORT QgisInterface : public QObject
/** \note added in 2.0
*/
virtual QMenu *newLayerMenu() = 0;
/** \note added in 2.5
*/
virtual QMenu *addLayerMenu() = 0;
virtual QMenu *settingsMenu() = 0;
virtual QMenu *pluginMenu() = 0;
virtual QMenu *rasterMenu() = 0;
@@ -64,7 +64,7 @@ void QgsOraclePlugin::initGui()
// Add the icon to the new layers toolbar
mQGisIface->layerToolBar()->insertAction( mQGisIface->actionAddWmsLayer(), mQActionPointer );
// Also add to Layer menu
mQGisIface->layerMenu()->insertAction( mQGisIface->actionAddWmsLayer(), mQActionPointer );
mQGisIface->insertAddLayerAction( mQActionPointer );
}
//method defined in interface

@@ -17,7 +17,7 @@
<x>0</x>
<y>0</y>
<width>1050</width>
<height>25</height>
<height>24</height>
</rect>
</property>
<widget class="QMenu" name="mProjectMenu">
@@ -132,20 +132,26 @@
<addaction name="mActionNewVectorLayer"/>
<addaction name="mActionNewSpatiaLiteLayer"/>
</widget>
<widget class="QMenu" name="mAddLayerMenu">
<property name="title">
<string>Add</string>
</property>
<addaction name="mActionAddOgrLayer"/>
<addaction name="mActionAddRasterLayer"/>
<addaction name="mActionAddPgLayer"/>
<addaction name="mActionAddSpatiaLiteLayer"/>
<addaction name="mActionAddMssqlLayer"/>
<addaction name="mActionAddOracleLayer"/>
<addaction name="mActionAddWmsLayer"/>
<addaction name="mActionAddLayerSeparator"/>
<addaction name="mActionAddWcsLayer"/>
<addaction name="mActionAddWfsLayer"/>
<addaction name="mActionAddDelimitedText"/>
</widget>
<addaction name="mNewLayerMenu"/>
<addaction name="mAddLayerMenu"/>
<addaction name="mActionEmbedLayers"/>
<addaction name="mActionAddLayerDefinition"/>
<addaction name="mActionAddOgrLayer"/>
<addaction name="mActionAddRasterLayer"/>
<addaction name="mActionAddPgLayer"/>
<addaction name="mActionAddSpatiaLiteLayer"/>
<addaction name="mActionAddMssqlLayer"/>
<addaction name="mActionAddOracleLayer"/>
<addaction name="mActionAddWmsLayer"/>
<addaction name="mActionAddLayerSeparator"/>
<addaction name="mActionAddWcsLayer"/>
<addaction name="mActionAddWfsLayer"/>
<addaction name="mActionAddDelimitedText"/>
<addaction name="separator"/>
<addaction name="mActionCopyStyle"/>
<addaction name="mActionPasteStyle"/>

0 comments on commit 47613da

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