Skip to content

Commit

Permalink
move all raster related plugins to the Raster menu (adresses #4395)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Dec 20, 2011
1 parent 02555ad commit 0f41da3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
12 changes: 6 additions & 6 deletions src/plugins/georeferencer/qgsgeorefplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ void QgsGeorefPlugin::initGui()
connect( mQGisIface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );

// Add to the toolbar & menu
mQGisIface->addToolBarIcon( mActionRunGeoref );
mQGisIface->addPluginToMenu( tr( "&Georeferencer" ), mActionRunGeoref );
mQGisIface->addPluginToMenu( tr( "&Georeferencer" ), mActionAbout );
mQGisIface->addRasterToolBarIcon( mActionRunGeoref );
mQGisIface->addPluginToRasterMenu( tr( "&Georeferencer" ), mActionRunGeoref );
mQGisIface->addPluginToRasterMenu( tr( "&Georeferencer" ), mActionAbout );
}

// Slot called when the buffer menu item is triggered
Expand All @@ -126,9 +126,9 @@ void QgsGeorefPlugin::run()
void QgsGeorefPlugin::unload()
{
// remove the GUI
mQGisIface->removePluginMenu( tr( "&Georeferencer" ), mActionAbout );
mQGisIface->removePluginMenu( tr( "&Georeferencer" ), mActionRunGeoref );
mQGisIface->removeToolBarIcon( mActionRunGeoref );
mQGisIface->removePluginRasterMenu( tr( "&Georeferencer" ), mActionAbout );
mQGisIface->removePluginRasterMenu( tr( "&Georeferencer" ), mActionRunGeoref );
mQGisIface->removeRasterToolBarIcon( mActionRunGeoref );

delete mActionRunGeoref;
delete mActionAbout;
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/interpolation/qgsinterpolationplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ void QgsInterpolationPlugin::initGui()
mInterpolationAction = new QAction( QIcon(), tr( "&Interpolation" ), 0 );
setCurrentTheme( "" );
QObject::connect( mInterpolationAction, SIGNAL( triggered() ), this, SLOT( showInterpolationDialog() ) );
mIface->addToolBarIcon( mInterpolationAction );
mIface->addPluginToMenu( tr( "&Interpolation" ), mInterpolationAction );
mIface->addRasterToolBarIcon( mInterpolationAction );
mIface->addPluginToRasterMenu( tr( "&Interpolation" ), mInterpolationAction );
// this is called when the icon theme is changed
connect( mIface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );
}
}

void QgsInterpolationPlugin::unload()
{
mIface->removePluginMenu( tr( "&Interpolation" ), mInterpolationAction );
mIface->removeToolBarIcon( mInterpolationAction );
mIface->removePluginRasterMenu( tr( "&Interpolation" ), mInterpolationAction );
mIface->removeRasterToolBarIcon( mInterpolationAction );
delete mInterpolationAction;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ void QgsRasterTerrainAnalysisPlugin::initGui()
//create Action
if ( mIface )
{
mAction = new QAction( QIcon( ":/raster/raster_terrain_icon.png" ), tr( "&Raster based terrain analysis..." ), 0 );
mAction = new QAction( QIcon( ":/raster/raster_terrain_icon.png" ), tr( "&Raster based terrain analysis" ), 0 );
QObject::connect( mAction, SIGNAL( triggered() ), this, SLOT( run() ) );
mIface->addToolBarIcon( mAction );
mIface->addPluginToMenu( tr( "&Raster based terrain analysis..." ), mAction );
mIface->addRasterToolBarIcon( mAction );
mIface->addPluginToRasterMenu( tr( "&Raster based terrain analysis" ), mAction );
}
}

void QgsRasterTerrainAnalysisPlugin::unload()
{
if ( mIface )
{
mIface->removePluginMenu( tr( "&Raster based terrain analysis..." ), mAction );
mIface ->removeToolBarIcon( mAction );
mIface->removePluginRasterMenu( tr( "&Raster based terrain analysis" ), mAction );
mIface ->removeRasterToolBarIcon( mAction );
delete mAction;
}
}
Expand Down
10 changes: 6 additions & 4 deletions src/plugins/zonal_statistics/qgszonalstatisticsplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,17 @@ QgsZonalStatisticsPlugin::~QgsZonalStatisticsPlugin()

void QgsZonalStatisticsPlugin::initGui()
{
mAction = new QAction( tr( "&Zonal statistics..." ), 0 );
mAction = new QAction( tr( "&Zonal statistics" ), 0 );
QObject::connect( mAction, SIGNAL( triggered() ), this, SLOT( run() ) );
mIface->addToolBarIcon( mAction );
mIface->addPluginToMenu( tr( "&Zonal statistics..." ), mAction );
mIface->addRasterToolBarIcon( mAction );
mIface->addPluginToRasterMenu( tr( "&Zonal statistics" ), mAction );
}

void QgsZonalStatisticsPlugin::unload()
{

mIface->removeRasterToolBarIcon( mAction );
mIface->removePluginRasterMenu( tr( "&Zonal statistics" ), mAction );
delete mAction;
}

void QgsZonalStatisticsPlugin::run()
Expand Down

0 comments on commit 0f41da3

Please sign in to comment.