Skip to content
Permalink
Browse files

created the Raster menu and moved the "raster calculator" to it

git-svn-id: http://svn.osgeo.org/qgis/trunk@14675 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
brushtyler
brushtyler committed Nov 15, 2010
1 parent 3b8e430 commit 5fe962a149b9a965dc6edf27093757897d12a3a4
Showing with 32 additions and 6 deletions.
  1. +22 −3 python/plugins/GdalTools/GdalTools.py
  2. +7 −3 src/app/qgisapp.cpp
  3. +3 −0 src/app/qgisapp.h
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : GdalTools
Name : GdalTools
Description : Integrate gdal tools into qgis
Date : 17/Sep/09
copyright : (C) 2009 by Lorenzo Masini (Faunalia)
@@ -81,8 +81,27 @@ def initGui( self ):
from tools.GdalTools_utils import Version, GdalConfig
self.GdalVersion = Version( GdalConfig.version() )

self.menu = QMenu()
self.menu.setTitle( QCoreApplication.translate( "GdalTools", "&Raster" ) )
# find the Raster menu
rasterMenu = None
menu_bar = self.iface.mainWindow().menuBar()
actions = menu_bar.actions()

rasterText = QCoreApplication.translate( "QgisApp", "&Raster" )

for a in actions:
if a.menu().title() == rasterText:
rasterMenu = a.menu()
break

if rasterMenu == None:
# no Raster menu, create and insert it before the Help menu
self.menu = QMenu()
self.menu.setTitle( QCoreApplication.translate( "GdalTools", "&Raster" ) )
lastAction = actions[ len( actions ) - 1 ]
menu_bar.insertMenu( lastAction, self.menu )
else:
self.menu = rasterMenu
self.menu.addSeparator()

if self.GdalVersion >= "1.6":
self.buildVRT = QAction( QIcon(":/icons/vrt.png"), QCoreApplication.translate( "GdalTools", "Build Virtual Raster (catalog)" ), self.iface.mainWindow() )
@@ -1528,9 +1528,6 @@ void QgisApp::createMenus()
mLayerMenu->addAction( mActionNewVectorLayer );
#endif

//todo: should probably go into a raster menu
mLayerMenu->addAction( mActionShowRasterCalculator );

mLayerMenu->addAction( mActionAddOgrLayer );
mLayerMenu->addAction( mActionAddRasterLayer );
#ifdef HAVE_POSTGRESQL
@@ -1609,6 +1606,13 @@ void QgisApp::createMenus()
// don't add it yet, wait for a plugin
mDatabaseMenu = new QMenu( tr( "&Database" ) );


// Raster Menu

mRasterMenu = menuBar()->addMenu( tr( "&Raster" ) );

mRasterMenu->addAction( mActionShowRasterCalculator );


// Help Menu

@@ -333,6 +333,7 @@ class QgisApp : public QMainWindow
QMenu *settingsMenu() { return mSettingsMenu; }
QMenu *pluginMenu() { return mPluginMenu; }
QMenu *databaseMenu() { return mDatabaseMenu; }
QMenu *rasterMenu() { return mRasterMenu; }
#ifdef Q_WS_MAC
QMenu *firstRightStandardMenu() { return mWindowMenu; }
QMenu *windowMenu() { return mWindowMenu; }
@@ -1100,6 +1101,8 @@ class QgisApp : public QMainWindow
QMenu *mPluginMenu;
//! Top level database menu
QMenu *mDatabaseMenu;
//! Top level raster menu
QMenu *mRasterMenu;
//! Popup menu for the map overview tools
QMenu *toolPopupOverviews;
//! Popup menu for the display tools

0 comments on commit 5fe962a

Please sign in to comment.
You can’t perform that action at this time.