def __init__(self, editor: PresetEditor, game: GameDescription):
        super().__init__(editor)
        self.setupUi(self)
        self.game_description = game
        self._during_batch_update = False

        self._row_widget_for_node = {}

        world_list = self.game_description.world_list

        nodes_by_world = collections.defaultdict(list)
        node_names = {}
        pickup_match = re.compile(r"Pickup \(([^\)]+)\)")

        for world in world_list.worlds:
            for is_dark_world in dark_world_flags(world):
                for area in world.areas:
                    if area.in_dark_aether != is_dark_world:
                        continue
                    for node in area.nodes:
                        if isinstance(node, PickupNode):
                            nodes_by_world[world.correct_name(
                                is_dark_world)].append(node)
                            match = pickup_match.match(node.name)
                            if match is not None:
                                node_name = match.group(1)
                            else:
                                node_name = node.name
                            node_names[
                                node] = f"{world_list.nodes_to_area(node).name} ({node_name})"

        for world_name in sorted(nodes_by_world.keys()):
            spoiler = Foldable(world_name)
            vbox_layout = QtWidgets.QVBoxLayout()

            first_node = True
            for node in sorted(nodes_by_world[world_name], key=node_names.get):
                if not first_node:
                    separator_line = QFrame()
                    separator_line.setFrameShape(QFrame.HLine)
                    separator_line.setFrameShadow(QFrame.Sunken)
                    transparent = QGraphicsOpacityEffect(separator_line)
                    transparent.setOpacity(0.33)
                    separator_line.setGraphicsEffect(transparent)
                    vbox_layout.addWidget(separator_line)
                else:
                    first_node = False

                row_widget = LocationPoolRowWidget(node, node_names[node])
                vbox_layout.addWidget(row_widget)
                row_widget.changed.connect(
                    functools.partial(self._on_location_changed, row_widget))
                self._row_widget_for_node[node] = row_widget

            spoiler.set_content_layout(vbox_layout)
            self.locations_scroll_area_layout.addWidget(spoiler)

        self.locations_scroll_area_layout.addItem(
            QSpacerItem(5, 5, QSizePolicy.Expanding, QSizePolicy.Expanding))
class Ui_IncomeSpendingReportWidget(object):
    def setupUi(self, IncomeSpendingReportWidget):
        if not IncomeSpendingReportWidget.objectName():
            IncomeSpendingReportWidget.setObjectName(
                u"IncomeSpendingReportWidget")
        IncomeSpendingReportWidget.resize(595, 347)
        self.verticalLayout = QVBoxLayout(IncomeSpendingReportWidget)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.ReportParamsFrame = QFrame(IncomeSpendingReportWidget)
        self.ReportParamsFrame.setObjectName(u"ReportParamsFrame")
        self.ReportParamsFrame.setFrameShape(QFrame.Panel)
        self.ReportParamsFrame.setFrameShadow(QFrame.Sunken)
        self.horizontalLayout = QHBoxLayout(self.ReportParamsFrame)
        self.horizontalLayout.setSpacing(6)
        self.horizontalLayout.setObjectName(u"horizontalLayout")
        self.horizontalLayout.setContentsMargins(2, 2, 2, 2)
        self.ReportRange = DateRangeSelector(self.ReportParamsFrame)
        self.ReportRange.setObjectName(u"ReportRange")
        self.ReportRange.setProperty("ItemsList",
                                     u"QTD;YTD;this_year;last_year")

        self.horizontalLayout.addWidget(self.ReportRange)

        self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding,
                                            QSizePolicy.Minimum)

        self.horizontalLayout.addItem(self.horizontalSpacer)

        self.verticalLayout.addWidget(self.ReportParamsFrame)

        self.ReportTreeView = QTreeView(IncomeSpendingReportWidget)
        self.ReportTreeView.setObjectName(u"ReportTreeView")
        self.ReportTreeView.setEditTriggers(QAbstractItemView.NoEditTriggers)
        self.ReportTreeView.setAlternatingRowColors(True)
        self.ReportTreeView.header().setStretchLastSection(False)

        self.verticalLayout.addWidget(self.ReportTreeView)

        self.retranslateUi(IncomeSpendingReportWidget)

        QMetaObject.connectSlotsByName(IncomeSpendingReportWidget)

    # setupUi

    def retranslateUi(self, IncomeSpendingReportWidget):
        IncomeSpendingReportWidget.setWindowTitle(
            QCoreApplication.translate("IncomeSpendingReportWidget",
                                       u"Income/Spending", None))
Beispiel #3
0
class Ui_Dialog(object):
    def setupUi(self, Dialog):
        if not Dialog.objectName():
            Dialog.setObjectName(u"Dialog")
        Dialog.resize(400, 120)
        Dialog.setMinimumSize(QSize(400, 120))
        Dialog.setMaximumSize(QSize(400, 120))
        self.verticalLayout = QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.verticalLayout.setContentsMargins(9, 9, 9, 9)
        self.bg_diag = QFrame(Dialog)
        self.bg_diag.setObjectName(u"bg_diag")
        self.bg_diag.setStyleSheet(u"background-color: rgb(29, 0, 86);\n"
                                   "border-radius: 10px;")
        self.bg_diag.setFrameShape(QFrame.NoFrame)
        self.bg_diag.setFrameShadow(QFrame.Raised)
        self.tittle_bar = QFrame(self.bg_diag)
        self.tittle_bar.setObjectName(u"tittle_bar")
        self.tittle_bar.setGeometry(QRect(10, 10, 361, 31))
        self.tittle_bar.setFrameShape(QFrame.StyledPanel)
        self.tittle_bar.setFrameShadow(QFrame.Raised)
        self.lbl_falhaLogar = QLabel(self.tittle_bar)
        self.lbl_falhaLogar.setObjectName(u"lbl_falhaLogar")
        self.lbl_falhaLogar.setGeometry(QRect(64, -9, 241, 41))
        self.lbl_falhaLogar.setStyleSheet(u"color: rgb(255, 255, 255);\n"
                                          "font: 18pt \"Segoe UI\";")
        self.pushButton = QPushButton(self.bg_diag)
        self.pushButton.setObjectName(u"pushButton")
        self.pushButton.setGeometry(QRect(161, 60, 61, 31))
        self.pushButton.setStyleSheet(u"background-color: rgb(53, 159, 159);\n"
                                      "color: rgb(255, 255, 255);\n"
                                      "font: 18pt \"Segoe UI\";\n"
                                      "")

        self.verticalLayout.addWidget(self.bg_diag)

        self.retranslateUi(Dialog)

        QMetaObject.connectSlotsByName(Dialog)

    # setupUi

    def retranslateUi(self, Dialog):
        Dialog.setWindowTitle(
            QCoreApplication.translate("Dialog", u"Dialog", None))
        self.lbl_falhaLogar.setText(
            QCoreApplication.translate("Dialog",
                                       u"Falha ao logar usu\u00e1rio", None))
        self.pushButton.setText(
            QCoreApplication.translate("Dialog", u"Ok", None))
Beispiel #4
0
class Ui_FindAndReplaceDlg(object):
    def setupUi(self, FindAndReplaceDlg):
        if not FindAndReplaceDlg.objectName():
            FindAndReplaceDlg.setObjectName(u"FindAndReplaceDlg")
        FindAndReplaceDlg.resize(355, 274)
        self.hboxLayout = QHBoxLayout(FindAndReplaceDlg)
        # ifndef Q_OS_MAC
        self.hboxLayout.setSpacing(6)
        # endif
        # ifndef Q_OS_MAC
        self.hboxLayout.setContentsMargins(9, 9, 9, 9)
        # endif
        self.hboxLayout.setObjectName(u"hboxLayout")
        self.vboxLayout = QVBoxLayout()
        # ifndef Q_OS_MAC
        self.vboxLayout.setSpacing(6)
        # endif
        # ifndef Q_OS_MAC
        self.vboxLayout.setContentsMargins(0, 0, 0, 0)
        # endif
        self.vboxLayout.setObjectName(u"vboxLayout")
        self.gridLayout = QGridLayout()
        # ifndef Q_OS_MAC
        self.gridLayout.setSpacing(6)
        # endif
        # ifndef Q_OS_MAC
        self.gridLayout.setContentsMargins(0, 0, 0, 0)
        # endif
        self.gridLayout.setObjectName(u"gridLayout")
        self.replaceLineEdit = QLineEdit(FindAndReplaceDlg)
        self.replaceLineEdit.setObjectName(u"replaceLineEdit")

        self.gridLayout.addWidget(self.replaceLineEdit, 1, 1, 1, 1)

        self.findLineEdit = QLineEdit(FindAndReplaceDlg)
        self.findLineEdit.setObjectName(u"findLineEdit")

        self.gridLayout.addWidget(self.findLineEdit, 0, 1, 1, 1)

        self.label_2 = QLabel(FindAndReplaceDlg)
        self.label_2.setObjectName(u"label_2")

        self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)

        self.label = QLabel(FindAndReplaceDlg)
        self.label.setObjectName(u"label")

        self.gridLayout.addWidget(self.label, 0, 0, 1, 1)

        self.vboxLayout.addLayout(self.gridLayout)

        self.vboxLayout1 = QVBoxLayout()
        # ifndef Q_OS_MAC
        self.vboxLayout1.setSpacing(6)
        # endif
        self.vboxLayout1.setContentsMargins(0, 0, 0, 0)
        self.vboxLayout1.setObjectName(u"vboxLayout1")
        self.caseCheckBox = QCheckBox(FindAndReplaceDlg)
        self.caseCheckBox.setObjectName(u"caseCheckBox")

        self.vboxLayout1.addWidget(self.caseCheckBox)

        self.wholeCheckBox = QCheckBox(FindAndReplaceDlg)
        self.wholeCheckBox.setObjectName(u"wholeCheckBox")
        self.wholeCheckBox.setChecked(True)

        self.vboxLayout1.addWidget(self.wholeCheckBox)

        self.vboxLayout.addLayout(self.vboxLayout1)

        self.spacerItem = QSpacerItem(231, 16, QSizePolicy.Minimum,
                                      QSizePolicy.Expanding)

        self.vboxLayout.addItem(self.spacerItem)

        self.moreFrame = QFrame(FindAndReplaceDlg)
        self.moreFrame.setObjectName(u"moreFrame")
        self.moreFrame.setFrameShape(QFrame.StyledPanel)
        self.moreFrame.setFrameShadow(QFrame.Raised)
        self.vboxLayout2 = QVBoxLayout(self.moreFrame)
        # ifndef Q_OS_MAC
        self.vboxLayout2.setSpacing(6)
        # endif
        # ifndef Q_OS_MAC
        self.vboxLayout2.setContentsMargins(9, 9, 9, 9)
        # endif
        self.vboxLayout2.setObjectName(u"vboxLayout2")
        self.backwardsCheckBox = QCheckBox(self.moreFrame)
        self.backwardsCheckBox.setObjectName(u"backwardsCheckBox")

        self.vboxLayout2.addWidget(self.backwardsCheckBox)

        self.regexCheckBox = QCheckBox(self.moreFrame)
        self.regexCheckBox.setObjectName(u"regexCheckBox")

        self.vboxLayout2.addWidget(self.regexCheckBox)

        self.ignoreNotesCheckBox = QCheckBox(self.moreFrame)
        self.ignoreNotesCheckBox.setObjectName(u"ignoreNotesCheckBox")

        self.vboxLayout2.addWidget(self.ignoreNotesCheckBox)

        self.vboxLayout.addWidget(self.moreFrame)

        self.hboxLayout.addLayout(self.vboxLayout)

        self.line = QFrame(FindAndReplaceDlg)
        self.line.setObjectName(u"line")
        self.line.setFrameShape(QFrame.VLine)
        self.line.setFrameShadow(QFrame.Sunken)

        self.hboxLayout.addWidget(self.line)

        self.vboxLayout3 = QVBoxLayout()
        # ifndef Q_OS_MAC
        self.vboxLayout3.setSpacing(6)
        # endif
        self.vboxLayout3.setContentsMargins(0, 0, 0, 0)
        self.vboxLayout3.setObjectName(u"vboxLayout3")
        self.findButton = QPushButton(FindAndReplaceDlg)
        self.findButton.setObjectName(u"findButton")
        self.findButton.setFocusPolicy(Qt.NoFocus)

        self.vboxLayout3.addWidget(self.findButton)

        self.replaceButton = QPushButton(FindAndReplaceDlg)
        self.replaceButton.setObjectName(u"replaceButton")
        self.replaceButton.setFocusPolicy(Qt.NoFocus)

        self.vboxLayout3.addWidget(self.replaceButton)

        self.closeButton = QPushButton(FindAndReplaceDlg)
        self.closeButton.setObjectName(u"closeButton")
        self.closeButton.setFocusPolicy(Qt.NoFocus)

        self.vboxLayout3.addWidget(self.closeButton)

        self.moreButton = QPushButton(FindAndReplaceDlg)
        self.moreButton.setObjectName(u"moreButton")
        self.moreButton.setFocusPolicy(Qt.NoFocus)
        self.moreButton.setCheckable(True)

        self.vboxLayout3.addWidget(self.moreButton)

        self.spacerItem1 = QSpacerItem(21, 16, QSizePolicy.Minimum,
                                       QSizePolicy.Expanding)

        self.vboxLayout3.addItem(self.spacerItem1)

        self.hboxLayout.addLayout(self.vboxLayout3)

        # if QT_CONFIG(shortcut)
        self.label_2.setBuddy(self.replaceLineEdit)
        self.label.setBuddy(self.findLineEdit)
        # endif // QT_CONFIG(shortcut)
        QWidget.setTabOrder(self.findLineEdit, self.replaceLineEdit)
        QWidget.setTabOrder(self.replaceLineEdit, self.caseCheckBox)
        QWidget.setTabOrder(self.caseCheckBox, self.wholeCheckBox)
        QWidget.setTabOrder(self.wholeCheckBox, self.backwardsCheckBox)
        QWidget.setTabOrder(self.backwardsCheckBox, self.regexCheckBox)
        QWidget.setTabOrder(self.regexCheckBox, self.ignoreNotesCheckBox)

        self.retranslateUi(FindAndReplaceDlg)
        self.closeButton.clicked.connect(FindAndReplaceDlg.reject)
        self.moreButton.toggled.connect(self.moreFrame.setVisible)

        QMetaObject.connectSlotsByName(FindAndReplaceDlg)

    # setupUi

    def retranslateUi(self, FindAndReplaceDlg):
        FindAndReplaceDlg.setWindowTitle(
            QCoreApplication.translate("FindAndReplaceDlg",
                                       u"Find and Replace", None))
        self.label_2.setText(
            QCoreApplication.translate("FindAndReplaceDlg", u"Replace w&ith:",
                                       None))
        self.label.setText(
            QCoreApplication.translate("FindAndReplaceDlg", u"Find &what:",
                                       None))
        self.caseCheckBox.setText(
            QCoreApplication.translate("FindAndReplaceDlg", u"&Case sensitive",
                                       None))
        self.wholeCheckBox.setText(
            QCoreApplication.translate("FindAndReplaceDlg", u"Wh&ole words",
                                       None))
        self.backwardsCheckBox.setText(
            QCoreApplication.translate("FindAndReplaceDlg",
                                       u"Search &Backwards", None))
        self.regexCheckBox.setText(
            QCoreApplication.translate("FindAndReplaceDlg",
                                       u"Regular E&xpression", None))
        self.ignoreNotesCheckBox.setText(
            QCoreApplication.translate("FindAndReplaceDlg",
                                       u"Ignore foot&notes and endnotes",
                                       None))
        self.findButton.setText(
            QCoreApplication.translate("FindAndReplaceDlg", u"&Find", None))
        self.replaceButton.setText(
            QCoreApplication.translate("FindAndReplaceDlg", u"&Replace", None))
        self.closeButton.setText(
            QCoreApplication.translate("FindAndReplaceDlg", u"Close", None))
        self.moreButton.setText(
            QCoreApplication.translate("FindAndReplaceDlg", u"&More", None))
Beispiel #5
0
class Ui_TimeRemap_UI(object):
    def setupUi(self, TimeRemap_UI):
        if not TimeRemap_UI.objectName():
            TimeRemap_UI.setObjectName(u"TimeRemap_UI")
        TimeRemap_UI.resize(398, 379)
        self.gridLayout_2 = QGridLayout(TimeRemap_UI)
        self.gridLayout_2.setSpacing(0)
        self.gridLayout_2.setObjectName(u"gridLayout_2")
        self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
        self.warningMessage = KMessageWidget(TimeRemap_UI)
        self.warningMessage.setObjectName(u"warningMessage")
        self.warningMessage.setWordWrap(True)
        self.warningMessage.setCloseButtonVisible(False)
        self.warningMessage.setMessageType(KMessageWidget.Warning)

        self.gridLayout_2.addWidget(self.warningMessage, 0, 0, 1, 1)

        self.remap_box = QFrame(TimeRemap_UI)
        self.remap_box.setObjectName(u"remap_box")
        self.remap_box.setFrameShape(QFrame.NoFrame)
        self.remap_box.setFrameShadow(QFrame.Plain)
        self.gridLayout = QGridLayout(self.remap_box)
        self.gridLayout.setSpacing(0)
        self.gridLayout.setObjectName(u"gridLayout")
        self.gridLayout.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_6 = QHBoxLayout()
        self.horizontalLayout_6.setObjectName(u"horizontalLayout_6")
        self.label_6 = QLabel(self.remap_box)
        self.label_6.setObjectName(u"label_6")

        self.horizontalLayout_6.addWidget(self.label_6)

        self.button_center_top = QToolButton(self.remap_box)
        self.button_center_top.setObjectName(u"button_center_top")
        icon = QIcon()
        iconThemeName = u"align-horizontal-center"
        if QIcon.hasThemeIcon(iconThemeName):
            icon = QIcon.fromTheme(iconThemeName)
        else:
            icon.addFile(u".", QSize(), QIcon.Normal, QIcon.Off)

        self.button_center_top.setIcon(icon)
        self.button_center_top.setAutoRaise(True)

        self.horizontalLayout_6.addWidget(self.button_center_top)

        self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding,
                                            QSizePolicy.Minimum)

        self.horizontalLayout_6.addItem(self.horizontalSpacer)

        self.horizontalSpacer1 = QSpacerItem(40, 20, QSizePolicy.Expanding,
                                             QSizePolicy.Minimum)

        self.horizontalLayout_6.addItem(self.horizontalSpacer1)

        self.gridLayout.addLayout(self.horizontalLayout_6, 0, 0, 1, 1)

        self.remapLayout = QVBoxLayout()
        self.remapLayout.setObjectName(u"remapLayout")

        self.gridLayout.addLayout(self.remapLayout, 1, 0, 1, 1)

        self.horizontalLayout_7 = QHBoxLayout()
        self.horizontalLayout_7.setObjectName(u"horizontalLayout_7")
        self.label_5 = QLabel(self.remap_box)
        self.label_5.setObjectName(u"label_5")

        self.horizontalLayout_7.addWidget(self.label_5)

        self.button_center = QToolButton(self.remap_box)
        self.button_center.setObjectName(u"button_center")
        self.button_center.setIcon(icon)
        self.button_center.setAutoRaise(True)

        self.horizontalLayout_7.addWidget(self.button_center)

        self.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Expanding,
                                              QSizePolicy.Minimum)

        self.horizontalLayout_7.addItem(self.horizontalSpacer_2)

        self.gridLayout.addLayout(self.horizontalLayout_7, 2, 0, 1, 1)

        self.horizontalLayout_8 = QHBoxLayout()
        self.horizontalLayout_8.setObjectName(u"horizontalLayout_8")
        self.button_prev = QToolButton(self.remap_box)
        self.button_prev.setObjectName(u"button_prev")
        self.button_prev.setAutoRaise(True)

        self.horizontalLayout_8.addWidget(self.button_prev)

        self.button_add = QToolButton(self.remap_box)
        self.button_add.setObjectName(u"button_add")
        self.button_add.setAutoRaise(True)

        self.horizontalLayout_8.addWidget(self.button_add)

        self.button_next = QToolButton(self.remap_box)
        self.button_next.setObjectName(u"button_next")
        self.button_next.setAutoRaise(True)

        self.horizontalLayout_8.addWidget(self.button_next)

        self.horizontalSpacer_3 = QSpacerItem(28, 20, QSizePolicy.Expanding,
                                              QSizePolicy.Minimum)

        self.horizontalLayout_8.addItem(self.horizontalSpacer_3)

        self.gridLayout.addLayout(self.horizontalLayout_8, 3, 0, 1, 1)

        self.info_frame = QFrame(self.remap_box)
        self.info_frame.setObjectName(u"info_frame")
        self.info_frame.setFrameShape(QFrame.NoFrame)
        self.info_frame.setFrameShadow(QFrame.Raised)
        self.verticalLayout_2 = QVBoxLayout(self.info_frame)
        self.verticalLayout_2.setSpacing(0)
        self.verticalLayout_2.setObjectName(u"verticalLayout_2")
        self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_9 = QHBoxLayout()
        self.horizontalLayout_9.setObjectName(u"horizontalLayout_9")
        self.label_7 = QLabel(self.info_frame)
        self.label_7.setObjectName(u"label_7")

        self.horizontalLayout_9.addWidget(self.label_7)

        self.inLayout = QHBoxLayout()
        self.inLayout.setObjectName(u"inLayout")

        self.horizontalLayout_9.addLayout(self.inLayout)

        self.verticalLayout_2.addLayout(self.horizontalLayout_9)

        self.horizontalLayout_10 = QHBoxLayout()
        self.horizontalLayout_10.setObjectName(u"horizontalLayout_10")
        self.label_8 = QLabel(self.info_frame)
        self.label_8.setObjectName(u"label_8")

        self.horizontalLayout_10.addWidget(self.label_8)

        self.outLayout = QHBoxLayout()
        self.outLayout.setObjectName(u"outLayout")

        self.horizontalLayout_10.addLayout(self.outLayout)

        self.verticalLayout_2.addLayout(self.horizontalLayout_10)

        self.horizontalLayout_11 = QHBoxLayout()
        self.horizontalLayout_11.setObjectName(u"horizontalLayout_11")
        self.label_9 = QLabel(self.info_frame)
        self.label_9.setObjectName(u"label_9")

        self.horizontalLayout_11.addWidget(self.label_9)

        self.speedBefore = QDoubleSpinBox(self.info_frame)
        self.speedBefore.setObjectName(u"speedBefore")
        self.speedBefore.setMinimum(-100000.000000000000000)
        self.speedBefore.setMaximum(100000.000000000000000)
        self.speedBefore.setValue(100.000000000000000)

        self.horizontalLayout_11.addWidget(self.speedBefore)

        self.verticalLayout_2.addLayout(self.horizontalLayout_11)

        self.horizontalLayout_12 = QHBoxLayout()
        self.horizontalLayout_12.setObjectName(u"horizontalLayout_12")
        self.label_10 = QLabel(self.info_frame)
        self.label_10.setObjectName(u"label_10")

        self.horizontalLayout_12.addWidget(self.label_10)

        self.speedAfter = QDoubleSpinBox(self.info_frame)
        self.speedAfter.setObjectName(u"speedAfter")
        self.speedAfter.setMinimum(-100000.000000000000000)
        self.speedAfter.setMaximum(100000.000000000000000)
        self.speedAfter.setValue(100.000000000000000)

        self.horizontalLayout_12.addWidget(self.speedAfter)

        self.verticalLayout_2.addLayout(self.horizontalLayout_12)

        self.gridLayout.addWidget(self.info_frame, 4, 0, 1, 1)

        self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum,
                                          QSizePolicy.Expanding)

        self.gridLayout.addItem(self.verticalSpacer, 5, 0, 1, 1)

        self.horizontalLayout_13 = QHBoxLayout()
        self.horizontalLayout_13.setObjectName(u"horizontalLayout_13")
        self.pitch_compensate = QCheckBox(self.remap_box)
        self.pitch_compensate.setObjectName(u"pitch_compensate")
        self.pitch_compensate.setChecked(True)
        self.pitch_compensate.setTristate(False)

        self.horizontalLayout_13.addWidget(self.pitch_compensate)

        self.frame_blending = QCheckBox(self.remap_box)
        self.frame_blending.setObjectName(u"frame_blending")

        self.horizontalLayout_13.addWidget(self.frame_blending)

        self.gridLayout.addLayout(self.horizontalLayout_13, 6, 0, 1, 1)

        self.horizontalLayout_14 = QHBoxLayout()
        self.horizontalLayout_14.setObjectName(u"horizontalLayout_14")
        self.move_next = QCheckBox(self.remap_box)
        self.move_next.setObjectName(u"move_next")
        self.move_next.setChecked(True)

        self.horizontalLayout_14.addWidget(self.move_next)

        self.button_del = QToolButton(self.remap_box)
        self.button_del.setObjectName(u"button_del")
        icon1 = QIcon()
        iconThemeName = u"edit-delete"
        if QIcon.hasThemeIcon(iconThemeName):
            icon1 = QIcon.fromTheme(iconThemeName)
        else:
            icon1.addFile(u".", QSize(), QIcon.Normal, QIcon.Off)

        self.button_del.setIcon(icon1)

        self.horizontalLayout_14.addWidget(self.button_del)

        self.gridLayout.addLayout(self.horizontalLayout_14, 7, 0, 1, 1)

        self.gridLayout_2.addWidget(self.remap_box, 1, 0, 1, 1)

        self.retranslateUi(TimeRemap_UI)

        QMetaObject.connectSlotsByName(TimeRemap_UI)

    # setupUi

    def retranslateUi(self, TimeRemap_UI):
        TimeRemap_UI.setWindowTitle(
            QCoreApplication.translate("TimeRemap_UI", u"Form", None))
        self.label_6.setText(
            QCoreApplication.translate("TimeRemap_UI", u"Source clip", None))
        self.button_center_top.setText(
            QCoreApplication.translate("TimeRemap_UI", u"...", None))
        self.label_5.setText(
            QCoreApplication.translate("TimeRemap_UI", u"Output", None))
        self.button_center.setText(
            QCoreApplication.translate("TimeRemap_UI", u"...", None))
        self.button_prev.setText(
            QCoreApplication.translate("TimeRemap_UI", u"...", None))
        self.button_add.setText(
            QCoreApplication.translate("TimeRemap_UI", u"...", None))
        self.button_next.setText(
            QCoreApplication.translate("TimeRemap_UI", u"...", None))
        self.label_7.setText(
            QCoreApplication.translate("TimeRemap_UI", u"Source time", None))
        self.label_8.setText(
            QCoreApplication.translate("TimeRemap_UI", u"Output time", None))
        self.label_9.setText(
            QCoreApplication.translate("TimeRemap_UI", u"Speed before", None))
        self.label_10.setText(
            QCoreApplication.translate("TimeRemap_UI", u"After", None))
        self.pitch_compensate.setText(
            QCoreApplication.translate("TimeRemap_UI", u"Pitch compensation",
                                       None))
        self.frame_blending.setText(
            QCoreApplication.translate("TimeRemap_UI", u"Frame blending",
                                       None))
        self.move_next.setText(
            QCoreApplication.translate("TimeRemap_UI",
                                       u"Preserve speed of next keyframes",
                                       None))
        self.button_del.setText(
            QCoreApplication.translate("TimeRemap_UI", u"...", None))
Beispiel #6
0
class Setting_Ui(QWidget):
    def __init__(self, persepolis_setting):
        super().__init__()
        icon = QIcon()

        self.persepolis_setting = persepolis_setting

        # add support for other languages
        locale = str(self.persepolis_setting.value('settings/locale'))
        QLocale.setDefault(QLocale(locale))
        self.translator = QTranslator()
        if self.translator.load(':/translations/locales/ui_' + locale, 'ts'):
            QCoreApplication.installTranslator(self.translator)

        self.setWindowIcon(
            QIcon.fromTheme('persepolis', QIcon(':/persepolis.svg')))
        self.setWindowTitle(
            QCoreApplication.translate("setting_ui_tr", 'Preferences'))

        # set ui direction
        ui_direction = self.persepolis_setting.value('ui_direction')

        if ui_direction == 'rtl':
            self.setLayoutDirection(Qt.RightToLeft)

        elif ui_direction in 'ltr':
            self.setLayoutDirection(Qt.LeftToRight)

        global icons
        icons = ':/' + str(
            self.persepolis_setting.value('settings/icons')) + '/'

        # main layout
        window_verticalLayout = QVBoxLayout(self)

        # setting_tabWidget
        self.setting_tabWidget = QTabWidget(self)

        # download_options_tab
        self.download_options_tab = QWidget()
        download_options_tab_verticalLayout = QVBoxLayout(
            self.download_options_tab)
        download_options_tab_verticalLayout.setContentsMargins(21, 21, 0, 0)

        # tries
        tries_horizontalLayout = QHBoxLayout()

        self.tries_label = QLabel(self.download_options_tab)
        tries_horizontalLayout.addWidget(self.tries_label)

        self.tries_spinBox = QSpinBox(self.download_options_tab)
        self.tries_spinBox.setMinimum(1)

        tries_horizontalLayout.addWidget(self.tries_spinBox)
        download_options_tab_verticalLayout.addLayout(tries_horizontalLayout)

        # wait
        wait_horizontalLayout = QHBoxLayout()

        self.wait_label = QLabel(self.download_options_tab)
        wait_horizontalLayout.addWidget(self.wait_label)

        self.wait_spinBox = QSpinBox(self.download_options_tab)
        wait_horizontalLayout.addWidget(self.wait_spinBox)

        download_options_tab_verticalLayout.addLayout(wait_horizontalLayout)

        # time_out
        time_out_horizontalLayout = QHBoxLayout()

        self.time_out_label = QLabel(self.download_options_tab)
        time_out_horizontalLayout.addWidget(self.time_out_label)

        self.time_out_spinBox = QSpinBox(self.download_options_tab)
        time_out_horizontalLayout.addWidget(self.time_out_spinBox)

        download_options_tab_verticalLayout.addLayout(
            time_out_horizontalLayout)

        # connections
        connections_horizontalLayout = QHBoxLayout()

        self.connections_label = QLabel(self.download_options_tab)
        connections_horizontalLayout.addWidget(self.connections_label)

        self.connections_spinBox = QSpinBox(self.download_options_tab)
        self.connections_spinBox.setMinimum(1)
        self.connections_spinBox.setMaximum(16)
        connections_horizontalLayout.addWidget(self.connections_spinBox)

        download_options_tab_verticalLayout.addLayout(
            connections_horizontalLayout)

        # rpc_port
        self.rpc_port_label = QLabel(self.download_options_tab)
        self.rpc_horizontalLayout = QHBoxLayout()
        self.rpc_horizontalLayout.addWidget(self.rpc_port_label)

        self.rpc_port_spinbox = QSpinBox(self.download_options_tab)
        self.rpc_port_spinbox.setMinimum(1024)
        self.rpc_port_spinbox.setMaximum(65535)
        self.rpc_horizontalLayout.addWidget(self.rpc_port_spinbox)

        download_options_tab_verticalLayout.addLayout(
            self.rpc_horizontalLayout)

        # wait_queue
        wait_queue_horizontalLayout = QHBoxLayout()

        self.wait_queue_label = QLabel(self.download_options_tab)
        wait_queue_horizontalLayout.addWidget(self.wait_queue_label)

        self.wait_queue_time = MyQDateTimeEdit(self.download_options_tab)
        self.wait_queue_time.setDisplayFormat('H:mm')
        wait_queue_horizontalLayout.addWidget(self.wait_queue_time)

        download_options_tab_verticalLayout.addLayout(
            wait_queue_horizontalLayout)

        # don't check certificate checkBox
        self.dont_check_certificate_checkBox = QCheckBox(
            self.download_options_tab)
        download_options_tab_verticalLayout.addWidget(
            self.dont_check_certificate_checkBox)

        # change aria2 path
        aria2_path_verticalLayout = QVBoxLayout()

        self.aria2_path_checkBox = QCheckBox(self.download_options_tab)
        aria2_path_verticalLayout.addWidget(self.aria2_path_checkBox)

        aria2_path_horizontalLayout = QHBoxLayout()

        self.aria2_path_lineEdit = QLineEdit(self.download_options_tab)
        aria2_path_horizontalLayout.addWidget(self.aria2_path_lineEdit)

        self.aria2_path_pushButton = QPushButton(self.download_options_tab)
        aria2_path_horizontalLayout.addWidget(self.aria2_path_pushButton)

        aria2_path_verticalLayout.addLayout(aria2_path_horizontalLayout)

        download_options_tab_verticalLayout.addLayout(
            aria2_path_verticalLayout)

        download_options_tab_verticalLayout.addStretch(1)

        self.setting_tabWidget.addTab(self.download_options_tab, "")

        # save_as_tab
        self.save_as_tab = QWidget()

        save_as_tab_verticalLayout = QVBoxLayout(self.save_as_tab)
        save_as_tab_verticalLayout.setContentsMargins(20, 30, 0, 0)

        # download_folder
        self.download_folder_horizontalLayout = QHBoxLayout()

        self.download_folder_label = QLabel(self.save_as_tab)
        self.download_folder_horizontalLayout.addWidget(
            self.download_folder_label)

        self.download_folder_lineEdit = QLineEdit(self.save_as_tab)
        self.download_folder_horizontalLayout.addWidget(
            self.download_folder_lineEdit)

        self.download_folder_pushButton = QPushButton(self.save_as_tab)
        self.download_folder_horizontalLayout.addWidget(
            self.download_folder_pushButton)

        save_as_tab_verticalLayout.addLayout(
            self.download_folder_horizontalLayout)

        # temp_download_folder
        self.temp_horizontalLayout = QHBoxLayout()

        self.temp_download_label = QLabel(self.save_as_tab)
        self.temp_horizontalLayout.addWidget(self.temp_download_label)

        self.temp_download_lineEdit = QLineEdit(self.save_as_tab)
        self.temp_horizontalLayout.addWidget(self.temp_download_lineEdit)

        self.temp_download_pushButton = QPushButton(self.save_as_tab)
        self.temp_horizontalLayout.addWidget(self.temp_download_pushButton)

        save_as_tab_verticalLayout.addLayout(self.temp_horizontalLayout)

        # create subfolder
        self.subfolder_checkBox = QCheckBox(self.save_as_tab)
        save_as_tab_verticalLayout.addWidget(self.subfolder_checkBox)

        save_as_tab_verticalLayout.addStretch(1)

        self.setting_tabWidget.addTab(self.save_as_tab, "")

        # notifications_tab
        self.notifications_tab = QWidget()
        notification_tab_verticalLayout = QVBoxLayout(self.notifications_tab)
        notification_tab_verticalLayout.setContentsMargins(21, 21, 0, 0)

        self.enable_notifications_checkBox = QCheckBox(self.notifications_tab)
        notification_tab_verticalLayout.addWidget(
            self.enable_notifications_checkBox)

        self.sound_frame = QFrame(self.notifications_tab)
        self.sound_frame.setFrameShape(QFrame.StyledPanel)
        self.sound_frame.setFrameShadow(QFrame.Raised)

        verticalLayout = QVBoxLayout(self.sound_frame)

        self.volume_label = QLabel(self.sound_frame)
        verticalLayout.addWidget(self.volume_label)

        self.volume_dial = QDial(self.sound_frame)
        self.volume_dial.setProperty("value", 100)
        verticalLayout.addWidget(self.volume_dial)

        notification_tab_verticalLayout.addWidget(self.sound_frame)

        # message_notification
        message_notification_horizontalLayout = QHBoxLayout()
        self.notification_label = QLabel(self.notifications_tab)
        message_notification_horizontalLayout.addWidget(
            self.notification_label)

        self.notification_comboBox = QComboBox(self.notifications_tab)
        message_notification_horizontalLayout.addWidget(
            self.notification_comboBox)
        notification_tab_verticalLayout.addLayout(
            message_notification_horizontalLayout)

        notification_tab_verticalLayout.addStretch(1)

        self.setting_tabWidget.addTab(self.notifications_tab, "")

        # style_tab
        self.style_tab = QWidget()
        style_tab_verticalLayout = QVBoxLayout(self.style_tab)
        style_tab_verticalLayout.setContentsMargins(21, 21, 0, 0)

        # style
        style_horizontalLayout = QHBoxLayout()

        self.style_label = QLabel(self.style_tab)
        style_horizontalLayout.addWidget(self.style_label)

        self.style_comboBox = QComboBox(self.style_tab)
        style_horizontalLayout.addWidget(self.style_comboBox)

        style_tab_verticalLayout.addLayout(style_horizontalLayout)

        # language
        language_horizontalLayout = QHBoxLayout()

        self.lang_label = QLabel(self.style_tab)
        language_horizontalLayout.addWidget(self.lang_label)
        self.lang_comboBox = QComboBox(self.style_tab)
        language_horizontalLayout.addWidget(self.lang_comboBox)

        style_tab_verticalLayout.addLayout(language_horizontalLayout)
        language_horizontalLayout = QHBoxLayout()
        self.lang_label.setText(
            QCoreApplication.translate("setting_ui_tr", "Language: "))

        # color scheme
        self.color_label = QLabel(self.style_tab)
        language_horizontalLayout.addWidget(self.color_label)

        self.color_comboBox = QComboBox(self.style_tab)
        language_horizontalLayout.addWidget(self.color_comboBox)

        style_tab_verticalLayout.addLayout(language_horizontalLayout)

        # icons
        icons_horizontalLayout = QHBoxLayout()
        self.icon_label = QLabel(self.style_tab)
        icons_horizontalLayout.addWidget(self.icon_label)

        self.icon_comboBox = QComboBox(self.style_tab)
        icons_horizontalLayout.addWidget(self.icon_comboBox)

        style_tab_verticalLayout.addLayout(icons_horizontalLayout)

        self.icons_size_horizontalLayout = QHBoxLayout()
        self.icons_size_label = QLabel(self.style_tab)
        self.icons_size_horizontalLayout.addWidget(self.icons_size_label)

        self.icons_size_comboBox = QComboBox(self.style_tab)
        self.icons_size_horizontalLayout.addWidget(self.icons_size_comboBox)

        style_tab_verticalLayout.addLayout(self.icons_size_horizontalLayout)

        # font
        font_horizontalLayout = QHBoxLayout()
        self.font_checkBox = QCheckBox(self.style_tab)
        font_horizontalLayout.addWidget(self.font_checkBox)

        self.fontComboBox = QFontComboBox(self.style_tab)
        font_horizontalLayout.addWidget(self.fontComboBox)

        self.font_size_label = QLabel(self.style_tab)
        font_horizontalLayout.addWidget(self.font_size_label)

        self.font_size_spinBox = QSpinBox(self.style_tab)
        self.font_size_spinBox.setMinimum(1)
        font_horizontalLayout.addWidget(self.font_size_spinBox)

        style_tab_verticalLayout.addLayout(font_horizontalLayout)
        self.setting_tabWidget.addTab(self.style_tab, "")
        window_verticalLayout.addWidget(self.setting_tabWidget)

        # start persepolis in system tray if browser executed
        self.start_persepolis_if_browser_executed_checkBox = QCheckBox(
            self.style_tab)
        style_tab_verticalLayout.addWidget(
            self.start_persepolis_if_browser_executed_checkBox)

        # hide window if close button clicked
        self.hide_window_checkBox = QCheckBox(self.style_tab)
        style_tab_verticalLayout.addWidget(self.hide_window_checkBox)

        # Enable system tray icon
        self.enable_system_tray_checkBox = QCheckBox(self.style_tab)
        style_tab_verticalLayout.addWidget(self.enable_system_tray_checkBox)

        # after_download dialog
        self.after_download_checkBox = QCheckBox()
        style_tab_verticalLayout.addWidget(self.after_download_checkBox)

        # show_menubar_checkbox
        self.show_menubar_checkbox = QCheckBox()
        style_tab_verticalLayout.addWidget(self.show_menubar_checkbox)

        # show_sidepanel_checkbox
        self.show_sidepanel_checkbox = QCheckBox()
        style_tab_verticalLayout.addWidget(self.show_sidepanel_checkbox)

        # hide progress window
        self.show_progress_window_checkbox = QCheckBox()
        style_tab_verticalLayout.addWidget(self.show_progress_window_checkbox)

        # add persepolis to startup
        self.startup_checkbox = QCheckBox()
        style_tab_verticalLayout.addWidget(self.startup_checkbox)

        # keep system awake
        self.keep_awake_checkBox = QCheckBox()
        style_tab_verticalLayout.addWidget(self.keep_awake_checkBox)

        style_tab_verticalLayout.addStretch(1)

        # columns_tab
        self.columns_tab = QWidget()

        columns_tab_verticalLayout = QVBoxLayout(self.columns_tab)
        columns_tab_verticalLayout.setContentsMargins(21, 21, 0, 0)

        # creating checkBox for columns
        self.show_column_label = QLabel()
        self.column0_checkBox = QCheckBox()
        self.column1_checkBox = QCheckBox()
        self.column2_checkBox = QCheckBox()
        self.column3_checkBox = QCheckBox()
        self.column4_checkBox = QCheckBox()
        self.column5_checkBox = QCheckBox()
        self.column6_checkBox = QCheckBox()
        self.column7_checkBox = QCheckBox()
        self.column10_checkBox = QCheckBox()
        self.column11_checkBox = QCheckBox()
        self.column12_checkBox = QCheckBox()

        columns_tab_verticalLayout.addWidget(self.show_column_label)
        columns_tab_verticalLayout.addWidget(self.column0_checkBox)
        columns_tab_verticalLayout.addWidget(self.column1_checkBox)
        columns_tab_verticalLayout.addWidget(self.column2_checkBox)
        columns_tab_verticalLayout.addWidget(self.column3_checkBox)
        columns_tab_verticalLayout.addWidget(self.column4_checkBox)
        columns_tab_verticalLayout.addWidget(self.column5_checkBox)
        columns_tab_verticalLayout.addWidget(self.column6_checkBox)
        columns_tab_verticalLayout.addWidget(self.column7_checkBox)
        columns_tab_verticalLayout.addWidget(self.column10_checkBox)
        columns_tab_verticalLayout.addWidget(self.column11_checkBox)
        columns_tab_verticalLayout.addWidget(self.column12_checkBox)

        columns_tab_verticalLayout.addStretch(1)

        self.setting_tabWidget.addTab(self.columns_tab, '')

        # video_finder_tab
        self.video_finder_tab = QWidget()

        video_finder_layout = QVBoxLayout(self.video_finder_tab)
        video_finder_layout.setContentsMargins(21, 21, 0, 0)

        video_finder_tab_verticalLayout = QVBoxLayout()

        max_links_horizontalLayout = QHBoxLayout()

        # max_links_label
        self.max_links_label = QLabel(self.video_finder_tab)

        max_links_horizontalLayout.addWidget(self.max_links_label)

        # max_links_spinBox
        self.max_links_spinBox = QSpinBox(self.video_finder_tab)
        self.max_links_spinBox.setMinimum(1)
        self.max_links_spinBox.setMaximum(16)
        max_links_horizontalLayout.addWidget(self.max_links_spinBox)
        video_finder_tab_verticalLayout.addLayout(max_links_horizontalLayout)

        self.video_finder_dl_path_horizontalLayout = QHBoxLayout()

        self.video_finder_frame = QFrame(self.video_finder_tab)
        self.video_finder_frame.setLayout(video_finder_tab_verticalLayout)

        video_finder_tab_verticalLayout.addStretch(1)

        video_finder_layout.addWidget(self.video_finder_frame)

        self.setting_tabWidget.addTab(self.video_finder_tab, "")

        # shortcut tab
        self.shortcut_tab = QWidget()
        shortcut_tab_verticalLayout = QVBoxLayout(self.shortcut_tab)
        shortcut_tab_verticalLayout.setContentsMargins(21, 21, 0, 0)

        # shortcut_table
        self.shortcut_table = QTableWidget(self)
        self.shortcut_table.setColumnCount(2)
        self.shortcut_table.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.shortcut_table.setSelectionMode(QAbstractItemView.SingleSelection)
        self.shortcut_table.setEditTriggers(QAbstractItemView.NoEditTriggers)
        self.shortcut_table.verticalHeader().hide()

        shortcut_table_header = [
            QCoreApplication.translate("setting_ui_tr", 'Action'),
            QCoreApplication.translate("setting_ui_tr", 'Shortcut')
        ]

        self.shortcut_table.setHorizontalHeaderLabels(shortcut_table_header)

        shortcut_tab_verticalLayout.addWidget(self.shortcut_table)

        self.setting_tabWidget.addTab(
            self.shortcut_tab,
            QCoreApplication.translate("setting_ui_tr", "Shortcuts"))

        # Actions
        actions_list = [
            QCoreApplication.translate('setting_ui_tr', 'Quit'),
            QCoreApplication.translate('setting_ui_tr',
                                       'Minimize to System Tray'),
            QCoreApplication.translate('setting_ui_tr',
                                       'Remove Download Items'),
            QCoreApplication.translate('setting_ui_tr',
                                       'Delete Download Items'),
            QCoreApplication.translate('setting_ui_tr',
                                       'Move Selected Items Up'),
            QCoreApplication.translate('setting_ui_tr',
                                       'Move Selected Items Down'),
            QCoreApplication.translate('setting_ui_tr',
                                       'Add New Download Link'),
            QCoreApplication.translate('setting_ui_tr', 'Add New Video Link'),
            QCoreApplication.translate('setting_ui_tr',
                                       'Import Links from Text File')
        ]

        # add actions to the shortcut_table
        j = 0
        for action in actions_list:
            item = QTableWidgetItem(str(action))

            # align center
            item.setTextAlignment(0x0004 | 0x0080)

            # insert item in shortcut_table
            self.shortcut_table.insertRow(j)
            self.shortcut_table.setItem(j, 0, item)

            j = j + 1

        self.shortcut_table.resizeColumnsToContents()

        # window buttons
        buttons_horizontalLayout = QHBoxLayout()
        buttons_horizontalLayout.addStretch(1)

        self.defaults_pushButton = QPushButton(self)
        buttons_horizontalLayout.addWidget(self.defaults_pushButton)

        self.cancel_pushButton = QPushButton(self)
        self.cancel_pushButton.setIcon(QIcon(icons + 'remove'))
        buttons_horizontalLayout.addWidget(self.cancel_pushButton)

        self.ok_pushButton = QPushButton(self)
        self.ok_pushButton.setIcon(QIcon(icons + 'ok'))
        buttons_horizontalLayout.addWidget(self.ok_pushButton)

        window_verticalLayout.addLayout(buttons_horizontalLayout)

        # set style_tab for default
        self.setting_tabWidget.setCurrentIndex(3)

        # labels and translations
        self.setWindowTitle(
            QCoreApplication.translate("setting_ui_tr", "Preferences"))

        self.tries_label.setToolTip(
            QCoreApplication.translate(
                "setting_ui_tr",
                "<html><head/><body><p>Set number of tries if download failed.</p></body></html>"
            ))
        self.tries_label.setText(
            QCoreApplication.translate("setting_ui_tr", "Number of tries: "))
        self.tries_spinBox.setToolTip(
            QCoreApplication.translate(
                "setting_ui_tr",
                "<html><head/><body><p>Set number of tries if download failed.</p></body></html>"
            ))

        self.wait_label.setToolTip(
            QCoreApplication.translate(
                "setting_ui_tr",
                "<html><head/><body><p>Set the seconds to wait between retries. Download manager will  retry  downloads  when  the  HTTP  server  returns  a  503 response.</p></body></html>"
            ))
        self.wait_label.setText(
            QCoreApplication.translate(
                "setting_ui_tr", "Wait period between retries (seconds): "))
        self.wait_spinBox.setToolTip(
            QCoreApplication.translate(
                "setting_ui_tr",
                "<html><head/><body><p>Set the seconds to wait between retries. Download manager will  retry  downloads  when  the  HTTP  server  returns  a  503 response.</p></body></html>"
            ))

        self.time_out_label.setToolTip(
            QCoreApplication.translate(
                "setting_ui_tr",
                "<html><head/><body><p>Set timeout in seconds. </p></body></html>"
            ))
        self.time_out_label.setText(
            QCoreApplication.translate("setting_ui_tr", "Timeout (seconds): "))
        self.time_out_spinBox.setToolTip(
            QCoreApplication.translate(
                "setting_ui_tr",
                "<html><head/><body><p>Set timeout in seconds. </p></body></html>"
            ))

        self.connections_label.setToolTip(
            QCoreApplication.translate(
                "setting_ui_tr",
                "<html><head/><body><p>Using multiple connections can help speed up your download.</p></body></html>"
            ))
        self.connections_label.setText(
            QCoreApplication.translate("setting_ui_tr",
                                       "Number of connections: "))
        self.connections_spinBox.setToolTip(
            QCoreApplication.translate(
                "setting_ui_tr",
                "<html><head/><body><p>Using multiple connections can help speed up your download.</p></body></html>"
            ))

        self.rpc_port_label.setText(
            QCoreApplication.translate("setting_ui_tr", "RPC port number: "))
        self.rpc_port_spinbox.setToolTip(
            QCoreApplication.translate(
                "setting_ui_tr",
                "<html><head/><body><p> Specify a port number for JSON-RPC/XML-RPC server to listen to. Possible Values: 1024 - 65535 Default: 6801 </p></body></html>"
            ))

        self.wait_queue_label.setText(
            QCoreApplication.translate(
                "setting_ui_tr",
                'Wait period between each download in queue:'))

        self.dont_check_certificate_checkBox.setText(
            QCoreApplication.translate(
                "setting_ui_tr", "Don't use certificate to verify the peers"))
        self.dont_check_certificate_checkBox.setToolTip(
            QCoreApplication.translate(
                "setting_ui_tr",
                "<html><head/><body><p>This option avoids SSL/TLS handshake failure. But use it at your own risk!</p></body></html>"
            ))

        self.aria2_path_checkBox.setText(
            QCoreApplication.translate("setting_ui_tr",
                                       'Change Aria2 default path'))
        self.aria2_path_pushButton.setText(
            QCoreApplication.translate("setting_ui_tr", 'Change'))
        aria2_path_tooltip = QCoreApplication.translate(
            "setting_ui_tr",
            "<html><head/><body><p>Attention: Wrong path may cause problems! Do it carefully or don't change default setting!</p></body></html>"
        )
        self.aria2_path_checkBox.setToolTip(aria2_path_tooltip)
        self.aria2_path_lineEdit.setToolTip(aria2_path_tooltip)
        self.aria2_path_pushButton.setToolTip(aria2_path_tooltip)

        self.setting_tabWidget.setTabText(
            self.setting_tabWidget.indexOf(self.download_options_tab),
            QCoreApplication.translate("setting_ui_tr", "Download Options"))

        self.download_folder_label.setText(
            QCoreApplication.translate("setting_ui_tr", "Download folder: "))
        self.download_folder_pushButton.setText(
            QCoreApplication.translate("setting_ui_tr", "Change"))

        self.temp_download_label.setText(
            QCoreApplication.translate("setting_ui_tr",
                                       "Temporary download folder: "))
        self.temp_download_pushButton.setText(
            QCoreApplication.translate("setting_ui_tr", "Change"))

        self.subfolder_checkBox.setText(
            QCoreApplication.translate(
                "setting_ui_tr",
                "Create subfolders for Music,Videos, ... in default download folder"
            ))

        self.setting_tabWidget.setTabText(
            self.setting_tabWidget.indexOf(self.save_as_tab),
            QCoreApplication.translate("setting_ui_tr", "Save As"))

        self.enable_notifications_checkBox.setText(
            QCoreApplication.translate("setting_ui_tr",
                                       "Enable Notification Sounds"))

        self.volume_label.setText(
            QCoreApplication.translate("setting_ui_tr", "Volume: "))

        self.setting_tabWidget.setTabText(
            self.setting_tabWidget.indexOf(self.notifications_tab),
            QCoreApplication.translate("setting_ui_tr", "Notifications"))

        self.style_label.setText(
            QCoreApplication.translate("setting_ui_tr", "Style: "))
        self.color_label.setText(
            QCoreApplication.translate("setting_ui_tr", "Color scheme: "))
        self.icon_label.setText(
            QCoreApplication.translate("setting_ui_tr", "Icons: "))

        self.icons_size_label.setText(
            QCoreApplication.translate("setting_ui_tr",
                                       "Toolbar icons size: "))

        self.notification_label.setText(
            QCoreApplication.translate("setting_ui_tr", "Notification type: "))

        self.font_checkBox.setText(
            QCoreApplication.translate("setting_ui_tr", "Font: "))
        self.font_size_label.setText(
            QCoreApplication.translate("setting_ui_tr", "Size: "))

        self.hide_window_checkBox.setText(
            QCoreApplication.translate(
                "setting_ui_tr", "Hide main window if close button clicked."))
        self.hide_window_checkBox.setToolTip(
            QCoreApplication.translate(
                "setting_ui_tr",
                "<html><head/><body><p>This feature may not work in your operating system.</p></body></html>"
            ))

        self.start_persepolis_if_browser_executed_checkBox.setText(
            QCoreApplication.translate(
                'setting_ui_tr',
                'If browser is opened, start Persepolis in system tray'))

        self.enable_system_tray_checkBox.setText(
            QCoreApplication.translate("setting_ui_tr",
                                       "Enable system tray icon"))

        self.after_download_checkBox.setText(
            QCoreApplication.translate(
                "setting_ui_tr",
                "Show download complete dialog when download is finished"))

        self.show_menubar_checkbox.setText(
            QCoreApplication.translate("setting_ui_tr", "Show menubar"))
        self.show_sidepanel_checkbox.setText(
            QCoreApplication.translate("setting_ui_tr", "Show side panel"))
        self.show_progress_window_checkbox.setText(
            QCoreApplication.translate("setting_ui_tr",
                                       "Show download progress window"))

        self.startup_checkbox.setText(
            QCoreApplication.translate("setting_ui_tr",
                                       "Run Persepolis at startup"))

        self.keep_awake_checkBox.setText(
            QCoreApplication.translate("setting_ui_tr", "Keep system awake!"))
        self.keep_awake_checkBox.setToolTip(
            QCoreApplication.translate(
                "setting_ui_tr",
                "<html><head/><body><p>This option will prevent the system from going to sleep.\
            It is necessary if your power manager is suspending the system automatically. </p></body></html>"
            ))

        self.wait_queue_time.setToolTip(
            QCoreApplication.translate(
                "setting_ui_tr",
                "<html><head/><body><p>Format HH:MM</p></body></html>"))

        self.setting_tabWidget.setTabText(
            self.setting_tabWidget.indexOf(self.style_tab),
            QCoreApplication.translate("setting_ui_tr", "Preferences"))

        # columns_tab
        self.show_column_label.setText(
            QCoreApplication.translate("setting_ui_tr", 'Show these columns:'))
        self.column0_checkBox.setText(
            QCoreApplication.translate("setting_ui_tr", 'File Name'))
        self.column1_checkBox.setText(
            QCoreApplication.translate("setting_ui_tr", 'Status'))
        self.column2_checkBox.setText(
            QCoreApplication.translate("setting_ui_tr", 'Size'))
        self.column3_checkBox.setText(
            QCoreApplication.translate("setting_ui_tr", 'Downloaded'))
        self.column4_checkBox.setText(
            QCoreApplication.translate("setting_ui_tr", 'Percentage'))
        self.column5_checkBox.setText(
            QCoreApplication.translate("setting_ui_tr", 'Connections'))
        self.column6_checkBox.setText(
            QCoreApplication.translate("setting_ui_tr", 'Transfer Rate'))
        self.column7_checkBox.setText(
            QCoreApplication.translate("setting_ui_tr", 'Estimated Time Left'))
        self.column10_checkBox.setText(
            QCoreApplication.translate("setting_ui_tr", 'First Try Date'))
        self.column11_checkBox.setText(
            QCoreApplication.translate("setting_ui_tr", 'Last Try Date'))
        self.column12_checkBox.setText(
            QCoreApplication.translate("setting_ui_tr", 'Category'))

        self.setting_tabWidget.setTabText(
            self.setting_tabWidget.indexOf(self.columns_tab),
            QCoreApplication.translate("setting_ui_tr",
                                       "Columns Customization"))

        # Video Finder options tab
        self.setting_tabWidget.setTabText(
            self.setting_tabWidget.indexOf(self.video_finder_tab),
            QCoreApplication.translate("setting_ui_tr",
                                       "Video Finder Options"))

        self.max_links_label.setText(
            QCoreApplication.translate(
                "setting_ui_tr", 'Maximum number of links to capture:<br/>'
                '<small>(If browser sends multiple video links at a time)</small>'
            ))

        # window buttons
        self.defaults_pushButton.setText(
            QCoreApplication.translate("setting_ui_tr", "Defaults"))
        self.cancel_pushButton.setText(
            QCoreApplication.translate("setting_ui_tr", "Cancel"))
        self.ok_pushButton.setText(
            QCoreApplication.translate("setting_ui_tr", "OK"))
Beispiel #7
0
class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        if not MainWindow.objectName():
            MainWindow.setObjectName(u"MainWindow")
        MainWindow.resize(450, 520)
        MainWindow.setMinimumSize(QSize(450, 520))
        MainWindow.setMaximumSize(QSize(450, 520))
        self.centralwidget = QWidget(MainWindow)
        self.centralwidget.setObjectName(u"centralwidget")
        self.bg_frame_2 = QVBoxLayout(self.centralwidget)
        self.bg_frame_2.setSpacing(0)
        self.bg_frame_2.setObjectName(u"bg_frame_2")
        self.bg_frame_2.setContentsMargins(10, 10, 10, 10)
        self.bg_frame = QFrame(self.centralwidget)
        self.bg_frame.setObjectName(u"bg_frame")
        self.bg_frame.setStyleSheet(u"background-color: rgb(29, 0, 86);\n"
                                    "border-radius: 10px;")
        self.bg_frame.setFrameShape(QFrame.NoFrame)
        self.bg_frame.setFrameShadow(QFrame.Raised)
        self.tittle_bar = QFrame(self.bg_frame)
        self.tittle_bar.setObjectName(u"tittle_bar")
        self.tittle_bar.setGeometry(QRect(10, 10, 411, 31))
        self.tittle_bar.setFrameShape(QFrame.StyledPanel)
        self.tittle_bar.setFrameShadow(QFrame.Raised)
        self.label = QLabel(self.tittle_bar)
        self.label.setObjectName(u"label")
        self.label.setGeometry(QRect(10, 0, 61, 31))
        self.label.setStyleSheet(u"color: rgb(255, 255, 255);\n"
                                 "font: 18pt \"Segoe UI\";")
        self.button_close = QPushButton(self.tittle_bar)
        self.button_close.setObjectName(u"button_close")
        self.button_close.setGeometry(QRect(380, 0, 21, 24))
        self.button_close.setStyleSheet(u"background-color: rgb(152, 0, 0);\n"
                                        "font: 14pt \"Segoe UI\";")
        self.button_minimize = QPushButton(self.tittle_bar)
        self.button_minimize.setObjectName(u"button_minimize")
        self.button_minimize.setGeometry(QRect(350, 0, 21, 24))
        self.button_minimize.setStyleSheet(
            u"background-color: rgb(53, 159, 159);\n"
            "font: 14pt \"Segoe UI\";")
        self.user_login = QLineEdit(self.bg_frame)
        self.user_login.setObjectName(u"user_login")
        self.user_login.setGeometry(QRect(60, 160, 301, 51))
        self.user_login.setStyleSheet(u"background-color: rgb(53, 159, 159);\n"
                                      "")
        self.pass_login = QLineEdit(self.bg_frame)
        self.pass_login.setObjectName(u"pass_login")
        self.pass_login.setGeometry(QRect(60, 281, 301, 51))
        self.pass_login.setStyleSheet(u"background-color: rgb(53, 159, 159);\n"
                                      "")
        self.user_lbl = QLabel(self.bg_frame)
        self.user_lbl.setObjectName(u"user_lbl")
        self.user_lbl.setGeometry(QRect(170, 110, 81, 41))
        self.user_lbl.setStyleSheet(u"color: rgb(255, 255, 255);\n"
                                    "font: 18pt \"Segoe UI\";")
        self.senha_lbl = QLabel(self.bg_frame)
        self.senha_lbl.setObjectName(u"senha_lbl")
        self.senha_lbl.setGeometry(QRect(179, 230, 71, 41))
        self.senha_lbl.setStyleSheet(u"color: rgb(255, 255, 255);\n"
                                     "font: 18pt \"Segoe UI\";")
        self.btn_login = QPushButton(self.bg_frame)
        self.btn_login.setObjectName(u"btn_login")
        self.btn_login.setGeometry(QRect(160, 360, 101, 41))
        self.btn_login.setStyleSheet(u"background-color: rgb(53, 159, 159);\n"
                                     "color: rgb(255, 255, 255);\n"
                                     "font: 18pt \"Segoe UI\";\n"
                                     "")

        self.bg_frame_2.addWidget(self.bg_frame)

        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)

        QMetaObject.connectSlotsByName(MainWindow)

    # setupUi

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(
            QCoreApplication.translate("MainWindow", u"Login", None))
        self.label.setText(
            QCoreApplication.translate("MainWindow", u"Login", None))
        self.button_close.setText(
            QCoreApplication.translate("MainWindow", u"x", None))
        self.button_minimize.setText(
            QCoreApplication.translate("MainWindow", u"-", None))
        self.user_lbl.setText(
            QCoreApplication.translate("MainWindow", u"Usu\u00e1rio", None))
        self.senha_lbl.setText(
            QCoreApplication.translate("MainWindow", u"Senha", None))
        self.btn_login.setText(
            QCoreApplication.translate("MainWindow", u"Logar", None))
Beispiel #8
0
class Ui_CategoryReportWidget(object):
    def setupUi(self, CategoryReportWidget):
        if not CategoryReportWidget.objectName():
            CategoryReportWidget.setObjectName(u"CategoryReportWidget")
        CategoryReportWidget.resize(636, 345)
        self.verticalLayout = QVBoxLayout(CategoryReportWidget)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.ReportParamsFrame = QFrame(CategoryReportWidget)
        self.ReportParamsFrame.setObjectName(u"ReportParamsFrame")
        self.ReportParamsFrame.setFrameShape(QFrame.Panel)
        self.ReportParamsFrame.setFrameShadow(QFrame.Sunken)
        self.gridLayout = QGridLayout(self.ReportParamsFrame)
        self.gridLayout.setSpacing(6)
        self.gridLayout.setObjectName(u"gridLayout")
        self.gridLayout.setContentsMargins(2, 2, 2, 2)
        self.ReportFrameSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding,
                                             QSizePolicy.Minimum)

        self.gridLayout.addItem(self.ReportFrameSpacer, 0, 3, 1, 1)

        self.ReportRange = DateRangeSelector(self.ReportParamsFrame)
        self.ReportRange.setObjectName(u"ReportRange")
        self.ReportRange.setProperty("ItemsList",
                                     u"QTD;YTD;this_year;last_year")

        self.gridLayout.addWidget(self.ReportRange, 0, 0, 1, 1)

        self.ReportCategoryLbl = QLabel(self.ReportParamsFrame)
        self.ReportCategoryLbl.setObjectName(u"ReportCategoryLbl")

        self.gridLayout.addWidget(self.ReportCategoryLbl, 0, 1, 1, 1)

        self.ReportCategoryEdit = CategorySelector(self.ReportParamsFrame)
        self.ReportCategoryEdit.setObjectName(u"ReportCategoryEdit")

        self.gridLayout.addWidget(self.ReportCategoryEdit, 0, 2, 1, 1)

        self.verticalLayout.addWidget(self.ReportParamsFrame)

        self.ReportTableView = QTableView(CategoryReportWidget)
        self.ReportTableView.setObjectName(u"ReportTableView")
        self.ReportTableView.setFrameShape(QFrame.Panel)
        self.ReportTableView.setFrameShadow(QFrame.Sunken)
        self.ReportTableView.setEditTriggers(QAbstractItemView.NoEditTriggers)
        self.ReportTableView.setAlternatingRowColors(True)
        self.ReportTableView.setGridStyle(Qt.DotLine)
        self.ReportTableView.setWordWrap(False)
        self.ReportTableView.verticalHeader().setVisible(False)
        self.ReportTableView.verticalHeader().setMinimumSectionSize(20)
        self.ReportTableView.verticalHeader().setDefaultSectionSize(20)

        self.verticalLayout.addWidget(self.ReportTableView)

        self.retranslateUi(CategoryReportWidget)

        QMetaObject.connectSlotsByName(CategoryReportWidget)

    # setupUi

    def retranslateUi(self, CategoryReportWidget):
        CategoryReportWidget.setWindowTitle(
            QCoreApplication.translate("CategoryReportWidget",
                                       u"Report by category", None))
        self.ReportCategoryLbl.setText(
            QCoreApplication.translate("CategoryReportWidget", u"Category:",
                                       None))
Beispiel #9
0
class Ui_ConfigCapture_UI(object):
    def setupUi(self, ConfigCapture_UI):
        if not ConfigCapture_UI.objectName():
            ConfigCapture_UI.setObjectName(u"ConfigCapture_UI")
        ConfigCapture_UI.resize(525, 520)
        self.gridLayout_8 = QGridLayout(ConfigCapture_UI)
        self.gridLayout_8.setObjectName(u"gridLayout_8")
        self.gridLayout_8.setContentsMargins(0, 0, -1, -1)
        self.label = QLabel(ConfigCapture_UI)
        self.label.setObjectName(u"label")

        self.gridLayout_8.addWidget(self.label, 0, 0, 1, 1)

        self.kcfg_defaultcapture = QComboBox(ConfigCapture_UI)
        self.kcfg_defaultcapture.addItem("")
        self.kcfg_defaultcapture.addItem("")
        self.kcfg_defaultcapture.setObjectName(u"kcfg_defaultcapture")
        sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.kcfg_defaultcapture.sizePolicy().hasHeightForWidth())
        self.kcfg_defaultcapture.setSizePolicy(sizePolicy)

        self.gridLayout_8.addWidget(self.kcfg_defaultcapture, 0, 1, 1, 1)

        self.tabWidget = QTabWidget(ConfigCapture_UI)
        self.tabWidget.setObjectName(u"tabWidget")
        self.tabWidget.setMinimumSize(QSize(401, 0))
        self.ffmpeg_tab = QWidget()
        self.ffmpeg_tab.setObjectName(u"ffmpeg_tab")
        self.gridLayout = QGridLayout(self.ffmpeg_tab)
        self.gridLayout.setObjectName(u"gridLayout")
        self.line = QFrame(self.ffmpeg_tab)
        self.line.setObjectName(u"line")
        self.line.setFrameShape(QFrame.HLine)
        self.line.setFrameShadow(QFrame.Sunken)

        self.gridLayout.addWidget(self.line, 10, 0, 4, 8)

        self.label_9 = QLabel(self.ffmpeg_tab)
        self.label_9.setObjectName(u"label_9")

        self.gridLayout.addWidget(self.label_9, 3, 0, 1, 2)

        self.kcfg_alsachannels = QSpinBox(self.ffmpeg_tab)
        self.kcfg_alsachannels.setObjectName(u"kcfg_alsachannels")

        self.gridLayout.addWidget(self.kcfg_alsachannels, 15, 6, 1, 2)

        self.label_24 = QLabel(self.ffmpeg_tab)
        self.label_24.setObjectName(u"label_24")
        sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Preferred)
        sizePolicy1.setHorizontalStretch(0)
        sizePolicy1.setVerticalStretch(0)
        sizePolicy1.setHeightForWidth(
            self.label_24.sizePolicy().hasHeightForWidth())
        self.label_24.setSizePolicy(sizePolicy1)

        self.gridLayout.addWidget(self.label_24, 18, 0, 1, 2)

        self.label_4 = QLabel(self.ffmpeg_tab)
        self.label_4.setObjectName(u"label_4")

        self.gridLayout.addWidget(self.label_4, 5, 0, 1, 2)

        self.kcfg_v4l_format = QComboBox(self.ffmpeg_tab)
        self.kcfg_v4l_format.setObjectName(u"kcfg_v4l_format")

        self.gridLayout.addWidget(self.kcfg_v4l_format, 3, 3, 1, 5)

        self.label_11 = QLabel(self.ffmpeg_tab)
        self.label_11.setObjectName(u"label_11")

        self.gridLayout.addWidget(self.label_11, 15, 5, 1, 1)

        self.horizontalSpacer_5 = QSpacerItem(127, 21, QSizePolicy.Expanding,
                                              QSizePolicy.Minimum)

        self.gridLayout.addItem(self.horizontalSpacer_5, 9, 3, 1, 2)

        self.config_v4l = QPushButton(self.ffmpeg_tab)
        self.config_v4l.setObjectName(u"config_v4l")

        self.gridLayout.addWidget(self.config_v4l, 9, 5, 1, 3)

        self.kcfg_v4l_alsadevice = QComboBox(self.ffmpeg_tab)
        self.kcfg_v4l_alsadevice.setObjectName(u"kcfg_v4l_alsadevice")
        sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding,
                                  QSizePolicy.Fixed)
        sizePolicy2.setHorizontalStretch(0)
        sizePolicy2.setVerticalStretch(0)
        sizePolicy2.setHeightForWidth(
            self.kcfg_v4l_alsadevice.sizePolicy().hasHeightForWidth())
        self.kcfg_v4l_alsadevice.setSizePolicy(sizePolicy2)

        self.gridLayout.addWidget(self.kcfg_v4l_alsadevice, 15, 0, 1, 5)

        self.label_31 = QLabel(self.ffmpeg_tab)
        self.label_31.setObjectName(u"label_31")

        self.gridLayout.addWidget(self.label_31, 7, 0, 1, 3)

        self.p_progressive = QLabel(self.ffmpeg_tab)
        self.p_progressive.setObjectName(u"p_progressive")

        self.gridLayout.addWidget(self.p_progressive, 9, 0, 1, 2)

        self.label_30 = QLabel(self.ffmpeg_tab)
        self.label_30.setObjectName(u"label_30")

        self.gridLayout.addWidget(self.label_30, 1, 0, 1, 2)

        self.label_14 = QLabel(self.ffmpeg_tab)
        self.label_14.setObjectName(u"label_14")

        self.gridLayout.addWidget(self.label_14, 2, 0, 1, 2)

        self.v4l_profile_box = QHBoxLayout()
        self.v4l_profile_box.setObjectName(u"v4l_profile_box")

        self.gridLayout.addLayout(self.v4l_profile_box, 18, 3, 1, 5)

        self.kcfg_detectedv4ldevices = QComboBox(self.ffmpeg_tab)
        self.kcfg_detectedv4ldevices.setObjectName(u"kcfg_detectedv4ldevices")

        self.gridLayout.addWidget(self.kcfg_detectedv4ldevices, 1, 3, 1, 5)

        self.p_aspect = QLabel(self.ffmpeg_tab)
        self.p_aspect.setObjectName(u"p_aspect")

        self.gridLayout.addWidget(self.p_aspect, 6, 3, 1, 5)

        self.label_23 = QLabel(self.ffmpeg_tab)
        self.label_23.setObjectName(u"label_23")

        self.gridLayout.addWidget(self.label_23, 6, 0, 1, 2)

        self.kcfg_v4l_captureaudio = QCheckBox(self.ffmpeg_tab)
        self.kcfg_v4l_captureaudio.setObjectName(u"kcfg_v4l_captureaudio")

        self.gridLayout.addWidget(self.kcfg_v4l_captureaudio, 14, 0, 1, 8)

        self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum,
                                          QSizePolicy.Expanding)

        self.gridLayout.addItem(self.verticalSpacer, 20, 1, 1, 3)

        self.kcfg_v4l_capturevideo = QCheckBox(self.ffmpeg_tab)
        self.kcfg_v4l_capturevideo.setObjectName(u"kcfg_v4l_capturevideo")

        self.gridLayout.addWidget(self.kcfg_v4l_capturevideo, 0, 0, 1, 8)

        self.label_6 = QLabel(self.ffmpeg_tab)
        self.label_6.setObjectName(u"label_6")

        self.gridLayout.addWidget(self.label_6, 4, 0, 1, 1)

        self.line_2 = QFrame(self.ffmpeg_tab)
        self.line_2.setObjectName(u"line_2")
        self.line_2.setFrameShape(QFrame.HLine)
        self.line_2.setFrameShadow(QFrame.Sunken)

        self.gridLayout.addWidget(self.line_2, 17, 0, 1, 8)

        self.label_32 = QLabel(self.ffmpeg_tab)
        self.label_32.setObjectName(u"label_32")

        self.gridLayout.addWidget(self.label_32, 8, 0, 1, 2)

        self.p_size = QLabel(self.ffmpeg_tab)
        self.p_size.setObjectName(u"p_size")

        self.gridLayout.addWidget(self.p_size, 4, 3, 1, 5)

        self.p_display = QLabel(self.ffmpeg_tab)
        self.p_display.setObjectName(u"p_display")

        self.gridLayout.addWidget(self.p_display, 7, 3, 1, 5)

        self.kcfg_video4vdevice = QLineEdit(self.ffmpeg_tab)
        self.kcfg_video4vdevice.setObjectName(u"kcfg_video4vdevice")

        self.gridLayout.addWidget(self.kcfg_video4vdevice, 2, 3, 1, 5)

        self.p_colorspace = QLabel(self.ffmpeg_tab)
        self.p_colorspace.setObjectName(u"p_colorspace")

        self.gridLayout.addWidget(self.p_colorspace, 8, 3, 1, 5)

        self.p_fps = QLabel(self.ffmpeg_tab)
        self.p_fps.setObjectName(u"p_fps")

        self.gridLayout.addWidget(self.p_fps, 5, 3, 1, 5)

        self.tabWidget.addTab(self.ffmpeg_tab, "")
        self.screen_grab_tab = QWidget()
        self.screen_grab_tab.setObjectName(u"screen_grab_tab")
        self.gridLayout_5 = QGridLayout(self.screen_grab_tab)
        self.gridLayout_5.setObjectName(u"gridLayout_5")
        self.kcfg_grab_hide_mouse = QCheckBox(self.screen_grab_tab)
        self.kcfg_grab_hide_mouse.setObjectName(u"kcfg_grab_hide_mouse")

        self.gridLayout_5.addWidget(self.kcfg_grab_hide_mouse, 3, 0, 1, 4)

        self.horizontalSpacer_2 = QSpacerItem(237, 20, QSizePolicy.Expanding,
                                              QSizePolicy.Minimum)

        self.gridLayout_5.addItem(self.horizontalSpacer_2, 2, 2, 1, 1)

        self.verticalSpacer_3 = QSpacerItem(383, 160, QSizePolicy.Minimum,
                                            QSizePolicy.Expanding)

        self.gridLayout_5.addItem(self.verticalSpacer_3, 8, 0, 1, 3)

        self.label_screengrab = QLabel(self.screen_grab_tab)
        self.label_screengrab.setObjectName(u"label_screengrab")
        sizePolicy1.setHeightForWidth(
            self.label_screengrab.sizePolicy().hasHeightForWidth())
        self.label_screengrab.setSizePolicy(sizePolicy1)

        self.gridLayout_5.addWidget(self.label_screengrab, 5, 0, 1, 1)

        self.kcfg_grab_capture_type = QComboBox(self.screen_grab_tab)
        self.kcfg_grab_capture_type.addItem("")
        self.kcfg_grab_capture_type.addItem("")
        self.kcfg_grab_capture_type.setObjectName(u"kcfg_grab_capture_type")

        self.gridLayout_5.addWidget(self.kcfg_grab_capture_type, 0, 0, 1, 3)

        self.screen_grab_profile_box = QHBoxLayout()
        self.screen_grab_profile_box.setObjectName(u"screen_grab_profile_box")

        self.gridLayout_5.addLayout(self.screen_grab_profile_box, 5, 1, 1, 2)

        self.label_18 = QLabel(self.screen_grab_tab)
        self.label_18.setObjectName(u"label_18")

        self.gridLayout_5.addWidget(self.label_18, 2, 0, 1, 1)

        self.region_group = QFrame(self.screen_grab_tab)
        self.region_group.setObjectName(u"region_group")
        self.region_group.setFrameShape(QFrame.StyledPanel)
        self.region_group.setFrameShadow(QFrame.Raised)
        self.gridLayout_3 = QGridLayout(self.region_group)
        self.gridLayout_3.setObjectName(u"gridLayout_3")
        self.horizontalLayout = QHBoxLayout()
        self.horizontalLayout.setObjectName(u"horizontalLayout")
        self.kcfg_grab_follow_mouse = QCheckBox(self.region_group)
        self.kcfg_grab_follow_mouse.setObjectName(u"kcfg_grab_follow_mouse")

        self.horizontalLayout.addWidget(self.kcfg_grab_follow_mouse)

        self.kcfg_grab_hide_frame = QCheckBox(self.region_group)
        self.kcfg_grab_hide_frame.setObjectName(u"kcfg_grab_hide_frame")

        self.horizontalLayout.addWidget(self.kcfg_grab_hide_frame)

        self.horizontalSpacer_4 = QSpacerItem(40, 20, QSizePolicy.Expanding,
                                              QSizePolicy.Minimum)

        self.horizontalLayout.addItem(self.horizontalSpacer_4)

        self.gridLayout_3.addLayout(self.horizontalLayout, 0, 0, 1, 3)

        self.label_19 = QLabel(self.region_group)
        self.label_19.setObjectName(u"label_19")

        self.gridLayout_3.addWidget(self.label_19, 1, 0, 1, 1)

        self.kcfg_grab_offsetx = QSpinBox(self.region_group)
        self.kcfg_grab_offsetx.setObjectName(u"kcfg_grab_offsetx")
        sizePolicy.setHeightForWidth(
            self.kcfg_grab_offsetx.sizePolicy().hasHeightForWidth())
        self.kcfg_grab_offsetx.setSizePolicy(sizePolicy)
        self.kcfg_grab_offsetx.setMaximum(5000)
        self.kcfg_grab_offsetx.setValue(0)

        self.gridLayout_3.addWidget(self.kcfg_grab_offsetx, 1, 1, 1, 1)

        self.kcfg_grab_offsety = QSpinBox(self.region_group)
        self.kcfg_grab_offsety.setObjectName(u"kcfg_grab_offsety")
        sizePolicy.setHeightForWidth(
            self.kcfg_grab_offsety.sizePolicy().hasHeightForWidth())
        self.kcfg_grab_offsety.setSizePolicy(sizePolicy)
        self.kcfg_grab_offsety.setMaximum(5000)
        self.kcfg_grab_offsety.setValue(0)

        self.gridLayout_3.addWidget(self.kcfg_grab_offsety, 1, 2, 1, 1)

        self.label_20 = QLabel(self.region_group)
        self.label_20.setObjectName(u"label_20")

        self.gridLayout_3.addWidget(self.label_20, 2, 0, 1, 1)

        self.kcfg_grab_width = QSpinBox(self.region_group)
        self.kcfg_grab_width.setObjectName(u"kcfg_grab_width")
        self.kcfg_grab_width.setMinimum(1)
        self.kcfg_grab_width.setMaximum(5000)
        self.kcfg_grab_width.setValue(1280)

        self.gridLayout_3.addWidget(self.kcfg_grab_width, 2, 1, 1, 1)

        self.kcfg_grab_height = QSpinBox(self.region_group)
        self.kcfg_grab_height.setObjectName(u"kcfg_grab_height")
        self.kcfg_grab_height.setMinimum(1)
        self.kcfg_grab_height.setMaximum(5000)
        self.kcfg_grab_height.setValue(720)

        self.gridLayout_3.addWidget(self.kcfg_grab_height, 2, 2, 1, 1)

        self.gridLayout_5.addWidget(self.region_group, 1, 0, 1, 3)

        self.kcfg_grab_fps = QDoubleSpinBox(self.screen_grab_tab)
        self.kcfg_grab_fps.setObjectName(u"kcfg_grab_fps")
        self.kcfg_grab_fps.setMinimum(1.000000000000000)
        self.kcfg_grab_fps.setMaximum(1000.000000000000000)

        self.gridLayout_5.addWidget(self.kcfg_grab_fps, 2, 1, 1, 1)

        self.tabWidget.addTab(self.screen_grab_tab, "")
        self.decklink_tab = QWidget()
        self.decklink_tab.setObjectName(u"decklink_tab")
        self.gridLayout_6 = QGridLayout(self.decklink_tab)
        self.gridLayout_6.setObjectName(u"gridLayout_6")
        self.kcfg_decklink_capturedevice = QComboBox(self.decklink_tab)
        self.kcfg_decklink_capturedevice.setObjectName(
            u"kcfg_decklink_capturedevice")
        sizePolicy.setHeightForWidth(
            self.kcfg_decklink_capturedevice.sizePolicy().hasHeightForWidth())
        self.kcfg_decklink_capturedevice.setSizePolicy(sizePolicy)

        self.gridLayout_6.addWidget(self.kcfg_decklink_capturedevice, 0, 1, 1,
                                    1)

        self.kcfg_decklink_filename = QLineEdit(self.decklink_tab)
        self.kcfg_decklink_filename.setObjectName(u"kcfg_decklink_filename")

        self.gridLayout_6.addWidget(self.kcfg_decklink_filename, 5, 1, 1, 1)

        self.label_16 = QLabel(self.decklink_tab)
        self.label_16.setObjectName(u"label_16")
        sizePolicy1.setHeightForWidth(
            self.label_16.sizePolicy().hasHeightForWidth())
        self.label_16.setSizePolicy(sizePolicy1)

        self.gridLayout_6.addWidget(self.label_16, 2, 0, 1, 1)

        self.label_29 = QLabel(self.decklink_tab)
        self.label_29.setObjectName(u"label_29")

        self.gridLayout_6.addWidget(self.label_29, 5, 0, 1, 1)

        self.verticalSpacer_4 = QSpacerItem(20, 327, QSizePolicy.Minimum,
                                            QSizePolicy.Expanding)

        self.gridLayout_6.addItem(self.verticalSpacer_4, 6, 1, 1, 1)

        self.label_27 = QLabel(self.decklink_tab)
        self.label_27.setObjectName(u"label_27")

        self.gridLayout_6.addWidget(self.label_27, 0, 0, 1, 1)

        self.decklink_profile_box = QHBoxLayout()
        self.decklink_profile_box.setSpacing(0)
        self.decklink_profile_box.setObjectName(u"decklink_profile_box")

        self.gridLayout_6.addLayout(self.decklink_profile_box, 2, 1, 1, 1)

        self.tabWidget.addTab(self.decklink_tab, "")
        self.audio_tab = QWidget()
        self.audio_tab.setObjectName(u"audio_tab")
        self.gridLayout_2 = QGridLayout(self.audio_tab)
        self.gridLayout_2.setObjectName(u"gridLayout_2")
        self.label_5 = QLabel(self.audio_tab)
        self.label_5.setObjectName(u"label_5")

        self.gridLayout_2.addWidget(self.label_5, 5, 0, 1, 1)

        self.label_2 = QLabel(self.audio_tab)
        self.label_2.setObjectName(u"label_2")

        self.gridLayout_2.addWidget(self.label_2, 3, 0, 1, 1)

        self.verticalSpacer_2 = QSpacerItem(20, 661, QSizePolicy.Minimum,
                                            QSizePolicy.Expanding)

        self.gridLayout_2.addItem(self.verticalSpacer_2, 6, 1, 1, 1)

        self.label_3 = QLabel(self.audio_tab)
        self.label_3.setObjectName(u"label_3")

        self.gridLayout_2.addWidget(self.label_3, 4, 0, 1, 1)

        self.audiocapturesamplerate = QComboBox(self.audio_tab)
        self.audiocapturesamplerate.setObjectName(u"audiocapturesamplerate")

        self.gridLayout_2.addWidget(self.audiocapturesamplerate, 5, 1, 1, 1)

        self.kcfg_audiocapturevolume = QSlider(self.audio_tab)
        self.kcfg_audiocapturevolume.setObjectName(u"kcfg_audiocapturevolume")
        self.kcfg_audiocapturevolume.setMaximum(100)
        self.kcfg_audiocapturevolume.setSliderPosition(100)
        self.kcfg_audiocapturevolume.setTracking(True)
        self.kcfg_audiocapturevolume.setOrientation(Qt.Horizontal)
        self.kcfg_audiocapturevolume.setInvertedAppearance(False)
        self.kcfg_audiocapturevolume.setInvertedControls(False)
        self.kcfg_audiocapturevolume.setTickPosition(QSlider.TicksAbove)

        self.gridLayout_2.addWidget(self.kcfg_audiocapturevolume, 3, 1, 1, 1)

        self.audiocapturechannels = QComboBox(self.audio_tab)
        self.audiocapturechannels.setObjectName(u"audiocapturechannels")

        self.gridLayout_2.addWidget(self.audiocapturechannels, 4, 1, 1, 1)

        self.kcfg_defaultaudiocapture = QComboBox(self.audio_tab)
        self.kcfg_defaultaudiocapture.setObjectName(
            u"kcfg_defaultaudiocapture")

        self.gridLayout_2.addWidget(self.kcfg_defaultaudiocapture, 1, 1, 1, 1)

        self.label_33 = QLabel(self.audio_tab)
        self.label_33.setObjectName(u"label_33")

        self.gridLayout_2.addWidget(self.label_33, 1, 0, 1, 1)

        self.labelNoAudioDevices = QLabel(self.audio_tab)
        self.labelNoAudioDevices.setObjectName(u"labelNoAudioDevices")
        font = QFont()
        font.setPointSize(10)
        self.labelNoAudioDevices.setFont(font)

        self.gridLayout_2.addWidget(self.labelNoAudioDevices, 2, 0, 1, 2)

        self.tabWidget.addTab(self.audio_tab, "")

        self.gridLayout_8.addWidget(self.tabWidget, 1, 0, 1, 2)

        QWidget.setTabOrder(self.kcfg_defaultcapture, self.tabWidget)
        QWidget.setTabOrder(self.tabWidget, self.kcfg_grab_capture_type)
        QWidget.setTabOrder(self.kcfg_grab_capture_type,
                            self.kcfg_grab_follow_mouse)
        QWidget.setTabOrder(self.kcfg_grab_follow_mouse,
                            self.kcfg_grab_hide_frame)
        QWidget.setTabOrder(self.kcfg_grab_hide_frame, self.kcfg_grab_offsetx)
        QWidget.setTabOrder(self.kcfg_grab_offsetx, self.kcfg_grab_offsety)
        QWidget.setTabOrder(self.kcfg_grab_offsety, self.kcfg_grab_width)
        QWidget.setTabOrder(self.kcfg_grab_width, self.kcfg_grab_height)

        self.retranslateUi(ConfigCapture_UI)

        self.tabWidget.setCurrentIndex(0)

        QMetaObject.connectSlotsByName(ConfigCapture_UI)

    # setupUi

    def retranslateUi(self, ConfigCapture_UI):
        self.label.setText(
            QCoreApplication.translate("ConfigCapture_UI",
                                       u"Default capture device", None))
        self.kcfg_defaultcapture.setItemText(
            0, QCoreApplication.translate("ConfigCapture_UI", u"FFmpeg", None))
        self.kcfg_defaultcapture.setItemText(
            1,
            QCoreApplication.translate("ConfigCapture_UI", u"Screen grab",
                                       None))

        self.label_9.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Capture format",
                                       None))
        self.label_24.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Encoding profile",
                                       None))
        self.label_4.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Frame rate:",
                                       None))
        self.label_11.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Channels", None))
        self.config_v4l.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Edit", None))
        self.label_31.setText(
            QCoreApplication.translate("ConfigCapture_UI",
                                       u"Display aspect ratio:", None))
        self.p_progressive.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Interlaced",
                                       None))
        self.label_30.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Detected devices",
                                       None))
        self.label_14.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Video device",
                                       None))
        self.p_aspect.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"59/54", None))
        self.label_23.setText(
            QCoreApplication.translate("ConfigCapture_UI",
                                       u"Pixel aspect ratio:", None))
        self.kcfg_v4l_captureaudio.setText(
            QCoreApplication.translate("ConfigCapture_UI",
                                       u"Capture audio (ALSA)", None))
        self.kcfg_v4l_capturevideo.setText(
            QCoreApplication.translate("ConfigCapture_UI",
                                       u"Capture video (Video4Linux2)", None))
        self.label_6.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Size:", None))
        self.label_32.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Colorspace",
                                       None))
        self.p_size.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"720x576", None))
        self.p_display.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"4/3", None))
        self.kcfg_video4vdevice.setText("")
        self.p_colorspace.setText("")
        self.p_fps.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"25/1", None))
        self.tabWidget.setTabText(
            self.tabWidget.indexOf(self.ffmpeg_tab),
            QCoreApplication.translate("ConfigCapture_UI", u"FFmpeg", None))
        self.kcfg_grab_hide_mouse.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Hide cursor",
                                       None))
        self.label_screengrab.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Encoding profile",
                                       None))
        self.kcfg_grab_capture_type.setItemText(
            0,
            QCoreApplication.translate("ConfigCapture_UI",
                                       u"Full Screen Capture", None))
        self.kcfg_grab_capture_type.setItemText(
            1,
            QCoreApplication.translate("ConfigCapture_UI", u"Region Capture",
                                       None))

        self.label_18.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Frame rate",
                                       None))
        self.kcfg_grab_follow_mouse.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Follow mouse",
                                       None))
        self.kcfg_grab_hide_frame.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Hide frame",
                                       None))
        self.label_19.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Offset", None))
        self.label_20.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Size", None))
        self.tabWidget.setTabText(
            self.tabWidget.indexOf(self.screen_grab_tab),
            QCoreApplication.translate("ConfigCapture_UI", u"Screen Grab",
                                       None))
        self.label_16.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Encoding profile",
                                       None))
        self.label_29.setText(
            QCoreApplication.translate("ConfigCapture_UI",
                                       u"Capture file name:", None))
        self.label_27.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Detected devices",
                                       None))
        self.tabWidget.setTabText(
            self.tabWidget.indexOf(self.decklink_tab),
            QCoreApplication.translate("ConfigCapture_UI", u"Blackmagic",
                                       None))
        self.label_5.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Sample rate:",
                                       None))
        self.label_2.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Capture volume:",
                                       None))
        self.label_3.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Channels:", None))
        self.label_33.setText(
            QCoreApplication.translate("ConfigCapture_UI", u"Device:", None))
        self.labelNoAudioDevices.setText(
            QCoreApplication.translate(
                "ConfigCapture_UI",
                u"Make sure you have audio plugins installed on your system",
                None))
        self.tabWidget.setTabText(
            self.tabWidget.indexOf(self.audio_tab),
            QCoreApplication.translate("ConfigCapture_UI", u"Audio", None))
        pass
Beispiel #10
0
class Ui_MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()
        self.setWindowIcon(QIcon(resource_path('icon.ico')))
        self.setFixedSize(540, 470)

    def setupUi(self):
        self.centralwidget = QWidget(self)
        with open(resource_path('style.css'), 'r') as file:
            self.centralwidget.setStyleSheet(file.read())
        self.appswidget = QWidget(self.centralwidget)
        self.appswidget.setGeometry(50, 0, 490, 470)
        self.appswidget.setProperty('class', 'appswidget')
        self.sidebar = QFrame(self.centralwidget)
        self.sidebar.setFrameShape(QFrame.StyledPanel)
        self.sidebar.setGeometry(0, 0, 50, 470)
        self.sidebar.setProperty('class', 'sidebar')

        self.refresh_btn = QPushButton(self.sidebar)
        self.refresh_btn.setGeometry(QRect(0, 0, 51, 51))
        self.refresh_btn.setProperty('class', 'sidebar_btns')
        self.refresh_btn.setIcon(QIcon(':/icon/refresh_icon.png'))
        self.refresh_btn.setIconSize(QSize(24, 24))
        self.refresh_bind = QShortcut(QKeySequence('Ctrl+R'), self)

        self.store_btn = QPushButton(self.sidebar)
        self.store_btn.setGeometry(QRect(0, 51, 51, 51))
        self.store_btn.setProperty('class', 'sidebar_btns')
        self.store_btn.setIcon(QIcon(':/icon/store_icon.png'))
        self.store_btn.setIconSize(QSize(24, 24))
        self.store_bind = QShortcut(QKeySequence('Ctrl+S'), self)

        self.homepage_btn = QPushButton(self.sidebar)
        self.homepage_btn.setGeometry(QRect(0, 102, 51, 51))
        self.homepage_btn.setProperty('class', 'sidebar_btns')
        self.homepage_btn.setIcon(QIcon(':/icon/github_icon.png'))
        self.homepage_btn.setIconSize(QSize(24, 24))
        self.homepage_bind = QShortcut(QKeySequence('Ctrl+G'), self)

        self.about_btn = QPushButton(self.sidebar)
        self.about_btn.setGeometry(QRect(0, 153, 51, 51))
        self.about_btn.setProperty('class', 'sidebar_btns')
        self.about_btn.setIcon(QIcon(':/icon/about_icon.png'))
        self.about_btn.setIconSize(QSize(24, 24))
        self.about_bind = QShortcut(QKeySequence('Ctrl+A'), self)

        self.quit_btn = QPushButton(self.sidebar)
        self.quit_btn.setGeometry(QRect(0, 420, 51, 51))
        self.quit_btn.setProperty('class', 'sidebar_btns_quit')
        self.quit_btn.setIcon(QIcon(':/icon/quit_icon.png'))
        self.quit_btn.setIconSize(QSize(24, 24))
        self.quit_bind = QShortcut(QKeySequence('Ctrl+Q'), self)

        self.font = QFont()
        self.font.setPointSize(8)
        self.font.setStyleStrategy(QFont.PreferAntialias)

        self.label_refresh = QLabel(self.appswidget)
        self.label_refresh.setFont(self.font)
        self.label_refresh.setGeometry(QRect(20, 10, 441, 15))

        self.label_info = QLabel(self.appswidget)
        self.label_info.setFont(self.font)
        self.label_info.setGeometry(QRect(20, 10, 441, 30))

        self.progressbar = QProgressBar(self.appswidget)
        self.progressbar.setGeometry(QRect(20, 30, 441, 20))

        self.layout_widget_checkboxes = QWidget(self.appswidget)
        self.layout_widget_checkboxes.setGeometry(QRect(20, 55, 155, 311))
        self.layout_checkboxes = QVBoxLayout(self.layout_widget_checkboxes)
        self.layout_checkboxes.setContentsMargins(0, 0, 0, 0)

        self.layout_widget_checkboxes_2 = QWidget(self.appswidget)
        self.layout_widget_checkboxes_2.setGeometry(QRect(175, 55, 155, 311))
        self.layout_checkboxes_2 = QVBoxLayout(self.layout_widget_checkboxes_2)
        self.layout_checkboxes_2.setContentsMargins(0, 0, 0, 0)

        self.layout_widget_checkboxes_3 = QWidget(self.appswidget)
        self.layout_widget_checkboxes_3.setGeometry(QRect(330, 55, 155, 311))
        self.layout_checkboxes_3 = QVBoxLayout(self.layout_widget_checkboxes_3)
        self.layout_checkboxes_3.setContentsMargins(0, 0, 0, 0)

        self.layout_widget_labels = QWidget(self.appswidget)
        self.layout_widget_labels.setGeometry(QRect(20, 390, 350, 16))
        self.layout_labels = QHBoxLayout(self.layout_widget_labels)
        self.layout_labels.setContentsMargins(0, 0, 0, 0)
        self.label_space = QLabel(self.appswidget)
        self.label_space.setFont(self.font)
        self.layout_labels.addWidget(self.label_space)
        self.label_size = QLabel(self.appswidget)
        self.label_size.setFont(self.font)
        self.layout_labels.addWidget(self.label_size)

        self.layout_widget_buttons = QWidget(self.appswidget)
        self.layout_widget_buttons.setGeometry(QRect(20, 420, 454, 31))
        self.layout_buttons = QHBoxLayout(self.layout_widget_buttons)
        self.layout_buttons.setContentsMargins(0, 0, 0, 0)
        self.button_select_all = QPushButton(self.layout_widget_buttons)
        self.button_select_all.setIcon(QIcon(':/icon/check_icon.png'))
        self.button_select_all.setIconSize(QSize(18, 18))
        self.button_select_all.setLayoutDirection(Qt.RightToLeft)
        self.layout_buttons.addWidget(self.button_select_all)
        self.button_select_all.setMinimumSize(100, 30)
        self.button_select_all.setProperty('class', 'Aqua')
        self.button_deselect_all = QPushButton(self.layout_widget_buttons)
        self.button_deselect_all.setIcon(QIcon(':/icon/cancel_icon.png'))
        self.button_deselect_all.setIconSize(QSize(18, 18))
        self.button_deselect_all.setLayoutDirection(Qt.RightToLeft)
        self.layout_buttons.addWidget(self.button_deselect_all)
        self.button_deselect_all.setMinimumSize(100, 30)
        self.button_deselect_all.setProperty('class', 'Aqua')
        self.layout_buttons.addStretch()
        self.button_uninstall = QPushButton(self.layout_widget_buttons)
        self.button_uninstall.setIcon(QIcon(':/icon/trash_icon.png'))
        self.button_uninstall.setIconSize(QSize(18, 18))
        self.button_uninstall.setLayoutDirection(Qt.RightToLeft)
        self.layout_buttons.addWidget(self.button_uninstall)
        self.button_uninstall.setMinimumSize(100, 30)
        self.button_uninstall.setProperty('class', 'Grapefruit')

        self.setCentralWidget(self.centralwidget)
        self.retranslateUi()
        QMetaObject.connectSlotsByName(self)

    def retranslateUi(self):
        QToolTip.setFont(self.font)

        self.setWindowTitle(QCoreApplication.translate("Title", "PyDebloatX"))
        self.label_info.setText(QCoreApplication.translate("Label", ""))

        self.app_name_list = list(
            (  # Convert tuple to list, because lupdate ignores initial lists
                QCoreApplication.translate("AppName", "3D Builder"),
                QCoreApplication.translate("AppName", "3D Viewer"),
                QCoreApplication.translate("AppName", "Alarms and Clock"),
                QCoreApplication.translate("AppName", "Calculator"),
                QCoreApplication.translate("AppName", "Calendar and Mail"),
                QCoreApplication.translate("AppName", "Camera"),
                QCoreApplication.translate("AppName", "Feedback Hub"),
                QCoreApplication.translate("AppName", "Get Help"),
                QCoreApplication.translate("AppName", "Groove Music"),
                QCoreApplication.translate("AppName", "Maps"),
                QCoreApplication.translate("AppName", "Messaging"),
                QCoreApplication.translate("AppName", "Mixed Reality Portal"),
                QCoreApplication.translate("AppName", "Mobile Plans"),
                QCoreApplication.translate("AppName", "Money"),
                QCoreApplication.translate("AppName", "Movies && TV"),
                QCoreApplication.translate("AppName", "News"),
                QCoreApplication.translate("AppName", "Office"),
                QCoreApplication.translate("AppName", "OneNote"),
                QCoreApplication.translate("AppName", "Paint 3D"),
                QCoreApplication.translate("AppName", "People"),
                QCoreApplication.translate("AppName", "Photos"),
                QCoreApplication.translate("AppName", "Print 3D"),
                QCoreApplication.translate("AppName", "Skype"),
                QCoreApplication.translate("AppName", "Snip && Sketch"),
                QCoreApplication.translate("AppName", "Solitaire"),
                QCoreApplication.translate("AppName", "Sports"),
                QCoreApplication.translate("AppName", "Spotify"),
                QCoreApplication.translate("AppName", "Sticky Notes"),
                QCoreApplication.translate("AppName", "Tips"),
                QCoreApplication.translate("AppName", "Translator"),
                QCoreApplication.translate("AppName", "Voice Recorder"),
                QCoreApplication.translate("AppName", "Weather"),
                QCoreApplication.translate("AppName", "Xbox"),
                QCoreApplication.translate("AppName", "Xbox Game Bar"),
                QCoreApplication.translate("AppName", "Your Phone")))
        self.tooltip_list = list((
            QCoreApplication.translate(
                "ToolTip", "View, create, and personalize 3D objects."),
            QCoreApplication.translate(
                "ToolTip", "View 3D models and animations in real-time."),
            QCoreApplication.translate(
                "ToolTip",
                "A combination of alarm clock, world clock, timer, and stopwatch."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "A calculator that includes standard, scientific, and programmer modes, as well as a unit converter."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Stay up to date with email and schedule managing."),
            QCoreApplication.translate(
                "ToolTip", "Point and shoot to take pictures on Windows 10."),
            QCoreApplication.translate(
                "ToolTip",
                "Provide feedback about Windows and apps by sharing suggestions or problems."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Provide a way to ask a question and get recommended solutions or contact assisted support."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Listen to music on Windows, iOS, and Android devices."),
            QCoreApplication.translate(
                "ToolTip",
                "Search for places to get directions, business info, and reviews."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Quick, reliable SMS, MMS and RCS messaging from your phone."),
            QCoreApplication.translate(
                "ToolTip",
                "Discover Windows Mixed Reality and dive into more than 3,000 games and VR experiences from Steam VR and Microsoft Store."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Sign up for a data plan and connect with mobile operators in your area. You will need a supported SIM card."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Finance calculators, currency exchange rates and commodity prices from around the world."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "All your movies and TV shows, all in one place, on all your devices."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Deliver breaking news and trusted, in-depth reporting from the world\'s best journalists."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Find all your Office apps and files in one place."),
            QCoreApplication.translate(
                "ToolTip",
                "Digital notebook for capturing and organizing everything across your devices."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Make 2D masterpieces or 3D models that you can play with from all angles."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Connect with all your friends, family, colleagues, and acquaintances in one place."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "View and edit your photos and videos, make movies, and create albums."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Quickly and easily prepare objects for 3D printing on your PC."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Instant message, voice or video call application."),
            QCoreApplication.translate(
                "ToolTip",
                "Quickly annotate screenshots, photos and other images and save, paste or share with other apps."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Solitaire is one of the most played computer card games of all time."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Live scores and in-depth game experiences for more than 150 leagues."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Play your favorite songs and albums free on Windows 10 with Spotify."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Create notes, type, ink or add a picture, add text formatting, or stick them to the desktop."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Provide users with information and tips about operating system features."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Translate text and speech, have translated conversations, and even download AI-powered language packs to use offline."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Record sounds, lectures, interviews, and other events."),
            QCoreApplication.translate(
                "ToolTip",
                "Latest weather conditions, accurate 10-day and hourly forecasts."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Browse the catalogue, view recommendations, and discover PC games with Xbox Game Pass."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Instant access to widgets for screen capture and sharing, and chatting with Xbox friends."
            ),
            QCoreApplication.translate(
                "ToolTip",
                "Link your Android phone and PC to view and reply to text messages, access mobile apps, and receive notifications."
            )))
        self.app_data_list = [{
            "name": "*Microsoft.3DBuilder*",
            "link": "/?PFN=Microsoft.3DBuilder_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.Microsoft3DViewer*",
            "link": "/?PFN=Microsoft.Microsoft3DViewer_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.WindowsAlarms*",
            "link": "/?PFN=Microsoft.WindowsAlarms_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.WindowsCalculator*",
            "link": "/?PFN=Microsoft.WindowsCalculator_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*microsoft.windowscommunicationsapps*",
            "link": "/?PFN=Microsoft.windowscommunicationsapps_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.WindowsCamera*",
            "link": "/?PFN=Microsoft.WindowsCamera_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.WindowsFeedbackHub*",
            "link": "/?PFN=Microsoft.WindowsFeedbackHub_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.GetHelp*",
            "link": "/?PFN=Microsoft.Gethelp_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.ZuneMusic*",
            "link": "/?PFN=Microsoft.ZuneMusic_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.WindowsMaps*",
            "link": "/?PFN=Microsoft.WindowsMaps_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.Messaging*",
            "link": "/?PFN=Microsoft.Messaging_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.MixedReality.Portal*",
            "link": "/?PFN=Microsoft.MixedReality.Portal_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.OneConnect*",
            "link": "/?PFN=Microsoft.OneConnect_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.BingFinance*",
            "link": "/?PFN=Microsoft.BingFinance_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.ZuneVideo*",
            "link": "/?PFN=Microsoft.ZuneVideo_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.BingNews*",
            "link": "/?PFN=Microsoft.BingNews_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.MicrosoftOfficeHub*",
            "link": "/?PFN=Microsoft.MicrosoftOfficeHub_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.Office.OneNote*",
            "link": "/?PFN=Microsoft.Office.OneNote_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.MSPaint*",
            "link": "/?PFN=Microsoft.MSPaint_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.People*",
            "link": "/?PFN=Microsoft.People_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.Windows.Photos*",
            "link": "/?PFN=Microsoft.Windows.Photos_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.Print3D*",
            "link": "/?PFN=Microsoft.Print3D_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.SkypeApp*",
            "link": "/?PFN=Microsoft.SkypeApp_kzf8qxf38zg5c",
            "size": 0
        }, {
            "name": "*Microsoft.ScreenSketch*",
            "link": "/?PFN=Microsoft.ScreenSketch_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.MicrosoftSolitaireCollection*",
            "link":
            "/?PFN=Microsoft.MicrosoftSolitaireCollection_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.BingSports*",
            "link": "/?PFN=Microsoft.BingSports_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*SpotifyAB.SpotifyMusic*",
            "link": "/?PFN=SpotifyAB.SpotifyMusic_zpdnekdrzrea0",
            "size": 0
        }, {
            "name": "*Microsoft.MicrosoftStickyNotes*",
            "link": "/?PFN=Microsoft.MicrosoftStickyNotes_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.Getstarted*",
            "link": "/?PFN=Microsoft.Getstarted_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.BingTranslator*",
            "link": "/?PFN=Microsoft.BingTranslator_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.WindowsSoundRecorder*",
            "link": "/?PFN=Microsoft.WindowsSoundRecorder_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.BingWeather*",
            "link": "/?PFN=Microsoft.BingWeather_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.GamingApp*",
            "link": "/?PFN=Microsoft.GamingApp_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Xbox*",
            "link": "/?PFN=Microsoft.XboxGameOverlay_8wekyb3d8bbwe",
            "size": 0
        }, {
            "name": "*Microsoft.YourPhone*",
            "link": "/?PFN=Microsoft.YourPhone_8wekyb3d8bbwe",
            "size": 0
        }]

        if version.parse(platform.version()) >= version.parse("10.0.19041"):
            insort(self.app_name_list,
                   QCoreApplication.translate("AppName", "Cortana"))
            cortana_index = self.app_name_list.index("Cortana")
            self.tooltip_list.insert(
                cortana_index,
                QCoreApplication.translate("ToolTip",
                                           "Personal intelligence assistant."))
            self.app_data_list.insert(
                cortana_index, {
                    "name": "*Microsoft.549981C3F5F10*",
                    "link": "/?PFN=Microsoft.549981C3F5F10_8wekyb3d8bbwe",
                    "size": 0
                })

        self.checkbox_list = []
        for i, _ in enumerate(self.app_name_list):
            self.checkbox_list.append(QCheckBox())
            if i % 3 == 2:
                self.layout_checkboxes_3.addWidget(self.checkbox_list[i])
            elif i % 3 == 1:
                self.layout_checkboxes_2.addWidget(self.checkbox_list[i])
            else:
                self.layout_checkboxes.addWidget(self.checkbox_list[i])

        self.apps_dict = {}
        for i, checkbox in enumerate(self.checkbox_list):
            checkbox.setText(self.app_name_list[i])
            checkbox.setToolTip(self.tooltip_list[i])
            checkbox.setFont(self.font)
            self.apps_dict[checkbox] = self.app_data_list[i]

        self.label_space.setText(
            QCoreApplication.translate("Label", "Total amount of disk space:"))
        self.label_size.setText(QCoreApplication.translate("Label", "0 MB"))

        self.button_select_all.setText(
            QCoreApplication.translate("Button", "Select All"))
        self.button_deselect_all.setText(
            QCoreApplication.translate("Button", "Deselect All"))

        self.button_uninstall.setText(
            QCoreApplication.translate("Button", "Uninstall"))
Beispiel #11
0
class MainWindow(QWidget):
    '''
    Объявление UI для программы
    '''
    def __init__(self, parent):
        super(MainWindow, self).__init__()
        self._width = 360
        self._height = 320
        self.setMinimumSize(self._width, self._height)
        self.setMaximumSize(self._width, self._height)
        #self.resize(self._width, self._height)
        self.setWindowTitle('0-бед or 0-bet')
        self.VBox = QVBoxLayout(self)
        self.VBox.setContentsMargins(5, 5, 5, 5)
        self.restText = QLabel(self)
        self.restText.setText("Список заведений: ")
        self.restTable = QTableView(self)
        self.sep1 = QFrame(self)
        self.sep1.setFrameShape(QFrame.HLine)
        self.sep1.setFrameShadow(QFrame.Sunken)
        self.restUnitName = QLineEdit(self)
        self.restAddButt = QPushButton(self)
        self.restAddButt.setText('Добавить заведение')
        self.restRmvButt = QPushButton(self)
        self.restRmvButt.setText('Удалить заведение')
        self.sep2 = QFrame(self)
        self.sep2.setFrameShape(QFrame.HLine)
        self.sep2.setFrameShadow(QFrame.Sunken)
        self.restLotteryButt = QPushButton(self)
        self.restLotteryButt.setText('Лотерея')

        self.VBox.addWidget(self.restText)
        self.VBox.addWidget(self.restTable)
        self.VBox.addWidget(self.sep1)
        self.VBox.addWidget(self.restUnitName)
        self.VBox.addWidget(self.restAddButt)
        self.VBox.addWidget(self.restRmvButt)
        self.VBox.addWidget(self.sep2)
        self.VBox.addWidget(self.restLotteryButt)
        self.setLayout(self.VBox)

        self.restAddButt.clicked.connect(self.addRestItem)
        self.restLotteryButt.clicked.connect(self.startLottery)
        self.restRmvButt.clicked.connect(self.removeRestItem)
        self.restTable.clicked.connect(self.selectRest)

        self.name_list = []
        self.reqCount_list = []
        self.sg = Sig()
        parent.sg.updateTable.connect(self.updTbl)

    def addRestItem(self):
        name = self.restUnitName.text()
        if name in self.name_list:
            self.reqCount_list[self.name_list.index(
                name)] = self.reqCount_list[self.name_list.index(name)] + 1
        else:
            self.name_list.append(name)
            self.reqCount_list.append(1)
        table_model = RestaurantTableModeL(self.name_list, self.reqCount_list)
        self.restTable.setModel(table_model)
        self.restTable.horizontalHeader().setSectionResizeMode(
            QHeaderView.ResizeToContents)
        self.restTable.horizontalHeader().setStretchLastSection(True)

    def startLottery(self):
        self.sg.lists.emit(self.name_list, self.reqCount_list)

    def selectRest(self):
        self.idx = self.restTable.currentIndex()
        self.restTable.selectRow(self.idx.row())

    def removeRestItem(self):
        self.idx = self.restTable.currentIndex()
        if self.reqCount_list[self.idx.row()] > 1:
            self.reqCount_list[self.idx.row()] -= 1
        else:
            self.name_list.pop(self.idx.row())
            self.reqCount_list.pop(self.idx.row())
        table_model = RestaurantTableModeL(self.name_list, self.reqCount_list)
        self.restTable.setModel(table_model)
        self.restTable.horizontalHeader().setSectionResizeMode(
            QHeaderView.ResizeToContents)
        self.restTable.horizontalHeader().setStretchLastSection(True)

    @Slot(list)
    def updTbl(self, cnt):
        table_model = RestaurantTableModeL(self.name_list, self.reqCount_list,
                                           cnt)
        self.restTable.setModel(table_model)
        self.restTable.horizontalHeader().setSectionResizeMode(
            QHeaderView.ResizeToContents)
        self.restTable.horizontalHeader().setStretchLastSection(True)
class Ui_AboutForm(object):
    def setupUi(self, AboutForm):
        if not AboutForm.objectName():
            AboutForm.setObjectName(u"AboutForm")
        AboutForm.resize(679, 284)
        self.gridLayout = QGridLayout(AboutForm)
        self.gridLayout.setObjectName(u"gridLayout")
        self.line_4 = QFrame(AboutForm)
        self.line_4.setObjectName(u"line_4")
        self.line_4.setFrameShape(QFrame.HLine)
        self.line_4.setFrameShadow(QFrame.Sunken)

        self.gridLayout.addWidget(self.line_4, 8, 0, 1, 1)

        self.line_3 = QFrame(AboutForm)
        self.line_3.setObjectName(u"line_3")
        self.line_3.setFrameShape(QFrame.HLine)
        self.line_3.setFrameShadow(QFrame.Sunken)

        self.gridLayout.addWidget(self.line_3, 0, 0, 1, 1)

        self.line = QFrame(AboutForm)
        self.line.setObjectName(u"line")
        self.line.setFrameShape(QFrame.HLine)
        self.line.setFrameShadow(QFrame.Sunken)

        self.gridLayout.addWidget(self.line, 2, 0, 1, 1)

        self.line_2 = QFrame(AboutForm)
        self.line_2.setObjectName(u"line_2")
        self.line_2.setFrameShape(QFrame.HLine)
        self.line_2.setFrameShadow(QFrame.Sunken)

        self.gridLayout.addWidget(self.line_2, 5, 0, 1, 1)

        self.gridLayout_2 = QGridLayout()
        self.gridLayout_2.setObjectName(u"gridLayout_2")
        self.label_8 = QLabel(AboutForm)
        self.label_8.setObjectName(u"label_8")

        self.gridLayout_2.addWidget(self.label_8, 4, 4, 1, 1)

        self.label = QLabel(AboutForm)
        self.label.setObjectName(u"label")

        self.gridLayout_2.addWidget(self.label, 1, 0, 1, 1)

        self.label_2 = QLabel(AboutForm)
        self.label_2.setObjectName(u"label_2")

        self.gridLayout_2.addWidget(self.label_2, 1, 4, 1, 1)

        self.label_4 = QLabel(AboutForm)
        self.label_4.setObjectName(u"label_4")

        self.gridLayout_2.addWidget(self.label_4, 2, 0, 1, 1)

        self.line_6 = QFrame(AboutForm)
        self.line_6.setObjectName(u"line_6")
        self.line_6.setFrameShape(QFrame.VLine)
        self.line_6.setFrameShadow(QFrame.Sunken)

        self.gridLayout_2.addWidget(self.line_6, 3, 1, 1, 1)

        self.label_7 = QLabel(AboutForm)
        self.label_7.setObjectName(u"label_7")

        self.gridLayout_2.addWidget(self.label_7, 4, 0, 1, 1)

        self.label_6 = QLabel(AboutForm)
        self.label_6.setObjectName(u"label_6")

        self.gridLayout_2.addWidget(self.label_6, 3, 4, 1, 1)

        self.label_5 = QLabel(AboutForm)
        self.label_5.setObjectName(u"label_5")

        self.gridLayout_2.addWidget(self.label_5, 3, 0, 1, 1)

        self.line_5 = QFrame(AboutForm)
        self.line_5.setObjectName(u"line_5")
        self.line_5.setFrameShape(QFrame.VLine)
        self.line_5.setFrameShadow(QFrame.Sunken)

        self.gridLayout_2.addWidget(self.line_5, 2, 1, 1, 1)

        self.line_7 = QFrame(AboutForm)
        self.line_7.setObjectName(u"line_7")
        self.line_7.setFrameShape(QFrame.VLine)
        self.line_7.setFrameShadow(QFrame.Sunken)

        self.gridLayout_2.addWidget(self.line_7, 4, 1, 1, 1)

        self.line_9 = QFrame(AboutForm)
        self.line_9.setObjectName(u"line_9")
        self.line_9.setFrameShape(QFrame.VLine)
        self.line_9.setFrameShadow(QFrame.Sunken)

        self.gridLayout_2.addWidget(self.line_9, 1, 1, 1, 1)

        self.label_3 = QLabel(AboutForm)
        self.label_3.setObjectName(u"label_3")

        self.gridLayout_2.addWidget(self.label_3, 2, 4, 1, 1)


        self.gridLayout.addLayout(self.gridLayout_2, 4, 0, 1, 1)


        self.retranslateUi(AboutForm)

        QMetaObject.connectSlotsByName(AboutForm)
    # setupUi

    def retranslateUi(self, AboutForm):
        AboutForm.setWindowTitle(QCoreApplication.translate("AboutForm", u"Form", None))
        self.label_8.setText(QCoreApplication.translate("AboutForm", u"<a href=\"https://github.com/tonquer/waifu2x-vulkan\"> waifu2x-vulkan</a>", None))
        self.label.setText(QCoreApplication.translate("AboutForm", u"waifu2x-GUI-demo v1.0.1", None))
        self.label_2.setText("")
        self.label_4.setText(QCoreApplication.translate("AboutForm", u"\u9879\u76ee\u5f00\u6e90\u5730\u5740\uff1a", None))
        self.label_7.setText(QCoreApplication.translate("AboutForm", u"waifu2x\u5730\u5740", None))
        self.label_6.setText(QCoreApplication.translate("AboutForm", u"1.1.1", None))
        self.label_5.setText(QCoreApplication.translate("AboutForm", u"waifu2x\u7248\u672c\uff1a", None))
        self.label_3.setText(QCoreApplication.translate("AboutForm", u"<a href=\"https://github.com/tonquer/waifu2x-ncnn-vulkan--GUI\"> waifu2x-ncnn-vulkan-GUI</a>", None))
class NovoCliente(QWidget):
    status_signal = Signal(str)

    def __init__(self):
        self.db = ClientesDB()
        QWidget.__init__(self)
        font = QFont()
        font.setBold(True)  # Labels em Negrito

        # Labels:
        self.label_title = QLabel("Novo Cliente")
        self.label_title.setFont(font)
        self.label_nome = QLabel("Nome Completo:")
        self.label_nome.setFont(font)
        self.label_endereco = QLabel("Endereço:")
        self.label_endereco.setFont(font)
        self.label_numero = QLabel("Número:")
        self.label_numero.setFont(font)
        self.label_cpf = QLabel("CPF:")
        self.label_cpf.setFont(font)

        # Entries:
        self.entry_nome = QLineEdit()
        self.entry_endereco = QTextEdit()
        self.entry_numero = QLineEdit()
        self.entry_cpf = QLineEdit()

        # Botões;
        self.button_salvar = QPushButton("&Salvar")
        self.button_salvar.clicked.connect(self.salvar_cliente)
        self.button_salvar.setShortcut("Ctrl+S")
        self.button_cancelar = QPushButton("Cancelar")
        self.button_cancelar.clicked.connect(self.limpar)
        self.button_cancelar.setShortcut("ESC")

        # Linha
        self.line = QFrame()
        self.line.setFrameShape(QFrame.HLine)
        self.line.setFrameShadow(QFrame.Sunken)
        self.line.setLineWidth(0)
        self.line.setMidLineWidth(1)

        # Leiaute:
        self.layout = QVBoxLayout()
        self.layout_buttons = QHBoxLayout()
        self.layout.addWidget(self.label_title)
        self.layout.addWidget(self.line)
        self.layout.addWidget(self.label_nome)
        self.layout.addWidget(self.entry_nome)
        self.layout.addWidget(self.label_numero)
        self.layout.addWidget(self.entry_numero)
        self.layout.addWidget(self.label_cpf)
        self.layout.addWidget(self.entry_cpf)
        self.layout.addWidget(self.label_endereco)
        self.layout.addWidget(self.entry_endereco)
        self.layout_buttons.addWidget(self.button_salvar)
        self.layout_buttons.addWidget(self.button_cancelar)
        self.layout.addStretch(2)
        self.layout.addLayout(self.layout_buttons)
        self.setLayout(self.layout)

    @Slot()
    def salvar_cliente(self):
        nome = self.entry_nome.text()
        cpf = self.entry_cpf.text()
        numero = self.entry_numero.text()
        endereco = self.entry_endereco.toPlainText()
        data = {
            'nome': nome,
            'cpf': cpf,
            'numero': numero,
            'endereco': endereco
        }
        try:
            self.db.novo_cliente(data)
            self.status_signal.emit("Salvo")
            self.limpar()
        except ValueError as e:
            popup = QMessageBox(QMessageBox.Critical, "Erro", "Campo Inválido")
            popup.setInformativeText(str(e))
            popup.addButton(QMessageBox.Ok)
            popup.exec()

    @Slot()
    def limpar(self):
        self.entry_nome.setText('')
        self.entry_endereco.setText('')
        self.entry_numero.setText('')
        self.entry_cpf.setText('')
Beispiel #14
0
class Ui_ImportSlipDlg(object):
    def setupUi(self, ImportSlipDlg):
        if not ImportSlipDlg.objectName():
            ImportSlipDlg.setObjectName(u"ImportSlipDlg")
        ImportSlipDlg.resize(850, 587)
        self.verticalLayout = QVBoxLayout(ImportSlipDlg)
        self.verticalLayout.setSpacing(6)
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.verticalLayout.setContentsMargins(2, 2, 2, 2)
        self.InputFrame = QFrame(ImportSlipDlg)
        self.InputFrame.setObjectName(u"InputFrame")
        sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Maximum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.InputFrame.sizePolicy().hasHeightForWidth())
        self.InputFrame.setSizePolicy(sizePolicy)
        self.InputFrame.setFrameShape(QFrame.NoFrame)
        self.InputFrame.setFrameShadow(QFrame.Plain)
        self.horizontalLayout_3 = QHBoxLayout(self.InputFrame)
        self.horizontalLayout_3.setSpacing(2)
        self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
        self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0)
        self.QRGroup = QGroupBox(self.InputFrame)
        self.QRGroup.setObjectName(u"QRGroup")
        sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        sizePolicy1.setHorizontalStretch(0)
        sizePolicy1.setVerticalStretch(0)
        sizePolicy1.setHeightForWidth(
            self.QRGroup.sizePolicy().hasHeightForWidth())
        self.QRGroup.setSizePolicy(sizePolicy1)
        self.QRGroup.setAlignment(Qt.AlignLeading | Qt.AlignLeft
                                  | Qt.AlignVCenter)
        self.verticalLayout_3 = QVBoxLayout(self.QRGroup)
        self.verticalLayout_3.setSpacing(6)
        self.verticalLayout_3.setObjectName(u"verticalLayout_3")
        self.verticalLayout_3.setContentsMargins(2, 2, 2, 2)
        self.GetQRfromCameraBtn = QPushButton(self.QRGroup)
        self.GetQRfromCameraBtn.setObjectName(u"GetQRfromCameraBtn")

        self.verticalLayout_3.addWidget(self.GetQRfromCameraBtn)

        self.LoadQRfromFileBtn = QPushButton(self.QRGroup)
        self.LoadQRfromFileBtn.setObjectName(u"LoadQRfromFileBtn")

        self.verticalLayout_3.addWidget(self.LoadQRfromFileBtn)

        self.GetQRfromClipboardBtn = QPushButton(self.QRGroup)
        self.GetQRfromClipboardBtn.setObjectName(u"GetQRfromClipboardBtn")

        self.verticalLayout_3.addWidget(self.GetQRfromClipboardBtn)

        self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum,
                                          QSizePolicy.Expanding)

        self.verticalLayout_3.addItem(self.verticalSpacer)

        self.horizontalLayout_3.addWidget(self.QRGroup)

        self.SlipDataGroup = QGroupBox(self.InputFrame)
        self.SlipDataGroup.setObjectName(u"SlipDataGroup")
        sizePolicy1.setHeightForWidth(
            self.SlipDataGroup.sizePolicy().hasHeightForWidth())
        self.SlipDataGroup.setSizePolicy(sizePolicy1)
        self.gridLayout_2 = QGridLayout(self.SlipDataGroup)
        self.gridLayout_2.setObjectName(u"gridLayout_2")
        self.gridLayout_2.setContentsMargins(2, 2, 2, 2)
        self.GetSlipBtn = QPushButton(self.SlipDataGroup)
        self.GetSlipBtn.setObjectName(u"GetSlipBtn")

        self.gridLayout_2.addWidget(self.GetSlipBtn, 7, 1, 1, 1)

        self.AmountLbl = QLabel(self.SlipDataGroup)
        self.AmountLbl.setObjectName(u"AmountLbl")

        self.gridLayout_2.addWidget(self.AmountLbl, 0, 2, 1, 1)

        self.SlipTimstamp = QDateTimeEdit(self.SlipDataGroup)
        self.SlipTimstamp.setObjectName(u"SlipTimstamp")
        self.SlipTimstamp.setTimeSpec(Qt.UTC)

        self.gridLayout_2.addWidget(self.SlipTimstamp, 0, 1, 1, 1)

        self.TimestampLbl = QLabel(self.SlipDataGroup)
        self.TimestampLbl.setObjectName(u"TimestampLbl")

        self.gridLayout_2.addWidget(self.TimestampLbl, 0, 0, 1, 1)

        self.FDlbl = QLabel(self.SlipDataGroup)
        self.FDlbl.setObjectName(u"FDlbl")

        self.gridLayout_2.addWidget(self.FDlbl, 2, 0, 1, 1)

        self.SlipAmount = QLineEdit(self.SlipDataGroup)
        self.SlipAmount.setObjectName(u"SlipAmount")

        self.gridLayout_2.addWidget(self.SlipAmount, 0, 3, 1, 1)

        self.FP = QLineEdit(self.SlipDataGroup)
        self.FP.setObjectName(u"FP")

        self.gridLayout_2.addWidget(self.FP, 2, 3, 1, 1)

        self.FD = QLineEdit(self.SlipDataGroup)
        self.FD.setObjectName(u"FD")

        self.gridLayout_2.addWidget(self.FD, 2, 1, 1, 1)

        self.FNlbl = QLabel(self.SlipDataGroup)
        self.FNlbl.setObjectName(u"FNlbl")

        self.gridLayout_2.addWidget(self.FNlbl, 4, 0, 1, 1)

        self.DummyLbl = QLabel(self.SlipDataGroup)
        self.DummyLbl.setObjectName(u"DummyLbl")

        self.gridLayout_2.addWidget(self.DummyLbl, 7, 0, 1, 1)

        self.SlipTypeLbl = QLabel(self.SlipDataGroup)
        self.SlipTypeLbl.setObjectName(u"SlipTypeLbl")

        self.gridLayout_2.addWidget(self.SlipTypeLbl, 4, 2, 1, 1)

        self.FN = QLineEdit(self.SlipDataGroup)
        self.FN.setObjectName(u"FN")

        self.gridLayout_2.addWidget(self.FN, 4, 1, 1, 1)

        self.LoadJSONfromFileBtn = QPushButton(self.SlipDataGroup)
        self.LoadJSONfromFileBtn.setObjectName(u"LoadJSONfromFileBtn")

        self.gridLayout_2.addWidget(self.LoadJSONfromFileBtn, 7, 3, 1, 1)

        self.FPlbl = QLabel(self.SlipDataGroup)
        self.FPlbl.setObjectName(u"FPlbl")

        self.gridLayout_2.addWidget(self.FPlbl, 2, 2, 1, 1)

        self.line = QFrame(self.SlipDataGroup)
        self.line.setObjectName(u"line")
        self.line.setFrameShape(QFrame.HLine)
        self.line.setFrameShadow(QFrame.Sunken)

        self.gridLayout_2.addWidget(self.line, 5, 0, 1, 4)

        self.SlipType = QComboBox(self.SlipDataGroup)
        self.SlipType.addItem("")
        self.SlipType.addItem("")
        self.SlipType.setObjectName(u"SlipType")

        self.gridLayout_2.addWidget(self.SlipType, 4, 3, 1, 1)

        self.horizontalLayout_3.addWidget(self.SlipDataGroup)

        self.CameraGroup = QGroupBox(self.InputFrame)
        self.CameraGroup.setObjectName(u"CameraGroup")
        self.verticalLayout_2 = QVBoxLayout(self.CameraGroup)
        self.verticalLayout_2.setSpacing(2)
        self.verticalLayout_2.setObjectName(u"verticalLayout_2")
        self.verticalLayout_2.setContentsMargins(2, 2, 2, 2)
        self.ScannerQR = QRScanner(self.CameraGroup)
        self.ScannerQR.setObjectName(u"ScannerQR")
        sizePolicy2 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding)
        sizePolicy2.setHorizontalStretch(0)
        sizePolicy2.setVerticalStretch(0)
        sizePolicy2.setHeightForWidth(
            self.ScannerQR.sizePolicy().hasHeightForWidth())
        self.ScannerQR.setSizePolicy(sizePolicy2)

        self.verticalLayout_2.addWidget(self.ScannerQR)

        self.CameraBtnFrame = QFrame(self.CameraGroup)
        self.CameraBtnFrame.setObjectName(u"CameraBtnFrame")
        self.CameraBtnFrame.setFrameShape(QFrame.NoFrame)
        self.CameraBtnFrame.setFrameShadow(QFrame.Plain)
        self.horizontalLayout_5 = QHBoxLayout(self.CameraBtnFrame)
        self.horizontalLayout_5.setSpacing(2)
        self.horizontalLayout_5.setObjectName(u"horizontalLayout_5")
        self.horizontalLayout_5.setContentsMargins(0, 0, 0, 0)
        self.StopCameraBtn = QPushButton(self.CameraBtnFrame)
        self.StopCameraBtn.setObjectName(u"StopCameraBtn")

        self.horizontalLayout_5.addWidget(self.StopCameraBtn)

        self.verticalLayout_2.addWidget(self.CameraBtnFrame)

        self.horizontalLayout_3.addWidget(self.CameraGroup)

        self.verticalLayout.addWidget(self.InputFrame)

        self.SlipGroup = QGroupBox(ImportSlipDlg)
        self.SlipGroup.setObjectName(u"SlipGroup")
        sizePolicy2.setHeightForWidth(
            self.SlipGroup.sizePolicy().hasHeightForWidth())
        self.SlipGroup.setSizePolicy(sizePolicy2)
        self.gridLayout = QGridLayout(self.SlipGroup)
        self.gridLayout.setObjectName(u"gridLayout")
        self.gridLayout.setContentsMargins(2, 2, 2, 2)
        self.SlipDateTime = QDateTimeEdit(self.SlipGroup)
        self.SlipDateTime.setObjectName(u"SlipDateTime")
        self.SlipDateTime.setTimeSpec(Qt.UTC)

        self.gridLayout.addWidget(self.SlipDateTime, 2, 1, 1, 1)

        self.DateTimeLbl = QLabel(self.SlipGroup)
        self.DateTimeLbl.setObjectName(u"DateTimeLbl")

        self.gridLayout.addWidget(self.DateTimeLbl, 1, 1, 1, 1)

        self.CorrespondenceLbl = QLabel(self.SlipGroup)
        self.CorrespondenceLbl.setObjectName(u"CorrespondenceLbl")

        self.gridLayout.addWidget(self.CorrespondenceLbl, 3, 2, 1, 1)

        self.PeerEdit = PeerSelector(self.SlipGroup)
        self.PeerEdit.setObjectName(u"PeerEdit")

        self.gridLayout.addWidget(self.PeerEdit, 3, 3, 1, 1)

        self.PeerLbl = QLabel(self.SlipGroup)
        self.PeerLbl.setObjectName(u"PeerLbl")

        self.gridLayout.addWidget(self.PeerLbl, 3, 0, 1, 1)

        self.SlipShopName = QLineEdit(self.SlipGroup)
        self.SlipShopName.setObjectName(u"SlipShopName")
        self.SlipShopName.setEnabled(False)

        self.gridLayout.addWidget(self.SlipShopName, 3, 1, 1, 1)

        self.LinesLbl = QLabel(self.SlipGroup)
        self.LinesLbl.setObjectName(u"LinesLbl")
        self.LinesLbl.setAlignment(Qt.AlignLeading | Qt.AlignLeft
                                   | Qt.AlignTop)

        self.gridLayout.addWidget(self.LinesLbl, 4, 0, 1, 1)

        self.AccountLbl = QLabel(self.SlipGroup)
        self.AccountLbl.setObjectName(u"AccountLbl")

        self.gridLayout.addWidget(self.AccountLbl, 1, 3, 1, 1)

        self.AccountEdit = AccountSelector(self.SlipGroup)
        self.AccountEdit.setObjectName(u"AccountEdit")

        self.gridLayout.addWidget(self.AccountEdit, 2, 3, 1, 1)

        self.LinesTableView = QTableView(self.SlipGroup)
        self.LinesTableView.setObjectName(u"LinesTableView")
        self.LinesTableView.verticalHeader().setVisible(False)
        self.LinesTableView.verticalHeader().setMinimumSectionSize(20)
        self.LinesTableView.verticalHeader().setDefaultSectionSize(20)

        self.gridLayout.addWidget(self.LinesTableView, 4, 1, 1, 4)

        self.AssignCategoryBtn = QPushButton(self.SlipGroup)
        self.AssignCategoryBtn.setObjectName(u"AssignCategoryBtn")

        self.gridLayout.addWidget(self.AssignCategoryBtn, 2, 4, 1, 1)

        self.AssignTagBtn = QPushButton(self.SlipGroup)
        self.AssignTagBtn.setObjectName(u"AssignTagBtn")

        self.gridLayout.addWidget(self.AssignTagBtn, 3, 4, 1, 1)

        self.verticalLayout.addWidget(self.SlipGroup)

        self.DialogButtonsFrame = QFrame(ImportSlipDlg)
        self.DialogButtonsFrame.setObjectName(u"DialogButtonsFrame")
        self.DialogButtonsFrame.setFrameShape(QFrame.NoFrame)
        self.DialogButtonsFrame.setFrameShadow(QFrame.Plain)
        self.horizontalLayout_4 = QHBoxLayout(self.DialogButtonsFrame)
        self.horizontalLayout_4.setObjectName(u"horizontalLayout_4")
        self.horizontalLayout_4.setContentsMargins(2, 2, 2, 2)
        self.ClearBtn = QPushButton(self.DialogButtonsFrame)
        self.ClearBtn.setObjectName(u"ClearBtn")
        self.ClearBtn.setEnabled(True)

        self.horizontalLayout_4.addWidget(self.ClearBtn)

        self.AddOperationBtn = QPushButton(self.DialogButtonsFrame)
        self.AddOperationBtn.setObjectName(u"AddOperationBtn")
        self.AddOperationBtn.setEnabled(True)

        self.horizontalLayout_4.addWidget(self.AddOperationBtn)

        self.CloseBtn = QPushButton(self.DialogButtonsFrame)
        self.CloseBtn.setObjectName(u"CloseBtn")

        self.horizontalLayout_4.addWidget(self.CloseBtn)

        self.verticalLayout.addWidget(self.DialogButtonsFrame)

        self.retranslateUi(ImportSlipDlg)
        self.CloseBtn.clicked.connect(ImportSlipDlg.close)

        QMetaObject.connectSlotsByName(ImportSlipDlg)

    # setupUi

    def retranslateUi(self, ImportSlipDlg):
        ImportSlipDlg.setWindowTitle(
            QCoreApplication.translate("ImportSlipDlg", u"Import Slip", None))
        self.QRGroup.setTitle(
            QCoreApplication.translate("ImportSlipDlg", u"QR-code", None))
        self.GetQRfromCameraBtn.setText(
            QCoreApplication.translate("ImportSlipDlg", u"Get from camera",
                                       None))
        self.LoadQRfromFileBtn.setText(
            QCoreApplication.translate("ImportSlipDlg", u"Load from file",
                                       None))
        self.GetQRfromClipboardBtn.setText(
            QCoreApplication.translate("ImportSlipDlg", u"Get from clipboard",
                                       None))
        self.SlipDataGroup.setTitle(
            QCoreApplication.translate("ImportSlipDlg", u"Slip data", None))
        self.GetSlipBtn.setText(
            QCoreApplication.translate("ImportSlipDlg",
                                       u"Get slip from internet", None))
        self.AmountLbl.setText(
            QCoreApplication.translate("ImportSlipDlg", u"Amount:", None))
        self.SlipTimstamp.setDisplayFormat(
            QCoreApplication.translate("ImportSlipDlg", u"dd/MM/yyyy hh:mm:ss",
                                       None))
        self.TimestampLbl.setText(
            QCoreApplication.translate("ImportSlipDlg", u"Date/Time:", None))
        self.FDlbl.setText(
            QCoreApplication.translate("ImportSlipDlg", u"FD:", None))
        self.FNlbl.setText(
            QCoreApplication.translate("ImportSlipDlg", u"FN:", None))
        self.DummyLbl.setText("")
        self.SlipTypeLbl.setText(
            QCoreApplication.translate("ImportSlipDlg", u"Type:", None))
        self.LoadJSONfromFileBtn.setText(
            QCoreApplication.translate("ImportSlipDlg",
                                       u"Load slip from JSON file", None))
        self.FPlbl.setText(
            QCoreApplication.translate("ImportSlipDlg", u"FP:", None))
        self.SlipType.setItemText(
            0, QCoreApplication.translate("ImportSlipDlg", u"Purchase", None))
        self.SlipType.setItemText(
            1, QCoreApplication.translate("ImportSlipDlg", u"Return", None))

        self.CameraGroup.setTitle(
            QCoreApplication.translate("ImportSlipDlg", u"Camera", None))
        self.StopCameraBtn.setText(
            QCoreApplication.translate("ImportSlipDlg", u"Stop camera", None))
        self.SlipGroup.setTitle(
            QCoreApplication.translate("ImportSlipDlg", u"Slip", None))
        self.SlipDateTime.setDisplayFormat(
            QCoreApplication.translate("ImportSlipDlg", u"dd/MM/yyyy hh:mm:ss",
                                       None))
        self.DateTimeLbl.setText(
            QCoreApplication.translate("ImportSlipDlg", u"Date / Time:", None))
        self.CorrespondenceLbl.setText(
            QCoreApplication.translate("ImportSlipDlg", u"-->", None))
        self.PeerLbl.setText(
            QCoreApplication.translate("ImportSlipDlg", u"Peer:", None))
        self.LinesLbl.setText(
            QCoreApplication.translate("ImportSlipDlg", u"Lines:", None))
        self.AccountLbl.setText(
            QCoreApplication.translate("ImportSlipDlg", u"Account:", None))
        self.AssignCategoryBtn.setText(
            QCoreApplication.translate("ImportSlipDlg",
                                       u"Auto-assign categories", None))
        self.AssignTagBtn.setText(
            QCoreApplication.translate("ImportSlipDlg",
                                       u"Set Tag for all lines", None))
        self.ClearBtn.setText(
            QCoreApplication.translate("ImportSlipDlg", u"Clear", None))
        self.AddOperationBtn.setText(
            QCoreApplication.translate("ImportSlipDlg", u"Add", None))
        self.CloseBtn.setText(
            QCoreApplication.translate("ImportSlipDlg", u"Close", None))
class Widgets(object):
    def top(self, Form):
        if not Form.objectName():
            Form.setObjectName(u"Form")
        self.container_top = QFrame(Form)
        self.container_top.setObjectName(u"container_top")
        self.container_top.setGeometry(QRect(0, 0, 500, 10))
        self.container_top.setMinimumSize(QSize(0, 10))
        self.container_top.setMaximumSize(QSize(16777215, 10))
        self.container_top.setFrameShape(QFrame.NoFrame)
        self.container_top.setFrameShadow(QFrame.Raised)
        self.top_layout = QHBoxLayout(self.container_top)
        self.top_layout.setSpacing(0)
        self.top_layout.setObjectName(u"top_layout")
        self.top_layout.setContentsMargins(0, 0, 0, 0)
        self.top_left = QFrame(self.container_top)
        self.top_left.setObjectName(u"top_left")
        self.top_left.setMinimumSize(QSize(10, 10))
        self.top_left.setMaximumSize(QSize(10, 10))
        self.top_left.setCursor(QCursor(Qt.SizeFDiagCursor))
        self.top_left.setStyleSheet(u"background-color: rgb(33, 37, 43);")
        self.top_left.setFrameShape(QFrame.NoFrame)
        self.top_left.setFrameShadow(QFrame.Raised)
        self.top_layout.addWidget(self.top_left)
        self.top = QFrame(self.container_top)
        self.top.setObjectName(u"top")
        self.top.setCursor(QCursor(Qt.SizeVerCursor))
        self.top.setStyleSheet(u"background-color: rgb(85, 255, 255);")
        self.top.setFrameShape(QFrame.NoFrame)
        self.top.setFrameShadow(QFrame.Raised)
        self.top_layout.addWidget(self.top)
        self.top_right = QFrame(self.container_top)
        self.top_right.setObjectName(u"top_right")
        self.top_right.setMinimumSize(QSize(10, 10))
        self.top_right.setMaximumSize(QSize(10, 10))
        self.top_right.setCursor(QCursor(Qt.SizeBDiagCursor))
        self.top_right.setStyleSheet(u"background-color: rgb(33, 37, 43);")
        self.top_right.setFrameShape(QFrame.NoFrame)
        self.top_right.setFrameShadow(QFrame.Raised)
        self.top_layout.addWidget(self.top_right)

    def bottom(self, Form):
        if not Form.objectName():
            Form.setObjectName(u"Form")
        self.container_bottom = QFrame(Form)
        self.container_bottom.setObjectName(u"container_bottom")
        self.container_bottom.setGeometry(QRect(0, 0, 500, 10))
        self.container_bottom.setMinimumSize(QSize(0, 10))
        self.container_bottom.setMaximumSize(QSize(16777215, 10))
        self.container_bottom.setFrameShape(QFrame.NoFrame)
        self.container_bottom.setFrameShadow(QFrame.Raised)
        self.bottom_layout = QHBoxLayout(self.container_bottom)
        self.bottom_layout.setSpacing(0)
        self.bottom_layout.setObjectName(u"bottom_layout")
        self.bottom_layout.setContentsMargins(0, 0, 0, 0)
        self.bottom_left = QFrame(self.container_bottom)
        self.bottom_left.setObjectName(u"bottom_left")
        self.bottom_left.setMinimumSize(QSize(10, 10))
        self.bottom_left.setMaximumSize(QSize(10, 10))
        self.bottom_left.setCursor(QCursor(Qt.SizeBDiagCursor))
        self.bottom_left.setStyleSheet(u"background-color: rgb(33, 37, 43);")
        self.bottom_left.setFrameShape(QFrame.NoFrame)
        self.bottom_left.setFrameShadow(QFrame.Raised)
        self.bottom_layout.addWidget(self.bottom_left)
        self.bottom = QFrame(self.container_bottom)
        self.bottom.setObjectName(u"bottom")
        self.bottom.setCursor(QCursor(Qt.SizeVerCursor))
        self.bottom.setStyleSheet(u"background-color: rgb(85, 170, 0);")
        self.bottom.setFrameShape(QFrame.NoFrame)
        self.bottom.setFrameShadow(QFrame.Raised)
        self.bottom_layout.addWidget(self.bottom)
        self.bottom_right = QFrame(self.container_bottom)
        self.bottom_right.setObjectName(u"bottom_right")
        self.bottom_right.setMinimumSize(QSize(10, 10))
        self.bottom_right.setMaximumSize(QSize(10, 10))
        self.bottom_right.setCursor(QCursor(Qt.SizeFDiagCursor))
        self.bottom_right.setStyleSheet(u"background-color: rgb(33, 37, 43);")
        self.bottom_right.setFrameShape(QFrame.NoFrame)
        self.bottom_right.setFrameShadow(QFrame.Raised)
        self.bottom_layout.addWidget(self.bottom_right)

    def left(self, Form):
        if not Form.objectName():
            Form.setObjectName(u"Form")
        self.leftgrip = QFrame(Form)
        self.leftgrip.setObjectName(u"left")
        self.leftgrip.setGeometry(QRect(0, 10, 10, 480))
        self.leftgrip.setMinimumSize(QSize(10, 0))
        self.leftgrip.setCursor(QCursor(Qt.SizeHorCursor))
        self.leftgrip.setStyleSheet(u"background-color: rgb(255, 121, 198);")
        self.leftgrip.setFrameShape(QFrame.NoFrame)
        self.leftgrip.setFrameShadow(QFrame.Raised)

    def right(self, Form):
        if not Form.objectName():
            Form.setObjectName(u"Form")
        Form.resize(500, 500)
        self.rightgrip = QFrame(Form)
        self.rightgrip.setObjectName(u"right")
        self.rightgrip.setGeometry(QRect(0, 0, 10, 500))
        self.rightgrip.setMinimumSize(QSize(10, 0))
        self.rightgrip.setCursor(QCursor(Qt.SizeHorCursor))
        self.rightgrip.setStyleSheet(u"background-color: rgb(255, 0, 127);")
        self.rightgrip.setFrameShape(QFrame.NoFrame)
        self.rightgrip.setFrameShadow(QFrame.Raised)
Beispiel #16
0
class Ui_Dialog(object):
    def setupUi(self, Dialog):
        if not Dialog.objectName():
            Dialog.setObjectName(u"Dialog")
        Dialog.resize(688, 530)
        Dialog.setMinimumSize(QSize(600, 0))
        Dialog.setMaximumSize(QSize(1000000, 16777215))
        self.verticalLayout = QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.horizontalLayout = QHBoxLayout()
        self.horizontalLayout.setObjectName(u"horizontalLayout")
        self.verticalFrame = QFrame(Dialog)
        self.verticalFrame.setObjectName(u"verticalFrame")
        self.verticalFrame.setMaximumSize(QSize(250, 16777215))
        self.verticalLayout_2 = QVBoxLayout(self.verticalFrame)
        self.verticalLayout_2.setObjectName(u"verticalLayout_2")
        self.label = QLabel(self.verticalFrame)
        self.label.setObjectName(u"label")

        self.verticalLayout_2.addWidget(self.label)

        self.treeWidget = QTreeWidget(self.verticalFrame)
        QTreeWidgetItem(self.treeWidget)
        QTreeWidgetItem(self.treeWidget)
        QTreeWidgetItem(self.treeWidget)
        self.treeWidget.setObjectName(u"treeWidget")
        font = QFont()
        font.setFamilies([u"Segoe UI"])
        font.setPointSize(10)
        self.treeWidget.setFont(font)
        self.treeWidget.setFrameShape(QFrame.VLine)
        self.treeWidget.setFrameShadow(QFrame.Plain)
        self.treeWidget.setTabKeyNavigation(True)
        self.treeWidget.setAlternatingRowColors(False)

        self.verticalLayout_2.addWidget(self.treeWidget)

        self.horizontalLayout.addWidget(self.verticalFrame)

        self.line = QFrame(Dialog)
        self.line.setObjectName(u"line")
        self.line.setFrameShape(QFrame.VLine)
        self.line.setFrameShadow(QFrame.Sunken)

        self.horizontalLayout.addWidget(self.line)

        self.stackedWidget = QStackedWidget(Dialog)
        self.stackedWidget.setObjectName(u"stackedWidget")
        self.page = QWidget()
        self.page.setObjectName(u"page")
        self.verticalLayout_3 = QVBoxLayout(self.page)
        self.verticalLayout_3.setObjectName(u"verticalLayout_3")
        self.groupBox = QGroupBox(self.page)
        self.groupBox.setObjectName(u"groupBox")
        self.formLayout_4 = QFormLayout(self.groupBox)
        self.formLayout_4.setObjectName(u"formLayout_4")
        self.label_2 = QLabel(self.groupBox)
        self.label_2.setObjectName(u"label_2")

        self.formLayout_4.setWidget(0, QFormLayout.LabelRole, self.label_2)

        self.comboBox = QComboBox(self.groupBox)
        self.comboBox.addItem("")
        self.comboBox.addItem("")
        self.comboBox.addItem("")
        self.comboBox.setObjectName(u"comboBox")

        self.formLayout_4.setWidget(0, QFormLayout.FieldRole, self.comboBox)

        self.verticalLayout_3.addWidget(self.groupBox)

        self.groupBox_2 = QGroupBox(self.page)
        self.groupBox_2.setObjectName(u"groupBox_2")
        self.formLayout_3 = QFormLayout(self.groupBox_2)
        self.formLayout_3.setObjectName(u"formLayout_3")
        self.label_3 = QLabel(self.groupBox_2)
        self.label_3.setObjectName(u"label_3")

        self.formLayout_3.setWidget(1, QFormLayout.LabelRole, self.label_3)

        self.spinBox = QSpinBox(self.groupBox_2)
        self.spinBox.setObjectName(u"spinBox")
        self.spinBox.setValue(11)

        self.formLayout_3.setWidget(1, QFormLayout.FieldRole, self.spinBox)

        self.label_4 = QLabel(self.groupBox_2)
        self.label_4.setObjectName(u"label_4")

        self.formLayout_3.setWidget(0, QFormLayout.LabelRole, self.label_4)

        self.fontComboBox = QFontComboBox(self.groupBox_2)
        self.fontComboBox.setObjectName(u"fontComboBox")

        self.formLayout_3.setWidget(0, QFormLayout.FieldRole,
                                    self.fontComboBox)

        self.verticalLayout_3.addWidget(self.groupBox_2)

        self.stackedWidget.addWidget(self.page)
        self.page_2 = QWidget()
        self.page_2.setObjectName(u"page_2")
        self.verticalLayout_5 = QVBoxLayout(self.page_2)
        self.verticalLayout_5.setObjectName(u"verticalLayout_5")
        self.verticalLayout_4 = QVBoxLayout()
        self.verticalLayout_4.setObjectName(u"verticalLayout_4")

        self.verticalLayout_5.addLayout(self.verticalLayout_4)

        self.stackedWidget.addWidget(self.page_2)

        self.horizontalLayout.addWidget(self.stackedWidget)

        self.verticalLayout.addLayout(self.horizontalLayout)

        self.buttonBox = QDialogButtonBox(Dialog)
        self.buttonBox.setObjectName(u"buttonBox")
        self.buttonBox.setOrientation(Qt.Horizontal)
        self.buttonBox.setStandardButtons(QDialogButtonBox.Apply
                                          | QDialogButtonBox.Close
                                          | QDialogButtonBox.Save)

        self.verticalLayout.addWidget(self.buttonBox)

        self.retranslateUi(Dialog)
        self.buttonBox.accepted.connect(Dialog.accept)
        self.buttonBox.rejected.connect(Dialog.reject)

        self.stackedWidget.setCurrentIndex(0)

        QMetaObject.connectSlotsByName(Dialog)

    # setupUi

    def retranslateUi(self, Dialog):
        Dialog.setWindowTitle(
            QCoreApplication.translate("Dialog", u"Dialog", None))
        self.label.setText(
            QCoreApplication.translate("Dialog", u"Preferences", None))
        ___qtreewidgetitem = self.treeWidget.headerItem()
        ___qtreewidgetitem.setText(
            0, QCoreApplication.translate("Dialog", u"General", None))

        __sortingEnabled = self.treeWidget.isSortingEnabled()
        self.treeWidget.setSortingEnabled(False)
        ___qtreewidgetitem1 = self.treeWidget.topLevelItem(0)
        ___qtreewidgetitem1.setText(
            0, QCoreApplication.translate("Dialog", u"Appearance", None))
        ___qtreewidgetitem2 = self.treeWidget.topLevelItem(1)
        ___qtreewidgetitem2.setText(
            0, QCoreApplication.translate("Dialog", u"Behavior", None))
        ___qtreewidgetitem3 = self.treeWidget.topLevelItem(2)
        ___qtreewidgetitem3.setText(
            0, QCoreApplication.translate("Dialog", u"Advanced", None))
        self.treeWidget.setSortingEnabled(__sortingEnabled)

        self.groupBox.setTitle(
            QCoreApplication.translate("Dialog", u"Theme", None))
        self.label_2.setText(
            QCoreApplication.translate("Dialog", u"Window style", None))
        self.comboBox.setItemText(
            0, QCoreApplication.translate("Dialog", u"Native", None))
        self.comboBox.setItemText(
            1, QCoreApplication.translate("Dialog", u"Fusion", None))
        self.comboBox.setItemText(
            2, QCoreApplication.translate("Dialog", u"Fusion dark", None))

        self.groupBox_2.setTitle(
            QCoreApplication.translate("Dialog", u"Accessibility", None))
        self.label_3.setText(
            QCoreApplication.translate("Dialog", u"Font size", None))
        self.label_4.setText(
            QCoreApplication.translate("Dialog", u"Font", None))
Beispiel #17
0
class Ui_AssetDialog(object):
    def setupUi(self, AssetDialog):
        if not AssetDialog.objectName():
            AssetDialog.setObjectName(u"AssetDialog")
        AssetDialog.setWindowModality(Qt.ApplicationModal)
        AssetDialog.resize(927, 323)
        AssetDialog.setModal(False)
        self.gridLayout = QGridLayout(AssetDialog)
        self.gridLayout.setSpacing(2)
        self.gridLayout.setObjectName(u"gridLayout")
        self.gridLayout.setContentsMargins(2, 2, 2, 2)
        self.horizontalSpacer_4 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)

        self.gridLayout.addItem(self.horizontalSpacer_4, 1, 2, 1, 1)

        self.frame = QFrame(AssetDialog)
        self.frame.setObjectName(u"frame")
        sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.frame.sizePolicy().hasHeightForWidth())
        self.frame.setSizePolicy(sizePolicy)
        self.frame.setFrameShape(QFrame.NoFrame)
        self.frame.setFrameShadow(QFrame.Raised)
        self.horizontalLayout_3 = QHBoxLayout(self.frame)
        self.horizontalLayout_3.setSpacing(2)
        self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
        self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0)
        self.splitter = QSplitter(self.frame)
        self.splitter.setObjectName(u"splitter")
        sizePolicy1 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
        sizePolicy1.setHorizontalStretch(0)
        sizePolicy1.setVerticalStretch(0)
        sizePolicy1.setHeightForWidth(self.splitter.sizePolicy().hasHeightForWidth())
        self.splitter.setSizePolicy(sizePolicy1)
        self.splitter.setOrientation(Qt.Horizontal)
        self.SymbolsFrame = QFrame(self.splitter)
        self.SymbolsFrame.setObjectName(u"SymbolsFrame")
        sizePolicy2 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        sizePolicy2.setHorizontalStretch(5)
        sizePolicy2.setVerticalStretch(0)
        sizePolicy2.setHeightForWidth(self.SymbolsFrame.sizePolicy().hasHeightForWidth())
        self.SymbolsFrame.setSizePolicy(sizePolicy2)
        self.SymbolsFrame.setFrameShape(QFrame.NoFrame)
        self.SymbolsFrame.setFrameShadow(QFrame.Raised)
        self.verticalLayout = QVBoxLayout(self.SymbolsFrame)
        self.verticalLayout.setSpacing(2)
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.SymbolsCaptionFrame = QFrame(self.SymbolsFrame)
        self.SymbolsCaptionFrame.setObjectName(u"SymbolsCaptionFrame")
        self.SymbolsCaptionFrame.setFrameShape(QFrame.NoFrame)
        self.SymbolsCaptionFrame.setFrameShadow(QFrame.Raised)
        self.horizontalLayout_5 = QHBoxLayout(self.SymbolsCaptionFrame)
        self.horizontalLayout_5.setSpacing(2)
        self.horizontalLayout_5.setObjectName(u"horizontalLayout_5")
        self.horizontalLayout_5.setContentsMargins(0, 0, 0, 0)
        self.SymbolsLabel = QLabel(self.SymbolsCaptionFrame)
        self.SymbolsLabel.setObjectName(u"SymbolsLabel")

        self.horizontalLayout_5.addWidget(self.SymbolsLabel)

        self.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)

        self.horizontalLayout_5.addItem(self.horizontalSpacer_2)

        self.AddSymbolButton = QPushButton(self.SymbolsCaptionFrame)
        self.AddSymbolButton.setObjectName(u"AddSymbolButton")

        self.horizontalLayout_5.addWidget(self.AddSymbolButton)

        self.RemoveSymbolButton = QPushButton(self.SymbolsCaptionFrame)
        self.RemoveSymbolButton.setObjectName(u"RemoveSymbolButton")

        self.horizontalLayout_5.addWidget(self.RemoveSymbolButton)


        self.verticalLayout.addWidget(self.SymbolsCaptionFrame)

        self.SymbolsTable = QTableView(self.SymbolsFrame)
        self.SymbolsTable.setObjectName(u"SymbolsTable")
        self.SymbolsTable.setEditTriggers(QAbstractItemView.AnyKeyPressed|QAbstractItemView.EditKeyPressed|QAbstractItemView.SelectedClicked)
        self.SymbolsTable.setAlternatingRowColors(True)
        self.SymbolsTable.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.SymbolsTable.verticalHeader().setVisible(False)
        self.SymbolsTable.verticalHeader().setMinimumSectionSize(20)
        self.SymbolsTable.verticalHeader().setDefaultSectionSize(20)

        self.verticalLayout.addWidget(self.SymbolsTable)

        self.splitter.addWidget(self.SymbolsFrame)
        self.DataFrame = QFrame(self.splitter)
        self.DataFrame.setObjectName(u"DataFrame")
        sizePolicy3 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        sizePolicy3.setHorizontalStretch(2)
        sizePolicy3.setVerticalStretch(0)
        sizePolicy3.setHeightForWidth(self.DataFrame.sizePolicy().hasHeightForWidth())
        self.DataFrame.setSizePolicy(sizePolicy3)
        self.DataFrame.setFrameShape(QFrame.NoFrame)
        self.DataFrame.setFrameShadow(QFrame.Raised)
        self.verticalLayout_2 = QVBoxLayout(self.DataFrame)
        self.verticalLayout_2.setSpacing(2)
        self.verticalLayout_2.setObjectName(u"verticalLayout_2")
        self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.DataCaptionFrame = QFrame(self.DataFrame)
        self.DataCaptionFrame.setObjectName(u"DataCaptionFrame")
        self.DataCaptionFrame.setFrameShape(QFrame.NoFrame)
        self.DataCaptionFrame.setFrameShadow(QFrame.Raised)
        self.horizontalLayout_2 = QHBoxLayout(self.DataCaptionFrame)
        self.horizontalLayout_2.setSpacing(2)
        self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
        self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.DataLbl = QLabel(self.DataCaptionFrame)
        self.DataLbl.setObjectName(u"DataLbl")

        self.horizontalLayout_2.addWidget(self.DataLbl)

        self.horizontalSpacer_3 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)

        self.horizontalLayout_2.addItem(self.horizontalSpacer_3)

        self.AddDataButton = QPushButton(self.DataCaptionFrame)
        self.AddDataButton.setObjectName(u"AddDataButton")

        self.horizontalLayout_2.addWidget(self.AddDataButton)

        self.RemoveDataButton = QPushButton(self.DataCaptionFrame)
        self.RemoveDataButton.setObjectName(u"RemoveDataButton")

        self.horizontalLayout_2.addWidget(self.RemoveDataButton)


        self.verticalLayout_2.addWidget(self.DataCaptionFrame)

        self.DataTable = QTableView(self.DataFrame)
        self.DataTable.setObjectName(u"DataTable")
        self.DataTable.setEditTriggers(QAbstractItemView.AnyKeyPressed|QAbstractItemView.EditKeyPressed|QAbstractItemView.SelectedClicked)
        self.DataTable.setAlternatingRowColors(True)
        self.DataTable.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.DataTable.verticalHeader().setVisible(False)
        self.DataTable.verticalHeader().setMinimumSectionSize(20)
        self.DataTable.verticalHeader().setDefaultSectionSize(20)

        self.verticalLayout_2.addWidget(self.DataTable)

        self.splitter.addWidget(self.DataFrame)

        self.horizontalLayout_3.addWidget(self.splitter)


        self.gridLayout.addWidget(self.frame, 3, 0, 1, 5)

        self.NameLbl = QLabel(AssetDialog)
        self.NameLbl.setObjectName(u"NameLbl")

        self.gridLayout.addWidget(self.NameLbl, 0, 0, 1, 1)

        self.isinLbl = QLabel(AssetDialog)
        self.isinLbl.setObjectName(u"isinLbl")

        self.gridLayout.addWidget(self.isinLbl, 1, 0, 1, 1)

        self.BaseAssetSelector = AssetSelector(AssetDialog)
        self.BaseAssetSelector.setObjectName(u"BaseAssetSelector")

        self.gridLayout.addWidget(self.BaseAssetSelector, 2, 1, 1, 1)

        self.ButtonsFrame = QFrame(AssetDialog)
        self.ButtonsFrame.setObjectName(u"ButtonsFrame")
        self.ButtonsFrame.setFrameShape(QFrame.NoFrame)
        self.ButtonsFrame.setFrameShadow(QFrame.Raised)
        self.horizontalLayout = QHBoxLayout(self.ButtonsFrame)
        self.horizontalLayout.setSpacing(2)
        self.horizontalLayout.setObjectName(u"horizontalLayout")
        self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
        self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)

        self.horizontalLayout.addItem(self.horizontalSpacer)

        self.CancelButton = QPushButton(self.ButtonsFrame)
        self.CancelButton.setObjectName(u"CancelButton")

        self.horizontalLayout.addWidget(self.CancelButton)

        self.OkButton = QPushButton(self.ButtonsFrame)
        self.OkButton.setObjectName(u"OkButton")

        self.horizontalLayout.addWidget(self.OkButton)


        self.gridLayout.addWidget(self.ButtonsFrame, 10, 0, 1, 5)

        self.BaseLbl = QLabel(AssetDialog)
        self.BaseLbl.setObjectName(u"BaseLbl")

        self.gridLayout.addWidget(self.BaseLbl, 2, 0, 1, 1)

        self.TypeLbl = QLabel(AssetDialog)
        self.TypeLbl.setObjectName(u"TypeLbl")

        self.gridLayout.addWidget(self.TypeLbl, 1, 3, 1, 1)

        self.isinEdit = QLineEdit(AssetDialog)
        self.isinEdit.setObjectName(u"isinEdit")

        self.gridLayout.addWidget(self.isinEdit, 1, 1, 1, 1)

        self.CountryLbl = QLabel(AssetDialog)
        self.CountryLbl.setObjectName(u"CountryLbl")

        self.gridLayout.addWidget(self.CountryLbl, 2, 3, 1, 1)

        self.CountryCombo = CountryCombo(AssetDialog)
        self.CountryCombo.setObjectName(u"CountryCombo")

        self.gridLayout.addWidget(self.CountryCombo, 2, 4, 1, 1)

        self.TypeCombo = AssetTypeCombo(AssetDialog)
        self.TypeCombo.setObjectName(u"TypeCombo")

        self.gridLayout.addWidget(self.TypeCombo, 1, 4, 1, 1)

        self.NameEdit = QLineEdit(AssetDialog)
        self.NameEdit.setObjectName(u"NameEdit")

        self.gridLayout.addWidget(self.NameEdit, 0, 1, 1, 4)


        self.retranslateUi(AssetDialog)
        self.OkButton.clicked.connect(AssetDialog.accept)
        self.CancelButton.clicked.connect(AssetDialog.reject)

        QMetaObject.connectSlotsByName(AssetDialog)
    # setupUi

    def retranslateUi(self, AssetDialog):
        AssetDialog.setWindowTitle(QCoreApplication.translate("AssetDialog", u"Asset", None))
        self.SymbolsLabel.setText(QCoreApplication.translate("AssetDialog", u"Symbols", None))
        self.AddSymbolButton.setText("")
        self.RemoveSymbolButton.setText("")
        self.DataLbl.setText(QCoreApplication.translate("AssetDialog", u"Extra data", None))
        self.AddDataButton.setText("")
        self.RemoveDataButton.setText("")
        self.NameLbl.setText(QCoreApplication.translate("AssetDialog", u"Name:", None))
        self.isinLbl.setText(QCoreApplication.translate("AssetDialog", u"ISIN:", None))
        self.CancelButton.setText(QCoreApplication.translate("AssetDialog", u"Cancel", None))
        self.OkButton.setText(QCoreApplication.translate("AssetDialog", u"OK", None))
        self.BaseLbl.setText(QCoreApplication.translate("AssetDialog", u"Base asset:", None))
        self.TypeLbl.setText(QCoreApplication.translate("AssetDialog", u"Type: ", None))
        self.CountryLbl.setText(QCoreApplication.translate("AssetDialog", u"Country: ", None))
Beispiel #18
0
class ProgressWindow_Ui(QWidget):
    def __init__(self, persepolis_setting):
        super().__init__()
        self.persepolis_setting = persepolis_setting
        icons = ':/' + str(persepolis_setting.value('settings/icons')) + '/'

        # add support for other languages
        locale = str(self.persepolis_setting.value('settings/locale'))
        QLocale.setDefault(QLocale(locale))
        self.translator = QTranslator()
        if self.translator.load(':/translations/locales/ui_' + locale, 'ts'):
            QCoreApplication.installTranslator(self.translator)

        # set ui direction
        ui_direction = self.persepolis_setting.value('ui_direction')

        if ui_direction == 'rtl':
            self.setLayoutDirection(Qt.RightToLeft)

        elif ui_direction in 'ltr':
            self.setLayoutDirection(Qt.LeftToRight)

# window
        self.setMinimumSize(QSize(595, 284))

        self.setWindowIcon(
            QIcon.fromTheme('persepolis', QIcon(':/persepolis.svg')))
        self.setWindowTitle(
            QCoreApplication.translate("progress_ui_tr",
                                       "Persepolis Download Manager"))

        verticalLayout = QVBoxLayout(self)

        # progress_tabWidget
        self.progress_tabWidget = QTabWidget(self)

        # information_tab
        self.information_tab = QWidget()
        information_verticalLayout = QVBoxLayout(self.information_tab)

        # link_label
        self.link_label = QLabel(self.information_tab)
        information_verticalLayout.addWidget(self.link_label)

        # status_label
        self.status_label = QLabel(self.information_tab)
        information_verticalLayout.addWidget(self.status_label)

        # downloaded_label
        self.downloaded_label = QLabel(self.information_tab)
        information_verticalLayout.addWidget(self.downloaded_label)

        # rate_label
        self.rate_label = QLabel(self.information_tab)
        information_verticalLayout.addWidget(self.rate_label)

        # time_label
        self.time_label = QLabel(self.information_tab)
        information_verticalLayout.addWidget(self.time_label)

        # connections_label
        self.connections_label = QLabel(self.information_tab)
        information_verticalLayout.addWidget(self.connections_label)

        information_verticalLayout.addStretch(1)

        # add information_tab to progress_tabWidget
        self.progress_tabWidget.addTab(self.information_tab, "")

        # options_tab
        self.options_tab = QWidget()
        options_tab_verticalLayout = QVBoxLayout(self.options_tab)
        options_tab_horizontalLayout = QHBoxLayout()
        #         options_tab_horizontalLayout.setContentsMargins(11, 11, 11, 11)

        # limit_checkBox
        self.limit_checkBox = QCheckBox(self.options_tab)

        limit_verticalLayout = QVBoxLayout()
        limit_verticalLayout.addWidget(self.limit_checkBox)

        # limit_frame
        self.limit_frame = QFrame(self.options_tab)
        self.limit_frame.setFrameShape(QFrame.StyledPanel)
        self.limit_frame.setFrameShadow(QFrame.Raised)
        limit_frame_verticalLayout = QVBoxLayout(self.limit_frame)
        limit_frame_horizontalLayout = QHBoxLayout()

        # limit_spinBox
        self.limit_spinBox = QDoubleSpinBox(self.options_tab)
        self.limit_spinBox.setMinimum(1)
        self.limit_spinBox.setMaximum(1023)
        limit_frame_horizontalLayout.addWidget(self.limit_spinBox)

        # limit_comboBox
        self.limit_comboBox = QComboBox(self.options_tab)
        self.limit_comboBox.addItem("")
        self.limit_comboBox.addItem("")

        limit_frame_horizontalLayout.addWidget(self.limit_comboBox)

        # limit_pushButton
        self.limit_pushButton = QPushButton(self.options_tab)

        limit_frame_verticalLayout.addLayout(limit_frame_horizontalLayout)
        limit_frame_verticalLayout.addWidget(self.limit_pushButton)

        limit_verticalLayout.addWidget(self.limit_frame)

        limit_verticalLayout.setContentsMargins(11, 11, 11, 11)

        options_tab_horizontalLayout.addLayout(limit_verticalLayout)

        options_tab_verticalLayout.addLayout(options_tab_horizontalLayout)
        options_tab_verticalLayout.addStretch(1)

        # after_checkBox
        self.after_checkBox = QCheckBox(self.options_tab)

        after_verticalLayout = QVBoxLayout()
        after_verticalLayout.addWidget(self.after_checkBox)

        # after_frame
        self.after_frame = QFrame(self.options_tab)
        self.after_frame.setFrameShape(QFrame.StyledPanel)
        self.after_frame.setFrameShadow(QFrame.Raised)

        after_frame_verticalLayout = QVBoxLayout(self.after_frame)

        # after_comboBox
        self.after_comboBox = QComboBox(self.options_tab)
        self.after_comboBox.addItem("")

        after_frame_verticalLayout.addWidget(self.after_comboBox)

        # after_pushButton
        self.after_pushButton = QPushButton(self.options_tab)
        after_frame_verticalLayout.addWidget(self.after_pushButton)

        after_verticalLayout.addWidget(self.after_frame)

        after_verticalLayout.setContentsMargins(11, 11, 11, 11)
        options_tab_horizontalLayout.addLayout(after_verticalLayout)

        self.progress_tabWidget.addTab(self.options_tab, "")

        verticalLayout.addWidget(self.progress_tabWidget)

        # download_progressBar
        self.download_progressBar = QProgressBar(self)
        verticalLayout.addWidget(self.download_progressBar)
        self.download_progressBar.setTextVisible(False)

        # buttons
        button_horizontalLayout = QHBoxLayout()
        button_horizontalLayout.addStretch(1)

        # resume_pushButton
        self.resume_pushButton = QPushButton(self)
        self.resume_pushButton.setIcon(QIcon(icons + 'play'))
        button_horizontalLayout.addWidget(self.resume_pushButton)

        # pause_pushButton
        self.pause_pushButton = QPushButton(self)
        self.pause_pushButton.setIcon(QIcon(icons + 'pause'))
        button_horizontalLayout.addWidget(self.pause_pushButton)

        # stop_pushButton
        self.stop_pushButton = QPushButton(self)
        self.stop_pushButton.setIcon(QIcon(icons + 'stop'))
        button_horizontalLayout.addWidget(self.stop_pushButton)

        verticalLayout.addLayout(button_horizontalLayout)

        self.progress_tabWidget.setCurrentIndex(0)
        # labels
        self.link_label.setText(
            QCoreApplication.translate("progress_ui_tr", "Link: "))
        self.status_label.setText(
            QCoreApplication.translate("progress_ui_tr", "Status: "))
        self.downloaded_label.setText(
            QCoreApplication.translate("progress_ui_tr", "Downloaded:"))
        self.rate_label.setText(
            QCoreApplication.translate("progress_ui_tr", "Transfer rate: "))
        self.time_label.setText(
            QCoreApplication.translate("progress_ui_tr",
                                       "Estimated time left:"))
        self.connections_label.setText(
            QCoreApplication.translate("progress_ui_tr",
                                       "Number of connections: "))
        self.progress_tabWidget.setTabText(
            self.progress_tabWidget.indexOf(self.information_tab),
            QCoreApplication.translate("progress_ui_tr",
                                       "Download Information"))
        self.limit_checkBox.setText(
            QCoreApplication.translate("progress_ui_tr", "Limit speed"))
        self.after_checkBox.setText(
            QCoreApplication.translate("progress_ui_tr", "After download"))
        self.limit_comboBox.setItemText(0, "KiB/s")
        self.limit_comboBox.setItemText(1, "MiB/s")
        self.limit_pushButton.setText(
            QCoreApplication.translate("progress_ui_tr", "Apply"))

        self.after_comboBox.setItemText(
            0, QCoreApplication.translate("progress_ui_tr", "Shut Down"))

        self.progress_tabWidget.setTabText(
            self.progress_tabWidget.indexOf(self.options_tab),
            QCoreApplication.translate("progress_ui_tr", "Download Options"))
        self.resume_pushButton.setText(
            QCoreApplication.translate("progress_ui_tr", "Resume"))
        self.pause_pushButton.setText(
            QCoreApplication.translate("progress_ui_tr", "Pause"))
        self.stop_pushButton.setText(
            QCoreApplication.translate("progress_ui_tr", "Stop"))
        self.after_pushButton.setText(
            QCoreApplication.translate("progress_ui_tr", "Apply"))
Beispiel #19
0
class Ui_TaxExportDlg(object):
    def setupUi(self, TaxExportDlg):
        if not TaxExportDlg.objectName():
            TaxExportDlg.setObjectName(u"TaxExportDlg")
        TaxExportDlg.resize(602, 315)
        self.gridLayout = QGridLayout(TaxExportDlg)
        self.gridLayout.setObjectName(u"gridLayout")
        self.gridLayout.setHorizontalSpacing(6)
        self.gridLayout.setContentsMargins(9, 9, 9, 9)
        self.line = QFrame(TaxExportDlg)
        self.line.setObjectName(u"line")
        self.line.setFrameShape(QFrame.HLine)
        self.line.setFrameShadow(QFrame.Sunken)

        self.gridLayout.addWidget(self.line, 4, 0, 1, 4)

        self.XlsSelectBtn = QPushButton(TaxExportDlg)
        self.XlsSelectBtn.setObjectName(u"XlsSelectBtn")
        sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.XlsSelectBtn.sizePolicy().hasHeightForWidth())
        self.XlsSelectBtn.setSizePolicy(sizePolicy)

        self.gridLayout.addWidget(self.XlsSelectBtn, 3, 2, 1, 1)

        self.WarningLbl = QLabel(TaxExportDlg)
        self.WarningLbl.setObjectName(u"WarningLbl")
        font = QFont()
        font.setItalic(True)
        self.WarningLbl.setFont(font)

        self.gridLayout.addWidget(self.WarningLbl, 5, 0, 1, 4)

        self.DlsgGroup = QGroupBox(TaxExportDlg)
        self.DlsgGroup.setObjectName(u"DlsgGroup")
        sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        sizePolicy1.setHorizontalStretch(0)
        sizePolicy1.setVerticalStretch(0)
        sizePolicy1.setHeightForWidth(
            self.DlsgGroup.sizePolicy().hasHeightForWidth())
        self.DlsgGroup.setSizePolicy(sizePolicy1)
        self.DlsgGroup.setFlat(False)
        self.DlsgGroup.setCheckable(True)
        self.DlsgGroup.setChecked(False)
        self.gridLayout_2 = QGridLayout(self.DlsgGroup)
        self.gridLayout_2.setSpacing(2)
        self.gridLayout_2.setObjectName(u"gridLayout_2")
        self.gridLayout_2.setContentsMargins(6, 6, 6, 6)
        self.InitialFileLbl = QLabel(self.DlsgGroup)
        self.InitialFileLbl.setObjectName(u"InitialFileLbl")

        self.gridLayout_2.addWidget(self.InitialFileLbl, 0, 0, 1, 1)

        self.DlsgOutFileName = QLineEdit(self.DlsgGroup)
        self.DlsgOutFileName.setObjectName(u"DlsgOutFileName")

        self.gridLayout_2.addWidget(self.DlsgOutFileName, 1, 1, 1, 1)

        self.DlsgInFileName = QLineEdit(self.DlsgGroup)
        self.DlsgInFileName.setObjectName(u"DlsgInFileName")

        self.gridLayout_2.addWidget(self.DlsgInFileName, 0, 1, 1, 1)

        self.OutputFileLbl = QLabel(self.DlsgGroup)
        self.OutputFileLbl.setObjectName(u"OutputFileLbl")

        self.gridLayout_2.addWidget(self.OutputFileLbl, 1, 0, 1, 1)

        self.DividendsOnly = QCheckBox(self.DlsgGroup)
        self.DividendsOnly.setObjectName(u"DividendsOnly")

        self.gridLayout_2.addWidget(self.DividendsOnly, 3, 0, 1, 3)

        self.OutputSelectBtn = QPushButton(self.DlsgGroup)
        self.OutputSelectBtn.setObjectName(u"OutputSelectBtn")

        self.gridLayout_2.addWidget(self.OutputSelectBtn, 1, 2, 1, 1)

        self.InitialSelectBtn = QPushButton(self.DlsgGroup)
        self.InitialSelectBtn.setObjectName(u"InitialSelectBtn")

        self.gridLayout_2.addWidget(self.InitialSelectBtn, 0, 2, 1, 1)

        self.IncomeSourceBroker = QCheckBox(self.DlsgGroup)
        self.IncomeSourceBroker.setObjectName(u"IncomeSourceBroker")
        self.IncomeSourceBroker.setChecked(True)

        self.gridLayout_2.addWidget(self.IncomeSourceBroker, 2, 0, 1, 3)

        self.gridLayout.addWidget(self.DlsgGroup, 7, 0, 1, 4)

        self.Year = QSpinBox(TaxExportDlg)
        self.Year.setObjectName(u"Year")
        self.Year.setAlignment(Qt.AlignRight | Qt.AlignTrailing
                               | Qt.AlignVCenter)
        self.Year.setMinimum(2010)
        self.Year.setMaximum(2030)
        self.Year.setValue(2020)

        self.gridLayout.addWidget(self.Year, 1, 1, 1, 2)

        self.XlsFileName = QLineEdit(TaxExportDlg)
        self.XlsFileName.setObjectName(u"XlsFileName")
        sizePolicy2 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        sizePolicy2.setHorizontalStretch(0)
        sizePolicy2.setVerticalStretch(0)
        sizePolicy2.setHeightForWidth(
            self.XlsFileName.sizePolicy().hasHeightForWidth())
        self.XlsFileName.setSizePolicy(sizePolicy2)

        self.gridLayout.addWidget(self.XlsFileName, 3, 1, 1, 1)

        self.AccountWidget = AccountSelector(TaxExportDlg)
        self.AccountWidget.setObjectName(u"AccountWidget")

        self.gridLayout.addWidget(self.AccountWidget, 2, 1, 1, 2)

        self.YearLbl = QLabel(TaxExportDlg)
        self.YearLbl.setObjectName(u"YearLbl")

        self.gridLayout.addWidget(self.YearLbl, 1, 0, 1, 1)

        self.buttonBox = QDialogButtonBox(TaxExportDlg)
        self.buttonBox.setObjectName(u"buttonBox")
        self.buttonBox.setOrientation(Qt.Vertical)
        self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel
                                          | QDialogButtonBox.Ok)

        self.gridLayout.addWidget(self.buttonBox, 1, 3, 3, 1)

        self.AccountLbl = QLabel(TaxExportDlg)
        self.AccountLbl.setObjectName(u"AccountLbl")

        self.gridLayout.addWidget(self.AccountLbl, 2, 0, 1, 1)

        self.XlsFileLbl = QLabel(TaxExportDlg)
        self.XlsFileLbl.setObjectName(u"XlsFileLbl")

        self.gridLayout.addWidget(self.XlsFileLbl, 3, 0, 1, 1)

        self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum,
                                          QSizePolicy.Expanding)

        self.gridLayout.addItem(self.verticalSpacer, 9, 0, 1, 1)

        self.NoSettlement = QCheckBox(TaxExportDlg)
        self.NoSettlement.setObjectName(u"NoSettlement")

        self.gridLayout.addWidget(self.NoSettlement, 8, 0, 1, 4)

        QWidget.setTabOrder(self.Year, self.XlsFileName)
        QWidget.setTabOrder(self.XlsFileName, self.XlsSelectBtn)
        QWidget.setTabOrder(self.XlsSelectBtn, self.DlsgGroup)
        QWidget.setTabOrder(self.DlsgGroup, self.DlsgInFileName)
        QWidget.setTabOrder(self.DlsgInFileName, self.InitialSelectBtn)
        QWidget.setTabOrder(self.InitialSelectBtn, self.DlsgOutFileName)
        QWidget.setTabOrder(self.DlsgOutFileName, self.OutputSelectBtn)

        self.retranslateUi(TaxExportDlg)
        self.buttonBox.accepted.connect(TaxExportDlg.accept)
        self.buttonBox.rejected.connect(TaxExportDlg.reject)

        QMetaObject.connectSlotsByName(TaxExportDlg)

    # setupUi

    def retranslateUi(self, TaxExportDlg):
        TaxExportDlg.setWindowTitle(
            QCoreApplication.translate(
                "TaxExportDlg", u"Select parameters and files for tax report",
                None))
        #if QT_CONFIG(tooltip)
        self.XlsSelectBtn.setToolTip(
            QCoreApplication.translate("TaxExportDlg", u"Select file", None))
        #endif // QT_CONFIG(tooltip)
        self.XlsSelectBtn.setText(
            QCoreApplication.translate("TaxExportDlg", u"...", None))
        self.WarningLbl.setText(
            QCoreApplication.translate(
                "TaxExportDlg",
                u"Below functions are experimental - use it with care", None))
        self.DlsgGroup.setTitle(
            QCoreApplication.translate(
                "TaxExportDlg",
                u"Update file \"\u0414\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044f\" (*.dc0)",
                None))
        self.InitialFileLbl.setText(
            QCoreApplication.translate("TaxExportDlg", u"Initial file:", None))
        #if QT_CONFIG(tooltip)
        self.DlsgOutFileName.setToolTip(
            QCoreApplication.translate(
                "TaxExportDlg", u"File where to store russian tax form", None))
        #endif // QT_CONFIG(tooltip)
        #if QT_CONFIG(tooltip)
        self.DlsgInFileName.setToolTip(
            QCoreApplication.translate(
                "TaxExportDlg",
                u"File to use as a template for russian tax form", None))
        #endif // QT_CONFIG(tooltip)
        self.OutputFileLbl.setText(
            QCoreApplication.translate("TaxExportDlg", u"Output file:", None))
        self.DividendsOnly.setText(
            QCoreApplication.translate(
                "TaxExportDlg", u"Update only information about dividends",
                None))
        #if QT_CONFIG(tooltip)
        self.OutputSelectBtn.setToolTip(
            QCoreApplication.translate("TaxExportDlg", u"Select file", None))
        #endif // QT_CONFIG(tooltip)
        self.OutputSelectBtn.setText(
            QCoreApplication.translate("TaxExportDlg", u" ... ", None))
        #if QT_CONFIG(tooltip)
        self.InitialSelectBtn.setToolTip(
            QCoreApplication.translate("TaxExportDlg", u"Select file", None))
        #endif // QT_CONFIG(tooltip)
        self.InitialSelectBtn.setText(
            QCoreApplication.translate("TaxExportDlg", u" ... ", None))
        self.IncomeSourceBroker.setText(
            QCoreApplication.translate("TaxExportDlg",
                                       u"Use broker name as income source",
                                       None))
        self.Year.setSuffix("")
        #if QT_CONFIG(tooltip)
        self.XlsFileName.setToolTip(
            QCoreApplication.translate(
                "TaxExportDlg",
                u"File where to store tax report in Excel format", None))
        #endif // QT_CONFIG(tooltip)
        #if QT_CONFIG(tooltip)
        self.AccountWidget.setToolTip(
            QCoreApplication.translate(
                "TaxExportDlg", u"Foreign account to prepare tax report for",
                None))
        #endif // QT_CONFIG(tooltip)
        self.YearLbl.setText(
            QCoreApplication.translate("TaxExportDlg", u"Year:", None))
        self.AccountLbl.setText(
            QCoreApplication.translate("TaxExportDlg", u"Account:", None))
        self.XlsFileLbl.setText(
            QCoreApplication.translate("TaxExportDlg", u"Excel file:", None))
        self.NoSettlement.setText(
            QCoreApplication.translate(
                "TaxExportDlg",
                u"Do not use settlement date for currency rates", None))
Beispiel #20
0
    def set_up_ui(self, src, dst):
        self.setWindowTitle('File Already exists')
        self.setFixedHeight(300)
        self.setFixedWidth(440)

        self.dst_dirname, self.dst_file = os.path.split(dst)
        self.dst_filename, self.dst_file_extension = os.path.splitext(self.dst_file)

        label_src_image = QLabel(self)
        label_src_image.setMinimumSize(180, 120)
        label_src_image.setAlignment(Qt.AlignCenter)
        label_dst_image = QLabel(self)
        label_dst_image.setMinimumSize(180, 120)
        label_dst_image.setAlignment(Qt.AlignCenter)

        self.display_image(label_src_image, src)
        self.display_image(label_dst_image, dst)

        str_format = "<p align='center'>Date : {} <br> size : {}</p>"
        src_date = datetime.fromtimestamp(os.path.getmtime(src)).ctime()
        src_size = self.convert_size(os.path.getsize(src))
        src_info = str_format.format(src_date, src_size)
        dst_date = datetime.fromtimestamp(os.path.getmtime(src)).ctime()
        dst_size = self.convert_size(os.path.getsize(dst))
        dst_info = str_format.format(dst_date, dst_size)

        frame = QFrame()
        frame.setFrameShape(QFrame.HLine)
        frame.setFrameShadow(QFrame.Sunken)

        # button box
        button_box = QDialogButtonBox()
        button_box.setOrientation(Qt.Horizontal)
        button_box.setStandardButtons(QDialogButtonBox.Cancel)

        self.button_rename = QPushButton('Rename')
        self.button_rename.clicked.connect(lambda: QDialog.done(self, 3))
        button_box.addButton(self.button_rename, QDialogButtonBox.ApplyRole)

        self.button_overwrite = button_box.addButton('Overwrite', QDialogButtonBox.AcceptRole)

        button_box.rejected.connect(self.reject)
        button_box.accepted.connect(self.accept)

        # line edit
        self.edit_file_name = QLineEdit()
        self.edit_file_name.textChanged.connect(self.text_changed)
        self.edit_file_name.setText(os.path.basename(dst))

        button_new_name = QPushButton('Suggest new name')
        layout_new_name = QHBoxLayout()
        layout_new_name.addWidget(self.edit_file_name)
        layout_new_name.addWidget(button_new_name)
        button_new_name.clicked.connect(lambda: self.sugest_new_name(dst))

        self.grid = QGridLayout()
        # self.grid.setVerticalSpacing(10)
        self.grid.addWidget(QLabel('This action will overwrite the destination.'), 0, 0, 1, 2)
        self.grid.addWidget(QLabel('<b>Source</b>'), 1, 0, Qt.AlignHCenter)
        self.grid.addWidget(QLabel('<b>Destination</b>'), 1, 1, Qt.AlignHCenter)

        self.grid.addWidget(label_dst_image, 2, 0, Qt.AlignHCenter)
        self.grid.addWidget(label_src_image, 2, 1, Qt.AlignHCenter)

        self.grid.addWidget(QLabel(src_info), 3, 0, Qt.AlignHCenter)
        self.grid.addWidget(QLabel(dst_info), 3, 1, Qt.AlignHCenter)

        self.grid.addLayout(layout_new_name, 4, 0, 1, 2)

        self.grid.addWidget(frame, 6, 0, 1, 2)

        self.grid.addWidget(button_box, 7, 0, 1, 2)

        self.setLayout(self.grid)
Beispiel #21
0
class Principal(QMainWindow):

    def __init__(self):
        QMainWindow.__init__(self)
        self.inicializar_db()
        self.setWindowTitle("Tião Automecânica - Clientes")
        self.widget = QWidget()

        # Janelas
        w1, w2 = Buscador(), NovoCliente()
        w1.status_signal.connect(self.atualizar_status)
        w2.status_signal.connect(self.atualizar_status)

        # Leiaute
        self.line = QFrame()
        self.line.setFrameShape(QFrame.VLine)
        self.line.setFrameShadow(QFrame.Sunken)
        self.line.setLineWidth(0)
        self.line.setMidLineWidth(1)
        self.layout = QGridLayout()
        self.layout.addWidget(w1, 0, 0, 1, 1)
        self.layout.addWidget(self.line, 0, 1, 1, 1)
        self.layout.addWidget(w2, 0, 1, 1, 2)
        self.widget.setLayout(self.layout)
        self.setCentralWidget(self.widget)

        # Menu
        self.menu = QMenuBar()
        self.setMenuBar(self.menu)
        self.sobre = QAction("Sobre", self)
        self.sobre.setShortcut("F1")
        self.menu.addAction(self.sobre)
        self.sobre.triggered.connect(self.info)

        # Status
        self.status = QStatusBar()
        self.setStatusBar(self.status)
        self.status_label = QLabel("Pronto")
        self.status.addWidget(self.status_label)

    @Slot()
    def info(self):
        self.popup = QMessageBox(QMessageBox.Information, "Sobre",
                                 "Informações")
        self.popup.setInformativeText("""Clientes \nVersão 0.5
        \nFeito com S2 por Zero \nMIT License""")
        self.popup.addButton(QMessageBox.Ok)
        self.popup.exec()

    @Slot()
    def atualizar_status(self, msg: str):
        self.status_label.setText(msg)

    @staticmethod
    def inicializar_db():
        try:
            init_db()
        except NameError:
            popup = QMessageBox(QMessageBox.Critical, "Erro", "Erro")
            popup.setInformativeText(
                "Arquivo de configuração não foi encontrado")
            popup.addButton(QMessageBox.Ok)
            popup.exec()
            exit(1)
Beispiel #22
0
class Ui_LoginFNSDialog(object):
    def setupUi(self, LoginFNSDialog):
        if not LoginFNSDialog.objectName():
            LoginFNSDialog.setObjectName(u"LoginFNSDialog")
        LoginFNSDialog.resize(400, 500)
        self.verticalLayout_3 = QVBoxLayout(LoginFNSDialog)
        self.verticalLayout_3.setSpacing(6)
        self.verticalLayout_3.setObjectName(u"verticalLayout_3")
        self.verticalLayout_3.setContentsMargins(2, 2, 2, 2)
        self.LoginMethodTabs = QTabWidget(LoginFNSDialog)
        self.LoginMethodTabs.setObjectName(u"LoginMethodTabs")
        self.LoginSMSTab = QWidget()
        self.LoginSMSTab.setObjectName(u"LoginSMSTab")
        self.verticalLayout_7 = QVBoxLayout(self.LoginSMSTab)
        self.verticalLayout_7.setSpacing(2)
        self.verticalLayout_7.setObjectName(u"verticalLayout_7")
        self.verticalLayout_7.setContentsMargins(0, 0, 0, 0)
        self.PhoneNumberFrame = QFrame(self.LoginSMSTab)
        self.PhoneNumberFrame.setObjectName(u"PhoneNumberFrame")
        self.PhoneNumberFrame.setFrameShape(QFrame.NoFrame)
        self.PhoneNumberFrame.setFrameShadow(QFrame.Plain)
        self.formLayout_2 = QFormLayout(self.PhoneNumberFrame)
        self.formLayout_2.setObjectName(u"formLayout_2")
        self.formLayout_2.setContentsMargins(6, -1, 6, 0)
        self.PhoneLbl = QLabel(self.PhoneNumberFrame)
        self.PhoneLbl.setObjectName(u"PhoneLbl")

        self.formLayout_2.setWidget(0, QFormLayout.LabelRole, self.PhoneLbl)

        self.PhoneNumberEdit = QLineEdit(self.PhoneNumberFrame)
        self.PhoneNumberEdit.setObjectName(u"PhoneNumberEdit")
        self.PhoneNumberEdit.setInputMask(u"+7-999-999-99-99;_")

        self.formLayout_2.setWidget(0, QFormLayout.FieldRole,
                                    self.PhoneNumberEdit)

        self.verticalLayout_7.addWidget(self.PhoneNumberFrame)

        self.CodeButtonFrame = QFrame(self.LoginSMSTab)
        self.CodeButtonFrame.setObjectName(u"CodeButtonFrame")
        self.CodeButtonFrame.setFrameShape(QFrame.NoFrame)
        self.CodeButtonFrame.setFrameShadow(QFrame.Plain)
        self.verticalLayout_8 = QVBoxLayout(self.CodeButtonFrame)
        self.verticalLayout_8.setObjectName(u"verticalLayout_8")
        self.verticalLayout_8.setContentsMargins(0, 6, 0, 0)
        self.GetCodeBtn = QPushButton(self.CodeButtonFrame)
        self.GetCodeBtn.setObjectName(u"GetCodeBtn")
        sizePolicy = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.GetCodeBtn.sizePolicy().hasHeightForWidth())
        self.GetCodeBtn.setSizePolicy(sizePolicy)

        self.verticalLayout_8.addWidget(self.GetCodeBtn, 0, Qt.AlignHCenter)

        self.verticalLayout_7.addWidget(self.CodeButtonFrame)

        self.CodeFrame = QFrame(self.LoginSMSTab)
        self.CodeFrame.setObjectName(u"CodeFrame")
        self.CodeFrame.setFrameShape(QFrame.NoFrame)
        self.CodeFrame.setFrameShadow(QFrame.Plain)
        self.formLayout_3 = QFormLayout(self.CodeFrame)
        self.formLayout_3.setObjectName(u"formLayout_3")
        self.formLayout_3.setContentsMargins(6, -1, 6, 0)
        self.CodeLbl = QLabel(self.CodeFrame)
        self.CodeLbl.setObjectName(u"CodeLbl")

        self.formLayout_3.setWidget(0, QFormLayout.LabelRole, self.CodeLbl)

        self.CodeEdit = QLineEdit(self.CodeFrame)
        self.CodeEdit.setObjectName(u"CodeEdit")

        self.formLayout_3.setWidget(0, QFormLayout.FieldRole, self.CodeEdit)

        self.verticalLayout_7.addWidget(self.CodeFrame)

        self.SMSButtonFrame = QFrame(self.LoginSMSTab)
        self.SMSButtonFrame.setObjectName(u"SMSButtonFrame")
        sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding)
        sizePolicy1.setHorizontalStretch(0)
        sizePolicy1.setVerticalStretch(0)
        sizePolicy1.setHeightForWidth(
            self.SMSButtonFrame.sizePolicy().hasHeightForWidth())
        self.SMSButtonFrame.setSizePolicy(sizePolicy1)
        self.SMSButtonFrame.setFrameShape(QFrame.NoFrame)
        self.SMSButtonFrame.setFrameShadow(QFrame.Plain)
        self.verticalLayout_10 = QVBoxLayout(self.SMSButtonFrame)
        self.verticalLayout_10.setObjectName(u"verticalLayout_10")
        self.verticalLayout_10.setContentsMargins(0, 0, 0, 6)
        self.frame = QFrame(self.SMSButtonFrame)
        self.frame.setObjectName(u"frame")
        sizePolicy1.setHeightForWidth(
            self.frame.sizePolicy().hasHeightForWidth())
        self.frame.setSizePolicy(sizePolicy1)
        self.frame.setFrameShape(QFrame.NoFrame)
        self.frame.setFrameShadow(QFrame.Plain)
        self.verticalLayout_9 = QVBoxLayout(self.frame)
        self.verticalLayout_9.setObjectName(u"verticalLayout_9")
        self.SMSLoginBtn = QPushButton(self.frame)
        self.SMSLoginBtn.setObjectName(u"SMSLoginBtn")
        sizePolicy.setHeightForWidth(
            self.SMSLoginBtn.sizePolicy().hasHeightForWidth())
        self.SMSLoginBtn.setSizePolicy(sizePolicy)

        self.verticalLayout_9.addWidget(self.SMSLoginBtn, 0,
                                        Qt.AlignHCenter | Qt.AlignTop)

        self.verticalLayout_10.addWidget(self.frame)

        self.line = QFrame(self.SMSButtonFrame)
        self.line.setObjectName(u"line")
        self.line.setFrameShape(QFrame.HLine)
        self.line.setFrameShadow(QFrame.Sunken)

        self.verticalLayout_10.addWidget(self.line)

        self.SMSCloseBtn = QPushButton(self.SMSButtonFrame)
        self.SMSCloseBtn.setObjectName(u"SMSCloseBtn")
        sizePolicy.setHeightForWidth(
            self.SMSCloseBtn.sizePolicy().hasHeightForWidth())
        self.SMSCloseBtn.setSizePolicy(sizePolicy)

        self.verticalLayout_10.addWidget(self.SMSCloseBtn, 0, Qt.AlignHCenter)

        self.verticalLayout_7.addWidget(self.SMSButtonFrame)

        self.LoginMethodTabs.addTab(self.LoginSMSTab, "")
        self.LoginPasswordTab = QWidget()
        self.LoginPasswordTab.setObjectName(u"LoginPasswordTab")
        self.verticalLayout = QVBoxLayout(self.LoginPasswordTab)
        self.verticalLayout.setSpacing(2)
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.LoginDataFrame = QFrame(self.LoginPasswordTab)
        self.LoginDataFrame.setObjectName(u"LoginDataFrame")
        sizePolicy2 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        sizePolicy2.setHorizontalStretch(0)
        sizePolicy2.setVerticalStretch(0)
        sizePolicy2.setHeightForWidth(
            self.LoginDataFrame.sizePolicy().hasHeightForWidth())
        self.LoginDataFrame.setSizePolicy(sizePolicy2)
        self.LoginDataFrame.setFrameShape(QFrame.NoFrame)
        self.LoginDataFrame.setFrameShadow(QFrame.Plain)
        self.formLayout = QFormLayout(self.LoginDataFrame)
        self.formLayout.setObjectName(u"formLayout")
        self.formLayout.setHorizontalSpacing(6)
        self.formLayout.setContentsMargins(6, -1, 6, 0)
        self.InnLbl = QLabel(self.LoginDataFrame)
        self.InnLbl.setObjectName(u"InnLbl")

        self.formLayout.setWidget(0, QFormLayout.LabelRole, self.InnLbl)

        self.InnEdit = QLineEdit(self.LoginDataFrame)
        self.InnEdit.setObjectName(u"InnEdit")

        self.formLayout.setWidget(0, QFormLayout.FieldRole, self.InnEdit)

        self.PasswordLbl = QLabel(self.LoginDataFrame)
        self.PasswordLbl.setObjectName(u"PasswordLbl")

        self.formLayout.setWidget(1, QFormLayout.LabelRole, self.PasswordLbl)

        self.PasswordEdit = QLineEdit(self.LoginDataFrame)
        self.PasswordEdit.setObjectName(u"PasswordEdit")
        self.PasswordEdit.setEchoMode(QLineEdit.Password)

        self.formLayout.setWidget(1, QFormLayout.FieldRole, self.PasswordEdit)

        self.verticalLayout.addWidget(self.LoginDataFrame)

        self.FNSButtonFrame = QFrame(self.LoginPasswordTab)
        self.FNSButtonFrame.setObjectName(u"FNSButtonFrame")
        self.FNSButtonFrame.setFrameShape(QFrame.NoFrame)
        self.FNSButtonFrame.setFrameShadow(QFrame.Plain)
        self.verticalLayout_4 = QVBoxLayout(self.FNSButtonFrame)
        self.verticalLayout_4.setSpacing(6)
        self.verticalLayout_4.setObjectName(u"verticalLayout_4")
        self.verticalLayout_4.setContentsMargins(0, 0, 0, 6)
        self.FNSLoginFrame = QFrame(self.FNSButtonFrame)
        self.FNSLoginFrame.setObjectName(u"FNSLoginFrame")
        sizePolicy1.setHeightForWidth(
            self.FNSLoginFrame.sizePolicy().hasHeightForWidth())
        self.FNSLoginFrame.setSizePolicy(sizePolicy1)
        self.FNSLoginFrame.setFrameShape(QFrame.NoFrame)
        self.FNSLoginFrame.setFrameShadow(QFrame.Plain)
        self.verticalLayout_5 = QVBoxLayout(self.FNSLoginFrame)
        self.verticalLayout_5.setObjectName(u"verticalLayout_5")
        self.FNSLoginBtn = QPushButton(self.FNSLoginFrame)
        self.FNSLoginBtn.setObjectName(u"FNSLoginBtn")
        sizePolicy.setHeightForWidth(
            self.FNSLoginBtn.sizePolicy().hasHeightForWidth())
        self.FNSLoginBtn.setSizePolicy(sizePolicy)

        self.verticalLayout_5.addWidget(self.FNSLoginBtn, 0,
                                        Qt.AlignHCenter | Qt.AlignTop)

        self.verticalLayout_4.addWidget(self.FNSLoginFrame)

        self.FNSSplitLine = QFrame(self.FNSButtonFrame)
        self.FNSSplitLine.setObjectName(u"FNSSplitLine")
        self.FNSSplitLine.setFrameShape(QFrame.HLine)
        self.FNSSplitLine.setFrameShadow(QFrame.Sunken)

        self.verticalLayout_4.addWidget(self.FNSSplitLine)

        self.FNSCloseBtn = QPushButton(self.FNSButtonFrame)
        self.FNSCloseBtn.setObjectName(u"FNSCloseBtn")
        sizePolicy.setHeightForWidth(
            self.FNSCloseBtn.sizePolicy().hasHeightForWidth())
        self.FNSCloseBtn.setSizePolicy(sizePolicy)

        self.verticalLayout_4.addWidget(self.FNSCloseBtn, 0, Qt.AlignHCenter)

        self.verticalLayout.addWidget(self.FNSButtonFrame)

        self.LoginMethodTabs.addTab(self.LoginPasswordTab, "")
        self.ESIATab = QWidget()
        self.ESIATab.setObjectName(u"ESIATab")
        self.verticalLayout_2 = QVBoxLayout(self.ESIATab)
        self.verticalLayout_2.setSpacing(2)
        self.verticalLayout_2.setObjectName(u"verticalLayout_2")
        self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.ESIAWebView = QWebEngineView(self.ESIATab)
        self.ESIAWebView.setObjectName(u"ESIAWebView")
        sizePolicy1.setHeightForWidth(
            self.ESIAWebView.sizePolicy().hasHeightForWidth())
        self.ESIAWebView.setSizePolicy(sizePolicy1)
        self.ESIAWebView.setUrl(QUrl(u"about:blank"))

        self.verticalLayout_2.addWidget(self.ESIAWebView)

        self.ESIAButtonFrame = QFrame(self.ESIATab)
        self.ESIAButtonFrame.setObjectName(u"ESIAButtonFrame")
        self.ESIAButtonFrame.setFrameShape(QFrame.NoFrame)
        self.ESIAButtonFrame.setFrameShadow(QFrame.Plain)
        self.verticalLayout_6 = QVBoxLayout(self.ESIAButtonFrame)
        self.verticalLayout_6.setObjectName(u"verticalLayout_6")
        self.verticalLayout_6.setContentsMargins(0, 0, 0, 6)
        self.ESIASplitLine = QFrame(self.ESIAButtonFrame)
        self.ESIASplitLine.setObjectName(u"ESIASplitLine")
        self.ESIASplitLine.setFrameShape(QFrame.HLine)
        self.ESIASplitLine.setFrameShadow(QFrame.Sunken)

        self.verticalLayout_6.addWidget(self.ESIASplitLine)

        self.ESIACloseBtn = QPushButton(self.ESIAButtonFrame)
        self.ESIACloseBtn.setObjectName(u"ESIACloseBtn")
        sizePolicy.setHeightForWidth(
            self.ESIACloseBtn.sizePolicy().hasHeightForWidth())
        self.ESIACloseBtn.setSizePolicy(sizePolicy)

        self.verticalLayout_6.addWidget(self.ESIACloseBtn, 0, Qt.AlignHCenter)

        self.verticalLayout_2.addWidget(self.ESIAButtonFrame)

        self.LoginMethodTabs.addTab(self.ESIATab, "")

        self.verticalLayout_3.addWidget(self.LoginMethodTabs)

        self.retranslateUi(LoginFNSDialog)
        self.FNSCloseBtn.clicked.connect(LoginFNSDialog.close)
        self.ESIACloseBtn.clicked.connect(LoginFNSDialog.close)
        self.SMSCloseBtn.clicked.connect(LoginFNSDialog.close)

        self.LoginMethodTabs.setCurrentIndex(0)

        QMetaObject.connectSlotsByName(LoginFNSDialog)

    # setupUi

    def retranslateUi(self, LoginFNSDialog):
        LoginFNSDialog.setWindowTitle(
            QCoreApplication.translate("LoginFNSDialog", u"Authorization FNS",
                                       None))
        self.PhoneLbl.setText(
            QCoreApplication.translate("LoginFNSDialog", u"Phone number:",
                                       None))
        self.GetCodeBtn.setText(
            QCoreApplication.translate("LoginFNSDialog", u"Send SMS with code",
                                       None))
        self.CodeLbl.setText(
            QCoreApplication.translate("LoginFNSDialog", u"Code from SMS:",
                                       None))
        self.SMSLoginBtn.setText(
            QCoreApplication.translate("LoginFNSDialog", u"Login", None))
        self.SMSCloseBtn.setText(
            QCoreApplication.translate("LoginFNSDialog", u"Close", None))
        self.LoginMethodTabs.setTabText(
            self.LoginMethodTabs.indexOf(self.LoginSMSTab),
            QCoreApplication.translate("LoginFNSDialog", u"SMS Login", None))
        self.InnLbl.setText(
            QCoreApplication.translate("LoginFNSDialog", u"INN:", None))
        self.PasswordLbl.setText(
            QCoreApplication.translate("LoginFNSDialog", u"Password:"******"LoginFNSDialog", u"Login", None))
        self.FNSCloseBtn.setText(
            QCoreApplication.translate("LoginFNSDialog", u"Close", None))
        self.LoginMethodTabs.setTabText(
            self.LoginMethodTabs.indexOf(self.LoginPasswordTab),
            QCoreApplication.translate("LoginFNSDialog", u"FNS Login", None))
        self.ESIACloseBtn.setText(
            QCoreApplication.translate("LoginFNSDialog", u"Close", None))
        self.LoginMethodTabs.setTabText(
            self.LoginMethodTabs.indexOf(self.ESIATab),
            QCoreApplication.translate("LoginFNSDialog", u"ESIA Login", None))
Beispiel #23
0
class Ui_TaxEstimationDialog(object):
    def setupUi(self, TaxEstimationDialog):
        if not TaxEstimationDialog.objectName():
            TaxEstimationDialog.setObjectName(u"TaxEstimationDialog")
        TaxEstimationDialog.resize(754, 191)
        self.verticalLayout = QVBoxLayout(TaxEstimationDialog)
        self.verticalLayout.setSpacing(2)
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout = QHBoxLayout()
        self.horizontalLayout.setSpacing(2)
        self.horizontalLayout.setObjectName(u"horizontalLayout")
        self.RateFrame = QFrame(TaxEstimationDialog)
        self.RateFrame.setObjectName(u"RateFrame")
        self.RateFrame.setFrameShape(QFrame.StyledPanel)
        self.RateFrame.setFrameShadow(QFrame.Raised)
        self.horizontalLayout_2 = QHBoxLayout(self.RateFrame)
        self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
        self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.LastQuoteLbl = QLabel(self.RateFrame)
        self.LastQuoteLbl.setObjectName(u"LastQuoteLbl")
        font = QFont()
        font.setBold(True)
        self.LastQuoteLbl.setFont(font)

        self.horizontalLayout_2.addWidget(self.LastQuoteLbl)

        self.QuoteLbl = QLabel(self.RateFrame)
        self.QuoteLbl.setObjectName(u"QuoteLbl")

        self.horizontalLayout_2.addWidget(self.QuoteLbl)

        self.RateSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)

        self.horizontalLayout_2.addItem(self.RateSpacer)


        self.horizontalLayout.addWidget(self.RateFrame)

        self.QuoteFrame = QFrame(TaxEstimationDialog)
        self.QuoteFrame.setObjectName(u"QuoteFrame")
        self.QuoteFrame.setFrameShape(QFrame.StyledPanel)
        self.QuoteFrame.setFrameShadow(QFrame.Raised)
        self.horizontalLayout_3 = QHBoxLayout(self.QuoteFrame)
        self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
        self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0)
        self.CurrentRateLbl = QLabel(self.QuoteFrame)
        self.CurrentRateLbl.setObjectName(u"CurrentRateLbl")
        self.CurrentRateLbl.setFont(font)

        self.horizontalLayout_3.addWidget(self.CurrentRateLbl)

        self.RateLbl = QLabel(self.QuoteFrame)
        self.RateLbl.setObjectName(u"RateLbl")

        self.horizontalLayout_3.addWidget(self.RateLbl)

        self.QuoteSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)

        self.horizontalLayout_3.addItem(self.QuoteSpacer)


        self.horizontalLayout.addWidget(self.QuoteFrame)


        self.verticalLayout.addLayout(self.horizontalLayout)

        self.DealsView = QTableView(TaxEstimationDialog)
        self.DealsView.setObjectName(u"DealsView")
        self.DealsView.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.DealsView.verticalHeader().setVisible(False)
        self.DealsView.verticalHeader().setMinimumSectionSize(20)
        self.DealsView.verticalHeader().setDefaultSectionSize(20)

        self.verticalLayout.addWidget(self.DealsView)


        self.retranslateUi(TaxEstimationDialog)

        QMetaObject.connectSlotsByName(TaxEstimationDialog)
    # setupUi

    def retranslateUi(self, TaxEstimationDialog):
        TaxEstimationDialog.setWindowTitle(QCoreApplication.translate("TaxEstimationDialog", u"Tax Estimation", None))
        self.LastQuoteLbl.setText(QCoreApplication.translate("TaxEstimationDialog", u"Last quote:", None))
        self.QuoteLbl.setText(QCoreApplication.translate("TaxEstimationDialog", u"X.XX", None))
        self.CurrentRateLbl.setText(QCoreApplication.translate("TaxEstimationDialog", u"Current rate:", None))
        self.RateLbl.setText(QCoreApplication.translate("TaxEstimationDialog", u"X.XX", None))
Beispiel #24
0
class Ui_Img(object):
    def setupUi(self, Img):
        if not Img.objectName():
            Img.setObjectName(u"Img")
        Img.resize(620, 559)
        self.gridLayout = QGridLayout(Img)
        self.gridLayout.setObjectName(u"gridLayout")
        self.graphicsView = QGraphicsView(Img)
        self.graphicsView.setObjectName(u"graphicsView")

        self.gridLayout.addWidget(self.graphicsView, 0, 0, 1, 1)

        self.verticalLayout = QVBoxLayout()
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.line_3 = QFrame(Img)
        self.line_3.setObjectName(u"line_3")
        self.line_3.setFrameShape(QFrame.VLine)
        self.line_3.setFrameShadow(QFrame.Sunken)

        self.verticalLayout.addWidget(self.line_3)

        self.verticalLayout_2 = QVBoxLayout()
        self.verticalLayout_2.setObjectName(u"verticalLayout_2")
        self.line_5 = QFrame(Img)
        self.line_5.setObjectName(u"line_5")
        self.line_5.setFrameShape(QFrame.VLine)
        self.line_5.setFrameShadow(QFrame.Sunken)

        self.verticalLayout_2.addWidget(self.line_5)

        self.checkBox = QCheckBox(Img)
        self.checkBox.setObjectName(u"checkBox")
        self.checkBox.setMaximumSize(QSize(100, 16777215))
        self.checkBox.setChecked(True)

        self.verticalLayout_2.addWidget(self.checkBox)

        self.ttaModel = QCheckBox(Img)
        self.ttaModel.setObjectName(u"ttaModel")
        self.ttaModel.setMaximumSize(QSize(70, 16777215))

        self.verticalLayout_2.addWidget(self.ttaModel)

        self.horizontalLayout_3 = QHBoxLayout()
        self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
        self.scaleRadio = QRadioButton(Img)
        self.buttonGroup_2 = QButtonGroup(Img)
        self.buttonGroup_2.setObjectName(u"buttonGroup_2")
        self.buttonGroup_2.addButton(self.scaleRadio)
        self.scaleRadio.setObjectName(u"scaleRadio")
        self.scaleRadio.setMaximumSize(QSize(80, 16777215))
        self.scaleRadio.setChecked(True)

        self.horizontalLayout_3.addWidget(self.scaleRadio)

        self.scaleEdit = QLineEdit(Img)
        self.scaleEdit.setObjectName(u"scaleEdit")
        self.scaleEdit.setMaximumSize(QSize(160, 16777215))
        self.scaleEdit.setAlignment(Qt.AlignCenter)

        self.horizontalLayout_3.addWidget(self.scaleEdit)

        self.verticalLayout_2.addLayout(self.horizontalLayout_3)

        self.horizontalLayout_4 = QHBoxLayout()
        self.horizontalLayout_4.setObjectName(u"horizontalLayout_4")
        self.heighRadio = QRadioButton(Img)
        self.buttonGroup_2.addButton(self.heighRadio)
        self.heighRadio.setObjectName(u"heighRadio")
        self.heighRadio.setMaximumSize(QSize(80, 16777215))

        self.horizontalLayout_4.addWidget(self.heighRadio)

        self.widthEdit = QLineEdit(Img)
        self.widthEdit.setObjectName(u"widthEdit")
        self.widthEdit.setEnabled(False)
        self.widthEdit.setMaximumSize(QSize(60, 16777215))
        self.widthEdit.setAlignment(Qt.AlignCenter)

        self.horizontalLayout_4.addWidget(self.widthEdit)

        self.label_2 = QLabel(Img)
        self.label_2.setObjectName(u"label_2")
        self.label_2.setMaximumSize(QSize(20, 16777215))

        self.horizontalLayout_4.addWidget(self.label_2)

        self.heighEdit = QLineEdit(Img)
        self.heighEdit.setObjectName(u"heighEdit")
        self.heighEdit.setEnabled(False)
        self.heighEdit.setMaximumSize(QSize(60, 16777215))
        self.heighEdit.setAlignment(Qt.AlignCenter)

        self.horizontalLayout_4.addWidget(self.heighEdit)

        self.verticalLayout_2.addLayout(self.horizontalLayout_4)

        self.horizontalLayout_5 = QHBoxLayout()
        self.horizontalLayout_5.setObjectName(u"horizontalLayout_5")
        self.label_4 = QLabel(Img)
        self.label_4.setObjectName(u"label_4")
        self.label_4.setMaximumSize(QSize(60, 16777215))

        self.horizontalLayout_5.addWidget(self.label_4)

        self.noiseCombox = QComboBox(Img)
        self.noiseCombox.addItem("")
        self.noiseCombox.addItem("")
        self.noiseCombox.addItem("")
        self.noiseCombox.addItem("")
        self.noiseCombox.addItem("")
        self.noiseCombox.setObjectName(u"noiseCombox")
        self.noiseCombox.setMaximumSize(QSize(160, 16777215))

        self.horizontalLayout_5.addWidget(self.noiseCombox)

        self.verticalLayout_2.addLayout(self.horizontalLayout_5)

        self.horizontalLayout_6 = QHBoxLayout()
        self.horizontalLayout_6.setObjectName(u"horizontalLayout_6")
        self.label_5 = QLabel(Img)
        self.label_5.setObjectName(u"label_5")
        self.label_5.setMaximumSize(QSize(60, 16777215))

        self.horizontalLayout_6.addWidget(self.label_5)

        self.comboBox = QComboBox(Img)
        self.comboBox.addItem("")
        self.comboBox.addItem("")
        self.comboBox.addItem("")
        self.comboBox.setObjectName(u"comboBox")
        self.comboBox.setMaximumSize(QSize(160, 16777215))

        self.horizontalLayout_6.addWidget(self.comboBox)

        self.verticalLayout_2.addLayout(self.horizontalLayout_6)

        self.horizontalLayout_7 = QHBoxLayout()
        self.horizontalLayout_7.setObjectName(u"horizontalLayout_7")
        self.changeJpg = QPushButton(Img)
        self.changeJpg.setObjectName(u"changeJpg")
        self.changeJpg.setMaximumSize(QSize(100, 16777215))

        self.horizontalLayout_7.addWidget(self.changeJpg)

        self.changePng = QPushButton(Img)
        self.changePng.setObjectName(u"changePng")
        self.changePng.setMaximumSize(QSize(100, 16777215))

        self.horizontalLayout_7.addWidget(self.changePng)

        self.changeLabel = QLabel(Img)
        self.changeLabel.setObjectName(u"changeLabel")
        self.changeLabel.setMaximumSize(QSize(100, 16777215))
        self.changeLabel.setAlignment(Qt.AlignCenter)

        self.horizontalLayout_7.addWidget(self.changeLabel)

        self.verticalLayout_2.addLayout(self.horizontalLayout_7)

        self.horizontalLayout_11 = QHBoxLayout()
        self.horizontalLayout_11.setObjectName(u"horizontalLayout_11")

        self.verticalLayout_2.addLayout(self.horizontalLayout_11)

        self.verticalLayout.addLayout(self.verticalLayout_2)

        self.line = QFrame(Img)
        self.line.setObjectName(u"line")
        self.line.setFrameShape(QFrame.VLine)
        self.line.setFrameShadow(QFrame.Sunken)

        self.verticalLayout.addWidget(self.line)

        self.line_4 = QFrame(Img)
        self.line_4.setObjectName(u"line_4")
        self.line_4.setFrameShape(QFrame.HLine)
        self.line_4.setFrameShadow(QFrame.Sunken)

        self.verticalLayout.addWidget(self.line_4)

        self.verticalLayout_3 = QVBoxLayout()
        self.verticalLayout_3.setObjectName(u"verticalLayout_3")
        self.horizontalLayout_8 = QHBoxLayout()
        self.horizontalLayout_8.setObjectName(u"horizontalLayout_8")
        self.label_8 = QLabel(Img)
        self.label_8.setObjectName(u"label_8")
        self.label_8.setMaximumSize(QSize(60, 16777215))

        self.horizontalLayout_8.addWidget(self.label_8)

        self.resolutionLabel = QLabel(Img)
        self.resolutionLabel.setObjectName(u"resolutionLabel")
        self.resolutionLabel.setMaximumSize(QSize(160, 16777215))

        self.horizontalLayout_8.addWidget(self.resolutionLabel)

        self.verticalLayout_3.addLayout(self.horizontalLayout_8)

        self.horizontalLayout_9 = QHBoxLayout()
        self.horizontalLayout_9.setObjectName(u"horizontalLayout_9")
        self.label_10 = QLabel(Img)
        self.label_10.setObjectName(u"label_10")
        self.label_10.setMaximumSize(QSize(60, 16777215))

        self.horizontalLayout_9.addWidget(self.label_10)

        self.sizeLabel = QLabel(Img)
        self.sizeLabel.setObjectName(u"sizeLabel")
        self.sizeLabel.setMaximumSize(QSize(160, 16777215))

        self.horizontalLayout_9.addWidget(self.sizeLabel)

        self.verticalLayout_3.addLayout(self.horizontalLayout_9)

        self.horizontalLayout = QHBoxLayout()
        self.horizontalLayout.setObjectName(u"horizontalLayout")
        self.label = QLabel(Img)
        self.label.setObjectName(u"label")
        self.label.setMaximumSize(QSize(60, 16777215))

        self.horizontalLayout.addWidget(self.label)

        self.gpuName = QLabel(Img)
        self.gpuName.setObjectName(u"gpuName")
        self.gpuName.setMaximumSize(QSize(160, 16777215))

        self.horizontalLayout.addWidget(self.gpuName)

        self.verticalLayout_3.addLayout(self.horizontalLayout)

        self.horizontalLayout_10 = QHBoxLayout()
        self.horizontalLayout_10.setObjectName(u"horizontalLayout_10")
        self.label_6 = QLabel(Img)
        self.label_6.setObjectName(u"label_6")
        self.label_6.setMaximumSize(QSize(60, 16777215))

        self.horizontalLayout_10.addWidget(self.label_6)

        self.tickLabel = QLabel(Img)
        self.tickLabel.setObjectName(u"tickLabel")
        self.tickLabel.setMaximumSize(QSize(160, 16777215))

        self.horizontalLayout_10.addWidget(self.tickLabel)

        self.verticalLayout_3.addLayout(self.horizontalLayout_10)

        self.oepnButton = QPushButton(Img)
        self.oepnButton.setObjectName(u"oepnButton")
        self.oepnButton.setMaximumSize(QSize(100, 16777215))

        self.verticalLayout_3.addWidget(self.oepnButton)

        self.horizontalLayout_2 = QHBoxLayout()
        self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")

        self.verticalLayout_3.addLayout(self.horizontalLayout_2)

        self.pushButton_3 = QPushButton(Img)
        self.pushButton_3.setObjectName(u"pushButton_3")
        self.pushButton_3.setMaximumSize(QSize(100, 16777215))

        self.verticalLayout_3.addWidget(self.pushButton_3)

        self.pushButton = QPushButton(Img)
        self.pushButton.setObjectName(u"pushButton")
        self.pushButton.setMaximumSize(QSize(100, 16777215))

        self.verticalLayout_3.addWidget(self.pushButton)

        self.saveButton = QPushButton(Img)
        self.saveButton.setObjectName(u"saveButton")
        self.saveButton.setMaximumSize(QSize(100, 16777215))

        self.verticalLayout_3.addWidget(self.saveButton)

        self.verticalLayout.addLayout(self.verticalLayout_3)

        self.line_6 = QFrame(Img)
        self.line_6.setObjectName(u"line_6")
        self.line_6.setFrameShape(QFrame.HLine)
        self.line_6.setFrameShadow(QFrame.Sunken)

        self.verticalLayout.addWidget(self.line_6)

        self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum,
                                          QSizePolicy.Expanding)

        self.verticalLayout.addItem(self.verticalSpacer)

        self.line_2 = QFrame(Img)
        self.line_2.setObjectName(u"line_2")
        self.line_2.setFrameShape(QFrame.VLine)
        self.line_2.setFrameShadow(QFrame.Sunken)

        self.verticalLayout.addWidget(self.line_2)

        self.gridLayout.addLayout(self.verticalLayout, 0, 1, 1, 1)

        self.retranslateUi(Img)
        self.checkBox.clicked.connect(Img.SwithPicture)
        self.saveButton.clicked.connect(Img.SavePicture)
        self.heighEdit.textChanged.connect(Img.CheckScaleRadio)
        self.pushButton_3.clicked.connect(Img.ReduceScalePic)
        self.heighRadio.clicked.connect(Img.CheckScaleRadio)
        self.ttaModel.clicked.connect(Img.CheckScaleRadio)
        self.oepnButton.clicked.connect(Img.OpenPicture)
        self.widthEdit.textChanged.connect(Img.CheckScaleRadio)
        self.pushButton.clicked.connect(Img.AddScalePic)
        self.scaleEdit.textChanged.connect(Img.CheckScaleRadio)
        self.scaleRadio.clicked.connect(Img.CheckScaleRadio)
        self.comboBox.currentIndexChanged.connect(Img.ChangeModel)
        self.changeJpg.clicked.connect(Img.StartWaifu2x)
        self.noiseCombox.currentIndexChanged.connect(Img.CheckScaleRadio)
        self.changePng.clicked.connect(Img.StartWaifu2xPng)
        self.changeJpg.clicked.connect(Img.StartWaifu2xJPG)

        QMetaObject.connectSlotsByName(Img)

    # setupUi

    def retranslateUi(self, Img):
        Img.setWindowTitle(QCoreApplication.translate("Img", u"Form", None))
        self.checkBox.setText(
            QCoreApplication.translate("Img", u"waifu2x", None))
        #if QT_CONFIG(tooltip)
        self.ttaModel.setToolTip(
            QCoreApplication.translate(
                "Img",
                u"\u753b\u8d28\u63d0\u5347\uff0c\u8017\u65f6\u589e\u52a0",
                None))
        #endif // QT_CONFIG(tooltip)
        self.ttaModel.setText(
            QCoreApplication.translate("Img", u"tta\u6a21\u5f0f", None))
        self.scaleRadio.setText(
            QCoreApplication.translate("Img", u"\u500d\u6570\u653e\u5927",
                                       None))
        self.scaleEdit.setText(QCoreApplication.translate("Img", u"2", None))
        self.heighRadio.setText(
            QCoreApplication.translate("Img", u"\u56fa\u5b9a\u957f\u5bbd",
                                       None))
        self.label_2.setText(QCoreApplication.translate("Img", u"x", None))
        self.label_4.setText(
            QCoreApplication.translate("Img", u"\u964d\u566a\uff1a", None))
        self.noiseCombox.setItemText(
            0, QCoreApplication.translate("Img", u"3", None))
        self.noiseCombox.setItemText(
            1, QCoreApplication.translate("Img", u"2", None))
        self.noiseCombox.setItemText(
            2, QCoreApplication.translate("Img", u"1", None))
        self.noiseCombox.setItemText(
            3, QCoreApplication.translate("Img", u"0", None))
        self.noiseCombox.setItemText(
            4, QCoreApplication.translate("Img", u"-1", None))

        self.label_5.setText(
            QCoreApplication.translate("Img", u"\u6a21\u578b\uff1a", None))
        self.comboBox.setItemText(
            0, QCoreApplication.translate("Img", u"cunet", None))
        self.comboBox.setItemText(
            1, QCoreApplication.translate("Img", u"photo", None))
        self.comboBox.setItemText(
            2, QCoreApplication.translate("Img", u"anime_style_art_rgb", None))

        self.changeJpg.setText(
            QCoreApplication.translate("Img", u"\u8f6c\u6362JPG", None))
        self.changePng.setText(
            QCoreApplication.translate("Img", u"\u8f6c\u6362PNG", None))
        self.changeLabel.setText("")
        self.label_8.setText(
            QCoreApplication.translate("Img", u"\u5206\u8fa8\u7387\uff1a",
                                       None))
        self.resolutionLabel.setText(
            QCoreApplication.translate("Img", u"TextLabel", None))
        self.label_10.setText(
            QCoreApplication.translate("Img", u"\u5927 \u5c0f\uff1a", None))
        self.sizeLabel.setText(
            QCoreApplication.translate("Img", u"TextLabel", None))
        self.label.setText(QCoreApplication.translate("Img", u"GPU:", None))
        self.gpuName.setText(
            QCoreApplication.translate("Img", u"TextLabel", None))
        self.label_6.setText(
            QCoreApplication.translate("Img", u"\u8017\u65f6\uff1a", None))
        self.tickLabel.setText("")
        self.oepnButton.setText(
            QCoreApplication.translate("Img", u"\u6253\u5f00\u56fe\u7247",
                                       None))
        self.pushButton_3.setText(
            QCoreApplication.translate("Img", u"\u7f29\u5c0f", None))
        self.pushButton.setText(
            QCoreApplication.translate("Img", u"\u653e\u5927", None))
        self.saveButton.setText(
            QCoreApplication.translate("Img", u"\u4fdd\u5b58\u56fe\u7247",
                                       None))
Beispiel #25
0
class Ui_DealsReportWidget(object):
    def setupUi(self, DealsReportWidget):
        if not DealsReportWidget.objectName():
            DealsReportWidget.setObjectName(u"DealsReportWidget")
        DealsReportWidget.resize(821, 280)
        self.verticalLayout = QVBoxLayout(DealsReportWidget)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.ReportParamsFrame = QFrame(DealsReportWidget)
        self.ReportParamsFrame.setObjectName(u"ReportParamsFrame")
        self.ReportParamsFrame.setFrameShape(QFrame.Panel)
        self.ReportParamsFrame.setFrameShadow(QFrame.Sunken)
        self.horizontalLayout = QHBoxLayout(self.ReportParamsFrame)
        self.horizontalLayout.setSpacing(6)
        self.horizontalLayout.setObjectName(u"horizontalLayout")
        self.horizontalLayout.setContentsMargins(2, 2, 2, 2)
        self.ReportRange = DateRangeSelector(self.ReportParamsFrame)
        self.ReportRange.setObjectName(u"ReportRange")
        self.ReportRange.setProperty("ItemsList",
                                     u"QTD;YTD;this_year;last_year")

        self.horizontalLayout.addWidget(self.ReportRange)

        self.ReportGroupCheck = QCheckBox(self.ReportParamsFrame)
        self.ReportGroupCheck.setObjectName(u"ReportGroupCheck")

        self.horizontalLayout.addWidget(self.ReportGroupCheck)

        self.ReportAccountLbl = QLabel(self.ReportParamsFrame)
        self.ReportAccountLbl.setObjectName(u"ReportAccountLbl")

        self.horizontalLayout.addWidget(self.ReportAccountLbl)

        self.ReportAccountBtn = AccountButton(self.ReportParamsFrame)
        self.ReportAccountBtn.setObjectName(u"ReportAccountBtn")

        self.horizontalLayout.addWidget(self.ReportAccountBtn)

        self.ReportFrameSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding,
                                             QSizePolicy.Minimum)

        self.horizontalLayout.addItem(self.ReportFrameSpacer)

        self.verticalLayout.addWidget(self.ReportParamsFrame)

        self.ReportTableView = QTableView(DealsReportWidget)
        self.ReportTableView.setObjectName(u"ReportTableView")
        self.ReportTableView.setFrameShape(QFrame.Panel)
        self.ReportTableView.setFrameShadow(QFrame.Sunken)
        self.ReportTableView.setEditTriggers(QAbstractItemView.NoEditTriggers)
        self.ReportTableView.setAlternatingRowColors(True)
        self.ReportTableView.setGridStyle(Qt.DotLine)
        self.ReportTableView.setWordWrap(False)
        self.ReportTableView.verticalHeader().setVisible(False)
        self.ReportTableView.verticalHeader().setMinimumSectionSize(20)
        self.ReportTableView.verticalHeader().setDefaultSectionSize(20)

        self.verticalLayout.addWidget(self.ReportTableView)

        self.retranslateUi(DealsReportWidget)

        QMetaObject.connectSlotsByName(DealsReportWidget)

    # setupUi

    def retranslateUi(self, DealsReportWidget):
        DealsReportWidget.setWindowTitle(
            QCoreApplication.translate("DealsReportWidget", u"Deals", None))
        self.ReportGroupCheck.setText(
            QCoreApplication.translate("DealsReportWidget", u"Group dates",
                                       None))
        self.ReportAccountLbl.setText(
            QCoreApplication.translate("DealsReportWidget", u"Account:", None))
Beispiel #26
0
class Ui_ReferenceDataDialog(object):
    def setupUi(self, ReferenceDataDialog):
        if not ReferenceDataDialog.objectName():
            ReferenceDataDialog.setObjectName(u"ReferenceDataDialog")
        ReferenceDataDialog.resize(869, 300)
        self.verticalLayout = QVBoxLayout(ReferenceDataDialog)
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.verticalLayout.setContentsMargins(2, 2, 2, 2)
        self.EditFrame = QFrame(ReferenceDataDialog)
        self.EditFrame.setObjectName(u"EditFrame")
        sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.EditFrame.sizePolicy().hasHeightForWidth())
        self.EditFrame.setSizePolicy(sizePolicy)
        self.EditFrame.setFrameShape(QFrame.Panel)
        self.EditFrame.setFrameShadow(QFrame.Plain)
        self.EditFrame.setLineWidth(0)
        self.edit_layout = QHBoxLayout(self.EditFrame)
        self.edit_layout.setObjectName(u"edit_layout")
        self.edit_layout.setContentsMargins(0, 0, 0, 0)
        self.GroupLbl = QLabel(self.EditFrame)
        self.GroupLbl.setObjectName(u"GroupLbl")

        self.edit_layout.addWidget(self.GroupLbl)

        self.GroupCombo = QComboBox(self.EditFrame)
        self.GroupCombo.setObjectName(u"GroupCombo")

        self.edit_layout.addWidget(self.GroupCombo)

        self.Toggle = QCheckBox(self.EditFrame)
        self.Toggle.setObjectName(u"Toggle")
        self.Toggle.setChecked(False)

        self.edit_layout.addWidget(self.Toggle)

        self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding,
                                            QSizePolicy.Minimum)

        self.edit_layout.addItem(self.horizontalSpacer)

        self.AddBtn = QPushButton(self.EditFrame)
        self.AddBtn.setObjectName(u"AddBtn")

        self.edit_layout.addWidget(self.AddBtn)

        self.AddChildBtn = QPushButton(self.EditFrame)
        self.AddChildBtn.setObjectName(u"AddChildBtn")

        self.edit_layout.addWidget(self.AddChildBtn)

        self.RemoveBtn = QPushButton(self.EditFrame)
        self.RemoveBtn.setObjectName(u"RemoveBtn")

        self.edit_layout.addWidget(self.RemoveBtn)

        self.CommitBtn = QPushButton(self.EditFrame)
        self.CommitBtn.setObjectName(u"CommitBtn")
        self.CommitBtn.setEnabled(False)

        self.edit_layout.addWidget(self.CommitBtn)

        self.RevertBtn = QPushButton(self.EditFrame)
        self.RevertBtn.setObjectName(u"RevertBtn")
        self.RevertBtn.setEnabled(False)

        self.edit_layout.addWidget(self.RevertBtn)

        self.verticalLayout.addWidget(self.EditFrame)

        self.SearchFrame = QFrame(ReferenceDataDialog)
        self.SearchFrame.setObjectName(u"SearchFrame")
        self.SearchFrame.setFrameShape(QFrame.Panel)
        self.SearchFrame.setFrameShadow(QFrame.Plain)
        self.SearchFrame.setLineWidth(0)
        self.search_layout = QHBoxLayout(self.SearchFrame)
        self.search_layout.setObjectName(u"search_layout")
        self.search_layout.setContentsMargins(0, 0, 0, 0)
        self.SearchLbl = QLabel(self.SearchFrame)
        self.SearchLbl.setObjectName(u"SearchLbl")

        self.search_layout.addWidget(self.SearchLbl)

        self.SearchString = QLineEdit(self.SearchFrame)
        self.SearchString.setObjectName(u"SearchString")

        self.search_layout.addWidget(self.SearchString)

        self.verticalLayout.addWidget(self.SearchFrame)

        self.DataView = QTableView(ReferenceDataDialog)
        self.DataView.setObjectName(u"DataView")
        self.DataView.setEditTriggers(QAbstractItemView.AnyKeyPressed
                                      | QAbstractItemView.EditKeyPressed
                                      | QAbstractItemView.SelectedClicked)
        self.DataView.setAlternatingRowColors(True)
        self.DataView.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.DataView.verticalHeader().setVisible(True)
        self.DataView.verticalHeader().setMinimumSectionSize(20)
        self.DataView.verticalHeader().setDefaultSectionSize(20)

        self.verticalLayout.addWidget(self.DataView)

        self.TreeView = QTreeView(ReferenceDataDialog)
        self.TreeView.setObjectName(u"TreeView")
        self.TreeView.setEditTriggers(QAbstractItemView.AnyKeyPressed
                                      | QAbstractItemView.EditKeyPressed
                                      | QAbstractItemView.SelectedClicked)
        self.TreeView.setTabKeyNavigation(True)
        self.TreeView.setAlternatingRowColors(True)
        self.TreeView.setSelectionMode(QAbstractItemView.ExtendedSelection)
        self.TreeView.setExpandsOnDoubleClick(False)
        self.TreeView.header().setStretchLastSection(False)

        self.verticalLayout.addWidget(self.TreeView)

        self.retranslateUi(ReferenceDataDialog)

        QMetaObject.connectSlotsByName(ReferenceDataDialog)

    # setupUi

    def retranslateUi(self, ReferenceDataDialog):
        ReferenceDataDialog.setWindowTitle(
            QCoreApplication.translate("ReferenceDataDialog",
                                       u"Reference Data", None))
        self.GroupLbl.setText(
            QCoreApplication.translate("ReferenceDataDialog", u"Account Type:",
                                       None))
        self.Toggle.setText(
            QCoreApplication.translate("ReferenceDataDialog", u"Show inactive",
                                       None))
        #if QT_CONFIG(tooltip)
        self.AddBtn.setToolTip(
            QCoreApplication.translate("ReferenceDataDialog", u"Add new",
                                       None))
        #endif // QT_CONFIG(tooltip)
        self.AddBtn.setText("")
        #if QT_CONFIG(tooltip)
        self.AddChildBtn.setToolTip(
            QCoreApplication.translate("ReferenceDataDialog", u"Add child",
                                       None))
        #endif // QT_CONFIG(tooltip)
        self.AddChildBtn.setText("")
        #if QT_CONFIG(tooltip)
        self.RemoveBtn.setToolTip(
            QCoreApplication.translate("ReferenceDataDialog", u"Delete", None))
        #endif // QT_CONFIG(tooltip)
        self.RemoveBtn.setText("")
        #if QT_CONFIG(tooltip)
        self.CommitBtn.setToolTip(
            QCoreApplication.translate("ReferenceDataDialog", u"Save changes",
                                       None))
        #endif // QT_CONFIG(tooltip)
        self.CommitBtn.setText("")
        #if QT_CONFIG(tooltip)
        self.RevertBtn.setToolTip(
            QCoreApplication.translate("ReferenceDataDialog",
                                       u"Revert changes", None))
        #endif // QT_CONFIG(tooltip)
        self.RevertBtn.setText("")
        self.SearchLbl.setText(
            QCoreApplication.translate("ReferenceDataDialog", u"Search:",
                                       None))
Beispiel #27
0
class MainWindow_Ui(QMainWindow):
    def __init__(self, persepolis_setting):
        super().__init__()
        # MainWindow
        self.persepolis_setting = persepolis_setting

        # add support for other languages
        locale = str(self.persepolis_setting.value('settings/locale'))
        QLocale.setDefault(QLocale(locale))
        self.translator = QTranslator()
        if self.translator.load(':/translations/locales/ui_' + locale, 'ts'):
            QCoreApplication.installTranslator(self.translator)

        # set ui direction
        ui_direction = self.persepolis_setting.value('ui_direction')

        if ui_direction == 'rtl':
            self.setLayoutDirection(Qt.RightToLeft)

        elif ui_direction in 'ltr':
            self.setLayoutDirection(Qt.LeftToRight)

        icons = ':/' + \
            str(self.persepolis_setting.value('settings/icons')) + '/'

        self.setWindowTitle(
            QCoreApplication.translate("mainwindow_ui_tr",
                                       "Persepolis Download Manager"))
        self.setWindowIcon(
            QIcon.fromTheme('persepolis', QIcon(':/persepolis.svg')))

        self.centralwidget = QWidget(self)
        self.verticalLayout = QVBoxLayout(self.centralwidget)

        # enable drag and drop
        self.setAcceptDrops(True)

        # frame
        self.frame = QFrame(self.centralwidget)

        # download_table_horizontalLayout
        download_table_horizontalLayout = QHBoxLayout()
        horizontal_splitter = QSplitter(Qt.Horizontal)

        vertical_splitter = QSplitter(Qt.Vertical)

        # category_tree
        self.category_tree_qwidget = QWidget(self)
        category_tree_verticalLayout = QVBoxLayout()
        self.category_tree = CategoryTreeView(self)
        category_tree_verticalLayout.addWidget(self.category_tree)

        self.category_tree_model = QStandardItemModel()
        self.category_tree.setModel(self.category_tree_model)
        category_table_header = [
            QCoreApplication.translate("mainwindow_ui_tr", 'Category')
        ]

        self.category_tree_model.setHorizontalHeaderLabels(
            category_table_header)
        self.category_tree.header().setStretchLastSection(True)

        self.category_tree.header().setDefaultAlignment(Qt.AlignCenter)

        # queue_panel
        self.queue_panel_widget = QWidget(self)

        queue_panel_verticalLayout_main = QVBoxLayout(self.queue_panel_widget)

        # queue_panel_show_button
        self.queue_panel_show_button = QPushButton(self)

        queue_panel_verticalLayout_main.addWidget(self.queue_panel_show_button)

        # queue_panel_widget_frame
        self.queue_panel_widget_frame = QFrame(self)
        self.queue_panel_widget_frame.setFrameShape(QFrame.StyledPanel)
        self.queue_panel_widget_frame.setFrameShadow(QFrame.Raised)

        queue_panel_verticalLayout_main.addWidget(
            self.queue_panel_widget_frame)

        queue_panel_verticalLayout = QVBoxLayout(self.queue_panel_widget_frame)
        queue_panel_verticalLayout_main.setContentsMargins(50, -1, 50, -1)

        # start_end_frame
        self.start_end_frame = QFrame(self)

        # start time
        start_verticalLayout = QVBoxLayout(self.start_end_frame)
        self.start_checkBox = QCheckBox(self)
        start_verticalLayout.addWidget(self.start_checkBox)

        self.start_frame = QFrame(self)
        self.start_frame.setFrameShape(QFrame.StyledPanel)
        self.start_frame.setFrameShadow(QFrame.Raised)

        start_frame_verticalLayout = QVBoxLayout(self.start_frame)

        self.start_time_qDataTimeEdit = MyQDateTimeEdit(self.start_frame)
        self.start_time_qDataTimeEdit.setDisplayFormat('H:mm')
        start_frame_verticalLayout.addWidget(self.start_time_qDataTimeEdit)

        start_verticalLayout.addWidget(self.start_frame)

        # end time
        self.end_checkBox = QCheckBox(self)
        start_verticalLayout.addWidget(self.end_checkBox)

        self.end_frame = QFrame(self)
        self.end_frame.setFrameShape(QFrame.StyledPanel)
        self.end_frame.setFrameShadow(QFrame.Raised)

        end_frame_verticalLayout = QVBoxLayout(self.end_frame)

        self.end_time_qDateTimeEdit = MyQDateTimeEdit(self.end_frame)
        self.end_time_qDateTimeEdit.setDisplayFormat('H:mm')
        end_frame_verticalLayout.addWidget(self.end_time_qDateTimeEdit)

        start_verticalLayout.addWidget(self.end_frame)

        self.reverse_checkBox = QCheckBox(self)
        start_verticalLayout.addWidget(self.reverse_checkBox)

        queue_panel_verticalLayout.addWidget(self.start_end_frame)

        # limit_after_frame
        self.limit_after_frame = QFrame(self)

        # limit_checkBox
        limit_verticalLayout = QVBoxLayout(self.limit_after_frame)
        self.limit_checkBox = QCheckBox(self)
        limit_verticalLayout.addWidget(self.limit_checkBox)

        # limit_frame
        self.limit_frame = QFrame(self)
        self.limit_frame.setFrameShape(QFrame.StyledPanel)
        self.limit_frame.setFrameShadow(QFrame.Raised)
        limit_verticalLayout.addWidget(self.limit_frame)

        limit_frame_verticalLayout = QVBoxLayout(self.limit_frame)

        # limit_spinBox
        limit_frame_horizontalLayout = QHBoxLayout()
        self.limit_spinBox = QDoubleSpinBox(self)
        self.limit_spinBox.setMinimum(1)
        self.limit_spinBox.setMaximum(1023)
        limit_frame_horizontalLayout.addWidget(self.limit_spinBox)

        # limit_comboBox
        self.limit_comboBox = QComboBox(self)
        self.limit_comboBox.addItem("")
        self.limit_comboBox.addItem("")
        limit_frame_horizontalLayout.addWidget(self.limit_comboBox)
        limit_frame_verticalLayout.addLayout(limit_frame_horizontalLayout)

        # limit_pushButton
        self.limit_pushButton = QPushButton(self)
        limit_frame_verticalLayout.addWidget(self.limit_pushButton)

        # after_checkBox
        self.after_checkBox = QCheckBox(self)
        limit_verticalLayout.addWidget(self.after_checkBox)

        # after_frame
        self.after_frame = QFrame(self)
        self.after_frame.setFrameShape(QFrame.StyledPanel)
        self.after_frame.setFrameShadow(QFrame.Raised)
        limit_verticalLayout.addWidget(self.after_frame)

        after_frame_verticalLayout = QVBoxLayout(self.after_frame)

        # after_comboBox
        self.after_comboBox = QComboBox(self)
        self.after_comboBox.addItem("")

        after_frame_verticalLayout.addWidget(self.after_comboBox)

        # after_pushButton
        self.after_pushButton = QPushButton(self)
        after_frame_verticalLayout.addWidget(self.after_pushButton)

        queue_panel_verticalLayout.addWidget(self.limit_after_frame)
        category_tree_verticalLayout.addWidget(self.queue_panel_widget)

        # keep_awake_checkBox
        self.keep_awake_checkBox = QCheckBox(self)
        queue_panel_verticalLayout.addWidget(self.keep_awake_checkBox)

        self.category_tree_qwidget.setLayout(category_tree_verticalLayout)
        horizontal_splitter.addWidget(self.category_tree_qwidget)

        # download table widget
        self.download_table_content_widget = QWidget(self)
        download_table_content_widget_verticalLayout = QVBoxLayout(
            self.download_table_content_widget)

        # download_table
        self.download_table = DownloadTableWidget(self)
        vertical_splitter.addWidget(self.download_table)

        horizontal_splitter.addWidget(self.download_table_content_widget)

        self.download_table.setColumnCount(13)
        self.download_table.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.download_table.setEditTriggers(QAbstractItemView.NoEditTriggers)
        self.download_table.verticalHeader().hide()

        # hide column of GID and column of link.
        self.download_table.setColumnHidden(8, True)
        self.download_table.setColumnHidden(9, True)

        download_table_header = [
            QCoreApplication.translate("mainwindow_ui_tr", 'File Name'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Status'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Size'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Downloaded'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Percentage'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Connections'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Transfer Rate'),
            QCoreApplication.translate("mainwindow_ui_tr",
                                       'Estimated Time Left'), 'Gid',
            QCoreApplication.translate("mainwindow_ui_tr", 'Link'),
            QCoreApplication.translate("mainwindow_ui_tr", 'First Try Date'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Last Try Date'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Category')
        ]

        self.download_table.setHorizontalHeaderLabels(download_table_header)

        # fixing the size of download_table when window is Maximized!
        self.download_table.horizontalHeader().setSectionResizeMode(
            QHeaderView.ResizeMode.Interactive)
        self.download_table.horizontalHeader().setStretchLastSection(True)

        horizontal_splitter.setStretchFactor(0, 3)  # category_tree width
        horizontal_splitter.setStretchFactor(1, 10)  # ratio of tables's width

        # video_finder_widget
        self.video_finder_widget = QWidget(self)
        video_finder_horizontalLayout = QHBoxLayout(self.video_finder_widget)

        self.muxing_pushButton = QPushButton(self)
        self.muxing_pushButton.setIcon(QIcon(icons + 'video_finder'))
        video_finder_horizontalLayout.addWidget(self.muxing_pushButton)
        video_finder_horizontalLayout.addSpacing(20)

        video_audio_verticalLayout = QVBoxLayout()

        self.video_label = QLabel(self)
        video_audio_verticalLayout.addWidget(self.video_label)

        self.audio_label = QLabel(self)
        video_audio_verticalLayout.addWidget(self.audio_label)
        video_finder_horizontalLayout.addLayout(video_audio_verticalLayout)

        status_muxing_verticalLayout = QVBoxLayout()

        self.video_finder_status_label = QLabel(self)
        status_muxing_verticalLayout.addWidget(self.video_finder_status_label)

        self.muxing_status_label = QLabel(self)
        status_muxing_verticalLayout.addWidget(self.muxing_status_label)
        video_finder_horizontalLayout.addLayout(status_muxing_verticalLayout)

        vertical_splitter.addWidget(self.video_finder_widget)

        download_table_content_widget_verticalLayout.addWidget(
            vertical_splitter)

        download_table_horizontalLayout.addWidget(horizontal_splitter)

        self.frame.setLayout(download_table_horizontalLayout)

        self.verticalLayout.addWidget(self.frame)

        self.setCentralWidget(self.centralwidget)

        # menubar
        self.menubar = QMenuBar(self)
        self.menubar.setGeometry(QRect(0, 0, 600, 24))
        self.setMenuBar(self.menubar)
        fileMenu = self.menubar.addMenu(
            QCoreApplication.translate("mainwindow_ui_tr", '&File'))
        editMenu = self.menubar.addMenu(
            QCoreApplication.translate("mainwindow_ui_tr", '&Edit'))
        viewMenu = self.menubar.addMenu(
            QCoreApplication.translate("mainwindow_ui_tr", '&View'))
        downloadMenu = self.menubar.addMenu(
            QCoreApplication.translate("mainwindow_ui_tr", '&Download'))
        queueMenu = self.menubar.addMenu(
            QCoreApplication.translate("mainwindow_ui_tr", '&Queue'))
        videoFinderMenu = self.menubar.addMenu(
            QCoreApplication.translate("mainwindow_ui_tr", 'V&ideo Finder'))
        helpMenu = self.menubar.addMenu(
            QCoreApplication.translate("mainwindow_ui_tr", '&Help'))

        # viewMenu submenus
        sortMenu = viewMenu.addMenu(
            QCoreApplication.translate("mainwindow_ui_tr", 'Sort by'))

        # statusbar
        self.statusbar = QStatusBar(self)
        self.setStatusBar(self.statusbar)
        self.statusbar.showMessage(
            QCoreApplication.translate("mainwindow_ui_tr",
                                       "Persepolis Download Manager"))

        # toolBar
        self.toolBar2 = QToolBar(self)
        self.addToolBar(Qt.TopToolBarArea, self.toolBar2)
        self.toolBar2.setWindowTitle(
            QCoreApplication.translate("mainwindow_ui_tr", 'Menu'))
        self.toolBar2.setFloatable(False)
        self.toolBar2.setMovable(False)

        self.toolBar = QToolBar(self)
        self.addToolBar(Qt.TopToolBarArea, self.toolBar)
        self.toolBar.setWindowTitle(
            QCoreApplication.translate("mainwindow_ui_tr", 'Toolbar'))
        self.toolBar.setFloatable(False)
        self.toolBar.setMovable(False)

        #toolBar and menubar and actions
        self.persepolis_setting.beginGroup('settings/shortcuts')

        # videoFinderAddLinkAction
        self.videoFinderAddLinkAction = QAction(
            QIcon(icons + 'video_finder'),
            QCoreApplication.translate("mainwindow_ui_tr",
                                       'Find Video Links...'),
            self,
            statusTip=QCoreApplication.translate(
                "mainwindow_ui_tr",
                'Download video or audio from Youtube, Vimeo, etc.'),
            triggered=self.showVideoFinderAddLinkWindow)

        self.videoFinderAddLinkAction_shortcut = QShortcut(
            self.persepolis_setting.value('video_finder_shortcut'), self,
            self.showVideoFinderAddLinkWindow)

        videoFinderMenu.addAction(self.videoFinderAddLinkAction)

        # stopAllAction
        self.stopAllAction = QAction(QIcon(icons + 'stop_all'),
                                     QCoreApplication.translate(
                                         "mainwindow_ui_tr",
                                         'Stop All Active Downloads'),
                                     self,
                                     statusTip='Stop All Active Downloads',
                                     triggered=self.stopAllDownloads)
        downloadMenu.addAction(self.stopAllAction)

        # sort_file_name_Action
        self.sort_file_name_Action = QAction(QCoreApplication.translate(
            "mainwindow_ui_tr", 'File Name'),
                                             self,
                                             triggered=self.sortByName)
        sortMenu.addAction(self.sort_file_name_Action)

        # sort_file_size_Action
        self.sort_file_size_Action = QAction(QCoreApplication.translate(
            "mainwindow_ui_tr", 'File Size'),
                                             self,
                                             triggered=self.sortBySize)
        sortMenu.addAction(self.sort_file_size_Action)

        # sort_first_try_date_Action
        self.sort_first_try_date_Action = QAction(
            QCoreApplication.translate("mainwindow_ui_tr", 'First Try Date'),
            self,
            triggered=self.sortByFirstTry)
        sortMenu.addAction(self.sort_first_try_date_Action)

        # sort_last_try_date_Action
        self.sort_last_try_date_Action = QAction(QCoreApplication.translate(
            "mainwindow_ui_tr", 'Last Try Date'),
                                                 self,
                                                 triggered=self.sortByLastTry)
        sortMenu.addAction(self.sort_last_try_date_Action)

        # sort_download_status_Action
        self.sort_download_status_Action = QAction(QCoreApplication.translate(
            "mainwindow_ui_tr", 'Download Status'),
                                                   self,
                                                   triggered=self.sortByStatus)
        sortMenu.addAction(self.sort_download_status_Action)

        # trayAction
        self.trayAction = QAction(
            QCoreApplication.translate("mainwindow_ui_tr",
                                       'Show System Tray Icon'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr",
                                                 "Show/Hide system tray icon"),
            triggered=self.showTray)
        self.trayAction.setCheckable(True)
        viewMenu.addAction(self.trayAction)

        # showMenuBarAction
        self.showMenuBarAction = QAction(
            QCoreApplication.translate("mainwindow_ui_tr", 'Show Menubar'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr",
                                                 'Show Menubar'),
            triggered=self.showMenuBar)
        self.showMenuBarAction.setCheckable(True)
        viewMenu.addAction(self.showMenuBarAction)

        # showSidePanelAction
        self.showSidePanelAction = QAction(
            QCoreApplication.translate("mainwindow_ui_tr", 'Show Side Panel'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr",
                                                 'Show Side Panel'),
            triggered=self.showSidePanel)
        self.showSidePanelAction.setCheckable(True)
        viewMenu.addAction(self.showSidePanelAction)

        # minimizeAction
        self.minimizeAction = QAction(
            QIcon(icons + 'minimize'),
            QCoreApplication.translate("mainwindow_ui_tr",
                                       'Minimize to System Tray'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr",
                                                 "Minimize to System Tray"),
            triggered=self.minMaxTray)

        self.minimizeAction_shortcut = QShortcut(
            self.persepolis_setting.value('hide_window_shortcut'), self,
            self.minMaxTray)
        viewMenu.addAction(self.minimizeAction)

        # addlinkAction
        self.addlinkAction = QAction(
            QIcon(icons + 'add'),
            QCoreApplication.translate("mainwindow_ui_tr",
                                       'Add New Download Link...'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr",
                                                 "Add New Download Link"),
            triggered=self.addLinkButtonPressed)

        self.addlinkAction_shortcut = QShortcut(
            self.persepolis_setting.value('add_new_download_shortcut'), self,
            self.addLinkButtonPressed)
        fileMenu.addAction(self.addlinkAction)

        # importText
        self.addtextfileAction = QAction(
            QIcon(icons + 'file'),
            QCoreApplication.translate("mainwindow_ui_tr",
                                       'Import Links from Text File...'),
            self,
            statusTip=QCoreApplication.translate(
                "mainwindow_ui_tr",
                'Create a text file and put links in it, line by line!'),
            triggered=self.importText)

        self.addtextfileAction_shortcut = QShortcut(
            self.persepolis_setting.value('import_text_shortcut'), self,
            self.importText)

        fileMenu.addAction(self.addtextfileAction)

        # resumeAction
        self.resumeAction = QAction(
            QIcon(icons + 'play'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Resume Download'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr",
                                                 "Resume Download"),
            triggered=self.resumeButtonPressed)

        downloadMenu.addAction(self.resumeAction)

        # pauseAction
        self.pauseAction = QAction(
            QIcon(icons + 'pause'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Pause Download'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr",
                                                 "Pause Download"),
            triggered=self.pauseButtonPressed)

        downloadMenu.addAction(self.pauseAction)

        # stopAction
        self.stopAction = QAction(
            QIcon(icons + 'stop'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Stop Download'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr",
                                                 "Stop/Cancel Download"),
            triggered=self.stopButtonPressed)

        downloadMenu.addAction(self.stopAction)

        # propertiesAction
        self.propertiesAction = QAction(
            QIcon(icons + 'setting'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Properties'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr",
                                                 "Properties"),
            triggered=self.propertiesButtonPressed)

        downloadMenu.addAction(self.propertiesAction)

        # progressAction
        self.progressAction = QAction(
            QIcon(icons + 'window'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Progress'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr",
                                                 "Progress"),
            triggered=self.progressButtonPressed)

        downloadMenu.addAction(self.progressAction)

        # openFileAction
        self.openFileAction = QAction(
            QIcon(icons + 'file'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Open File...'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr",
                                                 'Open File...'),
            triggered=self.openFile)
        fileMenu.addAction(self.openFileAction)

        # openDownloadFolderAction
        self.openDownloadFolderAction = QAction(
            QIcon(icons + 'folder'),
            QCoreApplication.translate("mainwindow_ui_tr",
                                       'Open Download Folder'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr",
                                                 'Open Download Folder'),
            triggered=self.openDownloadFolder)

        fileMenu.addAction(self.openDownloadFolderAction)

        # openDefaultDownloadFolderAction
        self.openDefaultDownloadFolderAction = QAction(
            QIcon(icons + 'folder'),
            QCoreApplication.translate("mainwindow_ui_tr",
                                       'Open Default Download Folder'),
            self,
            statusTip=QCoreApplication.translate(
                "mainwindow_ui_tr", 'Open Default Download Folder'),
            triggered=self.openDefaultDownloadFolder)

        fileMenu.addAction(self.openDefaultDownloadFolderAction)

        # exitAction
        self.exitAction = QAction(
            QIcon(icons + 'exit'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Exit'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr", "Exit"),
            triggered=self.closeAction)

        self.exitAction_shortcut = QShortcut(
            self.persepolis_setting.value('quit_shortcut'), self,
            self.closeAction)

        fileMenu.addAction(self.exitAction)

        # clearAction
        self.clearAction = QAction(QIcon(icons + 'multi_remove'),
                                   QCoreApplication.translate(
                                       "mainwindow_ui_tr",
                                       'Clear Download List'),
                                   self,
                                   statusTip=QCoreApplication.translate(
                                       "mainwindow_ui_tr",
                                       'Clear all items in download list'),
                                   triggered=self.clearDownloadList)
        editMenu.addAction(self.clearAction)

        # removeSelectedAction
        self.removeSelectedAction = QAction(
            QIcon(icons + 'remove'),
            QCoreApplication.translate("mainwindow_ui_tr",
                                       'Remove Selected Downloads from List'),
            self,
            statusTip=QCoreApplication.translate(
                "mainwindow_ui_tr", 'Remove Selected Downloads from List'),
            triggered=self.removeSelected)

        self.removeSelectedAction_shortcut = QShortcut(
            self.persepolis_setting.value('remove_shortcut'), self,
            self.removeSelected)

        editMenu.addAction(self.removeSelectedAction)
        self.removeSelectedAction.setEnabled(False)

        # deleteSelectedAction
        self.deleteSelectedAction = QAction(
            QIcon(icons + 'trash'),
            QCoreApplication.translate("mainwindow_ui_tr",
                                       'Delete Selected Download Files'),
            self,
            statusTip=QCoreApplication.translate(
                "mainwindow_ui_tr", 'Delete Selected Download Files'),
            triggered=self.deleteSelected)

        self.deleteSelectedAction_shortcut = QShortcut(
            self.persepolis_setting.value('delete_shortcut'), self,
            self.deleteSelected)

        editMenu.addAction(self.deleteSelectedAction)
        self.deleteSelectedAction.setEnabled(False)

        # moveSelectedDownloadsAction
        self.moveSelectedDownloadsAction = QAction(
            QIcon(icons + 'folder'),
            QCoreApplication.translate(
                "mainwindow_ui_tr",
                'Move Selected Download Files to Another Folder...'),
            self,
            statusTip=QCoreApplication.translate(
                "mainwindow_ui_tr",
                'Move Selected Download Files to Another Folder'),
            triggered=self.moveSelectedDownloads)

        editMenu.addAction(self.moveSelectedDownloadsAction)
        self.moveSelectedDownloadsAction.setEnabled(False)

        # createQueueAction
        self.createQueueAction = QAction(
            QIcon(icons + 'add_queue'),
            QCoreApplication.translate("mainwindow_ui_tr",
                                       'Create New Queue...'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr",
                                                 'Create new download queue'),
            triggered=self.createQueue)
        queueMenu.addAction(self.createQueueAction)

        # removeQueueAction
        self.removeQueueAction = QAction(
            QIcon(icons + 'remove_queue'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Remove Queue'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr",
                                                 'Remove this queue'),
            triggered=self.removeQueue)
        queueMenu.addAction(self.removeQueueAction)

        # startQueueAction
        self.startQueueAction = QAction(
            QIcon(icons + 'start_queue'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Start this queue'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr",
                                                 'Start Queue'),
            triggered=self.startQueue)

        queueMenu.addAction(self.startQueueAction)

        # stopQueueAction
        self.stopQueueAction = QAction(
            QIcon(icons + 'stop_queue'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Stop this queue'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr",
                                                 'Stop Queue'),
            triggered=self.stopQueue)

        queueMenu.addAction(self.stopQueueAction)

        # moveUpSelectedAction
        self.moveUpSelectedAction = QAction(
            QIcon(icons + 'multi_up'),
            QCoreApplication.translate("mainwindow_ui_tr",
                                       'Move Selected Items Up'),
            self,
            statusTip=QCoreApplication.translate(
                "mainwindow_ui_tr",
                'Move currently selected items up by one row'),
            triggered=self.moveUpSelected)

        self.moveUpSelectedAction_shortcut = QShortcut(
            self.persepolis_setting.value('move_up_selection_shortcut'), self,
            self.moveUpSelected)

        queueMenu.addAction(self.moveUpSelectedAction)

        # moveDownSelectedAction
        self.moveDownSelectedAction = QAction(
            QIcon(icons + 'multi_down'),
            QCoreApplication.translate("mainwindow_ui_tr",
                                       'Move Selected Items Down'),
            self,
            statusTip=QCoreApplication.translate(
                "mainwindow_ui_tr",
                'Move currently selected items down by one row'),
            triggered=self.moveDownSelected)
        self.moveDownSelectedAction_shortcut = QShortcut(
            self.persepolis_setting.value('move_down_selection_shortcut'),
            self, self.moveDownSelected)

        queueMenu.addAction(self.moveDownSelectedAction)

        # preferencesAction
        self.preferencesAction = QAction(
            QIcon(icons + 'preferences'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Preferences'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr",
                                                 'Preferences'),
            triggered=self.openPreferences,
            menuRole=QAction.MenuRole.PreferencesRole)
        editMenu.addAction(self.preferencesAction)

        # aboutAction
        self.aboutAction = QAction(
            QIcon(icons + 'about'),
            QCoreApplication.translate("mainwindow_ui_tr", 'About'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr", 'About'),
            triggered=self.openAbout,
            menuRole=QAction.MenuRole.AboutRole)
        helpMenu.addAction(self.aboutAction)

        # issueAction
        self.issueAction = QAction(
            QIcon(icons + 'about'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Report an Issue'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr",
                                                 'Report an issue'),
            triggered=self.reportIssue)
        helpMenu.addAction(self.issueAction)

        # updateAction
        self.updateAction = QAction(
            QIcon(icons + 'about'),
            QCoreApplication.translate("mainwindow_ui_tr",
                                       'Check for Newer Version'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr",
                                                 'Check for newer release'),
            triggered=self.newUpdate)
        helpMenu.addAction(self.updateAction)

        # logAction
        self.logAction = QAction(
            QIcon(icons + 'about'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Show Log File'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr", 'Help'),
            triggered=self.showLog)
        helpMenu.addAction(self.logAction)

        # helpAction
        self.helpAction = QAction(
            QIcon(icons + 'about'),
            QCoreApplication.translate("mainwindow_ui_tr", 'Help'),
            self,
            statusTip=QCoreApplication.translate("mainwindow_ui_tr", 'Help'),
            triggered=self.persepolisHelp)
        helpMenu.addAction(self.helpAction)

        self.persepolis_setting.endGroup()

        self.qmenu = MenuWidget(self)

        self.toolBar2.addWidget(self.qmenu)

        # labels
        self.queue_panel_show_button.setText(
            QCoreApplication.translate("mainwindow_ui_tr", "Hide Options"))
        self.start_checkBox.setText(
            QCoreApplication.translate("mainwindow_ui_tr", "Start Time"))

        self.end_checkBox.setText(
            QCoreApplication.translate("mainwindow_ui_tr", "End Time"))

        self.reverse_checkBox.setText(
            QCoreApplication.translate("mainwindow_ui_tr",
                                       "Download bottom of\n the list first"))

        self.limit_checkBox.setText(
            QCoreApplication.translate("mainwindow_ui_tr", "Limit Speed"))
        self.limit_comboBox.setItemText(0, "KiB/s")
        self.limit_comboBox.setItemText(1, "MiB/s")
        self.limit_pushButton.setText(
            QCoreApplication.translate("mainwindow_ui_tr", "Apply"))

        self.after_checkBox.setText(
            QCoreApplication.translate("mainwindow_ui_tr", "After download"))
        self.after_comboBox.setItemText(
            0, QCoreApplication.translate("mainwindow_ui_tr", "Shut Down"))

        self.keep_awake_checkBox.setText(
            QCoreApplication.translate("mainwindow_ui_tr",
                                       "Keep System Awake!"))
        self.keep_awake_checkBox.setToolTip(
            QCoreApplication.translate(
                "mainwindow_ui_tr",
                "<html><head/><body><p>This option will prevent the system from going to sleep.\
            It is necessary if your power manager is suspending the system automatically. </p></body></html>"
            ))

        self.after_pushButton.setText(
            QCoreApplication.translate("mainwindow_ui_tr", "Apply"))

        self.muxing_pushButton.setText(
            QCoreApplication.translate("mainwindow_ui_tr", "Start Mixing"))

        self.video_label.setText(
            QCoreApplication.translate("mainwindow_ui_tr",
                                       "<b>Video File Status: </b>"))
        self.audio_label.setText(
            QCoreApplication.translate("mainwindow_ui_tr",
                                       "<b>Audio File Status: </b>"))

        self.video_finder_status_label.setText(
            QCoreApplication.translate("mainwindow_ui_tr", "<b>Status: </b>"))
        self.muxing_status_label.setText(
            QCoreApplication.translate("mainwindow_ui_tr",
                                       "<b>Mixing status: </b>"))
Beispiel #28
0
class Ui_TaxWidget(object):
    def setupUi(self, TaxWidget):
        if not TaxWidget.objectName():
            TaxWidget.setObjectName(u"TaxWidget")
        TaxWidget.resize(696, 408)
        self.gridLayout = QGridLayout(TaxWidget)
        self.gridLayout.setObjectName(u"gridLayout")
        self.AccountLbl = QLabel(TaxWidget)
        self.AccountLbl.setObjectName(u"AccountLbl")

        self.gridLayout.addWidget(self.AccountLbl, 1, 0, 1, 1)

        self.AccountWidget = AccountSelector(TaxWidget)
        self.AccountWidget.setObjectName(u"AccountWidget")

        self.gridLayout.addWidget(self.AccountWidget, 1, 1, 1, 2)

        self.YearLbl = QLabel(TaxWidget)
        self.YearLbl.setObjectName(u"YearLbl")

        self.gridLayout.addWidget(self.YearLbl, 0, 0, 1, 1)

        self.Year = QSpinBox(TaxWidget)
        self.Year.setObjectName(u"Year")
        self.Year.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter)
        self.Year.setMinimum(2010)
        self.Year.setMaximum(2030)
        self.Year.setValue(2020)

        self.gridLayout.addWidget(self.Year, 0, 1, 1, 2)

        self.verticalSpacer = QSpacerItem(20, 52, QSizePolicy.Minimum, QSizePolicy.Expanding)

        self.gridLayout.addItem(self.verticalSpacer, 8, 0, 1, 1)

        self.line = QFrame(TaxWidget)
        self.line.setObjectName(u"line")
        self.line.setFrameShape(QFrame.HLine)
        self.line.setFrameShadow(QFrame.Sunken)

        self.gridLayout.addWidget(self.line, 3, 0, 1, 3)

        self.DlsgGroup = QGroupBox(TaxWidget)
        self.DlsgGroup.setObjectName(u"DlsgGroup")
        sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.DlsgGroup.sizePolicy().hasHeightForWidth())
        self.DlsgGroup.setSizePolicy(sizePolicy)
        self.DlsgGroup.setFlat(False)
        self.DlsgGroup.setCheckable(True)
        self.DlsgGroup.setChecked(False)
        self.gridLayout_2 = QGridLayout(self.DlsgGroup)
        self.gridLayout_2.setSpacing(2)
        self.gridLayout_2.setObjectName(u"gridLayout_2")
        self.gridLayout_2.setContentsMargins(6, 6, 6, 6)
        self.DlsgFileLbl = QLabel(self.DlsgGroup)
        self.DlsgFileLbl.setObjectName(u"DlsgFileLbl")

        self.gridLayout_2.addWidget(self.DlsgFileLbl, 0, 0, 1, 1)

        self.IncomeSourceBroker = QCheckBox(self.DlsgGroup)
        self.IncomeSourceBroker.setObjectName(u"IncomeSourceBroker")
        self.IncomeSourceBroker.setChecked(True)

        self.gridLayout_2.addWidget(self.IncomeSourceBroker, 1, 0, 1, 3)

        self.DividendsOnly = QCheckBox(self.DlsgGroup)
        self.DividendsOnly.setObjectName(u"DividendsOnly")

        self.gridLayout_2.addWidget(self.DividendsOnly, 2, 0, 1, 3)

        self.DlsgSelectBtn = QPushButton(self.DlsgGroup)
        self.DlsgSelectBtn.setObjectName(u"DlsgSelectBtn")

        self.gridLayout_2.addWidget(self.DlsgSelectBtn, 0, 2, 1, 1)

        self.DlsgFileName = QLineEdit(self.DlsgGroup)
        self.DlsgFileName.setObjectName(u"DlsgFileName")

        self.gridLayout_2.addWidget(self.DlsgFileName, 0, 1, 1, 1)


        self.gridLayout.addWidget(self.DlsgGroup, 5, 0, 1, 3)

        self.XlsFileLbl = QLabel(TaxWidget)
        self.XlsFileLbl.setObjectName(u"XlsFileLbl")

        self.gridLayout.addWidget(self.XlsFileLbl, 2, 0, 1, 1)

        self.XlsFileName = QLineEdit(TaxWidget)
        self.XlsFileName.setObjectName(u"XlsFileName")
        sizePolicy1 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        sizePolicy1.setHorizontalStretch(0)
        sizePolicy1.setVerticalStretch(0)
        sizePolicy1.setHeightForWidth(self.XlsFileName.sizePolicy().hasHeightForWidth())
        self.XlsFileName.setSizePolicy(sizePolicy1)

        self.gridLayout.addWidget(self.XlsFileName, 2, 1, 1, 1)

        self.XlsSelectBtn = QPushButton(TaxWidget)
        self.XlsSelectBtn.setObjectName(u"XlsSelectBtn")
        sizePolicy2 = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
        sizePolicy2.setHorizontalStretch(0)
        sizePolicy2.setVerticalStretch(0)
        sizePolicy2.setHeightForWidth(self.XlsSelectBtn.sizePolicy().hasHeightForWidth())
        self.XlsSelectBtn.setSizePolicy(sizePolicy2)

        self.gridLayout.addWidget(self.XlsSelectBtn, 2, 2, 1, 1)

        self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)

        self.gridLayout.addItem(self.horizontalSpacer, 5, 3, 1, 1)

        self.NoSettlement = QCheckBox(TaxWidget)
        self.NoSettlement.setObjectName(u"NoSettlement")

        self.gridLayout.addWidget(self.NoSettlement, 6, 0, 1, 4)

        self.SaveButton = QPushButton(TaxWidget)
        self.SaveButton.setObjectName(u"SaveButton")

        self.gridLayout.addWidget(self.SaveButton, 7, 2, 1, 1)

        self.WarningLbl = QLabel(TaxWidget)
        self.WarningLbl.setObjectName(u"WarningLbl")
        font = QFont()
        font.setItalic(True)
        self.WarningLbl.setFont(font)

        self.gridLayout.addWidget(self.WarningLbl, 4, 0, 1, 3)


        self.retranslateUi(TaxWidget)

        QMetaObject.connectSlotsByName(TaxWidget)
    # setupUi

    def retranslateUi(self, TaxWidget):
        TaxWidget.setWindowTitle(QCoreApplication.translate("TaxWidget", u"Taxes", None))
        self.AccountLbl.setText(QCoreApplication.translate("TaxWidget", u"Account:", None))
#if QT_CONFIG(tooltip)
        self.AccountWidget.setToolTip(QCoreApplication.translate("TaxWidget", u"Foreign account to prepare tax report for", None))
#endif // QT_CONFIG(tooltip)
        self.YearLbl.setText(QCoreApplication.translate("TaxWidget", u"Year:", None))
        self.Year.setSuffix("")
        self.DlsgGroup.setTitle(QCoreApplication.translate("TaxWidget", u"Create tax form in \"\u0414\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044f\" program format (*.dcX)", None))
        self.DlsgFileLbl.setText(QCoreApplication.translate("TaxWidget", u"Output file:", None))
        self.IncomeSourceBroker.setText(QCoreApplication.translate("TaxWidget", u"Use broker name as income source", None))
        self.DividendsOnly.setText(QCoreApplication.translate("TaxWidget", u"Update only information about dividends", None))
#if QT_CONFIG(tooltip)
        self.DlsgSelectBtn.setToolTip(QCoreApplication.translate("TaxWidget", u"Select file", None))
#endif // QT_CONFIG(tooltip)
        self.DlsgSelectBtn.setText(QCoreApplication.translate("TaxWidget", u" ... ", None))
#if QT_CONFIG(tooltip)
        self.DlsgFileName.setToolTip(QCoreApplication.translate("TaxWidget", u"File where to store russian tax form", None))
#endif // QT_CONFIG(tooltip)
        self.XlsFileLbl.setText(QCoreApplication.translate("TaxWidget", u"Excel file:", None))
#if QT_CONFIG(tooltip)
        self.XlsFileName.setToolTip(QCoreApplication.translate("TaxWidget", u"File where to store tax report in Excel format", None))
#endif // QT_CONFIG(tooltip)
#if QT_CONFIG(tooltip)
        self.XlsSelectBtn.setToolTip(QCoreApplication.translate("TaxWidget", u"Select file", None))
#endif // QT_CONFIG(tooltip)
        self.XlsSelectBtn.setText(QCoreApplication.translate("TaxWidget", u"...", None))
        self.NoSettlement.setText(QCoreApplication.translate("TaxWidget", u"Do not use settlement date for currency rates", None))
        self.SaveButton.setText(QCoreApplication.translate("TaxWidget", u"Save Report", None))
        self.WarningLbl.setText(QCoreApplication.translate("TaxWidget", u"Below functions are experimental - use it with care", None))
Beispiel #29
0
class Foldable(QWidget):
    _mainLayout: QGridLayout
    _toggleButton: QToolButton
    _headerLine: QFrame
    _contentArea: QScrollArea
    _folded: bool

    def __init__(self,
                 title: str,
                 initially_folded: bool = True,
                 parent: QWidget = None):
        super().__init__(parent)

        self._folded = initially_folded

        self._toggleButton = QToolButton(self)
        self._toggleButton.setStyleSheet("QToolButton { height: 20px; }")
        font = self._toggleButton.font()
        font.setBold(True)
        font.setPixelSize(13)
        self._toggleButton.setFont(font)
        self._toggleButton.setMaximumHeight(20)
        self._toggleButton.setToolButtonStyle(
            Qt.ToolButtonStyle.ToolButtonTextBesideIcon)
        self._toggleButton.setArrowType(Qt.ArrowType.RightArrow)
        self._toggleButton.setText(title)
        self._toggleButton.setCheckable(True)
        self._toggleButton.setChecked(False)
        self._toggleButton.clicked.connect(self._on_click)

        self._headerLine = QFrame(self)
        self._headerLine.setFrameShape(QFrame.HLine)
        self._headerLine.setSizePolicy(QSizePolicy.Expanding,
                                       QSizePolicy.Maximum)

        self._contentArea = QFrame(self)
        self._contentArea.setObjectName("foldable_contentArea")
        self._contentArea.setStyleSheet(
            "#foldable_contentArea { border: none; }")
        self._contentArea.setSizePolicy(QSizePolicy.Expanding,
                                        QSizePolicy.Minimum)

        self._mainLayout = QGridLayout(self)
        self._mainLayout.setVerticalSpacing(0)
        self._mainLayout.setContentsMargins(0, 0, 0, 0)
        self._mainLayout.addWidget(self._toggleButton, 0, 0, 1, 1,
                                   Qt.AlignLeft)
        self._mainLayout.addWidget(self._headerLine, 0, 1, 1, 1)
        self._mainLayout.addWidget(self._contentArea, 1, 0, 1, 2)

    @property
    def contents(self):
        return self._contentArea

    def _on_click(self, checked: bool):
        if self._folded:
            self._unfold()
        else:
            self._fold()

    def _unfold(self):
        self._folded = False
        self._contentArea.show()
        self._toggleButton.setArrowType(Qt.ArrowType.DownArrow)

    def _fold(self):
        self._folded = True
        self._contentArea.hide()
        self._toggleButton.setArrowType(Qt.ArrowType.RightArrow)

    def set_content_layout(self, content_layout: QLayout):
        self._contentArea.setLayout(content_layout)
        if self._folded:
            self._fold()
        else:
            self._unfold()
Beispiel #30
0
class Ui_HoldingsWidget(object):
    def setupUi(self, HoldingsWidget):
        if not HoldingsWidget.objectName():
            HoldingsWidget.setObjectName(u"HoldingsWidget")
        HoldingsWidget.resize(1066, 589)
        self.verticalLayout = QVBoxLayout(HoldingsWidget)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.HoldingsParamsFrame = QFrame(HoldingsWidget)
        self.HoldingsParamsFrame.setObjectName(u"HoldingsParamsFrame")
        self.HoldingsParamsFrame.setFrameShape(QFrame.Panel)
        self.HoldingsParamsFrame.setFrameShadow(QFrame.Sunken)
        self.horizontalLayout_8 = QHBoxLayout(self.HoldingsParamsFrame)
        self.horizontalLayout_8.setSpacing(6)
        self.horizontalLayout_8.setObjectName(u"horizontalLayout_8")
        self.horizontalLayout_8.setContentsMargins(2, 2, 2, 2)
        self.HoldingsDate = QDateEdit(self.HoldingsParamsFrame)
        self.HoldingsDate.setObjectName(u"HoldingsDate")
        self.HoldingsDate.setDateTime(
            QDateTime(QDate(2020, 11, 24), QTime(21, 0, 0)))
        self.HoldingsDate.setCalendarPopup(True)
        self.HoldingsDate.setTimeSpec(Qt.UTC)

        self.horizontalLayout_8.addWidget(self.HoldingsDate)

        self.HoldingsCurrencyLbl = QLabel(self.HoldingsParamsFrame)
        self.HoldingsCurrencyLbl.setObjectName(u"HoldingsCurrencyLbl")

        self.horizontalLayout_8.addWidget(self.HoldingsCurrencyLbl)

        self.HoldingsCurrencyCombo = CurrencyComboBox(self.HoldingsParamsFrame)
        self.HoldingsCurrencyCombo.setObjectName(u"HoldingsCurrencyCombo")

        self.horizontalLayout_8.addWidget(self.HoldingsCurrencyCombo)

        self.horizontalSpacer = QSpacerItem(1411, 20, QSizePolicy.Expanding,
                                            QSizePolicy.Minimum)

        self.horizontalLayout_8.addItem(self.horizontalSpacer)

        self.verticalLayout.addWidget(self.HoldingsParamsFrame)

        self.HoldingsTableView = QTreeView(HoldingsWidget)
        self.HoldingsTableView.setObjectName(u"HoldingsTableView")
        self.HoldingsTableView.setFrameShape(QFrame.Panel)
        self.HoldingsTableView.setAlternatingRowColors(True)
        self.HoldingsTableView.setAnimated(True)
        self.HoldingsTableView.setAllColumnsShowFocus(True)

        self.verticalLayout.addWidget(self.HoldingsTableView)

        self.retranslateUi(HoldingsWidget)

        QMetaObject.connectSlotsByName(HoldingsWidget)

    # setupUi

    def retranslateUi(self, HoldingsWidget):
        HoldingsWidget.setWindowTitle(
            QCoreApplication.translate("HoldingsWidget", u"Holdings", None))
        self.HoldingsDate.setDisplayFormat(
            QCoreApplication.translate("HoldingsWidget", u"dd/MM/yyyy", None))
        self.HoldingsCurrencyLbl.setText(
            QCoreApplication.translate("HoldingsWidget", u"Common currency:",
                                       None))