コード例 #1
0
class MainWidget(QWidget):
    def __init__(self, parent=None):
        super(MainWidget, self).__init__(parent)
        self.chart = QChart()
        self.series = QBarSeries()

        self.main_layout = QGridLayout()
        self.button_layout = QGridLayout()
        self.font_layout = QFormLayout()

        self.font_size = QDoubleSpinBox()

        self.legend_posx = QDoubleSpinBox()
        self.legend_posy = QDoubleSpinBox()
        self.legend_width = QDoubleSpinBox()
        self.legend_height = QDoubleSpinBox()

        self.detach_legend_button = QPushButton("Toggle attached")
        self.detach_legend_button.clicked.connect(self.toggle_attached)
        self.button_layout.addWidget(self.detach_legend_button, 0, 0)

        self.add_set_button = QPushButton("add barset")
        self.add_set_button.clicked.connect(self.add_barset)
        self.button_layout.addWidget(self.add_set_button, 2, 0)

        self.remove_barset_button = QPushButton("remove barset")
        self.remove_barset_button.clicked.connect(self.remove_barset)
        self.button_layout.addWidget(self.remove_barset_button, 3, 0)

        self.align_button = QPushButton("Align (Bottom)")
        self.align_button.clicked.connect(self.set_legend_alignment)
        self.button_layout.addWidget(self.align_button, 4, 0)

        self.bold_button = QPushButton("Toggle bold")
        self.bold_button.clicked.connect(self.toggle_bold)
        self.button_layout.addWidget(self.bold_button, 8, 0)

        self.italic_button = QPushButton("Toggle italic")
        self.italic_button.clicked.connect(self.toggle_italic)
        self.button_layout.addWidget(self.italic_button, 9, 0)

        self.legend_posx.valueChanged.connect(self.update_legend_layout)
        self.legend_posy.valueChanged.connect(self.update_legend_layout)
        self.legend_width.valueChanged.connect(self.update_legend_layout)
        self.legend_height.valueChanged.connect(self.update_legend_layout)

        legend_layout = QFormLayout()
        legend_layout.addRow("HPos", self.legend_posx)
        legend_layout.addRow("VPos", self.legend_posy)
        legend_layout.addRow("Width", self.legend_width)
        legend_layout.addRow("Height", self.legend_height)

        self.legend_settings = QGroupBox("Detached legend")
        self.legend_settings.setLayout(legend_layout)
        self.button_layout.addWidget(self.legend_settings)
        self.legend_settings.setVisible(False)

        # Create chart view with the chart
        self.chart_view = QChartView(self.chart, self)

        # Create spinbox to modify font size
        self.font_size.setValue(self.chart.legend().font().pointSizeF())
        self.font_size.valueChanged.connect(self.font_size_changed)

        self.font_layout.addRow("Legend font size", self.font_size)

        # Create layout for grid and detached legend
        self.main_layout.addLayout(self.button_layout, 0, 0)
        self.main_layout.addLayout(self.font_layout, 1, 0)
        self.main_layout.addWidget(self.chart_view, 0, 1, 3, 1)
        self.setLayout(self.main_layout)

        self.create_series()

    def create_series(self):
        self.add_barset()
        self.add_barset()
        self.add_barset()
        self.add_barset()

        self.chart.addSeries(self.series)
        self.chart.setTitle("Legend detach example")
        self.chart.createDefaultAxes()

        self.chart.legend().setVisible(True)
        self.chart.legend().setAlignment(Qt.AlignBottom)

        self.chart_view.setRenderHint(QPainter.Antialiasing)

    def show_legend_spinbox(self):
        self.legend_settings.setVisible(True)
        chart_viewrect = self.chart_view.rect()

        self.legend_posx.setMinimum(0)
        self.legend_posx.setMaximum(chart_viewrect.width())
        self.legend_posx.setValue(150)

        self.legend_posy.setMinimum(0)
        self.legend_posy.setMaximum(chart_viewrect.height())
        self.legend_posy.setValue(150)

        self.legend_width.setMinimum(0)
        self.legend_width.setMaximum(chart_viewrect.width())
        self.legend_width.setValue(150)

        self.legend_height.setMinimum(0)
        self.legend_height.setMaximum(chart_viewrect.height())
        self.legend_height.setValue(75)

    def hideLegendSpinbox(self):
        self.legend_settings.setVisible(False)

    def toggle_attached(self):
        legend = self.chart.legend()
        if legend.isAttachedToChart():
            legend.detachFromChart()
            legend.setBackgroundVisible(True)
            legend.setBrush(QBrush(QColor(128, 128, 128, 128)))
            legend.setPen(QPen(QColor(192, 192, 192, 192)))

            self.show_legend_spinbox()
            self.update_legend_layout()
        else:
            legend.attachToChart()
            legend.setBackgroundVisible(False)
            self.hideLegendSpinbox()
        self.update()

    def add_barset(self):
        series_count = self.series.count()
        bar_set = QBarSet(f"set {series_count}")
        delta = series_count * 0.1
        bar_set.append([1 + delta, 2 + delta, 3 + delta, 4 + delta])
        self.series.append(bar_set)

    def remove_barset(self):
        sets = self.series.barSets()
        len_sets = len(sets)
        if len_sets > 0:
            self.series.remove(sets[len_sets - 1])

    def set_legend_alignment(self):
        button = self.sender()
        legend = self.chart.legend()
        alignment = legend.alignment()

        if alignment == Qt.AlignTop:
            legend.setAlignment(Qt.AlignLeft)
            if button:
                button.setText("Align (Left)")
        elif alignment == Qt.AlignLeft:
            legend.setAlignment(Qt.AlignBottom)
            if button:
                button.setText("Align (Bottom)")
        elif alignment == Qt.AlignBottom:
            legend.setAlignment(Qt.AlignRight)
            if button:
                button.setText("Align (Right)")
        else:
            if button:
                button.setText("Align (Top)")
            legend.setAlignment(Qt.AlignTop)

    def toggle_bold(self):
        legend = self.chart.legend()
        font = legend.font()
        font.setBold(not font.bold())
        legend.setFont(font)

    def toggle_italic(self):
        legend = self.chart.legend()
        font = legend.font()
        font.setItalic(not font.italic())
        legend.setFont(font)

    def font_size_changed(self):
        legend = self.chart.legend()
        font = legend.font()
        font_size = self.font_size.value()
        if font_size < 1:
            font_size = 1
        font.setPointSizeF(font_size)
        legend.setFont(font)

    def update_legend_layout(self):
        legend = self.chart.legend()

        rect = QRectF(self.legend_posx.value(), self.legend_posy.value(),
                      self.legend_width.value(), self.legend_height.value())
        legend.setGeometry(rect)

        legend.update()
コード例 #2
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>"))
コード例 #3
0
ファイル: u.py プロジェクト: clpi/isutils
class Ui_Dialog(object):
    def setupUi(self, Dialog):
        if not Dialog.objectName():
            Dialog.setObjectName(u"Dialog")
        Dialog.resize(580, 501)
        icon = QIcon()
        icon.addFile(u":/openshot.svg", QSize(), QIcon.Normal, QIcon.Off)
        Dialog.setWindowIcon(icon)
        Dialog.setLocale(QLocale(QLocale.English, QLocale.UnitedStates))
        self.horizontalLayout = QHBoxLayout(Dialog)
        self.horizontalLayout.setObjectName(u"horizontalLayout")
        self.vbox_parent = QVBoxLayout()
        self.vbox_parent.setObjectName(u"vbox_parent")
        self.verticalLayout = QVBoxLayout()
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.horizontalLayout_2 = QHBoxLayout()
        self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
        self.vboxTreeParent = QVBoxLayout()
        self.vboxTreeParent.setObjectName(u"vboxTreeParent")
        self.horizontalLayout_6 = QHBoxLayout()
        self.horizontalLayout_6.setObjectName(u"horizontalLayout_6")
        self.btnMoveUp = QPushButton(Dialog)
        self.btnMoveUp.setObjectName(u"btnMoveUp")
        icon1 = QIcon()
        iconThemeName = u"go-up"
        if QIcon.hasThemeIcon(iconThemeName):
            icon1 = QIcon.fromTheme(iconThemeName)
        else:
            icon1.addFile(u"", QSize(), QIcon.Normal, QIcon.Off)

        self.btnMoveUp.setIcon(icon1)

        self.horizontalLayout_6.addWidget(self.btnMoveUp)

        self.btnMoveDown = QPushButton(Dialog)
        self.btnMoveDown.setObjectName(u"btnMoveDown")
        icon2 = QIcon()
        iconThemeName = u"go-down"
        if QIcon.hasThemeIcon(iconThemeName):
            icon2 = QIcon.fromTheme(iconThemeName)
        else:
            icon2.addFile(u"", QSize(), QIcon.Normal, QIcon.Off)

        self.btnMoveDown.setIcon(icon2)

        self.horizontalLayout_6.addWidget(self.btnMoveDown)

        self.btnShuffle = QPushButton(Dialog)
        self.btnShuffle.setObjectName(u"btnShuffle")
        icon3 = QIcon()
        iconThemeName = u"view-refresh"
        if QIcon.hasThemeIcon(iconThemeName):
            icon3 = QIcon.fromTheme(iconThemeName)
        else:
            icon3.addFile(u"", QSize(), QIcon.Normal, QIcon.Off)

        self.btnShuffle.setIcon(icon3)

        self.horizontalLayout_6.addWidget(self.btnShuffle)

        self.btnRemove = QPushButton(Dialog)
        self.btnRemove.setObjectName(u"btnRemove")
        icon4 = QIcon()
        iconThemeName = u"list-remove"
        if QIcon.hasThemeIcon(iconThemeName):
            icon4 = QIcon.fromTheme(iconThemeName)
        else:
            icon4.addFile(u"", QSize(), QIcon.Normal, QIcon.Off)

        self.btnRemove.setIcon(icon4)

        self.horizontalLayout_6.addWidget(self.btnRemove)

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

        self.horizontalLayout_6.addItem(self.horizontalSpacer)

        self.vboxTreeParent.addLayout(self.horizontalLayout_6)

        self.horizontalLayout_2.addLayout(self.vboxTreeParent)

        self.vbox_properties = QVBoxLayout()
        self.vbox_properties.setObjectName(u"vbox_properties")
        self.lblTimelineLocation = QLabel(Dialog)
        self.lblTimelineLocation.setObjectName(u"lblTimelineLocation")
        self.lblTimelineLocation.setStyleSheet(u"font-weight: bold")
        self.lblTimelineLocation.setMargin(0)

        self.vbox_properties.addWidget(self.lblTimelineLocation)

        self.horizontalLayout_4 = QHBoxLayout()
        self.horizontalLayout_4.setObjectName(u"horizontalLayout_4")
        self.lblStartTime = QLabel(Dialog)
        self.lblStartTime.setObjectName(u"lblStartTime")
        self.lblStartTime.setMinimumSize(QSize(100, 0))
        self.lblStartTime.setStyleSheet(u"")

        self.horizontalLayout_4.addWidget(self.lblStartTime)

        self.txtStartTime = QDoubleSpinBox(Dialog)
        self.txtStartTime.setObjectName(u"txtStartTime")
        sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.txtStartTime.sizePolicy().hasHeightForWidth())
        self.txtStartTime.setSizePolicy(sizePolicy)
        self.txtStartTime.setMinimumSize(QSize(150, 0))
        self.txtStartTime.setMaximum(999999999.000000000000000)

        self.horizontalLayout_4.addWidget(self.txtStartTime)

        self.vbox_properties.addLayout(self.horizontalLayout_4)

        self.horizontalLayout_3 = QHBoxLayout()
        self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
        self.lblTrack = QLabel(Dialog)
        self.lblTrack.setObjectName(u"lblTrack")
        self.lblTrack.setMinimumSize(QSize(100, 0))
        self.lblTrack.setStyleSheet(u"")

        self.horizontalLayout_3.addWidget(self.lblTrack)

        self.cmbTrack = QComboBox(Dialog)
        self.cmbTrack.setObjectName(u"cmbTrack")
        self.cmbTrack.setMinimumSize(QSize(150, 0))

        self.horizontalLayout_3.addWidget(self.cmbTrack)

        self.vbox_properties.addLayout(self.horizontalLayout_3)

        self.horizontalLayout_11 = QHBoxLayout()
        self.horizontalLayout_11.setObjectName(u"horizontalLayout_11")
        self.horizontalLayout_11.setContentsMargins(-1, 0, -1, -1)
        self.label_3 = QLabel(Dialog)
        self.label_3.setObjectName(u"label_3")
        self.label_3.setMinimumSize(QSize(100, 0))

        self.horizontalLayout_11.addWidget(self.label_3)

        self.txtImageLength = QDoubleSpinBox(Dialog)
        self.txtImageLength.setObjectName(u"txtImageLength")
        sizePolicy.setHeightForWidth(
            self.txtImageLength.sizePolicy().hasHeightForWidth())
        self.txtImageLength.setSizePolicy(sizePolicy)
        self.txtImageLength.setMinimumSize(QSize(150, 0))
        self.txtImageLength.setMaximum(999999999.000000000000000)

        self.horizontalLayout_11.addWidget(self.txtImageLength)

        self.vbox_properties.addLayout(self.horizontalLayout_11)

        self.lblFade = QLabel(Dialog)
        self.lblFade.setObjectName(u"lblFade")
        self.lblFade.setStyleSheet(u"font-weight: bold; margin-top: 15px;")
        self.lblFade.setMargin(0)

        self.vbox_properties.addWidget(self.lblFade)

        self.horizontalLayout_5 = QHBoxLayout()
        self.horizontalLayout_5.setObjectName(u"horizontalLayout_5")
        self.lblFade1 = QLabel(Dialog)
        self.lblFade1.setObjectName(u"lblFade1")
        self.lblFade1.setStyleSheet(u"")

        self.horizontalLayout_5.addWidget(self.lblFade1)

        self.cmbFade = QComboBox(Dialog)
        self.cmbFade.setObjectName(u"cmbFade")
        self.cmbFade.setMinimumSize(QSize(150, 0))

        self.horizontalLayout_5.addWidget(self.cmbFade)

        self.vbox_properties.addLayout(self.horizontalLayout_5)

        self.horizontalLayout_8 = QHBoxLayout()
        self.horizontalLayout_8.setObjectName(u"horizontalLayout_8")
        self.lblFadeLength = QLabel(Dialog)
        self.lblFadeLength.setObjectName(u"lblFadeLength")
        self.lblFadeLength.setStyleSheet(u"")

        self.horizontalLayout_8.addWidget(self.lblFadeLength)

        self.txtFadeLength = QDoubleSpinBox(Dialog)
        self.txtFadeLength.setObjectName(u"txtFadeLength")
        self.txtFadeLength.setMinimumSize(QSize(150, 0))
        self.txtFadeLength.setMaximum(999999999.000000000000000)
        self.txtFadeLength.setValue(2.000000000000000)

        self.horizontalLayout_8.addWidget(self.txtFadeLength)

        self.vbox_properties.addLayout(self.horizontalLayout_8)

        self.label = QLabel(Dialog)
        self.label.setObjectName(u"label")
        self.label.setStyleSheet(u"font-weight: bold; margin-top: 15px;")

        self.vbox_properties.addWidget(self.label)

        self.horizontalLayout_7 = QHBoxLayout()
        self.horizontalLayout_7.setObjectName(u"horizontalLayout_7")
        self.horizontalLayout_7.setContentsMargins(-1, 0, -1, -1)
        self.label_2 = QLabel(Dialog)
        self.label_2.setObjectName(u"label_2")

        self.horizontalLayout_7.addWidget(self.label_2)

        self.cmbZoom = QComboBox(Dialog)
        self.cmbZoom.setObjectName(u"cmbZoom")
        self.cmbZoom.setMinimumSize(QSize(150, 0))

        self.horizontalLayout_7.addWidget(self.cmbZoom)

        self.vbox_properties.addLayout(self.horizontalLayout_7)

        self.lblTransition = QLabel(Dialog)
        self.lblTransition.setObjectName(u"lblTransition")
        self.lblTransition.setStyleSheet(
            u"font-weight: bold; margin-top: 15px;")
        self.lblTransition.setMargin(0)

        self.vbox_properties.addWidget(self.lblTransition)

        self.horizontalLayout_9 = QHBoxLayout()
        self.horizontalLayout_9.setObjectName(u"horizontalLayout_9")
        self.lblTransition1 = QLabel(Dialog)
        self.lblTransition1.setObjectName(u"lblTransition1")
        self.lblTransition1.setStyleSheet(u"")

        self.horizontalLayout_9.addWidget(self.lblTransition1)

        self.cmbTransition = QComboBox(Dialog)
        self.cmbTransition.setObjectName(u"cmbTransition")
        self.cmbTransition.setMinimumSize(QSize(150, 0))
        self.cmbTransition.setMaximumSize(QSize(150, 16777215))

        self.horizontalLayout_9.addWidget(self.cmbTransition)

        self.vbox_properties.addLayout(self.horizontalLayout_9)

        self.horizontalLayout_10 = QHBoxLayout()
        self.horizontalLayout_10.setObjectName(u"horizontalLayout_10")
        self.lblTransitionLength = QLabel(Dialog)
        self.lblTransitionLength.setObjectName(u"lblTransitionLength")
        self.lblTransitionLength.setStyleSheet(u"")

        self.horizontalLayout_10.addWidget(self.lblTransitionLength)

        self.txtTransitionLength = QDoubleSpinBox(Dialog)
        self.txtTransitionLength.setObjectName(u"txtTransitionLength")
        self.txtTransitionLength.setMinimumSize(QSize(150, 0))
        self.txtTransitionLength.setMaximum(999999999.000000000000000)
        self.txtTransitionLength.setValue(2.000000000000000)

        self.horizontalLayout_10.addWidget(self.txtTransitionLength)

        self.vbox_properties.addLayout(self.horizontalLayout_10)

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

        self.vbox_properties.addItem(self.verticalSpacer)

        self.horizontalLayout_2.addLayout(self.vbox_properties)

        self.verticalLayout.addLayout(self.horizontalLayout_2)

        self.vbox_parent.addLayout(self.verticalLayout)

        self.horizontalLayout_12 = QHBoxLayout()
        self.horizontalLayout_12.setObjectName(u"horizontalLayout_12")
        self.horizontalLayout_12.setContentsMargins(-1, 0, -1, -1)
        self.lblTotalLength = QLabel(Dialog)
        self.lblTotalLength.setObjectName(u"lblTotalLength")
        sizePolicy1 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
        sizePolicy1.setHorizontalStretch(0)
        sizePolicy1.setVerticalStretch(0)
        sizePolicy1.setHeightForWidth(
            self.lblTotalLength.sizePolicy().hasHeightForWidth())
        self.lblTotalLength.setSizePolicy(sizePolicy1)
        self.lblTotalLength.setAlignment(Qt.AlignRight | Qt.AlignTrailing
                                         | Qt.AlignVCenter)

        self.horizontalLayout_12.addWidget(self.lblTotalLength)

        self.lblTotalLengthValue = QLabel(Dialog)
        self.lblTotalLengthValue.setObjectName(u"lblTotalLengthValue")
        sizePolicy2 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        sizePolicy2.setHorizontalStretch(0)
        sizePolicy2.setVerticalStretch(0)
        sizePolicy2.setHeightForWidth(
            self.lblTotalLengthValue.sizePolicy().hasHeightForWidth())
        self.lblTotalLengthValue.setSizePolicy(sizePolicy2)
        self.lblTotalLengthValue.setMinimumSize(QSize(75, 0))
        self.lblTotalLengthValue.setStyleSheet(u"font-weight:bold;")
        self.lblTotalLengthValue.setAlignment(Qt.AlignRight | Qt.AlignTrailing
                                              | Qt.AlignVCenter)

        self.horizontalLayout_12.addWidget(self.lblTotalLengthValue)

        self.vbox_parent.addLayout(self.horizontalLayout_12)

        self.btnBox = QDialogButtonBox(Dialog)
        self.btnBox.setObjectName(u"btnBox")
        self.btnBox.setStandardButtons(QDialogButtonBox.Cancel
                                       | QDialogButtonBox.Ok)
        self.btnBox.setCenterButtons(False)

        self.vbox_parent.addWidget(self.btnBox)

        self.horizontalLayout.addLayout(self.vbox_parent)

        self.retranslateUi(Dialog)

        QMetaObject.connectSlotsByName(Dialog)

    # setupUi

    def retranslateUi(self, Dialog):
        Dialog.setWindowTitle(
            QCoreApplication.translate("Dialog", u"Add To Timeline", None))
        #if QT_CONFIG(tooltip)
        self.btnMoveUp.setToolTip(
            QCoreApplication.translate("Dialog", u"Move Up", None))
        #endif // QT_CONFIG(tooltip)
        self.btnMoveUp.setText("")
        #if QT_CONFIG(tooltip)
        self.btnMoveDown.setToolTip(
            QCoreApplication.translate("Dialog", u"Move Down", None))
        #endif // QT_CONFIG(tooltip)
        self.btnMoveDown.setText("")
        #if QT_CONFIG(tooltip)
        self.btnShuffle.setToolTip(
            QCoreApplication.translate("Dialog", u"Shuffle", None))
        #endif // QT_CONFIG(tooltip)
        self.btnShuffle.setText("")
        #if QT_CONFIG(tooltip)
        self.btnRemove.setToolTip(
            QCoreApplication.translate("Dialog", u"Remove", None))
        #endif // QT_CONFIG(tooltip)
        self.btnRemove.setText("")
        self.lblTimelineLocation.setText(
            QCoreApplication.translate("Dialog", u"Timeline Location", None))
        self.lblStartTime.setText(
            QCoreApplication.translate("Dialog", u"Start Time (seconds):",
                                       None))
        self.lblTrack.setText(
            QCoreApplication.translate("Dialog", u"Track:", None))
        self.label_3.setText(
            QCoreApplication.translate("Dialog", u"Image Length (seconds):",
                                       None))
        self.lblFade.setText(
            QCoreApplication.translate("Dialog", u"Fade", None))
        self.lblFade1.setText(
            QCoreApplication.translate("Dialog", u"Fade:", None))
        self.lblFadeLength.setText(
            QCoreApplication.translate("Dialog", u"Length (seconds):", None))
        self.label.setText(QCoreApplication.translate("Dialog", u"Zoom", None))
        self.label_2.setText(
            QCoreApplication.translate("Dialog", u"Zoom:", None))
        self.lblTransition.setText(
            QCoreApplication.translate("Dialog", u"Transition", None))
        self.lblTransition1.setText(
            QCoreApplication.translate("Dialog", u"Transition:", None))
        self.lblTransitionLength.setText(
            QCoreApplication.translate("Dialog", u"Length:", None))
        self.lblTotalLength.setText(
            QCoreApplication.translate("Dialog", u"Total Length (seconds):",
                                       None))
        self.lblTotalLengthValue.setText(
            QCoreApplication.translate("Dialog", u"0.0", None))
コード例 #4
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
コード例 #5
0
ファイル: time.py プロジェクト: clpi/isutils
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))
コード例 #6
0
class Ui_PaymentDlg(object):
    def setupUi(self, PaymentDlg):
        if not PaymentDlg.objectName():
            PaymentDlg.setObjectName(u"PaymentDlg")
        PaymentDlg.resize(399, 276)
        self.gridLayout = QGridLayout(PaymentDlg)
        # ifndef Q_OS_MAC
        self.gridLayout.setSpacing(6)
        # endif
        # ifndef Q_OS_MAC
        self.gridLayout.setContentsMargins(9, 9, 9, 9)
        # endif
        self.gridLayout.setObjectName(u"gridLayout")
        self.buttonBox = QDialogButtonBox(PaymentDlg)
        self.buttonBox.setObjectName(u"buttonBox")
        self.buttonBox.setOrientation(Qt.Horizontal)
        self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel
                                          | QDialogButtonBox.NoButton
                                          | QDialogButtonBox.Ok)

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

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

        self.gridLayout.addItem(self.spacerItem, 2, 0, 1, 1)

        self.tabWidget = QTabWidget(PaymentDlg)
        self.tabWidget.setObjectName(u"tabWidget")
        self.tab = QWidget()
        self.tab.setObjectName(u"tab")
        self.hboxLayout = QHBoxLayout(self.tab)
        # 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.paidCheckBox = QCheckBox(self.tab)
        self.paidCheckBox.setObjectName(u"paidCheckBox")

        self.hboxLayout.addWidget(self.paidCheckBox)

        self.tabWidget.addTab(self.tab, "")
        self.tab_2 = QWidget()
        self.tab_2.setObjectName(u"tab_2")
        self.gridLayout1 = QGridLayout(self.tab_2)
        # ifndef Q_OS_MAC
        self.gridLayout1.setSpacing(6)
        # endif
        # ifndef Q_OS_MAC
        self.gridLayout1.setContentsMargins(9, 9, 9, 9)
        # endif
        self.gridLayout1.setObjectName(u"gridLayout1")
        self.sortCodeLineEdit = QLineEdit(self.tab_2)
        self.sortCodeLineEdit.setObjectName(u"sortCodeLineEdit")

        self.gridLayout1.addWidget(self.sortCodeLineEdit, 1, 3, 1, 1)

        self.label_8 = QLabel(self.tab_2)
        self.label_8.setObjectName(u"label_8")

        self.gridLayout1.addWidget(self.label_8, 1, 2, 1, 1)

        self.bankLineEdit = QLineEdit(self.tab_2)
        self.bankLineEdit.setObjectName(u"bankLineEdit")

        self.gridLayout1.addWidget(self.bankLineEdit, 0, 3, 1, 1)

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

        self.gridLayout1.addWidget(self.label_7, 0, 2, 1, 1)

        self.accountNumLineEdit = QLineEdit(self.tab_2)
        self.accountNumLineEdit.setObjectName(u"accountNumLineEdit")

        self.gridLayout1.addWidget(self.accountNumLineEdit, 1, 1, 1, 1)

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

        self.gridLayout1.addWidget(self.label_6, 1, 0, 1, 1)

        self.checkNumLineEdit = QLineEdit(self.tab_2)
        self.checkNumLineEdit.setObjectName(u"checkNumLineEdit")

        self.gridLayout1.addWidget(self.checkNumLineEdit, 0, 1, 1, 1)

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

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

        self.tabWidget.addTab(self.tab_2, "")
        self.tab_3 = QWidget()
        self.tab_3.setObjectName(u"tab_3")
        self.gridLayout2 = QGridLayout(self.tab_3)
        # ifndef Q_OS_MAC
        self.gridLayout2.setSpacing(6)
        # endif
        # ifndef Q_OS_MAC
        self.gridLayout2.setContentsMargins(9, 9, 9, 9)
        # endif
        self.gridLayout2.setObjectName(u"gridLayout2")
        self.creditCardLineEdit = QLineEdit(self.tab_3)
        self.creditCardLineEdit.setObjectName(u"creditCardLineEdit")

        self.gridLayout2.addWidget(self.creditCardLineEdit, 0, 1, 1, 3)

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

        self.gridLayout2.addWidget(self.label_11, 0, 0, 1, 1)

        self.expiryDateEdit = QDateEdit(self.tab_3)
        self.expiryDateEdit.setObjectName(u"expiryDateEdit")
        self.expiryDateEdit.setAlignment(Qt.AlignRight)

        self.gridLayout2.addWidget(self.expiryDateEdit, 1, 3, 1, 1)

        self.label_10 = QLabel(self.tab_3)
        self.label_10.setObjectName(u"label_10")

        self.gridLayout2.addWidget(self.label_10, 1, 2, 1, 1)

        self.validFromDateEdit = QDateEdit(self.tab_3)
        self.validFromDateEdit.setObjectName(u"validFromDateEdit")
        self.validFromDateEdit.setAlignment(Qt.AlignRight)

        self.gridLayout2.addWidget(self.validFromDateEdit, 1, 1, 1, 1)

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

        self.gridLayout2.addWidget(self.label_9, 1, 0, 1, 1)

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

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

        self.gridLayout3 = QGridLayout()
        # ifndef Q_OS_MAC
        self.gridLayout3.setSpacing(6)
        # endif
        self.gridLayout3.setContentsMargins(0, 0, 0, 0)
        self.gridLayout3.setObjectName(u"gridLayout3")
        self.label_3 = QLabel(PaymentDlg)
        self.label_3.setObjectName(u"label_3")

        self.gridLayout3.addWidget(self.label_3, 0, 2, 1, 1)

        self.amountSpinBox = QDoubleSpinBox(PaymentDlg)
        self.amountSpinBox.setObjectName(u"amountSpinBox")
        self.amountSpinBox.setAlignment(Qt.AlignRight)
        self.amountSpinBox.setMaximum(999999.000000000000000)

        self.gridLayout3.addWidget(self.amountSpinBox, 1, 3, 1, 1)

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

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

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

        self.gridLayout3.addWidget(self.label_5, 1, 0, 1, 1)

        self.surnameLineEdit = QLineEdit(PaymentDlg)
        self.surnameLineEdit.setObjectName(u"surnameLineEdit")

        self.gridLayout3.addWidget(self.surnameLineEdit, 0, 3, 1, 1)

        self.forenameLineEdit = QLineEdit(PaymentDlg)
        self.forenameLineEdit.setObjectName(u"forenameLineEdit")

        self.gridLayout3.addWidget(self.forenameLineEdit, 0, 1, 1, 1)

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

        self.gridLayout3.addWidget(self.label_4, 1, 2, 1, 1)

        self.invoiceNumSpinBox = QSpinBox(PaymentDlg)
        self.invoiceNumSpinBox.setObjectName(u"invoiceNumSpinBox")
        self.invoiceNumSpinBox.setAlignment(Qt.AlignRight)
        self.invoiceNumSpinBox.setMaximum(999999999)
        self.invoiceNumSpinBox.setMinimum(1000000)
        self.invoiceNumSpinBox.setValue(1000000)

        self.gridLayout3.addWidget(self.invoiceNumSpinBox, 1, 1, 1, 1)

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

        # if QT_CONFIG(shortcut)
        self.label_8.setBuddy(self.sortCodeLineEdit)
        self.label_7.setBuddy(self.bankLineEdit)
        self.label_6.setBuddy(self.accountNumLineEdit)
        self.label_2.setBuddy(self.checkNumLineEdit)
        self.label_11.setBuddy(self.creditCardLineEdit)
        self.label_10.setBuddy(self.expiryDateEdit)
        self.label_9.setBuddy(self.validFromDateEdit)
        self.label_3.setBuddy(self.surnameLineEdit)
        self.label.setBuddy(self.forenameLineEdit)
        self.label_5.setBuddy(self.invoiceNumSpinBox)
        self.label_4.setBuddy(self.amountSpinBox)
        # endif // QT_CONFIG(shortcut)
        QWidget.setTabOrder(self.forenameLineEdit, self.surnameLineEdit)
        QWidget.setTabOrder(self.surnameLineEdit, self.invoiceNumSpinBox)
        QWidget.setTabOrder(self.invoiceNumSpinBox, self.amountSpinBox)
        QWidget.setTabOrder(self.amountSpinBox, self.tabWidget)
        QWidget.setTabOrder(self.tabWidget, self.paidCheckBox)
        QWidget.setTabOrder(self.paidCheckBox, self.checkNumLineEdit)
        QWidget.setTabOrder(self.checkNumLineEdit, self.accountNumLineEdit)
        QWidget.setTabOrder(self.accountNumLineEdit, self.bankLineEdit)
        QWidget.setTabOrder(self.bankLineEdit, self.sortCodeLineEdit)
        QWidget.setTabOrder(self.sortCodeLineEdit, self.creditCardLineEdit)
        QWidget.setTabOrder(self.creditCardLineEdit, self.validFromDateEdit)
        QWidget.setTabOrder(self.validFromDateEdit, self.expiryDateEdit)

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

        self.tabWidget.setCurrentIndex(0)

        QMetaObject.connectSlotsByName(PaymentDlg)

    # setupUi

    def retranslateUi(self, PaymentDlg):
        PaymentDlg.setWindowTitle(
            QCoreApplication.translate("PaymentDlg", u"Payment Form", None))
        self.paidCheckBox.setText(
            QCoreApplication.translate("PaymentDlg", u"&Paid", None))
        self.tabWidget.setTabText(
            self.tabWidget.indexOf(self.tab),
            QCoreApplication.translate("PaymentDlg", u"Cas&h", None),
        )
        self.label_8.setText(
            QCoreApplication.translate("PaymentDlg", u"S&ort Code:", None))
        self.label_7.setText(
            QCoreApplication.translate("PaymentDlg", u"&Bank:", None))
        self.label_6.setText(
            QCoreApplication.translate("PaymentDlg", u"A&ccount No.:", None))
        self.label_2.setText(
            QCoreApplication.translate("PaymentDlg", u"Check &No.:", None))
        self.tabWidget.setTabText(
            self.tabWidget.indexOf(self.tab_2),
            QCoreApplication.translate("PaymentDlg", u"Chec&k", None),
        )
        self.label_11.setText(
            QCoreApplication.translate("PaymentDlg", u"&Number:", None))
        self.expiryDateEdit.setDisplayFormat(
            QCoreApplication.translate("PaymentDlg", u"MMM yyyy", None))
        self.label_10.setText(
            QCoreApplication.translate("PaymentDlg", u"E&xpiry Date", None))
        self.validFromDateEdit.setDisplayFormat(
            QCoreApplication.translate("PaymentDlg", u"MMM yyyy", None))
        self.label_9.setText(
            QCoreApplication.translate("PaymentDlg", u"&Valid From:", None))
        self.tabWidget.setTabText(
            self.tabWidget.indexOf(self.tab_3),
            QCoreApplication.translate("PaymentDlg", u"Credit Car&d", None),
        )
        self.label_3.setText(
            QCoreApplication.translate("PaymentDlg", u"&Surname:", None))
        self.amountSpinBox.setPrefix(
            QCoreApplication.translate("PaymentDlg", u"$ ", None))
        self.label.setText(
            QCoreApplication.translate("PaymentDlg", u"&Forename:", None))
        self.label_5.setText(
            QCoreApplication.translate("PaymentDlg", u"&Invoice No.:", None))
        self.label_4.setText(
            QCoreApplication.translate("PaymentDlg", u"&Amount:", None))
コード例 #7
0
ファイル: cropdialog.py プロジェクト: cbrnr/mnelab
class CropDialog(QDialog):
    def __init__(self, parent, start, stop):
        super().__init__(parent)
        self.setWindowTitle("Crop data")
        vbox = QVBoxLayout(self)
        grid = QGridLayout()
        self.start_checkbox = QCheckBox("Start time:")
        self.start_checkbox.setChecked(True)
        self.start_checkbox.stateChanged.connect(self.toggle_start)
        grid.addWidget(self.start_checkbox, 0, 0)
        self._start = QDoubleSpinBox()
        self._start.setMaximum(999999)
        self._start.setValue(start)
        self._start.setDecimals(2)
        self._start.setSuffix(" s")
        grid.addWidget(self._start, 0, 1)

        self.stop_checkbox = QCheckBox("Stop time:")
        self.stop_checkbox.setChecked(True)
        self.stop_checkbox.stateChanged.connect(self.toggle_stop)
        grid.addWidget(self.stop_checkbox, 1, 0)
        self._stop = QDoubleSpinBox()
        self._stop.setMaximum(999999)
        self._stop.setValue(stop)
        self._stop.setDecimals(2)
        self._stop.setSuffix(" s")
        grid.addWidget(self._stop, 1, 1)
        vbox.addLayout(grid)
        buttonbox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
        vbox.addWidget(buttonbox)
        buttonbox.accepted.connect(self.accept)
        buttonbox.rejected.connect(self.reject)
        vbox.setSizeConstraint(QVBoxLayout.SetFixedSize)

    @property
    def start(self):
        if self.start_checkbox.isChecked():
            return self._start.value()
        else:
            return None

    @property
    def stop(self):
        if self.stop_checkbox.isChecked():
            return self._stop.value()
        else:
            return None

    @Slot()
    def toggle_start(self):
        if self.start_checkbox.isChecked():
            self._start.setEnabled(True)
        else:
            self._start.setEnabled(False)

    @Slot()
    def toggle_stop(self):
        if self.stop_checkbox.isChecked():
            self._stop.setEnabled(True)
        else:
            self._stop.setEnabled(False)
コード例 #8
0
class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        if not MainWindow.objectName():
            MainWindow.setObjectName(u"MainWindow")
        MainWindow.resize(770, 640)
        MainWindow.setMinimumSize(QSize(770, 640))
        self.centralwidget = QWidget(MainWindow)
        self.centralwidget.setObjectName(u"centralwidget")
        self.gridLayout_10 = QGridLayout(self.centralwidget)
        self.gridLayout_10.setObjectName(u"gridLayout_10")
        self.groupBoxConnection = QGroupBox(self.centralwidget)
        self.groupBoxConnection.setObjectName(u"groupBoxConnection")
        sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(self.groupBoxConnection.sizePolicy().hasHeightForWidth())
        self.groupBoxConnection.setSizePolicy(sizePolicy)
        self.gridLayout_2 = QGridLayout(self.groupBoxConnection)
        self.gridLayout_2.setObjectName(u"gridLayout_2")
        self.pushButtonConnect = QPushButton(self.groupBoxConnection)
        self.pushButtonConnect.setObjectName(u"pushButtonConnect")
        sizePolicy1 = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
        sizePolicy1.setHorizontalStretch(1)
        sizePolicy1.setVerticalStretch(0)
        sizePolicy1.setHeightForWidth(self.pushButtonConnect.sizePolicy().hasHeightForWidth())
        self.pushButtonConnect.setSizePolicy(sizePolicy1)

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

        self.labelUpdateDelay = QLabel(self.groupBoxConnection)
        self.labelUpdateDelay.setObjectName(u"labelUpdateDelay")

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

        self.labelStatus = QLabel(self.groupBoxConnection)
        self.labelStatus.setObjectName(u"labelStatus")
        sizePolicy2 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        sizePolicy2.setHorizontalStretch(1)
        sizePolicy2.setVerticalStretch(0)
        sizePolicy2.setHeightForWidth(self.labelStatus.sizePolicy().hasHeightForWidth())
        self.labelStatus.setSizePolicy(sizePolicy2)

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

        self.comboBoxGameSelection = QComboBox(self.groupBoxConnection)
        self.comboBoxGameSelection.addItem("")
        self.comboBoxGameSelection.addItem("")
        self.comboBoxGameSelection.addItem("")
        self.comboBoxGameSelection.addItem("")
        self.comboBoxGameSelection.setObjectName(u"comboBoxGameSelection")
        sizePolicy3 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed)
        sizePolicy3.setHorizontalStretch(1)
        sizePolicy3.setVerticalStretch(0)
        sizePolicy3.setHeightForWidth(self.comboBoxGameSelection.sizePolicy().hasHeightForWidth())
        self.comboBoxGameSelection.setSizePolicy(sizePolicy3)

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

        self.doubleSpinBoxDelay = QDoubleSpinBox(self.groupBoxConnection)
        self.doubleSpinBoxDelay.setObjectName(u"doubleSpinBoxDelay")
        self.doubleSpinBoxDelay.setEnabled(False)
        self.doubleSpinBoxDelay.setMinimum(0.500000000000000)
        self.doubleSpinBoxDelay.setMaximum(2.000000000000000)

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


        self.gridLayout_10.addWidget(self.groupBoxConnection, 0, 0, 1, 1)

        self.tabWidget = QTabWidget(self.centralwidget)
        self.tabWidget.setObjectName(u"tabWidget")
        sizePolicy4 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        sizePolicy4.setHorizontalStretch(0)
        sizePolicy4.setVerticalStretch(5)
        sizePolicy4.setHeightForWidth(self.tabWidget.sizePolicy().hasHeightForWidth())
        self.tabWidget.setSizePolicy(sizePolicy4)
        self.tabGen6 = QWidget()
        self.tabGen6.setObjectName(u"tabGen6")
        self.gridLayout = QGridLayout(self.tabGen6)
        self.gridLayout.setObjectName(u"gridLayout")
        self.tabWidgetGen6 = QTabWidget(self.tabGen6)
        self.tabWidgetGen6.setObjectName(u"tabWidgetGen6")
        self.tabMain6 = QWidget()
        self.tabMain6.setObjectName(u"tabMain6")
        self.gridLayout_13 = QGridLayout(self.tabMain6)
        self.gridLayout_13.setObjectName(u"gridLayout_13")
        self.comboBoxMainIndex6 = QComboBox(self.tabMain6)
        self.comboBoxMainIndex6.addItem("")
        self.comboBoxMainIndex6.addItem("")
        self.comboBoxMainIndex6.addItem("")
        self.comboBoxMainIndex6.addItem("")
        self.comboBoxMainIndex6.addItem("")
        self.comboBoxMainIndex6.addItem("")
        self.comboBoxMainIndex6.addItem("")
        self.comboBoxMainIndex6.setObjectName(u"comboBoxMainIndex6")
        self.comboBoxMainIndex6.setEnabled(False)
        sizePolicy3.setHeightForWidth(self.comboBoxMainIndex6.sizePolicy().hasHeightForWidth())
        self.comboBoxMainIndex6.setSizePolicy(sizePolicy3)

        self.gridLayout_13.addWidget(self.comboBoxMainIndex6, 0, 0, 1, 1)

        self.groupBoxMainRNG6 = QGroupBox(self.tabMain6)
        self.groupBoxMainRNG6.setObjectName(u"groupBoxMainRNG6")
        sizePolicy2.setHeightForWidth(self.groupBoxMainRNG6.sizePolicy().hasHeightForWidth())
        self.groupBoxMainRNG6.setSizePolicy(sizePolicy2)
        self.gridLayout_11 = QGridLayout(self.groupBoxMainRNG6)
        self.gridLayout_11.setObjectName(u"gridLayout_11")
        self.lineEditFrame6 = QLineEdit(self.groupBoxMainRNG6)
        self.lineEditFrame6.setObjectName(u"lineEditFrame6")
        sizePolicy5 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed)
        sizePolicy5.setHorizontalStretch(0)
        sizePolicy5.setVerticalStretch(0)
        sizePolicy5.setHeightForWidth(self.lineEditFrame6.sizePolicy().hasHeightForWidth())
        self.lineEditFrame6.setSizePolicy(sizePolicy5)
        self.lineEditFrame6.setReadOnly(True)

        self.gridLayout_11.addWidget(self.lineEditFrame6, 3, 2, 1, 2)

        self.labelTiny2 = QLabel(self.groupBoxMainRNG6)
        self.labelTiny2.setObjectName(u"labelTiny2")

        self.gridLayout_11.addWidget(self.labelTiny2, 5, 2, 1, 1)

        self.labelTiny0 = QLabel(self.groupBoxMainRNG6)
        self.labelTiny0.setObjectName(u"labelTiny0")

        self.gridLayout_11.addWidget(self.labelTiny0, 6, 2, 1, 1)

        self.lineEditInitialSeed6 = QLineEdit(self.groupBoxMainRNG6)
        self.lineEditInitialSeed6.setObjectName(u"lineEditInitialSeed6")
        sizePolicy5.setHeightForWidth(self.lineEditInitialSeed6.sizePolicy().hasHeightForWidth())
        self.lineEditInitialSeed6.setSizePolicy(sizePolicy5)
        self.lineEditInitialSeed6.setMaxLength(8)
        self.lineEditInitialSeed6.setReadOnly(True)

        self.gridLayout_11.addWidget(self.lineEditInitialSeed6, 1, 2, 1, 2)

        self.labelTiny3 = QLabel(self.groupBoxMainRNG6)
        self.labelTiny3.setObjectName(u"labelTiny3")

        self.gridLayout_11.addWidget(self.labelTiny3, 5, 0, 1, 1)

        self.labelTiny1 = QLabel(self.groupBoxMainRNG6)
        self.labelTiny1.setObjectName(u"labelTiny1")

        self.gridLayout_11.addWidget(self.labelTiny1, 6, 0, 1, 1)

        self.labelMainCurrentSeed6 = QLabel(self.groupBoxMainRNG6)
        self.labelMainCurrentSeed6.setObjectName(u"labelMainCurrentSeed6")

        self.gridLayout_11.addWidget(self.labelMainCurrentSeed6, 2, 0, 1, 2)

        self.lineEditCurrentSeed6 = QLineEdit(self.groupBoxMainRNG6)
        self.lineEditCurrentSeed6.setObjectName(u"lineEditCurrentSeed6")
        sizePolicy5.setHeightForWidth(self.lineEditCurrentSeed6.sizePolicy().hasHeightForWidth())
        self.lineEditCurrentSeed6.setSizePolicy(sizePolicy5)
        self.lineEditCurrentSeed6.setMaxLength(16)
        self.lineEditCurrentSeed6.setReadOnly(True)

        self.gridLayout_11.addWidget(self.lineEditCurrentSeed6, 2, 2, 1, 2)

        self.lineEditTiny2 = QLineEdit(self.groupBoxMainRNG6)
        self.lineEditTiny2.setObjectName(u"lineEditTiny2")

        self.gridLayout_11.addWidget(self.lineEditTiny2, 5, 3, 1, 1)

        self.lineEditTiny1 = QLineEdit(self.groupBoxMainRNG6)
        self.lineEditTiny1.setObjectName(u"lineEditTiny1")

        self.gridLayout_11.addWidget(self.lineEditTiny1, 6, 1, 1, 1)

        self.lineEditTiny3 = QLineEdit(self.groupBoxMainRNG6)
        self.lineEditTiny3.setObjectName(u"lineEditTiny3")

        self.gridLayout_11.addWidget(self.lineEditTiny3, 5, 1, 1, 1)

        self.labelMainInitialSeed6 = QLabel(self.groupBoxMainRNG6)
        self.labelMainInitialSeed6.setObjectName(u"labelMainInitialSeed6")

        self.gridLayout_11.addWidget(self.labelMainInitialSeed6, 1, 0, 1, 2)

        self.labelMainFrame6 = QLabel(self.groupBoxMainRNG6)
        self.labelMainFrame6.setObjectName(u"labelMainFrame6")

        self.gridLayout_11.addWidget(self.labelMainFrame6, 3, 0, 1, 1)

        self.lineEditTiny0 = QLineEdit(self.groupBoxMainRNG6)
        self.lineEditTiny0.setObjectName(u"lineEditTiny0")

        self.gridLayout_11.addWidget(self.lineEditTiny0, 6, 3, 1, 1)

        self.pushButtonMainUpdate6 = QPushButton(self.groupBoxMainRNG6)
        self.pushButtonMainUpdate6.setObjectName(u"pushButtonMainUpdate6")
        self.pushButtonMainUpdate6.setEnabled(False)

        self.gridLayout_11.addWidget(self.pushButtonMainUpdate6, 0, 0, 1, 4)

        self.labelSaveVariable = QLabel(self.groupBoxMainRNG6)
        self.labelSaveVariable.setObjectName(u"labelSaveVariable")

        self.gridLayout_11.addWidget(self.labelSaveVariable, 4, 0, 1, 1)

        self.lineEditSaveVariable = QLineEdit(self.groupBoxMainRNG6)
        self.lineEditSaveVariable.setObjectName(u"lineEditSaveVariable")
        self.lineEditSaveVariable.setReadOnly(True)

        self.gridLayout_11.addWidget(self.lineEditSaveVariable, 4, 2, 1, 2)


        self.gridLayout_13.addWidget(self.groupBoxMainRNG6, 0, 1, 2, 1)

        self.mainPokemon6 = PokemonDisplay(self.tabMain6)
        self.mainPokemon6.setObjectName(u"mainPokemon6")
        sizePolicy2.setHeightForWidth(self.mainPokemon6.sizePolicy().hasHeightForWidth())
        self.mainPokemon6.setSizePolicy(sizePolicy2)

        self.gridLayout_13.addWidget(self.mainPokemon6, 1, 0, 1, 1)

        self.tabWidgetGen6.addTab(self.tabMain6, "")
        self.tabEgg6 = QWidget()
        self.tabEgg6.setObjectName(u"tabEgg6")
        self.gridLayout_15 = QGridLayout(self.tabEgg6)
        self.gridLayout_15.setObjectName(u"gridLayout_15")
        self.eggParent1_6 = PokemonDisplay(self.tabEgg6)
        self.eggParent1_6.setObjectName(u"eggParent1_6")
        sizePolicy2.setHeightForWidth(self.eggParent1_6.sizePolicy().hasHeightForWidth())
        self.eggParent1_6.setSizePolicy(sizePolicy2)

        self.gridLayout_15.addWidget(self.eggParent1_6, 0, 0, 1, 1)

        self.eggParent2_6 = PokemonDisplay(self.tabEgg6)
        self.eggParent2_6.setObjectName(u"eggParent2_6")
        sizePolicy2.setHeightForWidth(self.eggParent2_6.sizePolicy().hasHeightForWidth())
        self.eggParent2_6.setSizePolicy(sizePolicy2)

        self.gridLayout_15.addWidget(self.eggParent2_6, 0, 1, 1, 1)

        self.groupBoxEggRNG6 = QGroupBox(self.tabEgg6)
        self.groupBoxEggRNG6.setObjectName(u"groupBoxEggRNG6")
        sizePolicy2.setHeightForWidth(self.groupBoxEggRNG6.sizePolicy().hasHeightForWidth())
        self.groupBoxEggRNG6.setSizePolicy(sizePolicy2)
        self.gridLayout_14 = QGridLayout(self.groupBoxEggRNG6)
        self.gridLayout_14.setObjectName(u"gridLayout_14")
        self.labelEggReady6 = QLabel(self.groupBoxEggRNG6)
        self.labelEggReady6.setObjectName(u"labelEggReady6")
        sizePolicy5.setHeightForWidth(self.labelEggReady6.sizePolicy().hasHeightForWidth())
        self.labelEggReady6.setSizePolicy(sizePolicy5)

        self.gridLayout_14.addWidget(self.labelEggReady6, 1, 0, 1, 1)

        self.labelEggReadyStatus6 = QLabel(self.groupBoxEggRNG6)
        self.labelEggReadyStatus6.setObjectName(u"labelEggReadyStatus6")

        self.gridLayout_14.addWidget(self.labelEggReadyStatus6, 1, 1, 1, 1)

        self.lineEditEggSeed0_6 = QLineEdit(self.groupBoxEggRNG6)
        self.lineEditEggSeed0_6.setObjectName(u"lineEditEggSeed0_6")
        sizePolicy5.setHeightForWidth(self.lineEditEggSeed0_6.sizePolicy().hasHeightForWidth())
        self.lineEditEggSeed0_6.setSizePolicy(sizePolicy5)
        self.lineEditEggSeed0_6.setMaxLength(8)
        self.lineEditEggSeed0_6.setReadOnly(True)

        self.gridLayout_14.addWidget(self.lineEditEggSeed0_6, 3, 1, 1, 1)

        self.pushButtonEggUpdate6 = QPushButton(self.groupBoxEggRNG6)
        self.pushButtonEggUpdate6.setObjectName(u"pushButtonEggUpdate6")
        self.pushButtonEggUpdate6.setEnabled(False)

        self.gridLayout_14.addWidget(self.pushButtonEggUpdate6, 0, 0, 1, 2)

        self.labelEggSeed0_6 = QLabel(self.groupBoxEggRNG6)
        self.labelEggSeed0_6.setObjectName(u"labelEggSeed0_6")

        self.gridLayout_14.addWidget(self.labelEggSeed0_6, 3, 0, 1, 1)

        self.labelEggSeed1_6 = QLabel(self.groupBoxEggRNG6)
        self.labelEggSeed1_6.setObjectName(u"labelEggSeed1_6")

        self.gridLayout_14.addWidget(self.labelEggSeed1_6, 2, 0, 1, 1)

        self.lineEditEggSeed1_6 = QLineEdit(self.groupBoxEggRNG6)
        self.lineEditEggSeed1_6.setObjectName(u"lineEditEggSeed1_6")
        sizePolicy5.setHeightForWidth(self.lineEditEggSeed1_6.sizePolicy().hasHeightForWidth())
        self.lineEditEggSeed1_6.setSizePolicy(sizePolicy5)
        self.lineEditEggSeed1_6.setMaxLength(8)
        self.lineEditEggSeed1_6.setReadOnly(True)

        self.gridLayout_14.addWidget(self.lineEditEggSeed1_6, 2, 1, 1, 1)


        self.gridLayout_15.addWidget(self.groupBoxEggRNG6, 0, 2, 1, 1)

        self.tabWidgetGen6.addTab(self.tabEgg6, "")

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

        self.tabWidget.addTab(self.tabGen6, "")
        self.tabGen7 = QWidget()
        self.tabGen7.setObjectName(u"tabGen7")
        self.tabGen7.setEnabled(False)
        self.gridLayout_12 = QGridLayout(self.tabGen7)
        self.gridLayout_12.setObjectName(u"gridLayout_12")
        self.tabWidgetGen7 = QTabWidget(self.tabGen7)
        self.tabWidgetGen7.setObjectName(u"tabWidgetGen7")
        self.tabMain7 = QWidget()
        self.tabMain7.setObjectName(u"tabMain7")
        self.gridLayout_7 = QGridLayout(self.tabMain7)
        self.gridLayout_7.setObjectName(u"gridLayout_7")
        self.comboBoxMainIndex7 = QComboBox(self.tabMain7)
        self.comboBoxMainIndex7.addItem("")
        self.comboBoxMainIndex7.addItem("")
        self.comboBoxMainIndex7.addItem("")
        self.comboBoxMainIndex7.addItem("")
        self.comboBoxMainIndex7.addItem("")
        self.comboBoxMainIndex7.addItem("")
        self.comboBoxMainIndex7.addItem("")
        self.comboBoxMainIndex7.setObjectName(u"comboBoxMainIndex7")
        self.comboBoxMainIndex7.setEnabled(False)
        sizePolicy3.setHeightForWidth(self.comboBoxMainIndex7.sizePolicy().hasHeightForWidth())
        self.comboBoxMainIndex7.setSizePolicy(sizePolicy3)

        self.gridLayout_7.addWidget(self.comboBoxMainIndex7, 0, 0, 1, 1)

        self.groupBoxMainRNG7 = QGroupBox(self.tabMain7)
        self.groupBoxMainRNG7.setObjectName(u"groupBoxMainRNG7")
        sizePolicy2.setHeightForWidth(self.groupBoxMainRNG7.sizePolicy().hasHeightForWidth())
        self.groupBoxMainRNG7.setSizePolicy(sizePolicy2)
        self.gridLayout_3 = QGridLayout(self.groupBoxMainRNG7)
        self.gridLayout_3.setObjectName(u"gridLayout_3")
        self.labelMainInitialSeed7 = QLabel(self.groupBoxMainRNG7)
        self.labelMainInitialSeed7.setObjectName(u"labelMainInitialSeed7")

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

        self.lineEditInitialSeed7 = QLineEdit(self.groupBoxMainRNG7)
        self.lineEditInitialSeed7.setObjectName(u"lineEditInitialSeed7")
        sizePolicy5.setHeightForWidth(self.lineEditInitialSeed7.sizePolicy().hasHeightForWidth())
        self.lineEditInitialSeed7.setSizePolicy(sizePolicy5)
        self.lineEditInitialSeed7.setMaxLength(8)
        self.lineEditInitialSeed7.setReadOnly(True)

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

        self.labelMainCurrentSeed7 = QLabel(self.groupBoxMainRNG7)
        self.labelMainCurrentSeed7.setObjectName(u"labelMainCurrentSeed7")

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

        self.lineEditCurrentSeed7 = QLineEdit(self.groupBoxMainRNG7)
        self.lineEditCurrentSeed7.setObjectName(u"lineEditCurrentSeed7")
        sizePolicy5.setHeightForWidth(self.lineEditCurrentSeed7.sizePolicy().hasHeightForWidth())
        self.lineEditCurrentSeed7.setSizePolicy(sizePolicy5)
        self.lineEditCurrentSeed7.setMaxLength(16)
        self.lineEditCurrentSeed7.setReadOnly(True)

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

        self.labelMainFrame7 = QLabel(self.groupBoxMainRNG7)
        self.labelMainFrame7.setObjectName(u"labelMainFrame7")

        self.gridLayout_3.addWidget(self.labelMainFrame7, 3, 0, 1, 1)

        self.lineEditFrame7 = QLineEdit(self.groupBoxMainRNG7)
        self.lineEditFrame7.setObjectName(u"lineEditFrame7")
        sizePolicy5.setHeightForWidth(self.lineEditFrame7.sizePolicy().hasHeightForWidth())
        self.lineEditFrame7.setSizePolicy(sizePolicy5)
        self.lineEditFrame7.setReadOnly(True)

        self.gridLayout_3.addWidget(self.lineEditFrame7, 3, 1, 1, 1)

        self.pushButtonMainUpdate7 = QPushButton(self.groupBoxMainRNG7)
        self.pushButtonMainUpdate7.setObjectName(u"pushButtonMainUpdate7")
        self.pushButtonMainUpdate7.setEnabled(False)

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


        self.gridLayout_7.addWidget(self.groupBoxMainRNG7, 0, 1, 2, 1)

        self.mainPokemon7 = PokemonDisplay(self.tabMain7)
        self.mainPokemon7.setObjectName(u"mainPokemon7")
        sizePolicy2.setHeightForWidth(self.mainPokemon7.sizePolicy().hasHeightForWidth())
        self.mainPokemon7.setSizePolicy(sizePolicy2)

        self.gridLayout_7.addWidget(self.mainPokemon7, 1, 0, 1, 1)

        self.tabWidgetGen7.addTab(self.tabMain7, "")
        self.tabEgg7 = QWidget()
        self.tabEgg7.setObjectName(u"tabEgg7")
        self.gridLayout_6 = QGridLayout(self.tabEgg7)
        self.gridLayout_6.setObjectName(u"gridLayout_6")
        self.groupBoxEggRNG7 = QGroupBox(self.tabEgg7)
        self.groupBoxEggRNG7.setObjectName(u"groupBoxEggRNG7")
        sizePolicy2.setHeightForWidth(self.groupBoxEggRNG7.sizePolicy().hasHeightForWidth())
        self.groupBoxEggRNG7.setSizePolicy(sizePolicy2)
        self.gridLayout_4 = QGridLayout(self.groupBoxEggRNG7)
        self.gridLayout_4.setObjectName(u"gridLayout_4")
        self.pushButtonEggUpdate7 = QPushButton(self.groupBoxEggRNG7)
        self.pushButtonEggUpdate7.setObjectName(u"pushButtonEggUpdate7")
        self.pushButtonEggUpdate7.setEnabled(False)

        self.gridLayout_4.addWidget(self.pushButtonEggUpdate7, 0, 0, 1, 2)

        self.labelEggReady7 = QLabel(self.groupBoxEggRNG7)
        self.labelEggReady7.setObjectName(u"labelEggReady7")
        sizePolicy5.setHeightForWidth(self.labelEggReady7.sizePolicy().hasHeightForWidth())
        self.labelEggReady7.setSizePolicy(sizePolicy5)

        self.gridLayout_4.addWidget(self.labelEggReady7, 1, 0, 1, 1)

        self.labelEggReadyStatus7 = QLabel(self.groupBoxEggRNG7)
        self.labelEggReadyStatus7.setObjectName(u"labelEggReadyStatus7")

        self.gridLayout_4.addWidget(self.labelEggReadyStatus7, 1, 1, 1, 1)

        self.labelEggSeed3_7 = QLabel(self.groupBoxEggRNG7)
        self.labelEggSeed3_7.setObjectName(u"labelEggSeed3_7")

        self.gridLayout_4.addWidget(self.labelEggSeed3_7, 2, 0, 1, 1)

        self.lineEditEggSeed3_7 = QLineEdit(self.groupBoxEggRNG7)
        self.lineEditEggSeed3_7.setObjectName(u"lineEditEggSeed3_7")
        sizePolicy5.setHeightForWidth(self.lineEditEggSeed3_7.sizePolicy().hasHeightForWidth())
        self.lineEditEggSeed3_7.setSizePolicy(sizePolicy5)
        self.lineEditEggSeed3_7.setMaxLength(8)
        self.lineEditEggSeed3_7.setReadOnly(True)

        self.gridLayout_4.addWidget(self.lineEditEggSeed3_7, 2, 1, 1, 1)

        self.labelEggSeed2_7 = QLabel(self.groupBoxEggRNG7)
        self.labelEggSeed2_7.setObjectName(u"labelEggSeed2_7")

        self.gridLayout_4.addWidget(self.labelEggSeed2_7, 3, 0, 1, 1)

        self.lineEditEggSeed2_7 = QLineEdit(self.groupBoxEggRNG7)
        self.lineEditEggSeed2_7.setObjectName(u"lineEditEggSeed2_7")
        sizePolicy5.setHeightForWidth(self.lineEditEggSeed2_7.sizePolicy().hasHeightForWidth())
        self.lineEditEggSeed2_7.setSizePolicy(sizePolicy5)
        self.lineEditEggSeed2_7.setMaxLength(8)
        self.lineEditEggSeed2_7.setReadOnly(True)

        self.gridLayout_4.addWidget(self.lineEditEggSeed2_7, 3, 1, 1, 1)

        self.labelEggSeed1_7 = QLabel(self.groupBoxEggRNG7)
        self.labelEggSeed1_7.setObjectName(u"labelEggSeed1_7")

        self.gridLayout_4.addWidget(self.labelEggSeed1_7, 4, 0, 1, 1)

        self.lineEditEggSeed1_7 = QLineEdit(self.groupBoxEggRNG7)
        self.lineEditEggSeed1_7.setObjectName(u"lineEditEggSeed1_7")
        sizePolicy5.setHeightForWidth(self.lineEditEggSeed1_7.sizePolicy().hasHeightForWidth())
        self.lineEditEggSeed1_7.setSizePolicy(sizePolicy5)
        self.lineEditEggSeed1_7.setMaxLength(8)
        self.lineEditEggSeed1_7.setReadOnly(True)

        self.gridLayout_4.addWidget(self.lineEditEggSeed1_7, 4, 1, 1, 1)

        self.labelEggSeed0_7 = QLabel(self.groupBoxEggRNG7)
        self.labelEggSeed0_7.setObjectName(u"labelEggSeed0_7")

        self.gridLayout_4.addWidget(self.labelEggSeed0_7, 5, 0, 1, 1)

        self.lineEditEggSeed0_7 = QLineEdit(self.groupBoxEggRNG7)
        self.lineEditEggSeed0_7.setObjectName(u"lineEditEggSeed0_7")
        sizePolicy5.setHeightForWidth(self.lineEditEggSeed0_7.sizePolicy().hasHeightForWidth())
        self.lineEditEggSeed0_7.setSizePolicy(sizePolicy5)
        self.lineEditEggSeed0_7.setMaxLength(8)
        self.lineEditEggSeed0_7.setReadOnly(True)

        self.gridLayout_4.addWidget(self.lineEditEggSeed0_7, 5, 1, 1, 1)


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

        self.eggParent1_7 = PokemonDisplay(self.tabEgg7)
        self.eggParent1_7.setObjectName(u"eggParent1_7")
        sizePolicy2.setHeightForWidth(self.eggParent1_7.sizePolicy().hasHeightForWidth())
        self.eggParent1_7.setSizePolicy(sizePolicy2)

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

        self.eggParent2_7 = PokemonDisplay(self.tabEgg7)
        self.eggParent2_7.setObjectName(u"eggParent2_7")
        sizePolicy2.setHeightForWidth(self.eggParent2_7.sizePolicy().hasHeightForWidth())
        self.eggParent2_7.setSizePolicy(sizePolicy2)

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

        self.tabWidgetGen7.addTab(self.tabEgg7, "")
        self.tabSOS = QWidget()
        self.tabSOS.setObjectName(u"tabSOS")
        self.gridLayout_8 = QGridLayout(self.tabSOS)
        self.gridLayout_8.setObjectName(u"gridLayout_8")
        self.comboBoxSOSIndex = QComboBox(self.tabSOS)
        self.comboBoxSOSIndex.addItem("")
        self.comboBoxSOSIndex.addItem("")
        self.comboBoxSOSIndex.addItem("")
        self.comboBoxSOSIndex.addItem("")
        self.comboBoxSOSIndex.setObjectName(u"comboBoxSOSIndex")
        self.comboBoxSOSIndex.setEnabled(False)

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

        self.groupBoxSOS = QGroupBox(self.tabSOS)
        self.groupBoxSOS.setObjectName(u"groupBoxSOS")
        sizePolicy2.setHeightForWidth(self.groupBoxSOS.sizePolicy().hasHeightForWidth())
        self.groupBoxSOS.setSizePolicy(sizePolicy2)
        self.gridLayout_5 = QGridLayout(self.groupBoxSOS)
        self.gridLayout_5.setObjectName(u"gridLayout_5")
        self.pushButtonSOSUpdate = QPushButton(self.groupBoxSOS)
        self.pushButtonSOSUpdate.setObjectName(u"pushButtonSOSUpdate")
        self.pushButtonSOSUpdate.setEnabled(False)

        self.gridLayout_5.addWidget(self.pushButtonSOSUpdate, 0, 0, 1, 1)

        self.pushButtonSOSReset = QPushButton(self.groupBoxSOS)
        self.pushButtonSOSReset.setObjectName(u"pushButtonSOSReset")
        self.pushButtonSOSReset.setEnabled(False)

        self.gridLayout_5.addWidget(self.pushButtonSOSReset, 0, 1, 1, 1)

        self.labelSOSInitialSeed = QLabel(self.groupBoxSOS)
        self.labelSOSInitialSeed.setObjectName(u"labelSOSInitialSeed")

        self.gridLayout_5.addWidget(self.labelSOSInitialSeed, 1, 0, 1, 1)

        self.lineEditSOSInitialSeed = QLineEdit(self.groupBoxSOS)
        self.lineEditSOSInitialSeed.setObjectName(u"lineEditSOSInitialSeed")
        self.lineEditSOSInitialSeed.setMaxLength(8)
        self.lineEditSOSInitialSeed.setReadOnly(True)

        self.gridLayout_5.addWidget(self.lineEditSOSInitialSeed, 1, 1, 1, 1)

        self.labelSOSCurrentSeed = QLabel(self.groupBoxSOS)
        self.labelSOSCurrentSeed.setObjectName(u"labelSOSCurrentSeed")

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

        self.lineEditSOSCurrentSeed = QLineEdit(self.groupBoxSOS)
        self.lineEditSOSCurrentSeed.setObjectName(u"lineEditSOSCurrentSeed")
        self.lineEditSOSCurrentSeed.setMaxLength(8)
        self.lineEditSOSCurrentSeed.setReadOnly(True)

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

        self.labelSOSFrame = QLabel(self.groupBoxSOS)
        self.labelSOSFrame.setObjectName(u"labelSOSFrame")

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

        self.lineEditSOSFrame = QLineEdit(self.groupBoxSOS)
        self.lineEditSOSFrame.setObjectName(u"lineEditSOSFrame")
        self.lineEditSOSFrame.setMaxLength(8)
        self.lineEditSOSFrame.setReadOnly(True)

        self.gridLayout_5.addWidget(self.lineEditSOSFrame, 3, 1, 1, 1)

        self.labelSOSChainCount = QLabel(self.groupBoxSOS)
        self.labelSOSChainCount.setObjectName(u"labelSOSChainCount")

        self.gridLayout_5.addWidget(self.labelSOSChainCount, 4, 0, 1, 1)

        self.lineEditSOSChainCount = QLineEdit(self.groupBoxSOS)
        self.lineEditSOSChainCount.setObjectName(u"lineEditSOSChainCount")
        self.lineEditSOSChainCount.setMaxLength(8)
        self.lineEditSOSChainCount.setReadOnly(True)

        self.gridLayout_5.addWidget(self.lineEditSOSChainCount, 4, 1, 1, 1)


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

        self.sosPokemon = PokemonDisplay(self.tabSOS)
        self.sosPokemon.setObjectName(u"sosPokemon")
        sizePolicy2.setHeightForWidth(self.sosPokemon.sizePolicy().hasHeightForWidth())
        self.sosPokemon.setSizePolicy(sizePolicy2)

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

        self.tabWidgetGen7.addTab(self.tabSOS, "")

        self.gridLayout_12.addWidget(self.tabWidgetGen7, 0, 0, 1, 1)

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

        self.gridLayout_10.addWidget(self.tabWidget, 1, 0, 1, 1)

        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)

        QMetaObject.connectSlotsByName(MainWindow)
    # setupUi

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"CitraRNG 3.2.0", None))
        self.groupBoxConnection.setTitle(QCoreApplication.translate("MainWindow", u"Connection", None))
        self.pushButtonConnect.setText(QCoreApplication.translate("MainWindow", u"Connect", None))
        self.labelUpdateDelay.setText(QCoreApplication.translate("MainWindow", u"Auto update delay(seconds):", None))
        self.labelStatus.setText(QCoreApplication.translate("MainWindow", u"Status: Not Connected", None))
        self.comboBoxGameSelection.setItemText(0, QCoreApplication.translate("MainWindow", u"XY", None))
        self.comboBoxGameSelection.setItemText(1, QCoreApplication.translate("MainWindow", u"ORAS", None))
        self.comboBoxGameSelection.setItemText(2, QCoreApplication.translate("MainWindow", u"SM", None))
        self.comboBoxGameSelection.setItemText(3, QCoreApplication.translate("MainWindow", u"USUM", None))

        self.comboBoxMainIndex6.setItemText(0, QCoreApplication.translate("MainWindow", u"Party 1", None))
        self.comboBoxMainIndex6.setItemText(1, QCoreApplication.translate("MainWindow", u"Party 2", None))
        self.comboBoxMainIndex6.setItemText(2, QCoreApplication.translate("MainWindow", u"Party 3", None))
        self.comboBoxMainIndex6.setItemText(3, QCoreApplication.translate("MainWindow", u"Party 4", None))
        self.comboBoxMainIndex6.setItemText(4, QCoreApplication.translate("MainWindow", u"Party 5", None))
        self.comboBoxMainIndex6.setItemText(5, QCoreApplication.translate("MainWindow", u"Party 6", None))
        self.comboBoxMainIndex6.setItemText(6, QCoreApplication.translate("MainWindow", u"Wild", None))

        self.groupBoxMainRNG6.setTitle(QCoreApplication.translate("MainWindow", u"Main RNG", None))
        self.labelTiny2.setText(QCoreApplication.translate("MainWindow", u"[2]", None))
        self.labelTiny0.setText(QCoreApplication.translate("MainWindow", u"[0]", None))
        self.labelTiny3.setText(QCoreApplication.translate("MainWindow", u"[3]", None))
        self.labelTiny1.setText(QCoreApplication.translate("MainWindow", u"[1]", None))
        self.labelMainCurrentSeed6.setText(QCoreApplication.translate("MainWindow", u"Current Seed:", None))
        self.labelMainInitialSeed6.setText(QCoreApplication.translate("MainWindow", u"Initial Seed:", None))
        self.labelMainFrame6.setText(QCoreApplication.translate("MainWindow", u"Frame:", None))
        self.pushButtonMainUpdate6.setText(QCoreApplication.translate("MainWindow", u"Update", None))
        self.labelSaveVariable.setText(QCoreApplication.translate("MainWindow", u"Save Variable:", None))
        self.tabWidgetGen6.setTabText(self.tabWidgetGen6.indexOf(self.tabMain6), QCoreApplication.translate("MainWindow", u"Main", None))
        self.groupBoxEggRNG6.setTitle(QCoreApplication.translate("MainWindow", u"Egg RNG", None))
        self.labelEggReady6.setText(QCoreApplication.translate("MainWindow", u"Egg Ready:", None))
        self.labelEggReadyStatus6.setText(QCoreApplication.translate("MainWindow", u"No egg yet", None))
        self.pushButtonEggUpdate6.setText(QCoreApplication.translate("MainWindow", u"Update", None))
        self.labelEggSeed0_6.setText(QCoreApplication.translate("MainWindow", u"[0]", None))
        self.labelEggSeed1_6.setText(QCoreApplication.translate("MainWindow", u"[1]", None))
        self.tabWidgetGen6.setTabText(self.tabWidgetGen6.indexOf(self.tabEgg6), QCoreApplication.translate("MainWindow", u"Egg", None))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabGen6), QCoreApplication.translate("MainWindow", u"Gen 6", None))
        self.comboBoxMainIndex7.setItemText(0, QCoreApplication.translate("MainWindow", u"Party 1", None))
        self.comboBoxMainIndex7.setItemText(1, QCoreApplication.translate("MainWindow", u"Party 2", None))
        self.comboBoxMainIndex7.setItemText(2, QCoreApplication.translate("MainWindow", u"Party 3", None))
        self.comboBoxMainIndex7.setItemText(3, QCoreApplication.translate("MainWindow", u"Party 4", None))
        self.comboBoxMainIndex7.setItemText(4, QCoreApplication.translate("MainWindow", u"Party 5", None))
        self.comboBoxMainIndex7.setItemText(5, QCoreApplication.translate("MainWindow", u"Party 6", None))
        self.comboBoxMainIndex7.setItemText(6, QCoreApplication.translate("MainWindow", u"Wild", None))

        self.groupBoxMainRNG7.setTitle(QCoreApplication.translate("MainWindow", u"Main RNG", None))
        self.labelMainInitialSeed7.setText(QCoreApplication.translate("MainWindow", u"Initial Seed:", None))
        self.labelMainCurrentSeed7.setText(QCoreApplication.translate("MainWindow", u"Current Seed:", None))
        self.labelMainFrame7.setText(QCoreApplication.translate("MainWindow", u"Frame:", None))
        self.pushButtonMainUpdate7.setText(QCoreApplication.translate("MainWindow", u"Update", None))
        self.tabWidgetGen7.setTabText(self.tabWidgetGen7.indexOf(self.tabMain7), QCoreApplication.translate("MainWindow", u"Main", None))
        self.groupBoxEggRNG7.setTitle(QCoreApplication.translate("MainWindow", u"Egg RNG", None))
        self.pushButtonEggUpdate7.setText(QCoreApplication.translate("MainWindow", u"Update", None))
        self.labelEggReady7.setText(QCoreApplication.translate("MainWindow", u"Egg Ready:", None))
        self.labelEggReadyStatus7.setText(QCoreApplication.translate("MainWindow", u"No egg yet", None))
        self.labelEggSeed3_7.setText(QCoreApplication.translate("MainWindow", u"[3]", None))
        self.labelEggSeed2_7.setText(QCoreApplication.translate("MainWindow", u"[2]", None))
        self.labelEggSeed1_7.setText(QCoreApplication.translate("MainWindow", u"[1]", None))
        self.labelEggSeed0_7.setText(QCoreApplication.translate("MainWindow", u"[0]", None))
        self.tabWidgetGen7.setTabText(self.tabWidgetGen7.indexOf(self.tabEgg7), QCoreApplication.translate("MainWindow", u"Egg", None))
        self.comboBoxSOSIndex.setItemText(0, QCoreApplication.translate("MainWindow", u"SOS 1", None))
        self.comboBoxSOSIndex.setItemText(1, QCoreApplication.translate("MainWindow", u"SOS 2", None))
        self.comboBoxSOSIndex.setItemText(2, QCoreApplication.translate("MainWindow", u"SOS 3", None))
        self.comboBoxSOSIndex.setItemText(3, QCoreApplication.translate("MainWindow", u"SOS 4", None))

        self.groupBoxSOS.setTitle(QCoreApplication.translate("MainWindow", u"SOS RNG", None))
        self.pushButtonSOSUpdate.setText(QCoreApplication.translate("MainWindow", u"Update", None))
#if QT_CONFIG(tooltip)
        self.pushButtonSOSReset.setToolTip(QCoreApplication.translate("MainWindow", u"This should be used after a battle", None))
#endif // QT_CONFIG(tooltip)
        self.pushButtonSOSReset.setText(QCoreApplication.translate("MainWindow", u"Reset", None))
        self.labelSOSInitialSeed.setText(QCoreApplication.translate("MainWindow", u"Initial Seed:", None))
        self.labelSOSCurrentSeed.setText(QCoreApplication.translate("MainWindow", u"Current Seed:", None))
        self.labelSOSFrame.setText(QCoreApplication.translate("MainWindow", u"Frame:", None))
        self.labelSOSChainCount.setText(QCoreApplication.translate("MainWindow", u"Chain Count:", None))
        self.tabWidgetGen7.setTabText(self.tabWidgetGen7.indexOf(self.tabSOS), QCoreApplication.translate("MainWindow", u"SOS", None))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabGen7), QCoreApplication.translate("MainWindow", u"Gen 7", None))
コード例 #9
0
ファイル: progress_ui.py プロジェクト: sunshinenny/persepolis
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"))
コード例 #10
0
class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        if not MainWindow.objectName():
            MainWindow.setObjectName(u"MainWindow")
        MainWindow.resize(534, 188)
        self.centralwidget = QWidget(MainWindow)
        self.centralwidget.setObjectName(u"centralwidget")
        self.verticalLayout = QVBoxLayout(self.centralwidget)
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.horizontalLayout = QHBoxLayout()
        self.horizontalLayout.setObjectName(u"horizontalLayout")
        self.line_source = QLineEdit(self.centralwidget)
        self.line_source.setObjectName(u"line_source")
        self.line_source.setEnabled(True)
        self.line_source.setReadOnly(True)

        self.horizontalLayout.addWidget(self.line_source)

        self.button_source = QPushButton(self.centralwidget)
        self.button_source.setObjectName(u"button_source")

        self.horizontalLayout.addWidget(self.button_source)

        self.verticalLayout.addLayout(self.horizontalLayout)

        self.horizontalLayout_2 = QHBoxLayout()
        self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
        self.line_target = QLineEdit(self.centralwidget)
        self.line_target.setObjectName(u"line_target")
        self.line_target.setEnabled(True)
        self.line_target.setReadOnly(True)

        self.horizontalLayout_2.addWidget(self.line_target)

        self.button_target = QPushButton(self.centralwidget)
        self.button_target.setObjectName(u"button_target")

        self.horizontalLayout_2.addWidget(self.button_target)

        self.verticalLayout.addLayout(self.horizontalLayout_2)

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

        self.verticalLayout.addWidget(self.line)

        self.horizontalLayout_3 = QHBoxLayout()
        self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
        self.label_2 = QLabel(self.centralwidget)
        self.label_2.setObjectName(u"label_2")

        self.horizontalLayout_3.addWidget(self.label_2)

        self.spin_memory = QSpinBox(self.centralwidget)
        self.spin_memory.setObjectName(u"spin_memory")

        self.horizontalLayout_3.addWidget(self.spin_memory)

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

        self.horizontalLayout_3.addWidget(self.label_3)

        self.spin_blur = QSpinBox(self.centralwidget)
        self.spin_blur.setObjectName(u"spin_blur")
        self.spin_blur.setValue(9)

        self.horizontalLayout_3.addWidget(self.spin_blur)

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

        self.horizontalLayout_3.addWidget(self.label_5)

        self.double_spin_threshold = QDoubleSpinBox(self.centralwidget)
        self.double_spin_threshold.setObjectName(u"double_spin_threshold")
        self.double_spin_threshold.setMaximum(1.000000000000000)
        self.double_spin_threshold.setSingleStep(0.050000000000000)
        self.double_spin_threshold.setValue(0.300000000000000)

        self.horizontalLayout_3.addWidget(self.double_spin_threshold)

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

        self.horizontalLayout_3.addWidget(self.label_6)

        self.double_spin_roimulti = QDoubleSpinBox(self.centralwidget)
        self.double_spin_roimulti.setObjectName(u"double_spin_roimulti")
        self.double_spin_roimulti.setMinimum(0.800000000000000)
        self.double_spin_roimulti.setMaximum(10.000000000000000)
        self.double_spin_roimulti.setSingleStep(0.050000000000000)
        self.double_spin_roimulti.setValue(1.000000000000000)

        self.horizontalLayout_3.addWidget(self.double_spin_roimulti)

        self.verticalLayout.addLayout(self.horizontalLayout_3)

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

        self.verticalLayout.addWidget(self.line_2)

        self.horizontalLayout_4 = QHBoxLayout()
        self.horizontalLayout_4.setObjectName(u"horizontalLayout_4")
        self.label = QLabel(self.centralwidget)
        self.label.setObjectName(u"label")

        self.horizontalLayout_4.addWidget(self.label)

        self.combo_box_weights = QComboBox(self.centralwidget)
        self.combo_box_weights.setObjectName(u"combo_box_weights")

        self.horizontalLayout_4.addWidget(self.combo_box_weights)

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

        self.horizontalLayout_4.addWidget(self.label_4)

        self.combo_box_scale = QComboBox(self.centralwidget)
        self.combo_box_scale.addItem("")
        self.combo_box_scale.addItem("")
        self.combo_box_scale.addItem("")
        self.combo_box_scale.setObjectName(u"combo_box_scale")

        self.horizontalLayout_4.addWidget(self.combo_box_scale)

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

        self.horizontalLayout_4.addWidget(self.label_7)

        self.spin_quality = QSpinBox(self.centralwidget)
        self.spin_quality.setObjectName(u"spin_quality")
        self.spin_quality.setMaximum(10)
        self.spin_quality.setValue(5)

        self.horizontalLayout_4.addWidget(self.spin_quality)

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

        self.horizontalLayout_4.addItem(self.horizontalSpacer)

        self.verticalLayout.addLayout(self.horizontalLayout_4)

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

        self.verticalLayout.addWidget(self.line_3)

        self.horizontalLayout_5 = QHBoxLayout()
        self.horizontalLayout_5.setObjectName(u"horizontalLayout_5")
        self.progress = QProgressBar(self.centralwidget)
        self.progress.setObjectName(u"progress")
        self.progress.setEnabled(True)
        self.progress.setValue(0)

        self.horizontalLayout_5.addWidget(self.progress)

        self.button_start = QPushButton(self.centralwidget)
        self.button_start.setObjectName(u"button_start")

        self.horizontalLayout_5.addWidget(self.button_start)

        self.button_abort = QPushButton(self.centralwidget)
        self.button_abort.setObjectName(u"button_abort")
        self.button_abort.setEnabled(False)

        self.horizontalLayout_5.addWidget(self.button_abort)

        self.verticalLayout.addLayout(self.horizontalLayout_5)

        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)

        QMetaObject.connectSlotsByName(MainWindow)

    # setupUi

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(
            QCoreApplication.translate("MainWindow", u"DashcamCleaner", None))
        self.button_source.setText(
            QCoreApplication.translate("MainWindow", u"Select video", None))
        self.button_target.setText(
            QCoreApplication.translate("MainWindow", u"Select target", None))
        self.label_2.setText(
            QCoreApplication.translate("MainWindow", u"Frame memory:", None))
        self.label_3.setText(
            QCoreApplication.translate("MainWindow", u"Blur size:", None))
        self.label_5.setText(
            QCoreApplication.translate("MainWindow", u"Detection threshold:",
                                       None))
        self.label_6.setText(
            QCoreApplication.translate("MainWindow", u"ROI enlargement", None))
        self.label.setText(
            QCoreApplication.translate("MainWindow", u"Weights", None))
        self.label_4.setText(
            QCoreApplication.translate("MainWindow", u"Inference size", None))
        self.combo_box_scale.setItemText(
            0, QCoreApplication.translate("MainWindow", u"360p", None))
        self.combo_box_scale.setItemText(
            1, QCoreApplication.translate("MainWindow", u"720p", None))
        self.combo_box_scale.setItemText(
            2, QCoreApplication.translate("MainWindow", u"1080p", None))

        self.combo_box_scale.setCurrentText(
            QCoreApplication.translate("MainWindow", u"360p", None))
        self.label_7.setText(
            QCoreApplication.translate("MainWindow", u"Output Quality", None))
        self.button_start.setText(
            QCoreApplication.translate("MainWindow", u"Start", None))
        self.button_abort.setText(
            QCoreApplication.translate("MainWindow", u"Abort", None))
コード例 #11
0
class ImageFusionOptions(object):
    """
    UI class that can be used by the AddOnOptions Class to allow the user
    customise their input parameters for auto-registration.
    """
    def __init__(self, window_options):
        self.auto_image_fusion_frame = QtWidgets.QFrame()
        self.window = window_options
        self.moving_image = None
        self.fixed_image = None
        self.dict = {}

        self.setupUi()
        self.create_view()
        self.get_patients_info()

    def set_value(self, key, value):
        """
        Stores values into a dictionary to the corresponding key.
        Parameters
        ----------
        key (Any):

        value (Any):
        """
        self.dict[key] = value

    def create_view(self):
        """
        Create a table to hold all the ROI creation by isodose entries.
        """
        self.auto_image_fusion_frame.setVisible(False)

    def setVisible(self, visibility):
        """
        Custom setVisible function that will set the visibility of the GUI.

        Args:
            visibility (bool): flag for setting the GUI to visible
        """
        self.auto_image_fusion_frame.setVisible(visibility)

    def setupUi(self):
        """
        Constructs the GUI and sets the limit of each input field.
        """
        # Create a vertical Widget to hold Vertical Layout
        self.vertical_layout_widget = QWidget()
        self.vertical_layout = QtWidgets.QVBoxLayout()

        # Create a Widget and set layout to a GridLayout
        self.gridLayoutWidget = QWidget()
        self.gridLayout = QtWidgets.QGridLayout(self.gridLayoutWidget)
        self.gridLayout.setSizeConstraint(QLayout.SetDefaultConstraint)
        self.gridLayout.setContentsMargins(0, 0, 0, 0)
        self.gridLayout.setVerticalSpacing(0)

        # Create horizontal spacer in the middle of the grid
        hspacer = QtWidgets.QSpacerItem(QtWidgets.QSizePolicy.Expanding,
                                        QtWidgets.QSizePolicy.Minimum)
        self.gridLayout.addItem(hspacer, 0, 5, 16, 1)

        # Labels
        self.fixed_image_label = QLabel("Fixed Image: ")
        fixed_image_sizePolicy = QSizePolicy(QSizePolicy.Maximum,
                                             QSizePolicy.Preferred)
        fixed_image_sizePolicy.setHorizontalStretch(0)
        fixed_image_sizePolicy.setVerticalStretch(0)
        fixed_image_sizePolicy.setHeightForWidth(
            self.fixed_image_label.sizePolicy().hasHeightForWidth())

        self.fixed_image_label.setAlignment(Qt.AlignRight | Qt.AlignTrailing
                                            | Qt.AlignVCenter)

        self.fixed_image_placeholder \
            = QLabel("This is a placeholder for fixed image")
        self.fixed_image_placeholder.setWordWrap(False)
        self.fixed_image_placeholder.setText(str(self.fixed_image))
        self.fixed_image_placeholder.setMaximumSize(200, 50)

        self.moving_image_label = QLabel("Moving Image: ")
        moving_image_label_sizePolicy = QSizePolicy(QSizePolicy.Maximum,
                                                    QSizePolicy.Maximum)
        moving_image_label_sizePolicy.setHorizontalStretch(0)
        moving_image_label_sizePolicy.setVerticalStretch(0)
        moving_image_label_sizePolicy.setHeightForWidth(
            self.moving_image_label.sizePolicy().hasHeightForWidth())
        self.moving_image_label.setSizePolicy(moving_image_label_sizePolicy)

        self.moving_image_placeholder = QLabel("This is a placeholder")
        self.moving_image_placeholder.setWordWrap(False)
        self.moving_image_placeholder.setText(str(self.moving_image))
        self.moving_image_placeholder.setMaximumSize(200, 50)

        self.gridLayout.addWidget(self.fixed_image_label, 0, 0)
        self.gridLayout.addWidget(self.fixed_image_placeholder, 0, 1)
        self.gridLayout.addWidget(self.moving_image_label, 0, 2)
        self.gridLayout.addWidget(self.moving_image_placeholder, 0, 3)

        # Default Numbers
        self.default_numbers_label = QLabel("Default Numbers")
        self.default_numbers_label.setAlignment(Qt.AlignLeft | Qt.AlignTrailing
                                                | Qt.AlignVCenter)
        self.gridLayout.addWidget(self.default_numbers_label, 1, 0)

        self.default_number_spinBox = QSpinBox(self.gridLayoutWidget)
        self.default_number_spinBox.setRange(-2147483648, 2147483647)
        self.default_number_spinBox.setSizePolicy(QSizePolicy.Minimum,
                                                  QSizePolicy.Fixed)
        self.default_number_spinBox.setToolTip(
            "Default voxel value. Defaults to -1000.")
        self.gridLayout.addWidget(self.default_number_spinBox, 1, 1)

        # Final Interp
        self.interp_order_label = QLabel("Final Interp")
        self.interp_order_label.setAlignment(Qt.AlignLeft | Qt.AlignTrailing
                                             | Qt.AlignVCenter)
        self.gridLayout.addWidget(self.interp_order_label, 2, 0)

        self.interp_order_spinbox = QSpinBox(self.gridLayoutWidget)
        self.interp_order_spinbox.setSizePolicy(QSizePolicy.Minimum,
                                                QSizePolicy.Fixed)
        self.interp_order_spinbox.setToolTip("The final interpolation order.")
        self.gridLayout.addWidget(self.interp_order_spinbox, 2, 1)

        # Metric
        self.metric_label = QLabel("Metric")
        self.metric_label.setAlignment(QtCore.Qt.AlignLeft | Qt.AlignTrailing
                                       | Qt.AlignVCenter)
        self.gridLayout.addWidget(self.metric_label, 3, 0)

        self.metric_comboBox = QComboBox()
        self.metric_comboBox.addItem("correlation")
        self.metric_comboBox.addItem("mean_squares")
        self.metric_comboBox.addItem("mattes_mi")
        self.metric_comboBox.addItem("joint_hist_mi")
        self.metric_comboBox.setToolTip(
            "The metric to be optimised during image registration.")
        self.gridLayout.addWidget(self.metric_comboBox, 3, 1)

        # Number of Iterations
        self.no_of_iterations_label = QLabel("Number of Iterations")
        self.no_of_iterations_label.setAlignment(Qt.AlignLeft
                                                 | Qt.AlignTrailing
                                                 | Qt.AlignVCenter)
        self.gridLayout.addWidget(self.no_of_iterations_label, 4, 0)

        self.no_of_iterations_spinBox = QSpinBox(self.gridLayoutWidget)
        self.no_of_iterations_spinBox.setSizePolicy(QSizePolicy.Minimum,
                                                    QSizePolicy.Fixed)
        self.no_of_iterations_spinBox.setRange(0, 100)
        self.no_of_iterations_spinBox.setToolTip(
            "Number of iterations in each multi-resolution step.")
        self.gridLayout.addWidget(self.no_of_iterations_spinBox, 4, 1)

        # Shrink Factor
        self.shrink_factor_label = QLabel("Shrink Factor")
        self.shrink_factor_label.setAlignment(Qt.AlignLeft | Qt.AlignTrailing
                                              | Qt.AlignVCenter)

        self.gridLayout.addWidget(self.shrink_factor_label, 5, 0)

        self.shrink_factor_qLineEdit = QLineEdit()
        self.shrink_factor_qLineEdit.resize(
            self.shrink_factor_qLineEdit.sizeHint().width(),
            self.shrink_factor_qLineEdit.sizeHint().height())

        self.shrink_factor_qLineEdit.setValidator(
            QRegularExpressionValidator(
                QRegularExpression("^[0-9]*[,]?[0-9]*[,]?[0-9]")))

        self.shrink_factor_qLineEdit.setToolTip(
            "The multi-resolution downsampling factors. Can be up to three "
            "integer elements in an array. Example [8, 2, 1]")
        self.gridLayout.addWidget(self.shrink_factor_qLineEdit, 5, 1)

        # Optimiser
        self.optimiser_label = QLabel("Optimiser")
        self.optimiser_label.setAlignment(Qt.AlignLeft | Qt.AlignTrailing
                                          | Qt.AlignVCenter)
        self.gridLayout.addWidget(self.optimiser_label, 1, 2)

        self.optimiser_comboBox = QComboBox(self.gridLayoutWidget)
        self.optimiser_comboBox.addItem("lbfgsb")
        self.optimiser_comboBox.addItem("gradient_descent")
        self.optimiser_comboBox.addItem("gradient_descent_line_search")
        self.optimiser_comboBox.setToolTip(
            "The optimiser algorithm used for image registration.")
        self.gridLayout.addWidget(self.optimiser_comboBox, 1, 3)

        # Reg Method
        self.reg_method_label = QLabel("Reg Method")
        self.reg_method_label.setAlignment(QtCore.Qt.AlignLeft
                                           | Qt.AlignTrailing
                                           | Qt.AlignVCenter)
        self.gridLayout.addWidget(self.reg_method_label, 2, 2)

        self.reg_method_comboBox = QComboBox()
        self.reg_method_comboBox.addItem("translation")
        self.reg_method_comboBox.addItem("rigid")
        self.reg_method_comboBox.addItem("similarity")
        self.reg_method_comboBox.addItem("affine")
        self.reg_method_comboBox.addItem("scaleversor")
        self.reg_method_comboBox.addItem("scaleskewversor")
        self.reg_method_comboBox.setToolTip(
            "The linear transformation model to be used for image "
            "registration.")
        self.gridLayout.addWidget(self.reg_method_comboBox, 2, 3)

        # Sampling Rate
        self.sampling_rate_label = QLabel("Sampling Rate")
        self.sampling_rate_label.setAlignment(Qt.AlignLeft | Qt.AlignTrailing
                                              | Qt.AlignVCenter)
        self.gridLayout.addWidget(self.sampling_rate_label, 3, 2)

        self.sampling_rate_spinBox = QDoubleSpinBox(self.gridLayoutWidget)
        self.sampling_rate_spinBox.setMinimum(0)
        self.sampling_rate_spinBox.setMaximum(1)
        self.sampling_rate_spinBox.setSingleStep(0.01)
        self.sampling_rate_spinBox.setSizePolicy(QSizePolicy.Minimum,
                                                 QSizePolicy.Fixed)
        self.sampling_rate_spinBox.setToolTip("The fraction of voxels sampled "
                                              "during each iteration.")
        self.gridLayout.addWidget(self.sampling_rate_spinBox, 3, 3)

        # Smooth Sigmas
        self.smooth_sigma_label = QLabel("Smooth Sigma")
        self.smooth_sigma_label.setAlignment(Qt.AlignLeft | Qt.AlignTrailing
                                             | Qt.AlignVCenter)
        self.gridLayout.addWidget(self.smooth_sigma_label, 4, 2)

        self.smooth_sigmas_qLineEdit = QLineEdit()
        self.smooth_sigmas_qLineEdit.resize(
            self.smooth_sigmas_qLineEdit.sizeHint().width(),
            self.smooth_sigmas_qLineEdit.sizeHint().height())
        self.smooth_sigmas_qLineEdit.setValidator(
            QRegularExpressionValidator(
                QRegularExpression("^[0-9]*[,]?[0-9]*[,]?[0-9]")))
        self.smooth_sigmas_qLineEdit.setToolTip(
            "The multi-resolution smoothing kernal scale (Gaussian). Can be "
            "up to three integer elements in an array. Example [4, 2, 1]")
        self.gridLayout.addWidget(self.smooth_sigmas_qLineEdit, 4, 3)

        # Label to hold warning labels.
        self.warning_label = QLabel()

        # Button for fast mode
        self.fast_mode_button = QtWidgets.QPushButton("Fast Mode")
        self.fast_mode_button.setCursor(
            QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.fast_mode_button.clicked.connect(self.set_fast_mode)

        # Add Widgets to the vertical layout
        self.vertical_layout.addWidget(self.fast_mode_button)
        self.vertical_layout.addWidget(self.gridLayoutWidget)
        self.vertical_layout.addWidget(self.warning_label)

        # Set layout of frame to the gridlayout widget
        self.auto_image_fusion_frame.setLayout(self.vertical_layout)

    def set_gridLayout(self):
        """
        Set the UI based on the values taken from the JSON
        """
        msg = ""

        # If-Elif statements for setting the dict
        # this can only be done in if-else statements.
        if self.dict["reg_method"] == "translation":
            self.reg_method_comboBox.setCurrentIndex(0)
        elif self.dict["reg_method"] == "rigid":
            self.reg_method_comboBox.setCurrentIndex(1)
        elif self.dict["reg_method"] == "similarity":
            self.reg_method_comboBox.setCurrentIndex(2)
        elif self.dict["reg_method"] == "affine":
            self.reg_method_comboBox.setCurrentIndex(3)
        elif self.dict["reg_method"] == "scaleversor":
            self.reg_method_comboBox.setCurrentIndex(4)
        elif self.dict["reg_method"] == "scaleskewversor":
            self.reg_method_comboBox.setCurrentIndex(5)
        else:
            msg += 'There was an error setting the reg_method value.\n'
            self.warning_label.setText(msg)

        if self.dict["metric"] == "coorelation":
            self.metric_comboBox.setCurrentIndex(0)
        elif self.dict["metric"] == "mean_squares":
            self.metric_comboBox.setCurrentIndex(1)
        elif self.dict["metric"] == "mattes_mi":
            self.metric_comboBox.setCurrentIndex(2)
        elif self.dict["metric"] == "joint_hist_mi":
            self.metric_comboBox.setCurrentIndex(3)
        else:
            msg += 'There was an error setting the metric value.\n'
            self.warning_label.setText(msg)

        if self.dict["optimiser"] == "lbfgsb":
            self.optimiser_comboBox.setCurrentIndex(0)
        elif self.dict["optimiser"] == "gradient_descent":
            self.optimiser_comboBox.setCurrentIndex(1)
        elif self.dict["optimiser"] == "gradient_descent_line_search":
            self.optimiser_comboBox.setCurrentIndex(2)
        else:
            msg += 'There was an error setting the optimiser value.\n'
            self.warning_label.setText(msg)

        # Check if all elements in list are ints
        if all(isinstance(x, int) for x in self.dict["shrink_factors"]):
            # Shrink_factors is stored as a list in JSON convert the list into
            # a string.
            shrink_factor_list_json = ', '.join(
                str(e) for e in self.dict["shrink_factors"])
            self.shrink_factor_qLineEdit.setText(shrink_factor_list_json)
        else:
            msg += 'There was an error setting the Shrink Factors value.\n'
            self.warning_label.setText(msg)

        # Check if all elements in list are ints
        if all(isinstance(x, int) for x in self.dict["smooth_sigmas"]):
            # Since smooth_sigma is stored as a list in JSON convert the list
            # into a string.
            smooth_sigma_list_json = ', '.join(
                str(e) for e in self.dict["smooth_sigmas"])
            self.smooth_sigmas_qLineEdit.setText(smooth_sigma_list_json)
        else:
            msg += 'There was an error setting the Smooth Sigmas value.\n'
            self.warning_label.setText(msg)

        try:
            self.sampling_rate_spinBox.setValue(
                float(self.dict["sampling_rate"]))
        except ValueError:
            msg += 'There was an error setting the Sampling Rate value.\n'
            self.warning_label.setText(msg)

        try:
            self.interp_order_spinbox.setValue(int(self.dict["final_interp"]))
        except ValueError:
            msg += 'There was an error setting the Final Interp value.\n'
            self.warning_label.setText(msg)

        try:
            self.no_of_iterations_spinBox.setValue(
                int(self.dict["number_of_iterations"]))
        except ValueError:
            msg += 'There was an error setting the Number of iterations ' \
                   'value.\n'
            self.warning_label.setText(msg)

        try:
            self.default_number_spinBox.setValue(
                int(self.dict["default_value"]))
        except ValueError:
            msg += 'There was an error setting the Default Number'
            self.warning_label.setText(msg)

    def get_patients_info(self):
        """
        Retrieve the patient's study description of the fixed image
        and for the moving image (if it exists).
        """
        patient_dict_container = PatientDictContainer()
        if not patient_dict_container.is_empty():
            filename = patient_dict_container.filepaths[0]
            dicom_tree_slice = DicomTree(filename)
            dict_tree = dicom_tree_slice.dict
            try:
                self.fixed_image = dict_tree["Series Instance UID"][0]
            except:
                self.fixed_image = ""
                self.warning_label.setText(
                    'Couldn\'t find the series instance '
                    'UID for the Fixed Image.')

        moving_dict_container = MovingDictContainer()
        if not moving_dict_container.is_empty():
            filename = moving_dict_container.filepaths[0]
            dicom_tree_slice = DicomTree(filename)
            dict_tree = dicom_tree_slice.dict
            try:
                self.moving_image = dict_tree["Series Instance UID"][0]
            except:
                self.moving_image = ""
                self.warning_label.setText(
                    'Couldn\'t find the series instance '
                    'UID for the Moving Image.')

        if moving_dict_container.is_empty() and self.moving_image != "":
            self.moving_image = ""

        self.fixed_image_placeholder.setText(str(self.fixed_image))
        self.moving_image_placeholder.setText(str(self.moving_image))

    def get_values_from_UI(self):
        """
        Sets values from the GUI to the dict that will be used to store the
        relevant parameters to imageFusion.json.
        """
        self.dict["reg_method"] = str(self.reg_method_comboBox.currentText())
        self.dict["metric"] = str(self.metric_comboBox.currentText())
        self.dict["optimiser"] = str(self.optimiser_comboBox.currentText())

        a_string = self.shrink_factor_qLineEdit.text().split(",")
        a_int = list(map(int, a_string))
        self.dict["shrink_factors"] = a_int

        a_string = self.smooth_sigmas_qLineEdit.text().split(",")
        a_int = list(map(int, a_string))
        self.dict["smooth_sigmas"] = a_int

        self.dict["sampling_rate"] = self.sampling_rate_spinBox.value()
        self.dict["final_interp"] = self.interp_order_spinbox.value()
        self.dict[
            "number_of_iterations"] = self.no_of_iterations_spinBox.value()
        self.dict["default_value"] = self.default_number_spinBox.value()

        return self.dict

    def check_parameter(self):
        """
        Check the number of values of the smooth sigma and shrink factors of 
        that are parameters used for images fusion.
        """
        len_smooth_sigmas = len(self.dict["smooth_sigmas"])
        len_shrink_factor = len(self.dict["shrink_factors"])
        if len_smooth_sigmas != len_shrink_factor:
            raise ValueError

    def set_fast_mode(self):
        """These settings are customised to be fast for images fusion."""
        self.reg_method_comboBox.setCurrentIndex(1)
        self.metric_comboBox.setCurrentIndex(1)
        self.optimiser_comboBox.setCurrentIndex(1)
        self.shrink_factor_qLineEdit.setText("8")
        self.smooth_sigmas_qLineEdit.setText("10")
        self.sampling_rate_spinBox.setValue(0.25)
        self.interp_order_spinbox.setValue(2)
        self.no_of_iterations_spinBox.setValue(50)
        self.default_number_spinBox.setValue(-1000)
コード例 #12
0
class ParameterEditorItem(QWidget):
    onRemoveParameter = Signal(Parameter)
    onMoveParameterUp = Signal(Parameter)
    onMoveParameterDown = Signal(Parameter)
    onChanged = Signal()

    def __init__(self, parameter: Parameter):
        super().__init__()

        self.parameter = parameter

        deleteButton = QToolButton()
        deleteButton.setText("X")
        deleteButton.clicked.connect(
            lambda: self.onRemoveParameter.emit(self.parameter))
        upButton = QToolButton()
        upButton.setText("\u2191")
        upButton.clicked.connect(
            lambda: self.onMoveParameterUp.emit(self.parameter))
        downButton = QToolButton()
        downButton.setText("\u2193")
        downButton.clicked.connect(
            lambda: self.onMoveParameterDown.emit(self.parameter))

        buttonsLayout = QVBoxLayout()
        buttonsLayout.setAlignment(Qt.AlignTop)
        buttonsLayout.addWidget(deleteButton)
        buttonsLayout.addWidget(upButton)
        buttonsLayout.addWidget(downButton)

        self._nameLabel = QLabel("Name")
        self._nameField = QLineEdit()
        self._nameField.textChanged.connect(self.OnChanged)

        self._dataTypeLabel = QLabel("Data Type")
        self._dataTypeField = QComboBox()
        for dataType in DataType:
            self._dataTypeField.addItem(dataType.ToString(), userData=dataType)
        self._dataTypeField.currentIndexChanged.connect(self.OnChanged)

        self._defaultValueLabel = QLabel("Default Value")
        self._defaultInteger = QSpinBox()
        self._defaultInteger.valueChanged.connect(self.OnChanged)

        self._defaultFloat = QDoubleSpinBox()
        self._defaultFloat.valueChanged.connect(self.OnChanged)

        self._defaultBoolean = QComboBox()
        self._defaultBoolean.addItem("True", True)
        self._defaultBoolean.addItem("False", False)
        self._defaultBoolean.currentIndexChanged.connect(self.OnChanged)

        self._defaultString = QLineEdit()
        self._defaultString.textChanged.connect(self.OnChanged)

        self._minimumLabel = QLabel("Minimum")
        self._minimumFloat = QDoubleSpinBox()
        self._minimumFloat.valueChanged.connect(self.OnChanged)
        self._minimumInteger = QSpinBox()
        self._minimumInteger.valueChanged.connect(self.OnChanged)

        self._maximumLabel = QLabel("Maximum")
        self._maximumFloat = QDoubleSpinBox()
        self._maximumFloat.valueChanged.connect(self.OnChanged)
        self._maximumInteger = QSpinBox()
        self._maximumInteger.valueChanged.connect(self.OnChanged)

        gridLayout = QGridLayout()
        gridLayout.setAlignment(Qt.AlignTop)
        gridLayout.addWidget(self._nameLabel, 0, 0)
        gridLayout.addWidget(self._nameField, 0, 1)
        gridLayout.addWidget(self._dataTypeLabel, 1, 0)
        gridLayout.addWidget(self._dataTypeField, 1, 1)
        gridLayout.addWidget(self._defaultValueLabel, 2, 0)

        for defaultField in [
                self._defaultInteger, self._defaultFloat, self._defaultBoolean,
                self._defaultString
        ]:
            gridLayout.addWidget(defaultField, 2, 1)

        gridLayout.addWidget(self._minimumLabel, 3, 0)
        gridLayout.addWidget(self._minimumInteger, 3, 1)
        gridLayout.addWidget(self._minimumFloat, 3, 1)
        gridLayout.addWidget(self._maximumLabel, 4, 0)
        gridLayout.addWidget(self._maximumInteger, 4, 1)
        gridLayout.addWidget(self._maximumFloat, 4, 1)

        layout = QHBoxLayout()
        layout.addLayout(buttonsLayout)
        layout.addLayout(gridLayout)
        self.setLayout(layout)

        self.SetFieldsFromParameter()

    def SetFieldsFromParameter(self):
        self._nameField.setText(self.parameter.name)

        self._dataTypeField.setCurrentText(self.parameter.dataType.ToString())

        minFloat, maxFloat = self.parameter.minimumFloat, self.parameter.maximumFloat
        minInt, maxInt = self.parameter.minimumInteger, self.parameter.maximumInteger
        self._minimumFloat.setRange(-2**30, maxFloat)
        self._maximumFloat.setRange(minFloat, 2**30)
        self._minimumInteger.setRange(-2**30, maxInt)
        self._maximumInteger.setRange(minInt, 2**30)
        if self._minimumFloat.value() != minFloat:
            self._minimumFloat.setValue(minFloat)
        if self._maximumFloat.value() != maxFloat:
            self._maximumFloat.setValue(maxFloat)
        if self._minimumInteger.value() != minInt:
            self._minimumInteger.setValue(minInt)
        if self._maximumInteger.value() != maxInt:
            self._maximumInteger.setValue(maxInt)

        self._defaultInteger.setRange(minInt, maxInt)
        self._defaultFloat.setRange(minFloat, maxFloat)
        if self._defaultInteger.value() != self.parameter.defaultValueDict[
                DataType.INTEGER]:
            self._defaultInteger.setValue(
                self.parameter.defaultValueDict[DataType.INTEGER])
        if self._defaultFloat.value() != self.parameter.defaultValueDict[
                DataType.FLOAT]:
            self._defaultFloat.setValue(
                self.parameter.defaultValueDict[DataType.FLOAT])

        if self._defaultBoolean.currentData(
        ) != self.parameter.defaultValueDict[DataType.BOOLEAN]:
            self._defaultBoolean.setCurrentText(
                str(self.parameter.defaultValueDict[DataType.BOOLEAN]))

        if self._defaultString.text() != self.parameter.defaultValueDict[
                DataType.STRING]:
            self._defaultString.setText(
                self.parameter.defaultValueDict[DataType.STRING])

        self.UpdateVisibility()

    def UpdateVisibility(self):
        self._defaultInteger.setVisible(
            self._dataTypeField.currentData() is DataType.INTEGER)
        self._defaultFloat.setVisible(
            self._dataTypeField.currentData() is DataType.FLOAT)
        self._defaultBoolean.setVisible(
            self._dataTypeField.currentData() is DataType.BOOLEAN)
        self._defaultString.setVisible(
            self._dataTypeField.currentData() is DataType.STRING)

        self._minimumLabel.setVisible(self._dataTypeField.currentData() in
                                      [DataType.INTEGER, DataType.FLOAT])
        self._maximumLabel.setVisible(self._dataTypeField.currentData() in
                                      [DataType.INTEGER, DataType.FLOAT])
        self._minimumInteger.setVisible(
            self._dataTypeField.currentData() is DataType.INTEGER)
        self._maximumInteger.setVisible(
            self._dataTypeField.currentData() is DataType.INTEGER)
        self._minimumFloat.setVisible(
            self._dataTypeField.currentData() is DataType.FLOAT)
        self._maximumFloat.setVisible(
            self._dataTypeField.currentData() is DataType.FLOAT)
        self._minimumLabel.setVisible(self._dataTypeField.currentData() in
                                      [DataType.INTEGER, DataType.FLOAT])
        self._maximumLabel.setVisible(self._dataTypeField.currentData() in
                                      [DataType.INTEGER, DataType.FLOAT])

        self._defaultValueLabel.setVisible(self._dataTypeField.currentData(
        ) not in [DataType.VALVE, DataType.PROGRAM, DataType.PROGRAM_PRESET])

    def OnChanged(self):
        self.UpdateVisibility()
        self._minimumFloat.setMaximum(self._maximumFloat.value())
        self._maximumFloat.setMinimum(self._minimumFloat.value())
        self._minimumInteger.setMaximum(self._maximumInteger.value())
        self._maximumInteger.setMinimum(self._minimumInteger.value())
        self._defaultInteger.setRange(self._minimumInteger.value(),
                                      self._maximumInteger.value())
        self._defaultFloat.setRange(self._minimumFloat.value(),
                                    self._maximumFloat.value())
        self.onChanged.emit()

    def UpdateParameter(self):
        self.parameter.name = self._nameField.text()
        self.parameter.dataType = self._dataTypeField.currentData()

        self.parameter.defaultValueDict[
            DataType.INTEGER] = self._defaultInteger.value()
        self.parameter.defaultValueDict[
            DataType.FLOAT] = self._defaultFloat.value()
        self.parameter.defaultValueDict[
            DataType.BOOLEAN] = self._defaultBoolean.currentData()
        self.parameter.defaultValueDict[
            DataType.STRING] = self._defaultString.text()

        self.parameter.minimumInteger = self._minimumInteger.value()
        self.parameter.maximumInteger = self._maximumInteger.value()
        self.parameter.minimumFloat = self._minimumFloat.value()
        self.parameter.maximumFloat = self._maximumFloat.value()

        self.parameter.ValidateDefaultValues()

        self.SetFieldsFromParameter()
コード例 #13
0
 def createEditor(self, parent, option, index):
     editor = QDoubleSpinBox(parent)
     editor.setMinimum(self.min)
     editor.setMaximum(self.max)
     editor.setSuffix(self.suffix)
     return editor