示例#1
0
    def initGui(self):
        self.mapTool = MGRSMapTool(self.iface.mapCanvas())
        self.iface.mapCanvas().mapToolSet.connect(self.unsetTool)

        self.toolAction = QAction(QIcon(os.path.join(pluginPath, 'icons', 'mgrs.svg')),
                                  'MGRS map tool',
                                  self.iface.mainWindow())
        self.toolAction.setCheckable(True)
        self.iface.addToolBarIcon(self.toolAction)
        self.iface.addPluginToMenu('MGRS', self.toolAction)
        self.toolAction.triggered.connect(self.setTool)

        zoomToIcon = QIcon(':/images/themes/default/mActionZoomIn.svg')
        self.zoomToAction = QAction(zoomToIcon,
                                    'Zoom to MGRS coordinate',
                                    self.iface.mainWindow())
        self.iface.addPluginToMenu('MGRS', self.zoomToAction)
        self.zoomToAction.triggered.connect(self.zoomTo)

        addHelpMenu("MGRS", self.iface.addPluginToMenu)
        addAboutMenu("MGRS", self.iface.addPluginToMenu)

        self.mgrsDock = MgrsDockWidget(self.iface.mapCanvas(), self.iface.mainWindow())
        self.iface.addDockWidget(Qt.TopDockWidgetArea, self.mgrsDock)
        self.mgrsDock.hide()

        if processingOk:
            Processing.addProvider(self.provider)

        try:
            from lessons import addLessonsFolder, addGroup
            folder = os.path.join(os.path.dirname(__file__), "_lessons")
            addLessonsFolder(folder, "MGRS tools")
        except:
            pass
示例#2
0
    def __init__(self, iface):
        try:
            from lessons import addLessonsFolder
        except:
            return

        addLessonsFolder(self.folder, "examplelessons")
示例#3
0
    def initGui(self):
        icon = QIcon(os.path.dirname(__file__) + "reportingtool.png")
        self.action = QAction(icon, "Boundless Support Tool", self.iface.mainWindow())
        self.action.setObjectName("startreportingtool")
        self.action.triggered.connect(self.run)

        self.separator = QAction(self.iface.mainWindow())
        self.separator.setObjectName("reportingtoolseparator")
        self.separator.setSeparator(True)

        actions = self.iface.mainWindow().menuBar().actions()
        for action in actions:
            if action.menu().objectName() == 'mPluginMenu':
                menuPlugin = action.menu()
                for a in menuPlugin.actions():
                    if a.isSeparator():
                        menuPlugin.insertAction(a, self.action)

        helpMenu = self.iface.helpMenu()
        for action in helpMenu.actions():
            if action.objectName() == "mActionNeedSupport":
                helpMenu.insertActions(action, [self.action, self.separator])

        try:
            from lessons import addLessonsFolder
            folder = os.path.join(os.path.dirname(__file__), "_lessons")
            addLessonsFolder(folder)
        except:
            pass
示例#4
0
    def initGui(self):
        mapToolIcon = QIcon(
            os.path.join(os.path.dirname(__file__), "icons", "w3w.png"))
        self.toolAction = QAction(mapToolIcon, "what3words map tool",
                                  self.iface.mainWindow())
        self.toolAction.triggered.connect(self.setTool)
        self.toolAction.setCheckable(True)
        self.iface.addToolBarIcon(self.toolAction)
        self.iface.addPluginToMenu("what3words", self.toolAction)

        zoomToIcon = QIcon(':/images/themes/default/mActionZoomIn.svg')
        self.zoomToAction = QAction(zoomToIcon, "Zoom to 3 word address",
                                    self.iface.mainWindow())
        self.zoomToAction.triggered.connect(self.zoomTo)
        self.iface.addPluginToMenu("what3words", self.zoomToAction)

        addSettingsMenu("what3words", self.iface.addPluginToMenu)
        addHelpMenu("what3words", self.iface.addPluginToMenu)
        addAboutMenu("what3words", self.iface.addPluginToMenu)

        self.iface.mapCanvas().mapToolSet.connect(self.unsetTool)

        self.zoomToDialog = W3WCoordInputDialog(self.iface.mapCanvas(),
                                                self.iface.mainWindow())
        self.iface.addDockWidget(Qt.TopDockWidgetArea, self.zoomToDialog)
        self.zoomToDialog.hide()

        QgsApplication.processingRegistry().addProvider(self.provider)

        try:
            from lessons import addLessonsFolder, addGroup
            folder = os.path.join(os.path.dirname(__file__), "_lessons")
            addLessonsFolder(folder, "what3words")
        except:
            pass
示例#5
0
    def initGui(self):
        try:
            from lessons import addLessonsFolder
            folder = os.path.join(os.path.dirname(__file__), "_lessons")
            addLessonsFolder(folder, "datacubeplugin")
        except:
            pass

        self.dataCubeWidget = DataCubeWidget(self.iface.mainWindow())
        self.iface.addDockWidget(Qt.LeftDockWidgetArea, self.dataCubeWidget)
        self.dataCubeWidget.hide()

        self.iface.addDockWidget(Qt.BottomDockWidgetArea, plotWidget)
        plotWidget.hide()

        self.iface.addDockWidget(Qt.TopDockWidgetArea, mosaicWidget)
        mosaicWidget.hide()

        self.dataCubeAction = self.dataCubeWidget.toggleViewAction()
        icon = QIcon(os.path.dirname(__file__) + "/icons/desktop.svg")
        self.dataCubeAction.setIcon(icon)
        self.dataCubeAction.setText("Data Cube panel")
        self.iface.addPluginToMenu("Data Cube Plugin", self.dataCubeAction)

        self.mosaicAction = mosaicWidget.toggleViewAction()
        icon = QIcon(os.path.dirname(__file__) + "/icons/desktop.svg")
        self.mosaicAction.setIcon(icon)
        self.mosaicAction.setText("Mosaic tool")
        self.iface.addPluginToMenu("Data Cube Plugin", self.mosaicAction)

        #addSettingsMenu("Data Cube Plugin")
        addHelpMenu("Data Cube Plugin")
        addAboutMenu("Data Cube Plugin")
    def initGui(self):
        self.runAction = QAction(self.tr("Print templates creator"),
                                 self.iface.mainWindow())
        self.runAction.setIcon(
            QIcon(os.path.join(pluginPath, "icons", "print.svg")))
        self.runAction.setWhatsThis(
            self.tr("Generate Print JSON from QGIS composer layout"))
        self.runAction.setObjectName("printTemplatesCreatorRun")
        self.runAction.triggered.connect(self.run)

        self.helpAction = QAction(self.tr("Help"), self.iface.mainWindow())
        self.helpAction.setIcon(
            QgsApplication.getThemeIcon('/mActionHelpAPI.png'))
        self.helpAction.setObjectName("printTemplatesCreatorHelp")
        self.helpAction.triggered.connect(
            lambda: webbrowser.open_new("file://{}".format(
                os.path.join(os.path.dirname(__file__), "docs", "html",
                             "index.html"))))

        self.iface.addWebToolBarIcon(self.runAction)
        self.iface.addPluginToWebMenu(self.tr("Print templates creator"),
                                      self.runAction)
        self.iface.addPluginToWebMenu(self.tr("Print templates creator"),
                                      self.helpAction)

        try:
            from lessons import addLessonsFolder
            folder = os.path.join(os.path.dirname(__file__), "_lessons")
            addLessonsFolder(folder)
        except:
            pass
    def initGui(self):
        addHelpMenu("MIL-STD-2525", self.iface.addPluginToMenu)
        addAboutMenu("MIL-STD-2525", self.iface.addPluginToMenu)

        try:
            from lessons import addLessonsFolder, addGroup
            folder = os.path.join(os.path.dirname(__file__), "_lessons")
            addLessonsFolder(folder, "milstd2525")
        except:
            pass
    def initGui(self):
        self.dockWidget = getConnectDockWidget()
        self.iface.addDockWidget(Qt.RightDockWidgetArea, self.dockWidget)
        self.dockWidget.hide()

        utils.setRepositoryUrl()

        self.actionRunWizard = self.dockWidget.toggleViewAction()
        self.actionRunWizard.setText('Boundless Connect')
        self.actionRunWizard.setIcon(
            QIcon(os.path.join(pluginPath, 'icons', 'connect.svg')))
        self.actionRunWizard.setWhatsThis('Boundless Connect')
        self.actionRunWizard.setObjectName('actionRunWizard')

        # If Boundless repository is a directory, add menu entry
        # to start modified Plugin Manager which works with local repositories
        if utils.isRepositoryInDirectory():
            self.actionPluginManager = QAction(
                'Manage plugins (local folder)', self.iface.mainWindow())
            self.actionPluginManager.setIcon(
                QIcon(os.path.join(pluginPath, 'icons', 'plugin.svg')))
            self.actionPluginManager.setWhatsThis(
                'Manage and install plugins from local repository')
            self.actionPluginManager.setObjectName('actionPluginManager')

            self.iface.addPluginToMenu(
                'Boundless Connect', self.actionPluginManager)

            self.actionPluginManager.triggered.connect(self.pluginManagerLocal)

        actions = self.iface.mainWindow().menuBar().actions()
        for action in actions:
            if action.menu().objectName() == 'mPluginMenu':
                menuPlugin = action.menu()
                separator = menuPlugin.actions()[1]
                menuPlugin.insertAction(separator, self.actionRunWizard)
                if utils.isRepositoryInDirectory():
                    menuPlugin.insertAction(separator, self.actionPluginManager)

        addSettingsMenu('Boundless Connect')
        addHelpMenu('Boundless Connect')
        addAboutMenu('Boundless Connect')

        # Enable check for updates if it is not enabled
        utils.addCheckForUpdates()

        try:
            from lessons import addLessonsFolder, addGroup
            folder = os.path.join(os.path.dirname(__file__), "_lessons")
            addLessonsFolder(folder, "boundlessconnect")
            group_description = os.path.join(folder, "group.md")
            addGroup("Boundless Connect plugin", group_description)
        except:
            pass
示例#9
0
    def initGui(self):
        addHelpMenu("MIL-STD-2525", self.iface.addPluginToMenu)
        addAboutMenu("MIL-STD-2525", self.iface.addPluginToMenu)

        # noinspection PyBroadException
        try:
            # noinspection PyUnresolvedReferences
            from lessons import addLessonsFolder, addGroup
            folder = os.path.join(os.path.dirname(__file__), "_lessons")
            addLessonsFolder(folder, "milstd2525")
        except:
            pass
示例#10
0
    def initGui(self):
        readTrackedLayers()

        QgsMapLayerRegistry.instance().layerWasAdded.connect(trackLayer)
        QgsMapLayerRegistry.instance().layerRemoved.connect(layerRemoved)

        icon = QIcon(os.path.dirname(__file__) + "/ui/resources/geogig.png")
        self.explorerAction = navigatorInstance.toggleViewAction()
        self.explorerAction.setIcon(icon)
        self.explorerAction.setText("GeoGig Navigator")
        icon = QIcon(os.path.dirname(__file__) + "/ui/resources/identify.png")
        self.toolAction = QAction(icon, "GeoGig Feature Info Tool",
                                  self.iface.mainWindow())
        self.toolAction.setCheckable(True)
        self.toolAction.triggered.connect(self.setTool)

        self.menu = QMenu(self.iface.mainWindow())
        self.menu.setTitle("GeoGig")
        self.menu.addAction(self.explorerAction)
        self.menu.addAction(self.toolAction)
        bar = self.iface.layerToolBar()
        self.toolButton = QToolButton()
        self.toolButton.setMenu(self.menu)
        self.toolButton.setPopupMode(QToolButton.MenuButtonPopup)
        self.toolButton.setDefaultAction(self.explorerAction)
        bar.addWidget(self.toolButton)
        self.iface.addPluginToMenu("&GeoGig", self.explorerAction)
        self.iface.addPluginToMenu("&GeoGig", self.toolAction)

        addSettingsMenu("GeoGig")
        addHelpMenu("GeoGig")
        addAboutMenu("GeoGig")

        self.mapTool = MapToolGeoGigInfo(self.iface.mapCanvas())

        #This crashes QGIS, so we comment it out until finding a solution
        #self.mapTool.setAction(self.toolAction)

        self.iface.addDockWidget(Qt.RightDockWidgetArea, navigatorInstance)

        try:
            from lessons import addLessonsFolder, addGroup
            folder = os.path.join(os.path.dirname(__file__), "_lessons")
            addLessonsFolder(folder, "geogig")
            group_description = os.path.join(folder, "group.md")
            addGroup("GeoGig lessons", group_description)
        except Exception as e:
            pass
    def initGui(self):
        readTrackedLayers()

        QgsMapLayerRegistry.instance().layerWasAdded.connect(trackLayer)
        QgsMapLayerRegistry.instance().layerRemoved.connect(layerRemoved)

        icon = QIcon(os.path.dirname(__file__) + "/ui/resources/geogig.png")
        self.explorerAction = navigatorInstance.toggleViewAction()
        self.explorerAction.setIcon(icon)
        self.explorerAction.setText("GeoGig Navigator")
        icon = QIcon(os.path.dirname(__file__) + "/ui/resources/identify.png")
        self.toolAction = QAction(icon, "GeoGig Feature Info Tool", self.iface.mainWindow())
        self.toolAction.setCheckable(True)
        self.toolAction.triggered.connect(self.setTool)

        self.menu = QMenu(self.iface.mainWindow())
        self.menu.setTitle("GeoGig")
        self.menu.addAction(self.explorerAction)
        self.menu.addAction(self.toolAction)
        bar = self.iface.layerToolBar()
        self.toolButton = QToolButton()
        self.toolButton.setMenu(self.menu)
        self.toolButton.setPopupMode(QToolButton.MenuButtonPopup)
        self.toolButton.setDefaultAction(self.explorerAction)
        bar.addWidget(self.toolButton)
        self.iface.addPluginToMenu("&GeoGig", self.explorerAction)
        self.iface.addPluginToMenu("&GeoGig", self.toolAction)

        addSettingsMenu("GeoGig")
        addHelpMenu("GeoGig")
        addAboutMenu("GeoGig")

        self.mapTool = MapToolGeoGigInfo(self.iface.mapCanvas())

        #This crashes QGIS, so we comment it out until finding a solution
        #self.mapTool.setAction(self.toolAction)

        self.iface.addDockWidget(Qt.RightDockWidgetArea, navigatorInstance)

        try:
            from lessons import addLessonsFolder, addGroup
            folder = os.path.join(os.path.dirname(__file__), "_lessons")
            addLessonsFolder(folder, "geogig")
            group_description = os.path.join(folder, "group.md")
            addGroup("GeoGig lessons", group_description)
        except Exception as e:
            pass
示例#12
0
    def __init__(self, iface):
        self.iface = iface
        try:
            from .tests import testerplugin
            from qgistester.tests import addTestModule
            addTestModule(testerplugin, "Boundless Basemaps")
        except Exception as e:
            pass

        try:
            from lessons import addLessonsFolder
            folder = os.path.join(os.path.dirname(__file__), "_lessons")
            addLessonsFolder(folder)
        except:
            pass
        readSettings()
        if not pluginSetting('first_time_setup_done'):
            self.iface.initializationCompleted.connect(self.setup)
示例#13
0
    def initGui(self):
        icon = QIcon(os.path.dirname(__file__) + "/icons/desktop.svg")
        self.action = QAction(icon, "[pluginname]", self.iface.mainWindow())
        self.action.setObjectName("start[pluginshortname]")
        self.action.triggered.connect(self.run)
        self.iface.addPluginToMenu("[pluginname]", self.action)
        self.iface.addToolBarIcon(self.action)

        addSettingsMenu("[pluginname]")
        addHelpMenu("[pluginname]")
        addAboutMenu("[pluginname]")

        try:
            from lessons import addLessonsFolder
            folder = os.path.join(os.path.dirname(__file__), "_lessons")
            addLessonsFolder(folder, "[pluginshortname]")
        except:
            pass
示例#14
0
    def initGui(self):
        readTrackedLayers()

        QgsMapLayerRegistry.instance().layerWasAdded.connect(trackLayer)
        QgsMapLayerRegistry.instance().layerRemoved.connect(layerRemoved)

        icon = QIcon(os.path.dirname(__file__) + "/ui/resources/geogig.png")
        self.explorerAction = navigatorInstance.toggleViewAction()
        self.explorerAction.setIcon(icon)
        self.explorerAction.setText("GeoGig Navigator")
        icon = QIcon(os.path.dirname(__file__) + "/ui/resources/config.png")
        self.configAction = QAction(icon, "GeoGig Settings",
                                    self.iface.mainWindow())
        self.configAction.triggered.connect(self.openSettings)
        icon = QIcon(os.path.dirname(__file__) + "/ui/resources/identify.png")
        self.toolAction = QAction(icon, "GeoGig Feature Info Tool",
                                  self.iface.mainWindow())
        self.toolAction.setCheckable(True)
        self.toolAction.triggered.connect(self.setTool)
        helpIcon = QgsApplication.getThemeIcon('/mActionHelpAPI.png')
        self.helpAction = QAction(helpIcon, "GeoGig Plugin Help",
                                  self.iface.mainWindow())
        self.helpAction.setObjectName("GeoGigHelp")
        self.helpAction.triggered.connect(
            lambda: webbrowser.open_new("file://" + os.path.join(
                os.path.dirname(__file__), "docs", "html", "index.html")))
        self.menu = QMenu(self.iface.mainWindow())
        self.menu.setTitle("GeoGig")
        self.menu.addAction(self.explorerAction)
        self.menu.addAction(self.toolAction)
        self.menu.addAction(self.configAction)
        self.menu.addAction(self.helpAction)
        bar = self.iface.layerToolBar()
        self.toolButton = QToolButton()
        self.toolButton.setMenu(self.menu)
        self.toolButton.setPopupMode(QToolButton.MenuButtonPopup)
        self.toolButton.setDefaultAction(self.explorerAction)
        useMainMenu = config.getConfigValue(config.GENERAL,
                                            config.USE_MAIN_MENUBAR)
        bar.addWidget(self.toolButton)
        if useMainMenu:
            menuBar = self.iface.mainWindow().menuBar()
            menuBar.insertMenu(
                self.iface.firstRightStandardMenu().menuAction(), self.menu)
        else:
            self.iface.addPluginToMenu(u"&GeoGig", self.explorerAction)
            self.iface.addPluginToMenu(u"&GeoGig", self.configAction)
            self.iface.addPluginToMenu(u"&GeoGig", self.toolAction)

        self.mapTool = MapToolGeoGigInfo(self.iface.mapCanvas())
        #This crashes QGIS, so we comment it out until finding a solution
        #self.mapTool.setAction(self.toolAction)

        self.iface.addDockWidget(Qt.RightDockWidgetArea, navigatorInstance)

        try:
            from lessons import addLessonsFolder
            folder = os.path.join(os.path.dirname(__file__), "_lessons")
            addLessonsFolder(folder, "geogig")
        except Exception as e:
            pass