def load_ui(self):
        # Load page template
        load_ui_file(self, WIZARD_PAGE_SOURCE)

        # Setup tree widget overlay
        self.treeWidget_Src.info_overlay = InfoOverlay(self.treeWidget_Src)
        self.treeWidget_Src.overlay = Overlay(self.treeWidget_Src)
        self.treeWidget_Src.missing_ids = set()  # Dummy Attribute

        self.open_file_dialog = OpenPresetFile(self.app, None, self.ui,
                                               self.treeWidget_Src,
                                               self.openBtn)

        self.openBtn.pressed.connect(self.load_session_file)
        self.saveBtn.pressed.connect(self.save_session_user)
        self.reloadBtn.pressed.connect(self.load_session)

        self.parent.save_empty.connect(self.save_empty)
        self.parent.save_error.connect(self.save_error)

        # Setup filter text edit widget
        self.plainTextEditFilter.hide()

        # Show package filter as ; seperated string
        __filter_string = self.load_pkg_filter_string()

        self.plainTextEditFilter.setPlainText(__filter_string)
Ejemplo n.º 2
0
    def load_ui(self):
        # Load page template
        load_ui_file(self, WIZARD_PAGE_PRESET)

        # Set logo pixmap
        logo = QPixmap(Itemstyle.ICON_PATH['car'])
        logo = logo.scaled(96, 96, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
        self.setPixmap(QtWidgets.QWizard.LogoPixmap, logo)

        # Hide preset data column, stores package PR
        self.treeWidget_Preset.hideColumn(3)

        # Package and PR-options context menu
        self.treeWidget_Opt.context = WizardPresetSourceContext(self.treeWidget_Opt, self, self.parent)
        self.treeWidget_Pkg.context = WizardPresetSourceContext(self.treeWidget_Pkg, self, self.parent)

        # Preset tree context menu
        self.treeWidget_Preset.context = WizardPresetContextMenu(self.treeWidget_Preset, self, self.ui)
        self.treeWidget_Preset.item_order_changed.connect(self.update_used_pr_families)

        self.splitter.setSizes([400, 500])

        # Button labels
        self.setButtonText(QtWidgets.QWizard.BackButton, QobMsg.back_preset)
        self.setButtonText(QtWidgets.QWizard.NextButton, QobMsg.next_preset)

        # Back button label on first page
        if self.idx == 0:
            self.setButtonText(QtWidgets.QWizard.BackButton, QobMsg.back_first_preset)

        # Last preset page next label
        if self.parent.fakom_presets:
            if self.idx == len(self.parent.fakom_presets) - 1:
                self.setButtonText(QtWidgets.QWizard.NextButton, QobMsg.last_preset_next)
    def load_ui(self):
        load_ui_file(self, WIZARD_PAGE_RESULT)

        # Set logo pixmap
        logo = QPixmap(Itemstyle.ICON_PATH['qob_icon_sw'])
        logo = logo.scaled(96, 96, QtCore.Qt.KeepAspectRatio,
                           QtCore.Qt.SmoothTransformation)
        self.setPixmap(QtWidgets.QWizard.LogoPixmap, logo)

        self.setTitle(QobMsg.result_title)
        self.setSubTitle(QobMsg.result_sub)
        self.treeWidget_Result.info_overlay = InfoOverlay(
            self.treeWidget_Result)

        self.saveBtn.pressed.connect(self.save_session_user)
        self.parent.save_empty.connect(self.save_empty)
        self.parent.save_error.connect(self.save_error)
Ejemplo n.º 4
0
    def load_ui(self):
        load_ui_file(self, UI_FILE_PRESET_WIZARD)

        # Banner pixmap
        # banner = QPixmap(Itemstyle.ICON_PATH['banner'])
        # banner = banner.scaled(1600, 196, QtCore.Qt.IgnoreAspectRatio, QtCore.Qt.SmoothTransformation)
        # self.setPixmap(QtWidgets.QWizard.BannerPixmap, banner)

        # Set logo pixmap
        logo = QPixmap(Itemstyle.ICON_PATH['qob_icon_sw'])
        logo = logo.scaled(96, 96, QtCore.Qt.KeepAspectRatio,
                           QtCore.Qt.SmoothTransformation)
        self.setPixmap(QtWidgets.QWizard.LogoPixmap, logo)

        # Button labels
        self.setButtonText(QtWidgets.QWizard.NextButton, QobMsg.next_label)
        self.setButtonText(QtWidgets.QWizard.BackButton, QobMsg.back_label)
        self.setButtonText(QtWidgets.QWizard.FinishButton, QobMsg.finish_label)
        self.setButtonText(QtWidgets.QWizard.CancelButton, QobMsg.cancel_label)
    def __init__(self, parent):
        super(FakomWizardPage, self).__init__(parent)
        self.parent = parent
        self.selected_ids = set()
        self.ui, self.app = parent.ui, parent.app

        # Load page template
        load_ui_file(self, WIZARD_PAGE_FAKOM)

        self.setButtonText(QtWidgets.QWizard.BackButton, QobMsg.back_fakom)

        # Info Overlay
        self.fakomTree.info_overlay = InfoOverlay(self.fakomTree)
        self.treeWidget_Selected.info_overlay = InfoOverlay(
            self.treeWidget_Selected)

        # Add filter txt widgets as attribute
        self.fakomTree.filter_txt_widget = self.lineEditFilter
        # Connect text filter
        self.fakom_txt_filter = self.parent.TxtFiltering(
            self.parent.tree_filter_thread,
            self.fakomTree,
            column=[0],
            pattern=1)
        self.lineEditFilter.textChanged.connect(
            self.fakom_txt_filter.filter_txt)

        # Add Key events
        self.fakom_tree_keys = TreeKeyEvents(self.fakomTree,
                                             self.ui,
                                             self.app,
                                             wizard=True,
                                             no_edit=True)
        self.fakom_tree_keys.add_event_filter()

        # Selection context menu
        self.fakom_menu = SelectionContextMenu(self.fakomTree,
                                               self.ui,
                                               checkable=False)
        self.fakom_menu.all_deselected.connect(self.context_all_deselected)

        # Tree helpers
        self.iter_childs = iterate_item_childs(self.fakomTree)
        self.fakomTree.hideColumn(1)
        self.fakomTree.hideColumn(2)
        self.fakomTree.hideColumn(3)
        self.treeWidget_Selected.hideColumn(1)
        self.splitterSizes = self.treeSplitter.sizes()
        self.last_selection_size = 0

        # Selection update timer
        self.s_timer.timeout.connect(self.selection_changed)
        # Warning delay timer
        self.warn_display_delay.timeout.connect(self.warn_fakom)

        # Events
        self.fakomTree.itemSelectionChanged.connect(self.s_timer.start)
        self.treeWidget_Selected.itemClicked.connect(
            self.display_tree_item_clicked)
        self.checkBox_models.toggled.connect(self.list_by_model)
        self.checkBoxSort.toggled.connect(self.sort_btn_toggled)