mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
[FEATURE] layer menu function
- deprecated QgisInterface separator methods - add addAddLayer/removeAddLayer methods to QgisInterface to add entries to the layer menu - port plugins to use it git-svn-id: http://svn.osgeo.org/qgis/trunk@15461 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
e23bd22977
commit
ea34dde888
@ -95,17 +95,33 @@ class QgisInterface : QObject
|
||||
/** Remove action from the plugins menu */
|
||||
virtual void removePluginMenu(QString name, QAction* action)=0;
|
||||
|
||||
/** Add "add layer" action to the layer menu
|
||||
* @note added in 1.7
|
||||
*/
|
||||
virtual void addAddLayer( QAction* action )=0;
|
||||
|
||||
/** Remove "add layer" action from the layer menu
|
||||
* @note added in 1.7
|
||||
*/
|
||||
virtual void removeAddLayer( QAction* action )=0;
|
||||
|
||||
/** Add action to the Database menu
|
||||
@note added in version 1.7 */
|
||||
* @note added in 1.7
|
||||
*/
|
||||
virtual void addPluginToDatabaseMenu(QString name, QAction* action)=0;
|
||||
/** Remove action from the Database menu */
|
||||
|
||||
/** Remove action from the Database menu
|
||||
* @note added in 1.7
|
||||
*/
|
||||
virtual void removePluginDatabaseMenu(QString name, QAction* action)=0;
|
||||
|
||||
/** Add a dock widget to the main window
|
||||
@note added in version 1.7 */
|
||||
@note added in 1.7 */
|
||||
virtual void addDockWidget ( Qt::DockWidgetArea area, QDockWidget * dockwidget )=0;
|
||||
|
||||
/** Remove specified dock widget from main window (doesn't delete it). Added in QGIS 1.1. */
|
||||
/** Remove specified dock widget from main window (doesn't delete it).
|
||||
* @note added in 1.1
|
||||
*/
|
||||
virtual void removeDockWidget ( QDockWidget * dockwidget )=0;
|
||||
|
||||
/** refresh legend of a layer
|
||||
@ -168,38 +184,38 @@ class QgisInterface : QObject
|
||||
//! File menu actions
|
||||
virtual QAction *actionNewProject() = 0;
|
||||
virtual QAction *actionOpenProject() = 0;
|
||||
virtual QAction *actionFileSeparator1() = 0;
|
||||
virtual QAction *actionFileSeparator1() = 0 /Deprecated/;
|
||||
virtual QAction *actionSaveProject() = 0;
|
||||
virtual QAction *actionSaveProjectAs() = 0;
|
||||
virtual QAction *actionSaveMapAsImage() = 0;
|
||||
virtual QAction *actionFileSeparator2() = 0;
|
||||
virtual QAction *actionFileSeparator2() = 0 /Deprecated/;
|
||||
virtual QAction *actionProjectProperties() = 0;
|
||||
virtual QAction *actionFileSeparator3() = 0;
|
||||
virtual QAction *actionFileSeparator3() = 0 /Deprecated/;
|
||||
virtual QAction *actionPrintComposer() = 0;
|
||||
virtual QAction *actionFileSeparator4() = 0;
|
||||
virtual QAction *actionFileSeparator4() = 0 /Deprecated/;
|
||||
virtual QAction *actionExit() = 0;
|
||||
|
||||
//! Edit menu actions
|
||||
virtual QAction *actionCutFeatures() = 0;
|
||||
virtual QAction *actionCopyFeatures() = 0;
|
||||
virtual QAction *actionPasteFeatures() = 0;
|
||||
virtual QAction *actionEditSeparator1() = 0;
|
||||
virtual QAction *actionEditSeparator1() = 0 /Deprecated/;
|
||||
virtual QAction *actionCapturePoint() = 0;
|
||||
virtual QAction *actionCaptureLine() = 0;
|
||||
virtual QAction *actionCapturePolygon() = 0;
|
||||
virtual QAction *actionDeleteSelected() = 0;
|
||||
virtual QAction *actionMoveFeature() = 0;
|
||||
virtual QAction *actionSplitFeatures() = 0;
|
||||
virtual QAction *actionAddVertex() = 0;
|
||||
virtual QAction *actionDeleteVertex() = 0;
|
||||
virtual QAction *actionMoveVertex() = 0;
|
||||
virtual QAction *actionAddVertex() = 0 /Deprecated/;
|
||||
virtual QAction *actionDeleteVertex() = 0 /Deprecated/;
|
||||
virtual QAction *actionMoveVertex() = 0 /Deprecated/;
|
||||
virtual QAction *actionAddRing() = 0;
|
||||
virtual QAction *actionAddIsland() = 0;
|
||||
virtual QAction *actionSimplifyFeature() = 0;
|
||||
virtual QAction *actionDeleteRing() = 0;
|
||||
virtual QAction *actionDeletePart() = 0;
|
||||
virtual QAction *actionNodeTool() = 0;
|
||||
virtual QAction *actionEditSeparator2() = 0;
|
||||
virtual QAction *actionEditSeparator2() = 0 /Deprecated/;
|
||||
|
||||
//! View menu actions
|
||||
virtual QAction *actionPan() = 0;
|
||||
@ -213,18 +229,18 @@ class QgisInterface : QObject
|
||||
virtual QAction *actionIdentify() = 0;
|
||||
virtual QAction *actionMeasure() = 0;
|
||||
virtual QAction *actionMeasureArea() = 0;
|
||||
virtual QAction *actionViewSeparator1() = 0;
|
||||
virtual QAction *actionViewSeparator1() = 0 /Deprecated/;
|
||||
virtual QAction *actionZoomFullExtent() = 0;
|
||||
virtual QAction *actionZoomToLayer() = 0;
|
||||
virtual QAction *actionZoomToSelected() = 0;
|
||||
virtual QAction *actionZoomLast() = 0;
|
||||
virtual QAction *actionZoomActualSize() = 0;
|
||||
virtual QAction *actionViewSeparator2() = 0;
|
||||
virtual QAction *actionViewSeparator2() = 0 /Deprecated/;
|
||||
virtual QAction *actionMapTips() = 0;
|
||||
virtual QAction *actionNewBookmark() = 0;
|
||||
virtual QAction *actionShowBookmarks() = 0;
|
||||
virtual QAction *actionDraw() = 0;
|
||||
virtual QAction *actionViewSeparator3() = 0;
|
||||
virtual QAction *actionViewSeparator3() = 0 /Deprecated/;
|
||||
|
||||
//! Layer menu actions
|
||||
virtual QAction *actionNewVectorLayer() = 0;
|
||||
@ -232,41 +248,41 @@ class QgisInterface : QObject
|
||||
virtual QAction *actionAddRasterLayer() = 0;
|
||||
virtual QAction *actionAddPgLayer() = 0;
|
||||
virtual QAction *actionAddWmsLayer() = 0;
|
||||
virtual QAction *actionLayerSeparator1() = 0;
|
||||
virtual QAction *actionLayerSeparator1() = 0 /Deprecated/;
|
||||
virtual QAction *actionOpenTable() = 0;
|
||||
virtual QAction *actionToggleEditing() = 0;
|
||||
virtual QAction *actionLayerSaveAs() = 0;
|
||||
virtual QAction *actionLayerSelectionSaveAs() = 0;
|
||||
virtual QAction *actionRemoveLayer() = 0;
|
||||
virtual QAction *actionLayerProperties() = 0;
|
||||
virtual QAction *actionLayerSeparator2() = 0;
|
||||
virtual QAction *actionLayerSeparator2() = 0 /Deprecated/;
|
||||
virtual QAction *actionAddToOverview() = 0;
|
||||
virtual QAction *actionAddAllToOverview() = 0;
|
||||
virtual QAction *actionRemoveAllFromOverview() = 0;
|
||||
virtual QAction *actionLayerSeparator3() = 0;
|
||||
virtual QAction *actionLayerSeparator3() = 0 /Deprecated/;
|
||||
virtual QAction *actionHideAllLayers() = 0;
|
||||
virtual QAction *actionShowAllLayers() = 0;
|
||||
|
||||
//! Plugin menu actions
|
||||
virtual QAction *actionManagePlugins() = 0;
|
||||
virtual QAction *actionPluginSeparator1() = 0;
|
||||
virtual QAction *actionPluginSeparator1() = 0 /Deprecated/;
|
||||
virtual QAction *actionPluginListSeparator() = 0;
|
||||
virtual QAction *actionPluginSeparator2() = 0;
|
||||
virtual QAction *actionPluginPythonSeparator() = 0;
|
||||
virtual QAction *actionPluginSeparator2() = 0 /Deprecated/;
|
||||
virtual QAction *actionPluginPythonSeparator() = 0 /Deprecated/;
|
||||
virtual QAction *actionShowPythonDialog() = 0;
|
||||
|
||||
//! Settings menu actions
|
||||
virtual QAction *actionToggleFullScreen() = 0;
|
||||
virtual QAction *actionSettingsSeparator1() = 0;
|
||||
virtual QAction *actionSettingsSeparator1() = 0 /Deprecated/;
|
||||
virtual QAction *actionOptions() = 0;
|
||||
virtual QAction *actionCustomProjection() = 0;
|
||||
|
||||
//! Help menu actions
|
||||
virtual QAction *actionHelpContents() = 0;
|
||||
virtual QAction *actionHelpSeparator1() = 0;
|
||||
virtual QAction *actionHelpSeparator1() = 0 /Deprecated/;
|
||||
virtual QAction *actionQgisHomePage() = 0;
|
||||
virtual QAction *actionCheckQgisVersion() = 0;
|
||||
virtual QAction *actionHelpSeparator2() = 0;
|
||||
virtual QAction *actionHelpSeparator2() = 0 /Deprecated/;
|
||||
virtual QAction *actionAbout() = 0;
|
||||
|
||||
//! open feature form
|
||||
@ -312,4 +328,3 @@ class QgisInterface : QObject
|
||||
*/
|
||||
void newProjectCreated();
|
||||
};
|
||||
|
||||
|
@ -4862,7 +4862,7 @@ void QgisApp::fullHistogramStretch()
|
||||
}
|
||||
if ( rlayer->providerKey() == "wms" )
|
||||
{
|
||||
return;
|
||||
return;
|
||||
}
|
||||
if ( rlayer->drawingStyle() == QgsRasterLayer::SingleBandGray ||
|
||||
rlayer->drawingStyle() == QgsRasterLayer::MultiBandSingleBandGray ||
|
||||
@ -5299,6 +5299,16 @@ QMenu* QgisApp::getDatabaseMenu( QString menuName )
|
||||
return menu;
|
||||
}
|
||||
|
||||
void QgisApp::addAddLayer( QAction *action )
|
||||
{
|
||||
mLayerMenu->insertAction( mActionAddLayerSeparator, action );
|
||||
}
|
||||
|
||||
void QgisApp::removeAddLayer( QAction *action )
|
||||
{
|
||||
mLayerMenu->removeAction( action );
|
||||
}
|
||||
|
||||
void QgisApp::addPluginToDatabaseMenu( QString name, QAction* action )
|
||||
{
|
||||
QMenu* menu = getDatabaseMenu( name );
|
||||
|
@ -493,7 +493,7 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
|
||||
void zoomToLayerExtent();
|
||||
//! zoom to actual size of raster layer
|
||||
void zoomActualSize();
|
||||
/** Perform a local histogram stretch on the active raster layer
|
||||
/** Perform a local histogram stretch on the active raster layer
|
||||
* (stretch based on pixel values in view extent).
|
||||
* Valid for non wms raster layers only.
|
||||
* @note Added in QGIS 1.7 */
|
||||
@ -519,6 +519,10 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
|
||||
void addPluginToDatabaseMenu( QString name, QAction* action );
|
||||
//! Remove the action to the submenu with the given name under the Database menu
|
||||
void removePluginDatabaseMenu( QString name, QAction* action );
|
||||
//! Add "add layer" action to layer menu
|
||||
void addAddLayer( QAction* action );
|
||||
//! Remove "add layer" action to layer menu
|
||||
void removeAddLayer( QAction* action );
|
||||
//! Add an icon to the plugin toolbar
|
||||
int addPluginToolBarIcon( QAction * qAction );
|
||||
//! Remove an icon from the plugin toolbar
|
||||
|
@ -140,6 +140,16 @@ void QgisAppInterface::addPluginToMenu( QString name, QAction* action )
|
||||
qgis->addPluginToMenu( name, action );
|
||||
}
|
||||
|
||||
void QgisAppInterface::addAddLayer( QAction *action )
|
||||
{
|
||||
qgis->addAddLayer( action );
|
||||
}
|
||||
|
||||
void QgisAppInterface::removeAddLayer( QAction *action )
|
||||
{
|
||||
qgis->removeAddLayer( action );
|
||||
}
|
||||
|
||||
void QgisAppInterface::removePluginMenu( QString name, QAction* action )
|
||||
{
|
||||
qgis->removePluginMenu( name, action );
|
||||
|
@ -117,6 +117,11 @@ class QgisAppInterface : public QgisInterface
|
||||
/** Remove action from the Database menu */
|
||||
void removePluginDatabaseMenu( QString name, QAction* action );
|
||||
|
||||
/** Add "add layer" action to the layer menu */
|
||||
void addAddLayer( QAction *action );
|
||||
/** remove "add layer" action from the layer menu */
|
||||
void removeAddLayer( QAction *action );
|
||||
|
||||
/** Add a dock widget to the main window */
|
||||
void addDockWidget( Qt::DockWidgetArea area, QDockWidget * dockwidget );
|
||||
|
||||
|
@ -136,18 +136,32 @@ class GUI_EXPORT QgisInterface : public QObject
|
||||
/** Remove action from the plugins menu */
|
||||
virtual void removePluginMenu( QString name, QAction* action ) = 0;
|
||||
|
||||
/** Add "add layer" action to layer menu
|
||||
* @note added in 1.7
|
||||
*/
|
||||
virtual void addAddLayer( QAction *action ) = 0;
|
||||
|
||||
/** Remove "add layer" action from layer menu
|
||||
* @note added in 1.7
|
||||
*/
|
||||
virtual void removeAddLayer( QAction *action ) = 0;
|
||||
|
||||
/** Add action to the Database menu
|
||||
* @note added in 1.7
|
||||
*/
|
||||
virtual void addPluginToDatabaseMenu( QString name, QAction* action ) = 0;
|
||||
|
||||
/** Remove action from the Database menu */
|
||||
/** Remove action from the Database menu
|
||||
* @note added in 1.7
|
||||
*/
|
||||
virtual void removePluginDatabaseMenu( QString name, QAction* action ) = 0;
|
||||
|
||||
/** Add a dock widget to the main window */
|
||||
virtual void addDockWidget( Qt::DockWidgetArea area, QDockWidget * dockwidget ) = 0;
|
||||
|
||||
/** Remove specified dock widget from main window (doesn't delete it). Added in QGIS 1.1. */
|
||||
/** Remove specified dock widget from main window (doesn't delete it).
|
||||
* @note Added in 1.1
|
||||
*/
|
||||
virtual void removeDockWidget( QDockWidget * dockwidget ) = 0;
|
||||
|
||||
/** refresh the legend of a layer
|
||||
@ -228,14 +242,26 @@ class GUI_EXPORT QgisInterface : public QObject
|
||||
//! File menu actions
|
||||
virtual QAction *actionNewProject() = 0;
|
||||
virtual QAction *actionOpenProject() = 0;
|
||||
#ifndef Q_MOC_RUN
|
||||
Q_DECL_DEPRECATED
|
||||
#endif
|
||||
virtual QAction *actionFileSeparator1() = 0;
|
||||
virtual QAction *actionSaveProject() = 0;
|
||||
virtual QAction *actionSaveProjectAs() = 0;
|
||||
virtual QAction *actionSaveMapAsImage() = 0;
|
||||
#ifndef Q_MOC_RUN
|
||||
Q_DECL_DEPRECATED
|
||||
#endif
|
||||
virtual QAction *actionFileSeparator2() = 0;
|
||||
virtual QAction *actionProjectProperties() = 0;
|
||||
#ifndef Q_MOC_RUN
|
||||
Q_DECL_DEPRECATED
|
||||
#endif
|
||||
virtual QAction *actionFileSeparator3() = 0;
|
||||
virtual QAction *actionPrintComposer() = 0;
|
||||
#ifndef Q_MOC_RUN
|
||||
Q_DECL_DEPRECATED
|
||||
#endif
|
||||
virtual QAction *actionFileSeparator4() = 0;
|
||||
virtual QAction *actionExit() = 0;
|
||||
|
||||
@ -243,6 +269,9 @@ class GUI_EXPORT QgisInterface : public QObject
|
||||
virtual QAction *actionCutFeatures() = 0;
|
||||
virtual QAction *actionCopyFeatures() = 0;
|
||||
virtual QAction *actionPasteFeatures() = 0;
|
||||
#ifndef Q_MOC_RUN
|
||||
Q_DECL_DEPRECATED
|
||||
#endif
|
||||
virtual QAction *actionEditSeparator1() = 0;
|
||||
virtual QAction *actionCapturePoint() = 0;
|
||||
virtual QAction *actionCaptureLine() = 0;
|
||||
@ -250,8 +279,17 @@ class GUI_EXPORT QgisInterface : public QObject
|
||||
virtual QAction *actionDeleteSelected() = 0;
|
||||
virtual QAction *actionMoveFeature() = 0;
|
||||
virtual QAction *actionSplitFeatures() = 0;
|
||||
#ifndef Q_MOC_RUN
|
||||
Q_DECL_DEPRECATED
|
||||
#endif
|
||||
virtual QAction *actionAddVertex() = 0;
|
||||
#ifndef Q_MOC_RUN
|
||||
Q_DECL_DEPRECATED
|
||||
#endif
|
||||
virtual QAction *actionDeleteVertex() = 0;
|
||||
#ifndef Q_MOC_RUN
|
||||
Q_DECL_DEPRECATED
|
||||
#endif
|
||||
virtual QAction *actionMoveVertex() = 0;
|
||||
virtual QAction *actionAddRing() = 0;
|
||||
virtual QAction *actionAddIsland() = 0;
|
||||
@ -259,6 +297,9 @@ class GUI_EXPORT QgisInterface : public QObject
|
||||
virtual QAction *actionDeleteRing() = 0;
|
||||
virtual QAction *actionDeletePart() = 0;
|
||||
virtual QAction *actionNodeTool() = 0;
|
||||
#ifndef Q_MOC_RUN
|
||||
Q_DECL_DEPRECATED
|
||||
#endif
|
||||
virtual QAction *actionEditSeparator2() = 0;
|
||||
|
||||
//! View menu actions
|
||||
@ -273,17 +314,26 @@ class GUI_EXPORT QgisInterface : public QObject
|
||||
virtual QAction *actionIdentify() = 0;
|
||||
virtual QAction *actionMeasure() = 0;
|
||||
virtual QAction *actionMeasureArea() = 0;
|
||||
#ifndef Q_MOC_RUN
|
||||
Q_DECL_DEPRECATED
|
||||
#endif
|
||||
virtual QAction *actionViewSeparator1() = 0;
|
||||
virtual QAction *actionZoomFullExtent() = 0;
|
||||
virtual QAction *actionZoomToLayer() = 0;
|
||||
virtual QAction *actionZoomToSelected() = 0;
|
||||
virtual QAction *actionZoomLast() = 0;
|
||||
virtual QAction *actionZoomActualSize() = 0;
|
||||
#ifndef Q_MOC_RUN
|
||||
Q_DECL_DEPRECATED
|
||||
#endif
|
||||
virtual QAction *actionViewSeparator2() = 0;
|
||||
virtual QAction *actionMapTips() = 0;
|
||||
virtual QAction *actionNewBookmark() = 0;
|
||||
virtual QAction *actionShowBookmarks() = 0;
|
||||
virtual QAction *actionDraw() = 0;
|
||||
#ifndef Q_MOC_RUN
|
||||
Q_DECL_DEPRECATED
|
||||
#endif
|
||||
virtual QAction *actionViewSeparator3() = 0;
|
||||
|
||||
//! Layer menu actions
|
||||
@ -292,6 +342,9 @@ class GUI_EXPORT QgisInterface : public QObject
|
||||
virtual QAction *actionAddRasterLayer() = 0;
|
||||
virtual QAction *actionAddPgLayer() = 0;
|
||||
virtual QAction *actionAddWmsLayer() = 0;
|
||||
#ifndef Q_MOC_RUN
|
||||
Q_DECL_DEPRECATED
|
||||
#endif
|
||||
virtual QAction *actionLayerSeparator1() = 0;
|
||||
virtual QAction *actionOpenTable() = 0;
|
||||
virtual QAction *actionToggleEditing() = 0;
|
||||
@ -299,33 +352,54 @@ class GUI_EXPORT QgisInterface : public QObject
|
||||
virtual QAction *actionLayerSelectionSaveAs() = 0;
|
||||
virtual QAction *actionRemoveLayer() = 0;
|
||||
virtual QAction *actionLayerProperties() = 0;
|
||||
#ifndef Q_MOC_RUN
|
||||
Q_DECL_DEPRECATED
|
||||
#endif
|
||||
virtual QAction *actionLayerSeparator2() = 0;
|
||||
virtual QAction *actionAddToOverview() = 0;
|
||||
virtual QAction *actionAddAllToOverview() = 0;
|
||||
virtual QAction *actionRemoveAllFromOverview() = 0;
|
||||
#ifndef Q_MOC_RUN
|
||||
Q_DECL_DEPRECATED
|
||||
#endif
|
||||
virtual QAction *actionLayerSeparator3() = 0;
|
||||
virtual QAction *actionHideAllLayers() = 0;
|
||||
virtual QAction *actionShowAllLayers() = 0;
|
||||
|
||||
//! Plugin menu actions
|
||||
virtual QAction *actionManagePlugins() = 0;
|
||||
#ifndef Q_MOC_RUN
|
||||
Q_DECL_DEPRECATED
|
||||
#endif
|
||||
virtual QAction *actionPluginSeparator1() = 0;
|
||||
virtual QAction *actionPluginListSeparator() = 0;
|
||||
#ifndef Q_MOC_RUN
|
||||
Q_DECL_DEPRECATED
|
||||
#endif
|
||||
virtual QAction *actionPluginSeparator2() = 0;
|
||||
virtual QAction *actionPluginPythonSeparator() = 0;
|
||||
virtual QAction *actionShowPythonDialog() = 0;
|
||||
|
||||
//! Settings menu actions
|
||||
virtual QAction *actionToggleFullScreen() = 0;
|
||||
#ifndef Q_MOC_RUN
|
||||
Q_DECL_DEPRECATED
|
||||
#endif
|
||||
virtual QAction *actionSettingsSeparator1() = 0;
|
||||
virtual QAction *actionOptions() = 0;
|
||||
virtual QAction *actionCustomProjection() = 0;
|
||||
|
||||
//! Help menu actions
|
||||
virtual QAction *actionHelpContents() = 0;
|
||||
#ifndef Q_MOC_RUN
|
||||
Q_DECL_DEPRECATED
|
||||
#endif
|
||||
virtual QAction *actionHelpSeparator1() = 0;
|
||||
virtual QAction *actionQgisHomePage() = 0;
|
||||
virtual QAction *actionCheckQgisVersion() = 0;
|
||||
#ifndef Q_MOC_RUN
|
||||
Q_DECL_DEPRECATED
|
||||
#endif
|
||||
virtual QAction *actionHelpSeparator2() = 0;
|
||||
virtual QAction *actionAbout() = 0;
|
||||
|
||||
@ -340,13 +414,16 @@ class GUI_EXPORT QgisInterface : public QObject
|
||||
*/
|
||||
void currentLayerChanged( QgsMapLayer * layer );
|
||||
/**This signal is emitted when a new composer instance has been created
|
||||
@note added in version 1.4*/
|
||||
* @note added in 1.4
|
||||
*/
|
||||
void composerAdded( QgsComposerView* v );
|
||||
/**This signal is emitted before a new composer instance is going to be removed
|
||||
@note added in version 1.4*/
|
||||
* @note added in 1.4
|
||||
*/
|
||||
void composerWillBeRemoved( QgsComposerView* v );
|
||||
/**This signal is emitted when the initialization is complete
|
||||
@note added in version 1.6*/
|
||||
* @note added in version 1.6
|
||||
*/
|
||||
void initializationCompleted();
|
||||
/** emitted when a project file is successfully read
|
||||
@note
|
||||
|
@ -109,7 +109,7 @@ void QgsDelimitedTextPlugin::initGui()
|
||||
connect( myQActionPointer, SIGNAL( triggered() ), this, SLOT( run() ) );
|
||||
// Add the icon to the toolbar
|
||||
qGisInterface->addToolBarIcon( myQActionPointer );
|
||||
qGisInterface->addPluginToMenu( tr( "&Delimited text" ), myQActionPointer );
|
||||
qGisInterface->addAddLayer( myQActionPointer );
|
||||
// this is called when the icon theme is changed
|
||||
connect( qGisInterface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );
|
||||
|
||||
@ -143,7 +143,7 @@ void QgsDelimitedTextPlugin::drawVectorLayer( QString thePathNameQString,
|
||||
void QgsDelimitedTextPlugin::unload()
|
||||
{
|
||||
// remove the GUI
|
||||
qGisInterface->removePluginMenu( tr( "&Delimited text" ), myQActionPointer );
|
||||
qGisInterface->removeAddLayer( myQActionPointer );
|
||||
qGisInterface->removeToolBarIcon( myQActionPointer );
|
||||
delete myQActionPointer;
|
||||
}
|
||||
|
@ -54,14 +54,14 @@ void QgsOraclePlugin::initGui()
|
||||
{
|
||||
|
||||
// Create the action for tool
|
||||
mQActionPointer = new QAction( QIcon( ":/oracleplugin/oracleplugin.png" ), tr( "Select Oracle GeoRaster" ), this );
|
||||
mQActionPointer = new QAction( QIcon( ":/oracleplugin/oracleplugin.png" ), tr( "Add Oracle GeoRaster Layer..." ), this );
|
||||
// Set the what's this text
|
||||
mQActionPointer->setWhatsThis( tr( "Open a Oracle Spatial GeoRaster" ) );
|
||||
mQActionPointer->setWhatsThis( tr( "Add a Oracle Spatial GeoRaster..." ) );
|
||||
// Connect the action to the run
|
||||
connect( mQActionPointer, SIGNAL( triggered() ), this, SLOT( run() ) );
|
||||
// Add the icon to the toolbar
|
||||
mQGisIface->addToolBarIcon( mQActionPointer );
|
||||
mQGisIface->addPluginToDatabaseMenu( tr( "&Oracle Spatial" ), mQActionPointer );
|
||||
mQGisIface->addAddLayer( mQActionPointer );
|
||||
|
||||
}
|
||||
//method defined in interface
|
||||
@ -89,8 +89,8 @@ void QgsOraclePlugin::run()
|
||||
void QgsOraclePlugin::unload()
|
||||
{
|
||||
// remove the GUI
|
||||
mQGisIface->removePluginDatabaseMenu( "&Oracle Spatial", mQActionPointer );
|
||||
mQGisIface->removeToolBarIcon( mQActionPointer );
|
||||
mQGisIface->removeAddLayer( mQActionPointer );
|
||||
delete mQActionPointer;
|
||||
}
|
||||
|
||||
|
@ -83,13 +83,10 @@ void SqlAnywhere::initGui()
|
||||
connect( mActionAddSqlAnywhereLayer, SIGNAL( triggered() ), this, SLOT( addSqlAnywhereLayer() ) );
|
||||
|
||||
// Add the icon to the new layers toolbar
|
||||
// mQGisIface->addToolBarIcon( mActionAddSqlAnywhereLayer );
|
||||
mQGisIface->layerToolBar()->addAction( mActionAddSqlAnywhereLayer );
|
||||
// mQGisIface->addToolBarIcon( mActionAddSqlAnywhereLayer );
|
||||
|
||||
// Add menu option to Plugins menu
|
||||
mQGisIface->addPluginToMenu( tr( "&SQL Anywhere" ), mActionAddSqlAnywhereLayer );
|
||||
// Also add to Layer menu, immediately before the first separator
|
||||
mQGisIface->layerMenu()->insertAction( mQGisIface->actionLayerSeparator1(), mActionAddSqlAnywhereLayer );
|
||||
// Also add to Layer menu
|
||||
mQGisIface->addAddLayer( mActionAddSqlAnywhereLayer );
|
||||
}
|
||||
|
||||
//method defined in interface
|
||||
@ -184,10 +181,8 @@ void SqlAnywhere::addSqlAnywhereLayer()
|
||||
// Unload the plugin and clean up the GUI
|
||||
void SqlAnywhere::unload()
|
||||
{
|
||||
mQGisIface->removePluginMenu( "&SQL Anywhere", mActionAddSqlAnywhereLayer );
|
||||
mQGisIface->layerMenu()->removeAction( mActionAddSqlAnywhereLayer );
|
||||
//mQGisIface->removeToolBarIcon( mActionAddSqlAnywhereLayer );
|
||||
mQGisIface->layerToolBar()->removeAction( mActionAddSqlAnywhereLayer );
|
||||
// mQGisIface->removeToolBarIcon( mActionAddSqlAnywhereLayer );
|
||||
mQGisIface->removeAddLayer( mActionAddSqlAnywhereLayer );
|
||||
delete mActionAddSqlAnywhereLayer;
|
||||
}
|
||||
|
||||
|
@ -34,8 +34,9 @@ static const QString version_ = QObject::tr( "Version 0.1" );
|
||||
static const QString icon_ = ":/wfs.png";
|
||||
|
||||
QgsWFSPlugin::QgsWFSPlugin( QgisInterface* iface )
|
||||
: QgisPlugin( name_, description_, version_, QgisPlugin::MAPLAYER ),
|
||||
mIface( iface ), mWfsDialogAction( 0 )
|
||||
: QgisPlugin( name_, description_, version_, QgisPlugin::MAPLAYER )
|
||||
, mIface( iface )
|
||||
, mWfsDialogAction( 0 )
|
||||
{
|
||||
|
||||
}
|
||||
@ -49,11 +50,11 @@ void QgsWFSPlugin::initGui()
|
||||
{
|
||||
if ( mIface )
|
||||
{
|
||||
mWfsDialogAction = new QAction( QIcon(), tr( "&Add WFS layer" ), 0 );
|
||||
mWfsDialogAction = new QAction( QIcon(), tr( "Add W&FS layer..." ), 0 );
|
||||
setCurrentTheme( "" );
|
||||
QObject::connect( mWfsDialogAction, SIGNAL( triggered() ), this, SLOT( showSourceDialog() ) );
|
||||
mIface->layerToolBar()->addAction( mWfsDialogAction );
|
||||
mIface->addPluginToMenu( tr( "&Add WFS layer" ), mWfsDialogAction );
|
||||
mIface->addAddLayer( mWfsDialogAction );
|
||||
// this is called when the icon theme is changed
|
||||
connect( mIface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );
|
||||
}
|
||||
@ -62,7 +63,7 @@ void QgsWFSPlugin::initGui()
|
||||
void QgsWFSPlugin::unload()
|
||||
{
|
||||
mIface->removeToolBarIcon( mWfsDialogAction );
|
||||
mIface->removePluginMenu( tr( "&Add WFS layer" ), mWfsDialogAction );
|
||||
mIface->removeAddLayer( mWfsDialogAction );
|
||||
delete mWfsDialogAction;
|
||||
mWfsDialogAction = 0;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1054</width>
|
||||
<height>25</height>
|
||||
<height>27</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="mEditMenu">
|
||||
@ -139,6 +139,7 @@
|
||||
<addaction name="mActionAddPgLayer"/>
|
||||
<addaction name="mActionAddSpatiaLiteLayer"/>
|
||||
<addaction name="mActionAddWmsLayer"/>
|
||||
<addaction name="mActionAddLayerSeparator"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="mActionOpenTable"/>
|
||||
<addaction name="mActionSaveEdits"/>
|
||||
@ -1478,6 +1479,20 @@
|
||||
<string>Stretch histogram to full dataset</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="mActionAddLayerSeparator">
|
||||
<property name="text">
|
||||
<string notr="true">More Add Layer actions here</string>
|
||||
</property>
|
||||
<property name="iconText">
|
||||
<string notr="true">More Add Layer actions here</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string notr="true">More Add Layer actions here</string>
|
||||
</property>
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../images/images.qrc"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user