def append_menu_buttons(self):
        """
        Append menus and buttons to appropriate toolbar
        :return:
        """
        # add to QGIS menu
        if PluginSettings.move_to_layers_menu():
            self.iface.addLayerMenu().addMenu(self.menu)
        else:
            # need workaround for WebMenu
            _temp_act = QAction('temp', self.iface.mainWindow())
            self.iface.addPluginToWebMenu("_tmp", _temp_act)
            self.iface.webMenu().addMenu(self.menu)
            self.iface.removePluginWebMenu("_tmp", _temp_act)

        # add to QGIS toolbar
        toolbutton = QToolButton()
        toolbutton.setPopupMode(QToolButton.InstantPopup)
        toolbutton.setMenu(self.menu)
        toolbutton.setIcon(self.menu.icon())
        toolbutton.setText(self.menu.title())
        toolbutton.setToolTip(self.menu.title())
        if PluginSettings.move_to_layers_menu():
            self.tb_action = self.iface.layerToolBar().addWidget(toolbutton)
        else:
            self.tb_action = self.iface.webToolBar().addWidget(toolbutton)
Beispiel #2
0
    def append_menu_buttons(self):
        """
        Append menus and buttons to appropriate toolbar
        :return:
        """
        # add to QGIS menu
        if PluginSettings.move_to_layers_menu():
            self.iface.addLayerMenu().addMenu(self.menu)
        else:
            # need workaround for WebMenu
            _temp_act = QAction('temp', self.iface.mainWindow())
            self.iface.addPluginToWebMenu("_tmp", _temp_act)
            self.iface.webMenu().addMenu(self.menu)
            self.iface.removePluginWebMenu("_tmp", _temp_act)

        # add to QGIS toolbar
        toolbutton = QToolButton()
        toolbutton.setPopupMode(QToolButton.InstantPopup)
        toolbutton.setMenu(self.menu)
        toolbutton.setIcon(self.menu.icon())
        toolbutton.setText(self.menu.title())
        toolbutton.setToolTip(self.menu.title())
        if PluginSettings.move_to_layers_menu():
            self.tb_action = self.iface.layerToolBar().addWidget(toolbutton)
        else:
            self.tb_action = self.iface.webToolBar().addWidget(toolbutton)
 def fill_pages(self):
     # common
     self.chkMoveToLayersMenu.setChecked(PluginSettings.move_to_layers_menu())
     self.chkEnableOTF3857.setChecked(PluginSettings.enable_otf_3857())
     self.chkShowMessagesInBar.setChecked(PluginSettings.show_messages_in_bar())
     # tiled layers
     self.spnConnCount.setValue(PluginSettings.default_tile_layer_conn_count())
     self.spnCacheExp.setValue(QGISSettings.get_default_tile_expiry())
     self.spnNetworkTimeout.setValue(QGISSettings.get_default_network_timeout())
Beispiel #4
0
 def fill_pages(self):
     # common
     self.chkMoveToLayersMenu.setChecked(
         PluginSettings.move_to_layers_menu())
     self.chkEnableOTF3857.setChecked(PluginSettings.enable_otf_3857())
     self.chkShowMessagesInBar.setChecked(
         PluginSettings.show_messages_in_bar())
     # tiled layers
     self.spnConnCount.setValue(
         PluginSettings.default_tile_layer_conn_count())
     self.spnCacheExp.setValue(QGISSettings.get_default_tile_expiry())
     self.spnNetworkTimeout.setValue(
         QGISSettings.get_default_network_timeout())