Also hide ArcGIS provider actions if provider is disabled

This commit is contained in:
Sandro Mani 2016-06-03 11:52:03 +02:00
parent 6e66eef1ef
commit 8f158771a3
4 changed files with 22 additions and 4 deletions

View File

@ -200,7 +200,6 @@ FIND_PACKAGE(GDAL)
FIND_PACKAGE(Expat REQUIRED) FIND_PACKAGE(Expat REQUIRED)
FIND_PACKAGE(Spatialindex REQUIRED) FIND_PACKAGE(Spatialindex REQUIRED)
FIND_PACKAGE(Qwt REQUIRED) FIND_PACKAGE(Qwt REQUIRED)
FIND_PACKAGE(QJSON)
IF (WITH_INTERNAL_QEXTSERIALPORT) IF (WITH_INTERNAL_QEXTSERIALPORT)
SET(QEXTSERIALPORT_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/core/gps/qextserialport) SET(QEXTSERIALPORT_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/core/gps/qextserialport)
@ -313,6 +312,12 @@ ENDIF (WITH_TOUCH)
# search for QScintilla2 (C++ lib) # search for QScintilla2 (C++ lib)
FIND_PACKAGE(QScintilla REQUIRED) FIND_PACKAGE(QScintilla REQUIRED)
# search for QJSON and decide whether to enable ArcGIS providers
FIND_PACKAGE (QJSON)
IF (QJSON_FOUND AND NOT ENABLE_QT5)
SET (WITH_ARCGIS TRUE)
ENDIF (QJSON_FOUND AND NOT ENABLE_QT5)
# Master password hash and authentication encryption # Master password hash and authentication encryption
FIND_PACKAGE(QCA REQUIRED) FIND_PACKAGE(QCA REQUIRED)
# Check for runtime dependency of qca-ossl plugin # Check for runtime dependency of qca-ossl plugin

View File

@ -56,5 +56,7 @@
#cmakedefine ENABLE_MODELTEST #cmakedefine ENABLE_MODELTEST
#cmakedefine WITH_ARCGIS
#endif #endif

View File

@ -1676,6 +1676,13 @@ void QgisApp::createActions()
mActionAddPgLayer = 0; mActionAddPgLayer = 0;
#endif #endif
#ifndef WITH_ARCGIS
delete mActionAddAfsLayer;
mActionAddAfsLayer = 0;
delete mActionAddAmsLayer;
mActionAddAmsLayer = 0;
#endif
#ifndef HAVE_ORACLE #ifndef HAVE_ORACLE
delete mActionAddOracleLayer; delete mActionAddOracleLayer;
mActionAddOracleLayer = nullptr; mActionAddOracleLayer = nullptr;
@ -2126,6 +2133,7 @@ void QgisApp::createToolBars()
newLayerAction->setObjectName( "ActionNewLayer" ); newLayerAction->setObjectName( "ActionNewLayer" );
connect( bt, SIGNAL( triggered( QAction * ) ), this, SLOT( toolButtonActionTriggered( QAction * ) ) ); connect( bt, SIGNAL( triggered( QAction * ) ), this, SLOT( toolButtonActionTriggered( QAction * ) ) );
#ifdef WITH_ARCGIS
// map service tool button // map service tool button
bt = new QToolButton(); bt = new QToolButton();
bt->setPopupMode( QToolButton::MenuButtonPopup ); bt->setPopupMode( QToolButton::MenuButtonPopup );
@ -2167,6 +2175,7 @@ void QgisApp::createToolBars()
mLayerToolBar->removeAction( mActionAddWfsLayer ); mLayerToolBar->removeAction( mActionAddWfsLayer );
featureServiceAction->setObjectName( "ActionFeatureService" ); featureServiceAction->setObjectName( "ActionFeatureService" );
connect( bt, SIGNAL( triggered( QAction * ) ), this, SLOT( toolButtonActionTriggered( QAction * ) ) ); connect( bt, SIGNAL( triggered( QAction * ) ), this, SLOT( toolButtonActionTriggered( QAction * ) ) );
#endif
// add db layer button // add db layer button
bt = new QToolButton(); bt = new QToolButton();
@ -2545,8 +2554,10 @@ void QgisApp::setTheme( const QString& theThemeName )
mActionAddWmsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddWmsLayer.svg" ) ); mActionAddWmsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddWmsLayer.svg" ) );
mActionAddWcsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddWcsLayer.svg" ) ); mActionAddWcsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddWcsLayer.svg" ) );
mActionAddWfsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddWfsLayer.svg" ) ); mActionAddWfsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddWfsLayer.svg" ) );
#ifdef WITH_ARCGIS
mActionAddAfsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddAfsLayer.svg" ) ); mActionAddAfsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddAfsLayer.svg" ) );
mActionAddAmsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddAmsLayer.svg" ) ); mActionAddAmsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddAmsLayer.svg" ) );
#endif
mActionAddToOverview->setIcon( QgsApplication::getThemeIcon( "/mActionInOverview.svg" ) ); mActionAddToOverview->setIcon( QgsApplication::getThemeIcon( "/mActionInOverview.svg" ) );
mActionAnnotation->setIcon( QgsApplication::getThemeIcon( "/mActionAnnotation.png" ) ); mActionAnnotation->setIcon( QgsApplication::getThemeIcon( "/mActionAnnotation.png" ) );
mActionFormAnnotation->setIcon( QgsApplication::getThemeIcon( "/mActionFormAnnotation.png" ) ); mActionFormAnnotation->setIcon( QgsApplication::getThemeIcon( "/mActionFormAnnotation.png" ) );

View File

@ -2,9 +2,9 @@
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PLUGIN_SUBDIR}) SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PLUGIN_SUBDIR})
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PLUGIN_SUBDIR}) SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PLUGIN_SUBDIR})
IF(QJSON_FOUND AND NOT ENABLE_QT5) IF(WITH_ARCGIS)
ADD_SUBDIRECTORY(arcgisrest) ADD_SUBDIRECTORY(arcgisrest)
ENDIF(QJSON_FOUND AND NOT ENABLE_QT5) ENDIF(WITH_ARCGIS)
ADD_SUBDIRECTORY(memory) ADD_SUBDIRECTORY(memory)
ADD_SUBDIRECTORY(ogr) ADD_SUBDIRECTORY(ogr)
ADD_SUBDIRECTORY(wms) ADD_SUBDIRECTORY(wms)