Skip to content

Commit fc6968e

Browse files
committed
move some plugins under Vector menu and toolbar
1 parent 2e5aa32 commit fc6968e

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

src/plugins/delimited_text/qgsdelimitedtextplugin.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
#include "qgsmaplayer.h"
2828
#include "qgsdelimitedtextplugin.h"
2929

30-
3130
#include <QMenu>
3231
#include <QAction>
3332
#include <QFile>
33+
#include <QToolBar>
3434

3535
//the gui subclass
3636
#include "qgsdelimitedtextplugingui.h"
@@ -104,7 +104,7 @@ void QgsDelimitedTextPlugin::initGui()
104104
// Connect the action to the run
105105
connect( myQActionPointer, SIGNAL( triggered() ), this, SLOT( run() ) );
106106
// Add the icon to the toolbar
107-
qGisInterface->addToolBarIcon( myQActionPointer );
107+
qGisInterface->layerToolBar()->addAction( myQActionPointer );
108108
qGisInterface->insertAddLayerAction( myQActionPointer );
109109
// this is called when the icon theme is changed
110110
connect( qGisInterface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );
@@ -139,8 +139,8 @@ void QgsDelimitedTextPlugin::drawVectorLayer( QString thePathNameQString,
139139
void QgsDelimitedTextPlugin::unload()
140140
{
141141
// remove the GUI
142+
qGisInterface->layerToolBar()->removeAction( myQActionPointer );
142143
qGisInterface->removeAddLayerAction( myQActionPointer );
143-
qGisInterface->removeToolBarIcon( myQActionPointer );
144144
delete myQActionPointer;
145145
}
146146

src/plugins/dxf2shp_converter/dxf2shpconverter.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ void dxf2shpConverter::initGui()
7878
connect( mQActionPointer, SIGNAL( triggered() ), this, SLOT( run() ) );
7979

8080
// Add the icon to the toolbar
81-
mQGisIface->addToolBarIcon( mQActionPointer );
82-
mQGisIface->addPluginToMenu( tr( "&Dxf2Shp" ), mQActionPointer );
81+
mQGisIface->addVectorToolBarIcon( mQActionPointer );
82+
mQGisIface->addPluginToVectorMenu( tr( "&Dxf2Shp" ), mQActionPointer );
8383

8484
// this is called when the icon theme is changed
8585
connect( mQGisIface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );
@@ -111,8 +111,8 @@ void dxf2shpConverter::run()
111111
void dxf2shpConverter::unload()
112112
{
113113
// remove the GUI
114-
mQGisIface->removePluginMenu( tr( "&Dxf2Shp" ), mQActionPointer );
115-
mQGisIface->removeToolBarIcon( mQActionPointer );
114+
mQGisIface->removePluginVectorMenu( tr( "&Dxf2Shp" ), mQActionPointer );
115+
mQGisIface->removeVectorToolBarIcon( mQActionPointer );
116116
delete mQActionPointer;
117117
}
118118

src/plugins/gps_importer/qgsgpsplugin.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,10 @@ void QgsGPSPlugin::initGui()
9494
connect( mQActionPointer, SIGNAL( triggered() ), this, SLOT( run() ) );
9595
connect( mCreateGPXAction, SIGNAL( triggered() ), this, SLOT( createGPX() ) );
9696

97-
mQGisInterface->layerToolBar()->addAction( mQActionPointer );
98-
mQGisInterface->addPluginToMenu( tr( "&Gps" ), mQActionPointer );
99-
mQGisInterface->addPluginToMenu( tr( "&Gps" ), mCreateGPXAction );
97+
mQGisInterface->layerToolBar()->addAction( mCreateGPXAction );
98+
mQGisInterface->insertAddLayerAction( mCreateGPXAction );
99+
mQGisInterface->addPluginToVectorMenu( tr( "&Gps" ), mQActionPointer );
100+
mQGisInterface->addVectorToolBarIcon( mQActionPointer );
100101

101102
// this is called when the icon theme is changed
102103
connect( mQGisInterface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );
@@ -202,9 +203,10 @@ void QgsGPSPlugin::drawVectorLayer( QString thePathNameQString,
202203
void QgsGPSPlugin::unload()
203204
{
204205
// remove the GUI
205-
mQGisInterface->removePluginMenu( tr( "&Gps" ), mQActionPointer );
206-
mQGisInterface->removePluginMenu( tr( "&Gps" ), mCreateGPXAction );
207-
mQGisInterface->removeToolBarIcon( mQActionPointer );
206+
mQGisInterface->layerToolBar()->removeAction( mCreateGPXAction );
207+
mQGisInterface->removeAddLayerAction( mCreateGPXAction );
208+
mQGisInterface->removePluginVectorMenu( tr( "&Gps" ), mQActionPointer );
209+
mQGisInterface->removeVectorToolBarIcon( mQActionPointer );
208210
delete mQActionPointer;
209211
}
210212

src/plugins/spatialquery/qgsspatialqueryplugin.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,17 @@ void QgsSpatialQueryPlugin::initGui()
8585
connect( mIface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );
8686

8787
// Add the icon to the toolbar and to the plugin menu
88-
mIface->addToolBarIcon( mSpatialQueryAction );
89-
mIface->addPluginToMenu( tr( "&Spatial Query" ), mSpatialQueryAction );
88+
mIface->addVectorToolBarIcon( mSpatialQueryAction );
89+
mIface->addPluginToVectorMenu( tr( "&Spatial Query" ), mSpatialQueryAction );
9090

9191
}
9292

9393
//Unload the plugin by cleaning up the GUI
9494
void QgsSpatialQueryPlugin::unload()
9595
{
9696
// remove the GUI
97-
mIface->removeToolBarIcon( mSpatialQueryAction );
98-
mIface->removePluginMenu( tr( "&Spatial Query" ), mSpatialQueryAction );
97+
mIface->removeVectorToolBarIcon( mSpatialQueryAction );
98+
mIface->removePluginVectorMenu( tr( "&Spatial Query" ), mSpatialQueryAction );
9999

100100
delete mSpatialQueryAction;
101101

0 commit comments

Comments
 (0)