Skip to content
Permalink
Browse files

[FEATURE] [DBManager] Add a GeoPackage dedicated plugin

  • Loading branch information
rouault committed Oct 25, 2016
1 parent 3113fc6 commit 390588b69395dea27345a5224bf1abb2468bdf45
@@ -68,6 +68,17 @@ MACRO (PLUGIN_INSTALL plugin subdir )
ENDFOREACH(file)
ENDMACRO (PLUGIN_INSTALL)

ADD_CUSTOM_TARGET(staged-plugins-copy-init-py ALL DEPENDS staged-plugins)

# Dummy file to stage to output/python/plugins for testing purposes
ADD_CUSTOM_COMMAND(TARGET staged-plugins-copy-init-py
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "${PYTHON_OUTPUT_DIRECTORY}/plugins"
COMMAND ${CMAKE_COMMAND} -E copy __init__.py "${PYTHON_OUTPUT_DIRECTORY}/plugins"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS __init__.py
)

ADD_SUBDIRECTORY(GdalTools)
ADD_SUBDIRECTORY(db_manager)
ADD_SUBDIRECTORY(processing)
@@ -298,6 +298,7 @@ def __init__(self, parent=None):
self.importVector.connect(self.vectorImport)

self.hasSpatialiteSupport = "spatialite" in supportedDbTypes()
self.hasGPKGSupport = "gpkg" in supportedDbTypes()

self.rootItem = TreeItem(None, None)
for dbtype in supportedDbTypes():
@@ -399,7 +400,7 @@ def flags(self, index):
flags |= Qt.ItemIsDropEnabled

# SL/Geopackage db files can be dropped everywhere in the tree
if self.hasSpatialiteSupport:
if self.hasSpatialiteSupport or self.hasGPKGSupport:
flags |= Qt.ItemIsDropEnabled

return flags
@@ -1,5 +1,6 @@
ADD_SUBDIRECTORY(postgis)
ADD_SUBDIRECTORY(spatialite)
ADD_SUBDIRECTORY(gpkg)
IF(WITH_ORACLE)
ADD_SUBDIRECTORY(oracle)
ENDIF(WITH_ORACLE)
@@ -24,7 +24,8 @@
class NotSupportedDbType(Exception):

def __init__(self, dbtype):
self.msg = self.tr("%s is not supported yet") % dbtype
from qgis.PyQt.QtWidgets import QApplication
self.msg = QApplication.translate("DBManagerPlugin", "%s is not supported yet" % dbtype)
Exception(self, self.msg)

def __str__(self):
@@ -0,0 +1,9 @@

FILE(GLOB PY_FILES *.py)
FILE(GLOB ICON_FILES icons/*.png)

PYQT_ADD_RESOURCES(PYRC_FILES resources.qrc)

PLUGIN_INSTALL(db_manager db_plugins/gpkg ${PY_FILES} ${PYRC_FILES})
PLUGIN_INSTALL(db_manager db_plugins/gpkg/icons ${ICON_FILES})

No changes.

0 comments on commit 390588b

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