Skip to content
Permalink
Browse files
Make "Layer - New" accesible from QgsInterface, update GPS importer
plugin (fix #7202)
  • Loading branch information
alexbruy committed Feb 21, 2013
1 parent 64c9a4d commit 6f378682b05536076a01af8476c91dfbbcc3d405
Showing with 30 additions and 18 deletions.
  1. +3 −0 python/gui/qgisinterface.sip
  2. +2 −0 src/app/qgisapp.h
  3. +1 −0 src/app/qgisappinterface.cpp
  4. +2 −0 src/app/qgisappinterface.h
  5. +3 −0 src/gui/qgisinterface.h
  6. +3 −2 src/plugins/gps_importer/qgsgpsplugin.cpp
  7. +16 −16 src/ui/qgisapp.ui
@@ -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;
@@ -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; }
@@ -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(); }
@@ -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();
@@ -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;
@@ -33,6 +33,7 @@
#include <QMessageBox>
#include <QAction>
#include <QFile>
#include <QMenu>
#include <QToolBar>
#include <QProcess>
#include <QProgressDialog>
@@ -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 );

@@ -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;
@@ -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">
@@ -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"/>
@@ -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>

0 comments on commit 6f37868

Please sign in to comment.