Exemplo n.º 1
0
    def update_plugin_tabs(self):
        """ Updates what plugins are shown in the bottom tabs
        """
        for plugin_tab in self.plugin_tabs:
            plugin_tab.setParent(None)
        self.plugin_tabs.clear()

        if self.profile is None:
            return

        # get plugin instances for current profile from singleton
        plugins = (QaxPlugins.instance().get_profile_plugins(
            self.profile).plugins)

        for plugin in plugins:
            plugin_tab = PluginTab(parent_win=self,
                                   prj=self.prj,
                                   plugin=plugin)
            plugin_tab.plugin_changed.connect(self._on_plugin_changed)
            self.plugin_tabs.append(plugin_tab)
            icon_path = GuiSettings.icon_path(plugin.icon)
            if icon_path is not None:
                tab_index = self.tabs.addTab(plugin_tab,
                                             QtGui.QIcon(icon_path), "")
            else:
                tab_index = self.tabs.addTab(plugin_tab, plugin.name)
            self.tabs.setTabToolTip(tab_index, plugin.name)
Exemplo n.º 2
0
    def _update_file_list(self) -> NoReturn:
        self.file_list.clear()
        for selected_file in self.selected_files:
            file_item = QtWidgets.QListWidgetItem()
            file_item.setText(selected_file)
            file_item.setFont(GuiSettings.console_font())
            # file_item.setForeground(GuiSettings.console_fg_color())

            path = Path(selected_file)
            matching_file_type = self.file_group.matching_file_type(path)
            if ((matching_file_type is not None)
                    and (matching_file_type.icon is not None)):
                file_type_icon = QtGui.QIcon(
                    GuiSettings.icon_path(matching_file_type.icon))
                file_item.setIcon(file_type_icon)

            self.file_list.addItem(file_item)