示例#1
0
    def __init__(self, parent):
        super().__init__()
        self.iface = parent
        self.setupUi(self)
        self.cbNotifications.setChecked(notificationsEnabled())
        self.pteExtraCommands.setPlainText(getExtraCommands())

        #update the plugin list first! The plugin could be removed from the list if was temporarily broken.
        #Still doesn't work in every case. TODO?: try to load from scratch the plugin saved in QSettings if doesn't exist
        plugin = currentPlugin()
        updateAvailablePlugins()
        #if plugin not in plugins:
        #try:
        #loadPlugin(plugin)
        #startPlugin(plugin)
        #except:
        #pass
        #updateAvailablePlugins()

        plugins_list = sorted(plugins.keys())
        for plugin in plugins_list:
            try:
                icon = QIcon(plugin_installer.plugins.all()[plugin]['icon'])
            except KeyError:
                icon = QIcon()
            self.comboPlugin.addItem(icon, plugin)
        plugin = currentPlugin()
        if plugin in plugins:
            self.comboPlugin.setCurrentIndex(plugins_list.index(plugin))
  def __init__(self, parent):
    super().__init__()
    self.iface = parent
    self.setupUi(self)
    #update the plugin list first! The plugin could be removed from the list if was temporarily broken.
    #Still doesn't work in every case. TODO?: try to load from scratch the plugin saved in QSettings if doesn't exist
    plugin = currentPlugin()
    updateAvailablePlugins()
    #if plugin not in plugins:
      #try:
        #loadPlugin(plugin)
        #startPlugin(plugin)
      #except:
        #pass
    #updateAvailablePlugins()

    plugins_list = sorted(plugins.keys())
    for plugin in plugins_list:
      try:
        icon = QIcon(plugin_installer.plugins.all()[plugin]['icon'])
      except KeyError:
        icon = QIcon()
      self.comboPlugin.addItem(icon, plugin)
    plugin = currentPlugin()
    if plugin in plugins:
      self.comboPlugin.setCurrentIndex(plugins_list.index(plugin))
 def _load_available_trackers(self):
     self.PluginChooser.addItem("", None)
     for pl in plugins.keys():
         if pl:
             tracker = pluginMetadata(pl, 'tracker')
             if "github.com" in tracker:
                 self.PluginChooser.addItem(pl, tracker)
  def __init__(self, parent):
    QDialog.__init__(self)
    self.iface = parent
    self.setupUi(self)
    #update the plugin list first! The plugin could be removed from the list if was temporarily broken.
    #Still doesn't work in every case. TODO?: try to load from scratch the plugin saved in QSettings if doesn't exist
    plugin = currentPlugin()
    updateAvailablePlugins()
    #if plugin not in plugins:
      #try:
        #loadPlugin(plugin)
        #startPlugin(plugin)
      #except:
        #pass
    #updateAvailablePlugins()

    plugins_list = sorted(plugins.keys())
    for plugin in plugins_list:
      self.comboPlugin.addItem(plugin)
    plugin = currentPlugin()
    if plugin in plugins:
      self.comboPlugin.setCurrentIndex(plugins_list.index(plugin))
  def __init__(self, parent):
    QDialog.__init__(self)
    self.iface = parent
    self.setupUi(self)
    self.plugins = plugins.keys()
    self.plugins.sort()
    #update the plugin list first! The plugin could be removed from the list if was temporarily broken.
    #Still doesn't work in every case. TODO?: try to load from scratch the plugin saved in QSettings if doesn't exist
    plugin = currentPlugin()
    updateAvailablePlugins()
    #if not plugins.has_key(plugin):
      #try:
        #loadPlugin(plugin)
        #startPlugin(plugin)
      #except:
        #pass
    #updateAvailablePlugins()

    for plugin in self.plugins:
      self.comboPlugin.addItem(plugin)
    plugin = currentPlugin()
    if plugins.has_key(plugin):
      self.comboPlugin.setCurrentIndex(self.plugins.index(plugin))
示例#6
0
    def run(self):
        """Run method that loads and starts the plugin"""

        if not self.pluginIsActive:
            self.pluginIsActive = True

            # print "** STARTING PluginCompiler"

            # dockwidget may not exist if:
            #    first run of plugin
            #    removed on close (see self.onClosePlugin method)
            if self.dockwidget is None:
                # Create the dockwidget (after translation) and keep reference
                self.dockwidget = PluginCompilerDockWidget()

            # connect to provide cleanup on closing of dockwidget
            self.dockwidget.closingPlugin.connect(self.onClosePlugin)

            # show the dockwidget
            # TODO: fix to allow choice of dock location
            self.iface.addDockWidget(Qt.RightDockWidgetArea, self.dockwidget)
            self.dockwidget.show()

            self.cmbPluginList = self.dockwidget.cmbPluginList
            self.twGraphFile = self.dockwidget.twGraphFile
            self.ckbQrc = self.dockwidget.ckbQrc
            self.ckbUi = self.dockwidget.ckbUi
            self.ckbResources = self.dockwidget.ckbResources
            self.ckbPro = self.dockwidget.ckbPro
            self.ckbQm = self.dockwidget.ckbQm
            self.ckbTs = self.dockwidget.ckbTs
            self.ckbFilter = self.dockwidget.ckbFilter
            self.mCmbLanguage = self.dockwidget.mCmbLanguage

            self.lblLang = self.dockwidget.lblLang

            process = self.dockwidget.btnExec
            process.clicked.connect(self.get_selected_leaves)

            self.ckbQrc.stateChanged.connect(self.current_plugin)
            self.ckbUi.stateChanged.connect(self.current_plugin)
            self.ckbResources.stateChanged.connect(self.current_plugin)
            self.ckbPro.stateChanged.connect(self.current_plugin)
            self.ckbQm.stateChanged.connect(self.current_plugin)
            self.ckbTs.stateChanged.connect(self.current_plugin)
            self.ckbFilter.stateChanged.connect(self.current_plugin)

            dict_trad = {
                "Allemand": "de",
                "Anglais": "en",
                "Espagnol": "es",
                "Français": "fr",
                "Italien": "it"
            }
            for langue, lg in dict_trad.items():
                self.mCmbLanguage.addItemWithCheckState(langue, False, lg)

            plugins_list = sorted(plugins.keys(), key=str.casefold)
            for plugin in plugins_list:
                try:
                    icon = QIcon(
                        plugin_installer.plugins.all()[plugin]['icon'])
                except KeyError:
                    icon = QIcon()
                self.cmbPluginList.addItem(icon, plugin)

            self.cmbPluginList.currentTextChanged.connect(self.current_plugin)
            self.current_plugin()