Navigation Menu

Skip to content

Commit

Permalink
Make "Layer - New" accesible from QgsInterface, update GPS importer
Browse files Browse the repository at this point in the history
plugin (fix #7202)
  • Loading branch information
alexbruy committed Feb 21, 2013
1 parent 64c9a4d commit 6f37868
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 18 deletions.
3 changes: 3 additions & 0 deletions python/gui/qgisinterface.sip
Expand Up @@ -254,6 +254,9 @@ class QgisInterface : QObject
virtual QMenu *editMenu() = 0;
virtual QMenu *viewMenu() = 0;
virtual QMenu *layerMenu() = 0;
/** \note added in 2.0
*/
virtual QMenu *newLayerMenu() = 0;
virtual QMenu *settingsMenu() = 0;
virtual QMenu *pluginMenu() = 0;
virtual QMenu *rasterMenu() = 0;
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgisapp.h
Expand Up @@ -351,6 +351,8 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
QMenu *editMenu() { return mEditMenu; }
QMenu *viewMenu() { return mViewMenu; }
QMenu *layerMenu() { return mLayerMenu; }
//! @note added in 2.0
QMenu *newLayerMenu() { return mNewLayerMenu; }
QMenu *settingsMenu() { return mSettingsMenu; }
QMenu *pluginMenu() { return mPluginMenu; }
QMenu *databaseMenu() { return mDatabaseMenu; }
Expand Down
1 change: 1 addition & 0 deletions src/app/qgisappinterface.cpp
Expand Up @@ -362,6 +362,7 @@ QMenu *QgisAppInterface::fileMenu() { return qgis->fileMenu(); }
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::settingsMenu() { return qgis->settingsMenu(); }
QMenu *QgisAppInterface::pluginMenu() { return qgis->pluginMenu(); }
QMenu *QgisAppInterface::rasterMenu() { return qgis->rasterMenu(); }
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgisappinterface.h
Expand Up @@ -218,6 +218,8 @@ class QgisAppInterface : public QgisInterface
virtual QMenu *editMenu();
virtual QMenu *viewMenu();
virtual QMenu *layerMenu();
//! @note added in 2.0
virtual QMenu *newLayerMenu();
virtual QMenu *settingsMenu();
virtual QMenu *pluginMenu();
virtual QMenu *rasterMenu();
Expand Down
3 changes: 3 additions & 0 deletions src/gui/qgisinterface.h
Expand Up @@ -303,6 +303,9 @@ class GUI_EXPORT QgisInterface : public QObject
virtual QMenu *editMenu() = 0;
virtual QMenu *viewMenu() = 0;
virtual QMenu *layerMenu() = 0;
/** \note added in 2.0
*/
virtual QMenu *newLayerMenu() = 0;
virtual QMenu *settingsMenu() = 0;
virtual QMenu *pluginMenu() = 0;
virtual QMenu *rasterMenu() = 0;
Expand Down
5 changes: 3 additions & 2 deletions src/plugins/gps_importer/qgsgpsplugin.cpp
Expand Up @@ -33,6 +33,7 @@
#include <QMessageBox>
#include <QAction>
#include <QFile>
#include <QMenu>
#include <QToolBar>
#include <QProcess>
#include <QProgressDialog>
Expand Down Expand Up @@ -95,7 +96,7 @@ void QgsGPSPlugin::initGui()
connect( mCreateGPXAction, SIGNAL( triggered() ), this, SLOT( createGPX() ) );

mQGisInterface->layerToolBar()->addAction( mCreateGPXAction );
mQGisInterface->insertAddLayerAction( mCreateGPXAction );
mQGisInterface->newLayerMenu()->addAction( mCreateGPXAction );
mQGisInterface->addPluginToVectorMenu( tr( "&GPS" ), mQActionPointer );
mQGisInterface->addVectorToolBarIcon( mQActionPointer );

Expand Down Expand Up @@ -206,7 +207,7 @@ void QgsGPSPlugin::unload()
{
// remove the GUI
mQGisInterface->layerToolBar()->removeAction( mCreateGPXAction );
mQGisInterface->removeAddLayerAction( mCreateGPXAction );
mQGisInterface->newLayerMenu()->removeAction( mCreateGPXAction );
mQGisInterface->removePluginVectorMenu( tr( "&GPS" ), mQActionPointer );
mQGisInterface->removeVectorToolBarIcon( mQActionPointer );
delete mQActionPointer;
Expand Down
32 changes: 16 additions & 16 deletions src/ui/qgisapp.ui
Expand Up @@ -17,7 +17,7 @@
<x>0</x>
<y>0</y>
<width>1052</width>
<height>25</height>
<height>24</height>
</rect>
</property>
<widget class="QMenu" name="mEditMenu">
Expand Down Expand Up @@ -140,14 +140,14 @@
<property name="title">
<string>&amp;Layer</string>
</property>
<widget class="QMenu" name="menuNew">
<widget class="QMenu" name="mNewLayerMenu">
<property name="title">
<string>New</string>
</property>
<addaction name="mActionNewVectorLayer"/>
<addaction name="mActionNewSpatialiteLayer"/>
</widget>
<addaction name="menuNew"/>
<addaction name="mNewLayerMenu"/>
<addaction name="mActionEmbedLayers"/>
<addaction name="mActionAddOgrLayer"/>
<addaction name="mActionAddRasterLayer"/>
Expand Down Expand Up @@ -1970,19 +1970,19 @@ Acts on currently active editable layer</string>
</property>
</action>
<action name="mActionRotateFeature">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionRotateFeature.png</normaloff>:/images/themes/default/mActionRotateFeature.png</iconset>
</property>
<property name="text">
<string>Rotate Feature(s)</string>
</property>
<property name="toolTip">
<string>Rotate Feature(s)</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionRotateFeature.png</normaloff>:/images/themes/default/mActionRotateFeature.png</iconset>
</property>
<property name="text">
<string>Rotate Feature(s)</string>
</property>
<property name="toolTip">
<string>Rotate Feature(s)</string>
</property>
</action>
</widget>
<resources>
Expand Down

0 comments on commit 6f37868

Please sign in to comment.