class GeoServerExplorerPlugin: def __init__(self, iface): self.iface = iface config.iface = iface self.provider = GeoServerProvider() def unload(self): pem.removePkiTempFiles(self.explorer.catalogs()) self.explorer.deleteLater() self.iface.removePluginWebMenu(u"GeoServer", self.explorerAction) self.iface.removePluginWebMenu(u"GeoServer", self.configAction) self.iface.removePluginWebMenu(u"GeoServer", self.helpAction) Processing.removeProvider(self.provider) layerwatcher.disconnectLayerWasAdded() def initGui(self): icon = QtGui.QIcon(os.path.dirname(__file__) + "/images/geoserver.png") self.explorerAction = QtGui.QAction(icon, "GeoServer Explorer", self.iface.mainWindow()) self.explorerAction.triggered.connect(self.openExplorer) self.iface.addPluginToWebMenu(u"GeoServer", self.explorerAction) settings = QtCore.QSettings() self.explorer = GeoServerExplorer() self.iface.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.explorer) if not settings.value("/GeoServer/Settings/General/ExplorerVisible", False, bool): self.explorer.hide() self.explorer.visibilityChanged.connect(self._explorerVisibilityChanged) icon = QtGui.QIcon(os.path.dirname(__file__) + "/images/config.png") self.configAction = QtGui.QAction(icon, "GeoServer Explorer settings", self.iface.mainWindow()) self.configAction.triggered.connect(self.openSettings) self.iface.addPluginToWebMenu(u"GeoServer", self.configAction) icon = QtGui.QIcon(os.path.dirname(__file__) + "/images/help.png") self.helpAction = QtGui.QAction(icon, "GeoServer Explorer help", self.iface.mainWindow()) self.helpAction.triggered.connect(self.showHelp) self.iface.addPluginToWebMenu(u"GeoServer", self.helpAction) Processing.addProvider(self.provider) layerwatcher.connectLayerWasAdded(self.explorer) def _explorerVisibilityChanged(self, visible): settings = QtCore.QSettings() settings.setValue("/GeoServer/Settings/General/ExplorerVisible", visible) def showHelp(self): HELP_URL = "https://github.com/boundlessgeo/qgis-geoserver-plugin/blob/master/doc/source/intro.rst" webbrowser.open(HELP_URL) def openExplorer(self): self.explorer.show() def openSettings(self): dlg = ConfigDialog(self.explorer) dlg.exec_()
class GeoServerExplorerPlugin(object): def __init__(self, iface): self.iface = iface readSettings() try: from qgistester.tests import addTestModule from geoserverexplorer.test import testplugin addTestModule(testplugin, "GeoServer") except Exception as ex: pass def unload(self): self.explorer.deleteLater() removeSettingsMenu("GeoServer", self.iface.removePluginWebMenu) removeHelpMenu("GeoServer", self.iface.removePluginWebMenu) removeAboutMenu("GeoServer", self.iface.removePluginWebMenu) self.iface.removePluginWebMenu(u"GeoServer", self.explorerAction) layerwatcher.disconnectLayerWasAdded() try: from qgistester.tests import removeTestModule from geoserverexplorer.test import testplugin removeTestModule(testplugin, "GeoServer") except Exception as ex: pass def initGui(self): icon = QIcon(os.path.dirname(__file__) + "/images/geoserver.png") self.explorerAction = QAction(icon, "GeoServer Explorer", self.iface.mainWindow()) self.explorerAction.triggered.connect(self.openExplorer) self.iface.addPluginToWebMenu(u"GeoServer", self.explorerAction) self.explorer = GeoServerExplorer() self.iface.addDockWidget(Qt.RightDockWidgetArea, self.explorer) if not pluginSetting("ExplorerVisible"): self.explorer.hide() self.explorer.visibilityChanged.connect( self._explorerVisibilityChanged) addSettingsMenu("GeoServer", self.iface.addPluginToWebMenu) addHelpMenu("GeoServer", self.iface.addPluginToWebMenu) addAboutMenu("GeoServer", self.iface.addPluginToWebMenu) layerwatcher.connectLayerWasAdded(self.explorer) def _explorerVisibilityChanged(self, visible): setPluginSetting("ExplorerVisible", visible) def openExplorer(self): self.explorer.show()
class GeoServerExplorerPlugin(object): def __init__(self, iface): self.iface = iface readSettings() try: from qgistester.tests import addTestModule from geoserverexplorer.test import testplugin addTestModule(testplugin, "GeoServer") except Exception as ex: pass def unload(self): self.explorer.deleteLater() removeSettingsMenu("GeoServer", self.iface.removePluginWebMenu) removeHelpMenu("GeoServer", self.iface.removePluginWebMenu) removeAboutMenu("GeoServer", self.iface.removePluginWebMenu) self.iface.removePluginWebMenu(u"GeoServer", self.explorerAction) layerwatcher.disconnectLayerWasAdded() try: from qgistester.tests import removeTestModule from geoserverexplorer.test import testplugin removeTestModule(testplugin, "GeoServer") except Exception as ex: pass def initGui(self): icon = QIcon(os.path.dirname(__file__) + "/images/geoserver.png") self.explorerAction = QAction(icon, "GeoServer Explorer", self.iface.mainWindow()) self.explorerAction.triggered.connect(self.openExplorer) self.iface.addPluginToWebMenu(u"GeoServer", self.explorerAction) self.explorer = GeoServerExplorer() self.iface.addDockWidget(Qt.RightDockWidgetArea, self.explorer) if not pluginSetting("ExplorerVisible"): self.explorer.hide() self.explorer.visibilityChanged.connect(self._explorerVisibilityChanged) addSettingsMenu("GeoServer", self.iface.addPluginToWebMenu) addHelpMenu("GeoServer", self.iface.addPluginToWebMenu) addAboutMenu("GeoServer", self.iface.addPluginToWebMenu) layerwatcher.connectLayerWasAdded(self.explorer) def _explorerVisibilityChanged(self, visible): setPluginSetting("ExplorerVisible", visible) def openExplorer(self): self.explorer.show()
class GeoServerExplorerPlugin: def __init__(self, iface): self.iface = iface config.iface = iface def unload(self): pem.removePkiTempFiles(self.explorer.catalogs()) self.explorer.deleteLater() def initGui(self): icon = QtGui.QIcon(os.path.dirname(__file__) + "/images/geoserver.png") self.explorerAction = QtGui.QAction(icon, "GeoServer Explorer", self.iface.mainWindow()) self.explorerAction.triggered.connect(self.openExplorer) self.iface.addPluginToWebMenu(u"GeoServer", self.explorerAction) settings = QtCore.QSettings() self.explorer = GeoServerExplorer() self.iface.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.explorer) if not settings.value("/GeoServer/Settings/General/ExplorerVisible", False, bool): self.explorer.hide() self.explorer.visibilityChanged.connect(self._explorerVisibilityChanged) icon = QtGui.QIcon(os.path.dirname(__file__) + "/images/config.png") self.configAction = QtGui.QAction(icon, "GeoServer Explorer settings", self.iface.mainWindow()) self.configAction.triggered.connect(self.openSettings) self.iface.addPluginToWebMenu(u"GeoServer", self.configAction) icon = QtGui.QIcon(os.path.dirname(__file__) + "/images/help.png") self.helpAction = QtGui.QAction(icon, "GeoServer Explorer help", self.iface.mainWindow()) self.helpAction.triggered.connect(self.showHelp) self.iface.addPluginToWebMenu(u"GeoServer", self.helpAction) def _explorerVisibilityChanged(self, visible): settings = QtCore.QSettings() settings.setValue("/GeoServer/Settings/General/ExplorerVisible", visible) def showHelp(self): HELP_URL = "http://qgis.boundlessgeo.com/static/docs/index.html" webbrowser.open(HELP_URL) def openExplorer(self): self.explorer.show() def openSettings(self): dlg = ConfigDialog(self.explorer) dlg.exec_()
class GeoServerExplorerPlugin: def __init__(self, iface): self.iface = iface config.iface = iface if processingOk: self.provider = GeoServerProvider() try: from qgistester.tests import addTestModule from geoserverexplorer.test import testplugin from geoserverexplorer.test import testpkiplugin addTestModule(testplugin, "GeoServer") addTestModule(testpkiplugin, "PKI GeoServer") except Exception as ex: pass def unload(self): pem.removePkiTempFiles(self.explorer.catalogs()) self.explorer.deleteLater() self.iface.removePluginWebMenu(u"GeoServer", self.explorerAction) self.iface.removePluginWebMenu(u"GeoServer", self.configAction) self.iface.removePluginWebMenu(u"GeoServer", self.helpAction) if processingOk: Processing.removeProvider(self.provider) layerwatcher.disconnectLayerWasAdded() try: from qgistester.tests import removeTestModule from geoserverexplorer.test import testplugin from geoserverexplorer.test import testpkiplugin removeTestModule(testplugin, "GeoServer") removeTestModule(testpkiplugin, "PKI GeoServer") except Exception as ex: pass def initGui(self): icon = QtGui.QIcon(os.path.dirname(__file__) + "/images/geoserver.png") self.explorerAction = QtGui.QAction(icon, "GeoServer Explorer", self.iface.mainWindow()) self.explorerAction.triggered.connect(self.openExplorer) self.iface.addPluginToWebMenu(u"GeoServer", self.explorerAction) settings = QtCore.QSettings() self.explorer = GeoServerExplorer() self.iface.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.explorer) if not settings.value("/GeoServer/Settings/General/ExplorerVisible", False, bool): self.explorer.hide() self.explorer.visibilityChanged.connect( self._explorerVisibilityChanged) icon = QtGui.QIcon(os.path.dirname(__file__) + "/images/config.png") self.configAction = QtGui.QAction(icon, "GeoServer Explorer settings", self.iface.mainWindow()) self.configAction.triggered.connect(self.openSettings) self.iface.addPluginToWebMenu(u"GeoServer", self.configAction) icon = QtGui.QIcon(os.path.dirname(__file__) + "/images/help.png") self.helpAction = QtGui.QAction(icon, "GeoServer Explorer help", self.iface.mainWindow()) self.helpAction.triggered.connect(self.showHelp) self.iface.addPluginToWebMenu(u"GeoServer", self.helpAction) if processingOk: Processing.addProvider(self.provider) layerwatcher.connectLayerWasAdded(self.explorer) def _explorerVisibilityChanged(self, visible): settings = QtCore.QSettings() settings.setValue("/GeoServer/Settings/General/ExplorerVisible", visible) def showHelp(self): webbrowser.open_new("file://" + os.path.join(os.path.dirname( __file__), "docs", "html", "index.html")) def openExplorer(self): self.explorer.show() def openSettings(self): dlg = ConfigDialog(self.explorer) dlg.exec_()
class GeoServerExplorerPlugin: def __init__(self, iface): self.iface = iface config.iface = iface self.provider = GeoServerProvider() try: from qgistester.tests import addTestModule from geoserverexplorer.test import testplugin addTestModule(testplugin, "GeoServer") except: pass def unload(self): pem.removePkiTempFiles(self.explorer.catalogs()) self.explorer.deleteLater() self.iface.removePluginWebMenu(u"GeoServer", self.explorerAction) self.iface.removePluginWebMenu(u"GeoServer", self.configAction) self.iface.removePluginWebMenu(u"GeoServer", self.helpAction) Processing.removeProvider(self.provider) layerwatcher.disconnectLayerWasAdded() def initGui(self): icon = QtGui.QIcon(os.path.dirname(__file__) + "/images/geoserver.png") self.explorerAction = QtGui.QAction(icon, "GeoServer Explorer", self.iface.mainWindow()) self.explorerAction.triggered.connect(self.openExplorer) self.iface.addPluginToWebMenu(u"GeoServer", self.explorerAction) settings = QtCore.QSettings() self.explorer = GeoServerExplorer() self.iface.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.explorer) if not settings.value("/GeoServer/Settings/General/ExplorerVisible", False, bool): self.explorer.hide() self.explorer.visibilityChanged.connect( self._explorerVisibilityChanged) icon = QtGui.QIcon(os.path.dirname(__file__) + "/images/config.png") self.configAction = QtGui.QAction(icon, "GeoServer Explorer settings", self.iface.mainWindow()) self.configAction.triggered.connect(self.openSettings) self.iface.addPluginToWebMenu(u"GeoServer", self.configAction) icon = QtGui.QIcon(os.path.dirname(__file__) + "/images/help.png") self.helpAction = QtGui.QAction(icon, "GeoServer Explorer help", self.iface.mainWindow()) self.helpAction.triggered.connect(self.showHelp) self.iface.addPluginToWebMenu(u"GeoServer", self.helpAction) Processing.addProvider(self.provider) layerwatcher.connectLayerWasAdded(self.explorer) def _explorerVisibilityChanged(self, visible): settings = QtCore.QSettings() settings.setValue("/GeoServer/Settings/General/ExplorerVisible", visible) def showHelp(self): HELP_URL = "https://github.com/boundlessgeo/qgis-geoserver-plugin/blob/master/doc/source/intro.rst" webbrowser.open(HELP_URL) def openExplorer(self): self.explorer.show() def openSettings(self): dlg = ConfigDialog(self.explorer) dlg.exec_()