Skip to content

Commit

Permalink
move some plugins under Vector menu and toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Dec 20, 2011
1 parent 2e5aa32 commit fc6968e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
6 changes: 3 additions & 3 deletions src/plugins/delimited_text/qgsdelimitedtextplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
#include "qgsmaplayer.h"
#include "qgsdelimitedtextplugin.h"


#include <QMenu>
#include <QAction>
#include <QFile>
#include <QToolBar>

//the gui subclass
#include "qgsdelimitedtextplugingui.h"
Expand Down Expand Up @@ -104,7 +104,7 @@ void QgsDelimitedTextPlugin::initGui()
// Connect the action to the run
connect( myQActionPointer, SIGNAL( triggered() ), this, SLOT( run() ) );
// Add the icon to the toolbar
qGisInterface->addToolBarIcon( myQActionPointer );
qGisInterface->layerToolBar()->addAction( myQActionPointer );
qGisInterface->insertAddLayerAction( myQActionPointer );
// this is called when the icon theme is changed
connect( qGisInterface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );
Expand Down Expand Up @@ -139,8 +139,8 @@ void QgsDelimitedTextPlugin::drawVectorLayer( QString thePathNameQString,
void QgsDelimitedTextPlugin::unload()
{
// remove the GUI
qGisInterface->layerToolBar()->removeAction( myQActionPointer );
qGisInterface->removeAddLayerAction( myQActionPointer );
qGisInterface->removeToolBarIcon( myQActionPointer );
delete myQActionPointer;
}

Expand Down
8 changes: 4 additions & 4 deletions src/plugins/dxf2shp_converter/dxf2shpconverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ void dxf2shpConverter::initGui()
connect( mQActionPointer, SIGNAL( triggered() ), this, SLOT( run() ) );

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

// this is called when the icon theme is changed
connect( mQGisIface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );
Expand Down Expand Up @@ -111,8 +111,8 @@ void dxf2shpConverter::run()
void dxf2shpConverter::unload()
{
// remove the GUI
mQGisIface->removePluginMenu( tr( "&Dxf2Shp" ), mQActionPointer );
mQGisIface->removeToolBarIcon( mQActionPointer );
mQGisIface->removePluginVectorMenu( tr( "&Dxf2Shp" ), mQActionPointer );
mQGisIface->removeVectorToolBarIcon( mQActionPointer );
delete mQActionPointer;
}

Expand Down
14 changes: 8 additions & 6 deletions src/plugins/gps_importer/qgsgpsplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ void QgsGPSPlugin::initGui()
connect( mQActionPointer, SIGNAL( triggered() ), this, SLOT( run() ) );
connect( mCreateGPXAction, SIGNAL( triggered() ), this, SLOT( createGPX() ) );

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

// this is called when the icon theme is changed
connect( mQGisInterface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );
Expand Down Expand Up @@ -202,9 +203,10 @@ void QgsGPSPlugin::drawVectorLayer( QString thePathNameQString,
void QgsGPSPlugin::unload()
{
// remove the GUI
mQGisInterface->removePluginMenu( tr( "&Gps" ), mQActionPointer );
mQGisInterface->removePluginMenu( tr( "&Gps" ), mCreateGPXAction );
mQGisInterface->removeToolBarIcon( mQActionPointer );
mQGisInterface->layerToolBar()->removeAction( mCreateGPXAction );
mQGisInterface->removeAddLayerAction( mCreateGPXAction );
mQGisInterface->removePluginVectorMenu( tr( "&Gps" ), mQActionPointer );
mQGisInterface->removeVectorToolBarIcon( mQActionPointer );
delete mQActionPointer;
}

Expand Down
8 changes: 4 additions & 4 deletions src/plugins/spatialquery/qgsspatialqueryplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,17 @@ void QgsSpatialQueryPlugin::initGui()
connect( mIface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );

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

}

//Unload the plugin by cleaning up the GUI
void QgsSpatialQueryPlugin::unload()
{
// remove the GUI
mIface->removeToolBarIcon( mSpatialQueryAction );
mIface->removePluginMenu( tr( "&Spatial Query" ), mSpatialQueryAction );
mIface->removeVectorToolBarIcon( mSpatialQueryAction );
mIface->removePluginVectorMenu( tr( "&Spatial Query" ), mSpatialQueryAction );

delete mSpatialQueryAction;

Expand Down

0 comments on commit fc6968e

Please sign in to comment.