def PreviewWindow(self): self.statusBar().showMessage('Tablecloth preview generated.') self.statusBar().removeWidget(self.progress_bar) # Now you can go back to rigging self.ChangeAppStatus(True) self.preview_wid = QWidget() self.preview_wid.resize(600, 600) self.preview_wid.setWindowTitle("Tablecloth preview") tablecloth = QPixmap(tempfile.gettempdir()+"\\Table_Dif.jpg") tablecloth_preview_title = QLabel(self) tablecloth_preview_title.setText("Tablecloth preview (1/4 scale)") tablecloth_preview = QLabel(self) tablecloth_preview.setPixmap(tablecloth.scaled(512,512)) confirm = QPushButton(self) confirm.setText("Confirm") confirm.clicked.connect(self.GenerateImage) confirm.clicked.connect(self.preview_wid.close) vbox = QVBoxLayout() vbox.setAlignment(QtCore.Qt.AlignCenter) vbox.addWidget(tablecloth_preview_title) vbox.addWidget(tablecloth_preview) vbox.addWidget(confirm) self.preview_wid.setLayout(vbox) self.preview_wid.setWindowModality(QtCore.Qt.ApplicationModal) self.preview_wid.activateWindow() self.preview_wid.raise_() self.preview_wid.show()
class ROITransferOptionView(QtWidgets.QWidget): def __init__(self, fixed_dict_structure_modified_function, moving_dict_structure_modified_function): """ Initialize layout :param fixed_dict_structure_modified_function: function to call when the fixed image's rtss is modified :param moving_dict_structure_modified_function: function to call when the moving image's rtss is modified """ QtWidgets.QWidget.__init__(self) # Create the layout self.roi_transfer_option_layout = QtWidgets.QHBoxLayout() self.roi_transfer_handler = \ ROITransferOption(fixed_dict_structure_modified_function, moving_dict_structure_modified_function) # Create roi transfer option button self.roi_transfer_option_button = QPushButton() self.roi_transfer_option_button.setText("Open ROI Transfer Options") self.roi_transfer_option_button.clicked.connect( self.open_roi_transfer_option) # Set layout self.roi_transfer_option_layout\ .addWidget(self.roi_transfer_option_button) self.setLayout(self.roi_transfer_option_layout) def open_roi_transfer_option(self): self.roi_transfer_handler.show_roi_transfer_options()
def addNewMessage(self): name = self.ui.txt_name.text() text = self.ui.txt_message.text() now = datetime.now().strftime('%H') if name != "" and text != "": for message in self.messages: if name == message[1]: if int(now) - int(message[3][11:12]) <= 0: self.msgBox("Your message should be for 1 hour ago or more") break else: response = Database.insert(name, text) if response: self.length += 1 label = QLabel() label.setText(name + ": " + text) self.ui.gl_messages.addWidget(label, self.length, 1, alignment=Qt.Alignment()) btn = QPushButton() btn.setText('×') btn.setStyleSheet('max-width: 18px; min-height: 18px; background-color: red; color: white; border: 0px; border-radius: 5px;') self.ui.gl_messages.addWidget(btn, self.length, 0, alignment=Qt.Alignment()) btn.clicked.connect(partial(self.deleteMessage, self.messages[-1][0], btn, label)) self.ui.txt_name.setText("") self.ui.txt_message.setText("") self.msgBox("Your message sent successfully!") else: self.msgBox("Database error!") else: self.msgBox("Error: feilds are empty!")
def _show_pickup_spoiler(button: QtWidgets.QPushButton): target_player = getattr(button, "target_player", None) if target_player is not None: label = f"{button.item_name} for {button.player_names[target_player]}" else: label = button.item_name button.setText(label) button.item_is_hidden = False
def check_extracted_game(input_file_edit: QLineEdit, input_file_button: QPushButton, contents_file_path: Path) -> bool: prompt_input_file = not has_internal_copy(contents_file_path) input_file_edit.setEnabled(prompt_input_file) if prompt_input_file: input_file_button.setText("Select File") else: input_file_button.setText("Delete internal copy") input_file_edit.setText(_VALID_GAME_TEXT) return prompt_input_file
class MainWindow(QMainWindow): def __init__(self): super(MainWindow, self).__init__() self.setWindowTitle("My App") self.button = QPushButton("Press Me!") self.button.clicked.connect(self.the_button_was_clicked) self.setCentralWidget(self.button) def the_button_was_clicked(self): self.button.setText("You already clicked me.") self.button.setEnabled(False) self.setWindowTitle("My Oneshot App")
class Ui_Dialog(object): def setupUi(self, Dialog): if not Dialog.objectName(): Dialog.setObjectName(u"Dialog") Dialog.resize(400, 120) Dialog.setMinimumSize(QSize(400, 120)) Dialog.setMaximumSize(QSize(400, 120)) self.verticalLayout = QVBoxLayout(Dialog) self.verticalLayout.setObjectName(u"verticalLayout") self.verticalLayout.setContentsMargins(9, 9, 9, 9) self.bg_diag = QFrame(Dialog) self.bg_diag.setObjectName(u"bg_diag") self.bg_diag.setStyleSheet(u"background-color: rgb(29, 0, 86);\n" "border-radius: 10px;") self.bg_diag.setFrameShape(QFrame.NoFrame) self.bg_diag.setFrameShadow(QFrame.Raised) self.tittle_bar = QFrame(self.bg_diag) self.tittle_bar.setObjectName(u"tittle_bar") self.tittle_bar.setGeometry(QRect(10, 10, 361, 31)) self.tittle_bar.setFrameShape(QFrame.StyledPanel) self.tittle_bar.setFrameShadow(QFrame.Raised) self.lbl_falhaLogar = QLabel(self.tittle_bar) self.lbl_falhaLogar.setObjectName(u"lbl_falhaLogar") self.lbl_falhaLogar.setGeometry(QRect(64, -9, 241, 41)) self.lbl_falhaLogar.setStyleSheet(u"color: rgb(255, 255, 255);\n" "font: 18pt \"Segoe UI\";") self.pushButton = QPushButton(self.bg_diag) self.pushButton.setObjectName(u"pushButton") self.pushButton.setGeometry(QRect(161, 60, 61, 31)) self.pushButton.setStyleSheet(u"background-color: rgb(53, 159, 159);\n" "color: rgb(255, 255, 255);\n" "font: 18pt \"Segoe UI\";\n" "") self.verticalLayout.addWidget(self.bg_diag) self.retranslateUi(Dialog) QMetaObject.connectSlotsByName(Dialog) # setupUi def retranslateUi(self, Dialog): Dialog.setWindowTitle( QCoreApplication.translate("Dialog", u"Dialog", None)) self.lbl_falhaLogar.setText( QCoreApplication.translate("Dialog", u"Falha ao logar usu\u00e1rio", None)) self.pushButton.setText( QCoreApplication.translate("Dialog", u"Ok", None))
def readMessages(self): messages = Database.select() for i, message in enumerate(messages): label = QLabel() label.setText(message[1] + ": " + message[2]) self.ui.gl_messages.addWidget(label,i, 1, alignment=Qt.Alignment()) btn = QPushButton() btn.setText('×') btn.setStyleSheet('max-width: 18px; min-height: 18px; background-color: red; color: white; border: 0px; border-radius: 5px;') self.ui.gl_messages.addWidget(btn, i, 0, alignment=Qt.Alignment()) btn.clicked.connect(partial(self.deleteMessage, message[0], btn, label)) return messages
def EditTeamsWindow(self): self.teamedit_wid = EditionWidget() self.teamedit_wid.resize(400, 320) self.teamedit_wid.setWindowTitle("Edit Teams") self.teams_list = QComboBox(self) self.teams_list.addItem("--- Select a team ---") for team in self.teams: self.teams_list.addItem(team) self.teams_list.currentIndexChanged.connect(self.UpdateTeamInfo) team_id_label = QLabel(self) team_id_label.setText("Team ID: ") self.config_team_id = QLabel(self) team_name_label = QLabel(self) team_name_label.setText("Team name: ") self.config_team_name = QLabel(self) team_members_label = QLabel(self) team_members_label.setText("Team members: ") self.config_team_members = QListWidget(self) add_member_label = QLabel(self) add_member_label.setText("Add new member: ") add_member_input = QLineEdit(self) add_member_input.editingFinished.connect(self.AddNewMember) delete_member = QPushButton(self) delete_member.setText("Delete member") delete_member.clicked.connect(self.DeleteMember) delete_team = QPushButton(self) delete_team.setText("Delete Team") delete_team.clicked.connect(self.DeleteTeam) save_changes = QPushButton(self) save_changes.setText("Save changes") save_changes.clicked.connect(self.SaveEdits) export_config = QPushButton(self) export_config.setText("Export Configuration") export_config.clicked.connect(self.ExportTeams) config_lay = QGridLayout() config_lay.addWidget(self.teams_list, 1, 0) config_lay.addWidget(team_id_label, 2, 0) config_lay.addWidget(self.config_team_id, 2, 1) config_lay.addWidget(team_name_label, 3, 0) config_lay.addWidget(self.config_team_name, 3, 1, 1, 2) config_lay.addWidget(team_members_label, 4, 0) config_lay.addWidget(self.config_team_members, 5, 0) config_lay.addWidget(add_member_label, 6, 0) config_lay.addWidget(add_member_input, 6, 1, 1, 2) config_lay.addWidget(delete_member, 7, 0) config_lay.addWidget(delete_team, 7, 1) config_lay.addWidget(save_changes, 8, 0) config_lay.addWidget(export_config, 8, 1) self.teamedit_wid.setLayout(config_lay) self.teamedit_wid.setWindowModality(QtCore.Qt.ApplicationModal) self.teamedit_wid.activateWindow() self.teamedit_wid.raise_() self.teamedit_wid.show()
class Controls(QWidget): def __init__(self, parent, init_label, mainfunction, quitfunction): super().__init__(parent) self.button = QPushButton(init_label) self.button.clicked.connect(mainfunction) self.button.setAutoDefault(True) quitbutton = QPushButton('終わる') quitbutton.setStyleSheet('background-color: #c00; color: white;') quitbutton.clicked.connect(quitfunction) layout = QHBoxLayout() layout.addWidget(self.button) layout.addWidget(quitbutton) self.setLayout(layout) def set_button(self, label): self.button.setText(label) def hide_button(self): self.button.hide()
class AcquisitionBox(QGroupBox): def __init__(self, controller, parent=None): super().__init__("Acquisition", parent=parent) self.controller = controller self.is_running = False layout = QHBoxLayout() self.setLayout(layout) self.button_run = QPushButton("RUN") self.button_single = QPushButton("SINGLE") layout.addWidget(self.button_run) layout.addWidget(self.button_single) self.button_single.clicked.connect(self.on_single_button) self.button_run.clicked.connect(self.on_run_stop_button) def on_run_stop_button(self): if self.is_running: self.controller.oscilloscope_stop() self.is_running = False self.button_run.setText("RUN") else: if self.controller.oscilloscope_continuous_run(): self.is_running = True self.button_run.setText("STOP") def on_single_button(self): self.controller.oscilloscope_single_run() self.is_running = False self.button_run.setText("RUN")
def __init__(self): super().__init__() btn1 = QPushButton(self) btn2 = QPushButton(self) btn3 = QPushButton(self) btn1.setText('button 1') btn2.setText('button 2') btn3.setText('button 3') hbox = QHBoxLayout() # 设置伸缩量为1 hbox.addStretch(1) hbox.addWidget(btn1) # 设置伸缩量为1 hbox.addStretch(1) hbox.addWidget(btn2) # 设置伸缩量为1 hbox.addStretch(1) hbox.addWidget(btn3) # 设置伸缩量为1 hbox.addStretch(1) self.setLayout(hbox) self.setWindowTitle("addStretch 例子")
class Ui_MainWindow(object): def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") MainWindow.resize(659, 477) self.centralwidget = QWidget(MainWindow) self.centralwidget.setObjectName(u"centralwidget") self.verticalLayout = QVBoxLayout(self.centralwidget) self.verticalLayout.setObjectName(u"verticalLayout") self.verticalLayout.setContentsMargins(50, -1, 50, -1) self.pushButton = QPushButton(self.centralwidget) self.pushButton.setObjectName(u"pushButton") self.pushButton.setMinimumSize(QSize(0, 50)) font = QFont() font.setPointSize(16) self.pushButton.setFont(font) self.verticalLayout.addWidget(self.pushButton) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QMenuBar(MainWindow) self.menubar.setObjectName(u"menubar") self.menubar.setGeometry(QRect(0, 0, 659, 27)) MainWindow.setMenuBar(self.menubar) self.statusbar = QStatusBar(MainWindow) self.statusbar.setObjectName(u"statusbar") MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) QMetaObject.connectSlotsByName(MainWindow) # setupUi def retranslateUi(self, MainWindow): MainWindow.setWindowTitle( QCoreApplication.translate("MainWindow", u"MainWindow", None)) self.pushButton.setText( QCoreApplication.translate("MainWindow", u"pushButton", None))
class DeviceBox(QGroupBox): def __init__(self, controller, parent=None): super().__init__("Device", parent=parent) self.controller = controller self.is_connected = False layout = QVBoxLayout() self.setLayout(layout) self.button_refresh = QPushButton("Refresh") self.combobox_ports = QComboBox() self.button_connect = QPushButton("Connect") layout.addWidget(self.button_refresh) layout.addWidget(self.combobox_ports) layout.addWidget(self.button_connect) self.button_refresh.clicked.connect(self.refresh_ports) self.button_connect.clicked.connect(self.connect_to_device) def refresh_ports(self): self.combobox_ports.clear() self.combobox_ports.addItems(self.controller.get_ports_names()) def connect_to_device(self): if not self.is_connected: port = self.combobox_ports.currentText() self.controller.connect_to_device(port) else: self.controller.disconnect_device() self.is_connected = self.controller.is_device_connected() if self.is_connected: self.button_connect.setText("Disconnect") else: self.button_connect.setText("Connect")
def _init_ui(self): hbox = QVBoxLayout() self.setLayout(hbox) self.label = QLabel() self.label.setText(f"Turn {self.game_state.turn.value}") f: QtGui.QFont = self.label.font() f.setPixelSize(50) self.label.setFont(f) hbox.addWidget(self.label, alignment=Qt.AlignCenter) self.grid = QGridLayout() hbox.addLayout(self.grid) for y in range(0, GAME_SZIE): for x in range(0, GAME_SZIE): button = QPushButton() button.setText(self.game_state.get(x, y).value) f: QtGui.QFont = button.font() f.setPixelSize(50) button.setFont(f) button.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) button.clicked.connect( self.get_tile_clicked_listener(button, x, y)) self.grid.addWidget(button, y, x)
def CreateTeamsWindow(self): self.teamcreation_wid = EditionWidget() self.teamcreation_wid.resize(400, 200) self.teamcreation_wid.setWindowTitle("Teams configuration") self.new_config = {} id_label = QLabel(self) id_label.setText("Team ID: ") self.num_id = QLabel(self) current_id = str(self.config["total_teams"] + 1) self.num_id.setText(current_id) name_label = QLabel(self) name_label.setText("Team Name:") name_label.setFocus() self.name_input = QLineEdit(self) members_label = QLabel(self) members_label.setText("Members (write and press enter):") members_input = QLineEdit(self) members_input.editingFinished.connect( lambda: self.AddMember(members_input)) self.members_list = QListWidget(self) import_image = QPushButton(self) import_image.setText("Import Team Image") import_image.clicked.connect(self.ImportTeamImage) add_team = QPushButton(self) add_team.setText("Add Team") add_team.clicked.connect( lambda: self.addTeamFunction(self.name_input.text(), self.members_list)) import_config = QPushButton(self) import_config.setText("Import configuration") import_config.clicked.connect(self.importTeamFunction) config_lay = QGridLayout() config_lay.addWidget(id_label, 1, 0) config_lay.addWidget(self.num_id, 1, 1) config_lay.addWidget(name_label, 2, 0) config_lay.addWidget(self.name_input, 2, 1) config_lay.addWidget(members_label, 3, 0) config_lay.addWidget(members_input, 3, 1) config_lay.addWidget(self.members_list, 4, 0, 2, 2) config_lay.addWidget(add_team, 6, 0) config_lay.addWidget(import_image, 6, 1) config_lay.addWidget(import_config, 7, 0, 1, 2) self.teamcreation_wid.setLayout(config_lay) self.teamcreation_wid.setWindowModality(QtCore.Qt.ApplicationModal) self.teamcreation_wid.activateWindow() self.teamcreation_wid.raise_() self.teamcreation_wid.show()
class MyClass(QWidget): def __init__(self): super().__init__() self.initUI() def initUI(self): self.resize(300, 200) # 载入进度条控件 self.verticalLayout = QVBoxLayout() self.pgb = QProgressBar(self) self.verticalLayout.addWidget(self.pgb, 0, 0, 1, 1) #self.pgb.move(50, 50) #self.pgb.resize(250, 20) # 配置一个值表示进度条的当前进度 self.pv = 0 # 申明一个时钟控件 self.timer1 = QBasicTimer() # 设置进度条的范围 self.pgb.setMinimum(0) self.pgb.setMaximum(100) self.pgb.setValue(self.pv) # 载入按钮 self.btn = QPushButton("开始", self) self.btn.move(50, 100) self.btn.clicked.connect(self.myTimerState) self.show() def myTimerState(self): if self.pv == 100: self.close() if self.timer1.isActive(): self.timer1.stop() self.btn.setText("开始") else: self.timer1.start(100, self) self.btn.setText("停止") def timerEvent(self, e): if self.pv == 100: self.timer1.stop() self.btn.setText("完成") else: self.pv += 1 self.pgb.setValue(self.pv)
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>"))
class Ui_MainWindow(object): def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") MainWindow.resize(671, 496) self.help = QAction(MainWindow) self.help.setObjectName(u"help") self.centralwidget = QWidget(MainWindow) self.centralwidget.setObjectName(u"centralwidget") self.log_text = QTextEdit(self.centralwidget) self.log_text.setObjectName(u"log_text") self.log_text.setGeometry(QRect(0, 190, 671, 291)) self.labe = QLabel(self.centralwidget) self.labe.setObjectName(u"labe") self.labe.setGeometry(QRect(30, 20, 54, 12)) self.ssid = QLineEdit(self.centralwidget) self.ssid.setObjectName(u"ssid") self.ssid.setGeometry(QRect(70, 20, 131, 20)) self.time = QLineEdit(self.centralwidget) self.time.setObjectName(u"time") self.time.setGeometry(QRect(540, 20, 91, 20)) self.label_2 = QLabel(self.centralwidget) self.label_2.setObjectName(u"label_2") self.label_2.setGeometry(QRect(470, 20, 54, 12)) self.password = QLineEdit(self.centralwidget) self.password.setObjectName(u"password") self.password.setGeometry(QRect(310, 20, 131, 20)) self.label_3 = QLabel(self.centralwidget) self.label_3.setObjectName(u"label_3") self.label_3.setGeometry(QRect(240, 20, 54, 12)) self.connect = QPushButton(self.centralwidget) self.connect.setObjectName(u"connect") self.connect.setGeometry(QRect(140, 60, 75, 23)) self.disconnect = QPushButton(self.centralwidget) self.disconnect.setObjectName(u"disconnect") self.disconnect.setGeometry(QRect(250, 60, 75, 23)) self.labe_2 = QLabel(self.centralwidget) self.labe_2.setObjectName(u"labe_2") self.labe_2.setGeometry(QRect(30, 120, 91, 16)) self.cur_ssid = QTextEdit(self.centralwidget) self.cur_ssid.setObjectName(u"cur_ssid") self.cur_ssid.setGeometry(QRect(140, 110, 241, 31)) self.label = QLabel(self.centralwidget) self.label.setObjectName(u"label") self.label.setGeometry(QRect(30, 160, 101, 16)) self.interface_name = QTextEdit(self.centralwidget) self.interface_name.setObjectName(u"interface_name") self.interface_name.setGeometry(QRect(140, 150, 241, 31)) self.label_4 = QLabel(self.centralwidget) self.label_4.setObjectName(u"label_4") self.label_4.setGeometry(QRect(450, 70, 54, 12)) self.frequency = QLineEdit(self.centralwidget) self.frequency.setObjectName(u"frequency") self.frequency.setGeometry(QRect(540, 70, 91, 20)) self.test = QPushButton(self.centralwidget) self.test.setObjectName(u"test") self.test.setGeometry(QRect(550, 110, 75, 23)) self.label_5 = QLabel(self.centralwidget) self.label_5.setObjectName(u"label_5") self.label_5.setGeometry(QRect(470, 70, 61, 16)) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QMenuBar(MainWindow) self.menubar.setObjectName(u"menubar") self.menubar.setGeometry(QRect(0, 0, 671, 22)) self.menuFile = QMenu(self.menubar) self.menuFile.setObjectName(u"menuFile") MainWindow.setMenuBar(self.menubar) self.statusbar = QStatusBar(MainWindow) self.statusbar.setObjectName(u"statusbar") MainWindow.setStatusBar(self.statusbar) self.menubar.addAction(self.menuFile.menuAction()) self.menuFile.addAction(self.help) self.menuFile.addSeparator() self.retranslateUi(MainWindow) QMetaObject.connectSlotsByName(MainWindow) # setupUi def retranslateUi(self, MainWindow): MainWindow.setWindowTitle( QCoreApplication.translate("MainWindow", u"WIFI-Test", None)) self.help.setText( QCoreApplication.translate("MainWindow", u"\u5e2e\u52a9\u4fe1\u606f", None)) self.labe.setText( QCoreApplication.translate("MainWindow", u"SSID:", None)) self.label_2.setText( QCoreApplication.translate("MainWindow", u"Time(s):", None)) self.label_3.setText( QCoreApplication.translate("MainWindow", u"Password:"******"MainWindow", u"Connect", None)) self.disconnect.setText( QCoreApplication.translate("MainWindow", u"Disconnect", None)) self.labe_2.setText( QCoreApplication.translate("MainWindow", u"Connected SSID:", None)) self.label.setText( QCoreApplication.translate("MainWindow", u"Interface Name:", None)) self.label_4.setText("") self.test.setText( QCoreApplication.translate("MainWindow", u"Test", None)) self.label_5.setText( QCoreApplication.translate("MainWindow", u"Frequency:", None)) self.menuFile.setTitle( QCoreApplication.translate("MainWindow", u"help", None))
class Ui_AboutWindow(QMainWindow): def __init__(self): super().__init__() self.setWindowFlags(Qt.CustomizeWindowHint) self.setWindowIcon(QIcon(resource_path('icon.ico'))) self.setFixedSize(241, 190) def setupUi(self): self.centralwidget = QWidget(self) with open(resource_path('style.css'), 'r') as file: self.centralwidget.setStyleSheet(file.read()) self.layout_widget_about = QWidget(self.centralwidget) self.layout_widget_about.setGeometry(QRect(10, 10, 221, 81)) self.layout_about = QVBoxLayout(self.layout_widget_about) self.layout_about.setContentsMargins(0, 0, 0, 0) self.label_logo = QLabel(self.layout_widget_about) self.pixmap = QPixmap(resource_path('icon.ico')) self.pixmap = self.pixmap.scaledToWidth(30, Qt.SmoothTransformation) self.label_logo.setPixmap(self.pixmap) self.layout_about.addWidget(self.label_logo, 0, Qt.AlignHCenter) self.title_font = QFont() self.title_font.setPointSize(13) self.font = QFont() self.font.setPointSize(10) self.label_title = QLabel(self.layout_widget_about) self.title_font.setStyleStrategy(QFont.PreferAntialias) self.label_title.setFont(self.title_font) self.label_title.setLayoutDirection(Qt.LeftToRight) self.layout_about.addWidget(self.label_title, 0, Qt.AlignHCenter) self.label_version = QLabel(self.layout_widget_about) self.label_version.setFont(self.font) self.label_version.setLayoutDirection(Qt.LeftToRight) self.layout_about.addWidget(self.label_version, 0, Qt.AlignHCenter) self.layout_widget_about_2 = QWidget(self.centralwidget) self.layout_widget_about_2.setGeometry(QRect(10, 100, 221, 81)) self.layout_about_2 = QVBoxLayout(self.layout_widget_about_2) self.layout_about_2.setContentsMargins(0, 0, 0, 0) self.label_copyright = QLabel(self.layout_widget_about_2) self.label_copyright.setFont(self.font) self.label_copyright.setLayoutDirection(Qt.LeftToRight) self.layout_about_2.addWidget(self.label_copyright, 0, Qt.AlignHCenter) self.label_author = QLabel(self.layout_widget_about_2) self.label_author.setFont(self.font) self.label_author.setLayoutDirection(Qt.LeftToRight) self.layout_about_2.addWidget(self.label_author, 0, Qt.AlignHCenter) self.button_quit_about = QPushButton(self.layout_widget_about_2) self.layout_about_2.addWidget(self.button_quit_about) self.button_quit_about.setMinimumSize(100, 30) self.button_quit_about.setProperty('class', 'Aqua') self.setCentralWidget(self.centralwidget) self.retranslateUi() QMetaObject.connectSlotsByName(self) def retranslateUi(self): self.setWindowTitle(QCoreApplication.translate("AboutWindow", "About")) self.label_title.setText( QCoreApplication.translate("AboutWindow", "PyDebloatX")) self.label_version.setText( QCoreApplication.translate("AboutWindow", "")) self.label_copyright.setText( QCoreApplication.translate("AboutWindow", "Copyright") + " © 2020-2021") self.label_author.setText( QCoreApplication.translate("AboutWindow", "Anton Grouchtchak.")) self.button_quit_about.setText( QCoreApplication.translate("AboutWindow", "OK"))
class AdapterSettingsDialog(QDialog): def __init__(self, parent, data): assert type(data) == BinaryView self.bv = data QDialog.__init__(self, parent) debug_state = binjaplug.get_state(self.bv) self.setWindowTitle("Debug Adapter Settings") self.setMinimumSize(UIContext.getScaledWindowSize(400, 130)) self.setAttribute(Qt.WA_DeleteOnClose) layout = QVBoxLayout() layout.setSpacing(0) titleLabel = QLabel("Adapter Settings") titleLayout = QHBoxLayout() titleLayout.setContentsMargins(0, 0, 0, 0) titleLayout.addWidget(titleLabel) self.adapterEntry = QPushButton(self) self.adapterMenu = QMenu(self) for adapter in DebugAdapter.ADAPTER_TYPE: if not DebugAdapter.ADAPTER_TYPE.can_use(adapter): continue def select_adapter(adapter): return lambda: self.selectAdapter(adapter) self.adapterMenu.addAction(adapter.name, select_adapter(adapter)) if adapter == debug_state.adapter_type: self.adapterEntry.setText(adapter.name) self.adapterEntry.setMenu(self.adapterMenu) self.argumentsEntry = QLineEdit(self) self.addressEntry = QLineEdit(self) self.portEntry = QLineEdit(self) self.requestTerminalEmulator = QCheckBox(self) self.formLayout = QFormLayout() self.formLayout.addRow("Adapter Type", self.adapterEntry) self.formLayout.addRow("Command Line Arguments", self.argumentsEntry) self.formLayout.addRow("Address", self.addressEntry) self.formLayout.addRow("Port", self.portEntry) self.formLayout.addRow("Request Terminal Emulator", self.requestTerminalEmulator) buttonLayout = QHBoxLayout() buttonLayout.setContentsMargins(0, 0, 0, 0) self.cancelButton = QPushButton("Cancel") self.cancelButton.clicked.connect(lambda: self.reject()) self.acceptButton = QPushButton("Accept") self.acceptButton.clicked.connect(lambda: self.accept()) self.acceptButton.setDefault(True) buttonLayout.addStretch(1) buttonLayout.addWidget(self.cancelButton) buttonLayout.addWidget(self.acceptButton) layout.addLayout(titleLayout) layout.addSpacing(10) layout.addLayout(self.formLayout) layout.addStretch(1) layout.addSpacing(10) layout.addLayout(buttonLayout) self.setLayout(layout) self.addressEntry.setText(debug_state.remote_host) self.portEntry.setText(str(debug_state.remote_port)) self.addressEntry.textEdited.connect(lambda: self.apply()) self.portEntry.textEdited.connect(lambda: self.apply()) self.argumentsEntry.setText(' '.join( shlex.quote(arg) for arg in debug_state.command_line_args)) self.argumentsEntry.textEdited.connect(lambda: self.updateArguments()) self.requestTerminalEmulator.setChecked( debug_state.request_terminal_emulator) self.requestTerminalEmulator.stateChanged.connect(lambda: self.apply()) self.accepted.connect(lambda: self.apply()) def selectAdapter(self, adapter): self.bv.store_metadata('debugger.adapter_type', adapter.value) debug_state = binjaplug.get_state(self.bv) debug_state.adapter_type = adapter self.adapterEntry.setText(adapter.name) if DebugAdapter.ADAPTER_TYPE.use_exec(adapter): self.argumentsEntry.setEnabled(True) self.addressEntry.setEnabled(False) self.portEntry.setEnabled(False) elif DebugAdapter.ADAPTER_TYPE.use_connect(adapter): self.argumentsEntry.setEnabled(False) self.addressEntry.setEnabled(True) self.portEntry.setEnabled(True) def apply(self): debug_state = binjaplug.get_state(self.bv) arguments = shlex.split(self.argumentsEntry.text()) debug_state.command_line_args = arguments self.bv.store_metadata('debugger.command_line_args', arguments) address = self.addressEntry.text() port = int(self.portEntry.text()) debug_state.remote_host = address debug_state.remote_port = port self.bv.store_metadata('debugger.remote_host', address) self.bv.store_metadata('debugger.remote_port', port) request_terminal_emulator = self.requestTerminalEmulator.isChecked() debug_state.request_terminal_emulator = request_terminal_emulator self.bv.store_metadata('debugger.request_terminal_emulator', request_terminal_emulator) def updateArguments(self): try: arguments = shlex.split(self.argumentsEntry.text()) self.acceptButton.setEnabled(True) except: self.acceptButton.setEnabled(False)
class Ui_MainWindow(object): def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") MainWindow.resize(400, 300) MainWindow.setWindowTitle(u"\u0421\u0442\u0435\u0433\u0430\u043d\u043e\u0433\u0440\u0430\u0444\u0438\u044f") MainWindow.setStyleSheet(u "QMainWindow {\n" "background-color: #f8f9fa;\n" "}\n" "QPushButton:hover {\n" "color: rgb(70, 126, 163);\n" "font: bold 11pt;\n" "}\n" "QPushButton {\n" "color: white;\n" "border:1px solid rgb(82, 108, 125);\n" "border-radius: 6px;\n" "background-color: rgb(82, 108, 125)\n"; "}") 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.load_button = QPushButton(self.centralwidget) self.load_button.setObjectName(u"load_button") font = QFont() font.setPointSize(9) self.load_button.setFont(font) self.load_button.setStyleSheet(u"") self.load_button.setText(u"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435") self.horizontalLayout.addWidget(self.load_button) self.save_button = QPushButton(self.centralwidget) self.save_button.setObjectName(u"save_button") self.save_button.setFont(font) self.save_button.setStyleSheet(u"") self.save_button.setText(u"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435") self.horizontalLayout.addWidget(self.save_button) self.verticalLayout.addLayout(self.horizontalLayout) self.message_frame = QTextEdit(self.centralwidget) self.message_frame.setObjectName(u"message_frame") sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(1) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.message_frame.sizePolicy().hasHeightForWidth()) self.message_frame.setSizePolicy(sizePolicy) font.setPointSize(10) self.message_frame.setFont(font) font.setPointSize(9) self.message_frame.setStyleSheet(u"") self.message_frame.setFrameShape(QFrame.StyledPanel) self.message_frame.setMarkdown(u"") self.message_frame.setHtml(u"") self.message_frame.setPlaceholderText(u"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435") self.verticalLayout.addWidget(self.message_frame) self.output_label = QLabel(self.centralwidget) self.output_label.setObjectName(u"output_label") sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy1.setHorizontalStretch(1) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth(self.output_label.sizePolicy().hasHeightForWidth()) self.output_label.setSizePolicy(sizePolicy1) font1 = QFont() self.output_label.setFont(font1) self.output_label.setText(u"") self.output_label.setScaledContents(False) self.output_label.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop) self.output_label.setWordWrap(True) self.verticalLayout.addWidget(self.output_label) self.horizontalLayout_2 = QHBoxLayout() self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.decode_button = QPushButton(self.centralwidget) self.decode_button.setObjectName(u"decode_button") palette = QPalette() brush = QBrush(QColor(255, 255, 255, 255)) brush.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.WindowText, brush) brush1 = QBrush(QColor(13, 110, 253, 255)) brush1.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Button, brush1) palette.setBrush(QPalette.Active, QPalette.Text, brush) palette.setBrush(QPalette.Active, QPalette.ButtonText, brush) palette.setBrush(QPalette.Active, QPalette.Base, brush1) palette.setBrush(QPalette.Active, QPalette.Window, brush1) palette.setBrush(QPalette.Active, QPalette.PlaceholderText, brush) palette.setBrush(QPalette.Inactive, QPalette.WindowText, brush) palette.setBrush(QPalette.Inactive, QPalette.Button, brush1) palette.setBrush(QPalette.Inactive, QPalette.Text, brush) palette.setBrush(QPalette.Inactive, QPalette.ButtonText, brush) palette.setBrush(QPalette.Inactive, QPalette.Base, brush1) palette.setBrush(QPalette.Inactive, QPalette.Window, brush1) palette.setBrush(QPalette.Inactive, QPalette.PlaceholderText, brush) palette.setBrush(QPalette.Disabled, QPalette.WindowText, brush) palette.setBrush(QPalette.Disabled, QPalette.Button, brush1) palette.setBrush(QPalette.Disabled, QPalette.Text, brush) palette.setBrush(QPalette.Disabled, QPalette.ButtonText, brush) palette.setBrush(QPalette.Disabled, QPalette.Base, brush1) palette.setBrush(QPalette.Disabled, QPalette.Window, brush1) palette.setBrush(QPalette.Disabled, QPalette.PlaceholderText, brush) self.decode_button.setPalette(palette) self.decode_button.setFont(font) self.decode_button.setStyleSheet(u"") self.decode_button.setText(u"\u0414\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442") self.horizontalLayout_2.addWidget(self.decode_button) self.encode_button = QPushButton(self.centralwidget) self.encode_button.setObjectName(u"encode_button") self.encode_button.setFont(font) self.encode_button.setStyleSheet(u"") self.encode_button.setText(u"\u0417\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442") self.horizontalLayout_2.addWidget(self.encode_button) self.verticalLayout.addLayout(self.horizontalLayout_2) MainWindow.setCentralWidget(self.centralwidget) QWidget.setTabOrder(self.load_button, self.save_button) QWidget.setTabOrder(self.save_button, self.encode_button) QWidget.setTabOrder(self.encode_button, self.decode_button) self.retranslateUi(MainWindow) QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): pass
class Ui_MainWindow(object): def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") MainWindow.resize(450, 520) MainWindow.setMinimumSize(QSize(450, 520)) MainWindow.setMaximumSize(QSize(450, 520)) self.centralwidget = QWidget(MainWindow) self.centralwidget.setObjectName(u"centralwidget") self.bg_frame_2 = QVBoxLayout(self.centralwidget) self.bg_frame_2.setSpacing(0) self.bg_frame_2.setObjectName(u"bg_frame_2") self.bg_frame_2.setContentsMargins(10, 10, 10, 10) self.bg_frame = QFrame(self.centralwidget) self.bg_frame.setObjectName(u"bg_frame") self.bg_frame.setStyleSheet(u"background-color: rgb(29, 0, 86);\n" "border-radius: 10px;") self.bg_frame.setFrameShape(QFrame.NoFrame) self.bg_frame.setFrameShadow(QFrame.Raised) self.tittle_bar = QFrame(self.bg_frame) self.tittle_bar.setObjectName(u"tittle_bar") self.tittle_bar.setGeometry(QRect(10, 10, 411, 31)) self.tittle_bar.setFrameShape(QFrame.StyledPanel) self.tittle_bar.setFrameShadow(QFrame.Raised) self.label = QLabel(self.tittle_bar) self.label.setObjectName(u"label") self.label.setGeometry(QRect(10, 0, 61, 31)) self.label.setStyleSheet(u"color: rgb(255, 255, 255);\n" "font: 18pt \"Segoe UI\";") self.button_close = QPushButton(self.tittle_bar) self.button_close.setObjectName(u"button_close") self.button_close.setGeometry(QRect(380, 0, 21, 24)) self.button_close.setStyleSheet(u"background-color: rgb(152, 0, 0);\n" "font: 14pt \"Segoe UI\";") self.button_minimize = QPushButton(self.tittle_bar) self.button_minimize.setObjectName(u"button_minimize") self.button_minimize.setGeometry(QRect(350, 0, 21, 24)) self.button_minimize.setStyleSheet( u"background-color: rgb(53, 159, 159);\n" "font: 14pt \"Segoe UI\";") self.user_login = QLineEdit(self.bg_frame) self.user_login.setObjectName(u"user_login") self.user_login.setGeometry(QRect(60, 160, 301, 51)) self.user_login.setStyleSheet(u"background-color: rgb(53, 159, 159);\n" "") self.pass_login = QLineEdit(self.bg_frame) self.pass_login.setObjectName(u"pass_login") self.pass_login.setGeometry(QRect(60, 281, 301, 51)) self.pass_login.setStyleSheet(u"background-color: rgb(53, 159, 159);\n" "") self.user_lbl = QLabel(self.bg_frame) self.user_lbl.setObjectName(u"user_lbl") self.user_lbl.setGeometry(QRect(170, 110, 81, 41)) self.user_lbl.setStyleSheet(u"color: rgb(255, 255, 255);\n" "font: 18pt \"Segoe UI\";") self.senha_lbl = QLabel(self.bg_frame) self.senha_lbl.setObjectName(u"senha_lbl") self.senha_lbl.setGeometry(QRect(179, 230, 71, 41)) self.senha_lbl.setStyleSheet(u"color: rgb(255, 255, 255);\n" "font: 18pt \"Segoe UI\";") self.btn_login = QPushButton(self.bg_frame) self.btn_login.setObjectName(u"btn_login") self.btn_login.setGeometry(QRect(160, 360, 101, 41)) self.btn_login.setStyleSheet(u"background-color: rgb(53, 159, 159);\n" "color: rgb(255, 255, 255);\n" "font: 18pt \"Segoe UI\";\n" "") self.bg_frame_2.addWidget(self.bg_frame) MainWindow.setCentralWidget(self.centralwidget) self.retranslateUi(MainWindow) QMetaObject.connectSlotsByName(MainWindow) # setupUi def retranslateUi(self, MainWindow): MainWindow.setWindowTitle( QCoreApplication.translate("MainWindow", u"Login", None)) self.label.setText( QCoreApplication.translate("MainWindow", u"Login", None)) self.button_close.setText( QCoreApplication.translate("MainWindow", u"x", None)) self.button_minimize.setText( QCoreApplication.translate("MainWindow", u"-", None)) self.user_lbl.setText( QCoreApplication.translate("MainWindow", u"Usu\u00e1rio", None)) self.senha_lbl.setText( QCoreApplication.translate("MainWindow", u"Senha", None)) self.btn_login.setText( QCoreApplication.translate("MainWindow", u"Logar", None))
class Ui_Form(object): def setupUi(self, Form): if not Form.objectName(): Form.setObjectName(u"Form") Form.resize(400, 300) self.verticalLayout = QVBoxLayout(Form) self.verticalLayout.setObjectName(u"verticalLayout") self.opsTabs = QTabWidget(Form) self.opsTabs.setObjectName(u"opsTabs") self.opsTabs.setEnabled(True) self.opsTabs.setMaximumSize(QSize(410, 16777215)) self.stepsTab = QWidget() self.stepsTab.setObjectName(u"stepsTab") sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.stepsTab.sizePolicy().hasHeightForWidth()) self.stepsTab.setSizePolicy(sizePolicy) self.stepsTab.setMinimumSize(QSize(200, 278)) self.stepsTab.setAutoFillBackground(False) self.verticalLayout_2 = QVBoxLayout(self.stepsTab) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.verticalLayout_2.setContentsMargins(-1, 11, -1, -1) self.stepsTreeWidget = QTreeWidget(self.stepsTab) self.stepsTreeWidget.setObjectName(u"stepsTreeWidget") self.verticalLayout_2.addWidget(self.stepsTreeWidget) self.horizontalLayout_3 = QHBoxLayout() self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.stepDownBtn = QPushButton(self.stepsTab) self.stepDownBtn.setObjectName(u"stepDownBtn") self.horizontalLayout_3.addWidget(self.stepDownBtn) self.stepUpBtn = QPushButton(self.stepsTab) self.stepUpBtn.setObjectName(u"stepUpBtn") self.horizontalLayout_3.addWidget(self.stepUpBtn) self.removeStepBtn = QPushButton(self.stepsTab) self.removeStepBtn.setObjectName(u"removeStepBtn") self.horizontalLayout_3.addWidget(self.removeStepBtn) self.addStepBtn = QPushButton(self.stepsTab) self.addStepBtn.setObjectName(u"addStepBtn") self.horizontalLayout_3.addWidget(self.addStepBtn) self.runBtn = QPushButton(self.stepsTab) self.runBtn.setObjectName(u"runBtn") sizePolicy1 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.runBtn.sizePolicy().hasHeightForWidth()) self.runBtn.setSizePolicy(sizePolicy1) self.runBtn.setMinimumSize(QSize(0, 0)) font = QFont() font.setBold(False) self.runBtn.setFont(font) self.runBtn.setCheckable(False) self.runBtn.setFlat(False) self.horizontalLayout_3.addWidget(self.runBtn) self.verticalLayout_2.addLayout(self.horizontalLayout_3) self.opsTabs.addTab(self.stepsTab, "") self.optionsTab = QWidget() self.optionsTab.setObjectName(u"optionsTab") self.optionsTab.setAutoFillBackground(True) self.verticalLayout_17 = QVBoxLayout(self.optionsTab) self.verticalLayout_17.setObjectName(u"verticalLayout_17") self.stepOptionsTreeWidget = QTreeWidget(self.optionsTab) __qtreewidgetitem = QTreeWidgetItem() __qtreewidgetitem.setText(0, u"1") self.stepOptionsTreeWidget.setHeaderItem(__qtreewidgetitem) self.stepOptionsTreeWidget.setObjectName(u"stepOptionsTreeWidget") self.verticalLayout_17.addWidget(self.stepOptionsTreeWidget) self.opsTabs.addTab(self.optionsTab, "") self.templatesTab = QWidget() self.templatesTab.setObjectName(u"templatesTab") self.verticalLayout_19 = QVBoxLayout(self.templatesTab) self.verticalLayout_19.setObjectName(u"verticalLayout_19") self.treeWidget = QTreeWidget(self.templatesTab) __qtreewidgetitem1 = QTreeWidgetItem() __qtreewidgetitem1.setText(0, u"1") self.treeWidget.setHeaderItem(__qtreewidgetitem1) self.treeWidget.setObjectName(u"treeWidget") self.verticalLayout_19.addWidget(self.treeWidget) self.opsTabs.addTab(self.templatesTab, "") self.verticalLayout.addWidget(self.opsTabs) self.retranslateUi(Form) self.opsTabs.setCurrentIndex(0) QMetaObject.connectSlotsByName(Form) # setupUi def retranslateUi(self, Form): Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None)) ___qtreewidgetitem = self.stepsTreeWidget.headerItem() ___qtreewidgetitem.setText( 2, QCoreApplication.translate("Form", u"Target", None)) ___qtreewidgetitem.setText( 1, QCoreApplication.translate("Form", u"Operation", None)) ___qtreewidgetitem.setText( 0, QCoreApplication.translate("Form", u"#", None)) self.stepDownBtn.setText(QCoreApplication.translate( "Form", u"<", None)) self.stepUpBtn.setText(QCoreApplication.translate("Form", u">", None)) self.removeStepBtn.setText( QCoreApplication.translate("Form", u"-", None)) self.addStepBtn.setText(QCoreApplication.translate("Form", u"+", None)) self.runBtn.setText(QCoreApplication.translate("Form", u"Run", None)) self.opsTabs.setTabText( self.opsTabs.indexOf(self.stepsTab), QCoreApplication.translate("Form", u"Steps", None)) self.opsTabs.setTabText( self.opsTabs.indexOf(self.optionsTab), QCoreApplication.translate("Form", u"Options", None)) self.opsTabs.setTabText( self.opsTabs.indexOf(self.templatesTab), QCoreApplication.translate("Form", u"Templates", None))
class Ui_MainWindow(QMainWindow): def __init__(self): super().__init__() self.setWindowIcon(QIcon(resource_path('icon.ico'))) self.setFixedSize(540, 470) def setupUi(self): self.centralwidget = QWidget(self) with open(resource_path('style.css'), 'r') as file: self.centralwidget.setStyleSheet(file.read()) self.appswidget = QWidget(self.centralwidget) self.appswidget.setGeometry(50, 0, 490, 470) self.appswidget.setProperty('class', 'appswidget') self.sidebar = QFrame(self.centralwidget) self.sidebar.setFrameShape(QFrame.StyledPanel) self.sidebar.setGeometry(0, 0, 50, 470) self.sidebar.setProperty('class', 'sidebar') self.refresh_btn = QPushButton(self.sidebar) self.refresh_btn.setGeometry(QRect(0, 0, 51, 51)) self.refresh_btn.setProperty('class', 'sidebar_btns') self.refresh_btn.setIcon(QIcon(':/icon/refresh_icon.png')) self.refresh_btn.setIconSize(QSize(24, 24)) self.refresh_bind = QShortcut(QKeySequence('Ctrl+R'), self) self.store_btn = QPushButton(self.sidebar) self.store_btn.setGeometry(QRect(0, 51, 51, 51)) self.store_btn.setProperty('class', 'sidebar_btns') self.store_btn.setIcon(QIcon(':/icon/store_icon.png')) self.store_btn.setIconSize(QSize(24, 24)) self.store_bind = QShortcut(QKeySequence('Ctrl+S'), self) self.homepage_btn = QPushButton(self.sidebar) self.homepage_btn.setGeometry(QRect(0, 102, 51, 51)) self.homepage_btn.setProperty('class', 'sidebar_btns') self.homepage_btn.setIcon(QIcon(':/icon/github_icon.png')) self.homepage_btn.setIconSize(QSize(24, 24)) self.homepage_bind = QShortcut(QKeySequence('Ctrl+G'), self) self.about_btn = QPushButton(self.sidebar) self.about_btn.setGeometry(QRect(0, 153, 51, 51)) self.about_btn.setProperty('class', 'sidebar_btns') self.about_btn.setIcon(QIcon(':/icon/about_icon.png')) self.about_btn.setIconSize(QSize(24, 24)) self.about_bind = QShortcut(QKeySequence('Ctrl+A'), self) self.quit_btn = QPushButton(self.sidebar) self.quit_btn.setGeometry(QRect(0, 420, 51, 51)) self.quit_btn.setProperty('class', 'sidebar_btns_quit') self.quit_btn.setIcon(QIcon(':/icon/quit_icon.png')) self.quit_btn.setIconSize(QSize(24, 24)) self.quit_bind = QShortcut(QKeySequence('Ctrl+Q'), self) self.font = QFont() self.font.setPointSize(8) self.font.setStyleStrategy(QFont.PreferAntialias) self.label_refresh = QLabel(self.appswidget) self.label_refresh.setFont(self.font) self.label_refresh.setGeometry(QRect(20, 10, 441, 15)) self.label_info = QLabel(self.appswidget) self.label_info.setFont(self.font) self.label_info.setGeometry(QRect(20, 10, 441, 30)) self.progressbar = QProgressBar(self.appswidget) self.progressbar.setGeometry(QRect(20, 30, 441, 20)) self.layout_widget_checkboxes = QWidget(self.appswidget) self.layout_widget_checkboxes.setGeometry(QRect(20, 55, 155, 311)) self.layout_checkboxes = QVBoxLayout(self.layout_widget_checkboxes) self.layout_checkboxes.setContentsMargins(0, 0, 0, 0) self.layout_widget_checkboxes_2 = QWidget(self.appswidget) self.layout_widget_checkboxes_2.setGeometry(QRect(175, 55, 155, 311)) self.layout_checkboxes_2 = QVBoxLayout(self.layout_widget_checkboxes_2) self.layout_checkboxes_2.setContentsMargins(0, 0, 0, 0) self.layout_widget_checkboxes_3 = QWidget(self.appswidget) self.layout_widget_checkboxes_3.setGeometry(QRect(330, 55, 155, 311)) self.layout_checkboxes_3 = QVBoxLayout(self.layout_widget_checkboxes_3) self.layout_checkboxes_3.setContentsMargins(0, 0, 0, 0) self.layout_widget_labels = QWidget(self.appswidget) self.layout_widget_labels.setGeometry(QRect(20, 390, 350, 16)) self.layout_labels = QHBoxLayout(self.layout_widget_labels) self.layout_labels.setContentsMargins(0, 0, 0, 0) self.label_space = QLabel(self.appswidget) self.label_space.setFont(self.font) self.layout_labels.addWidget(self.label_space) self.label_size = QLabel(self.appswidget) self.label_size.setFont(self.font) self.layout_labels.addWidget(self.label_size) self.layout_widget_buttons = QWidget(self.appswidget) self.layout_widget_buttons.setGeometry(QRect(20, 420, 454, 31)) self.layout_buttons = QHBoxLayout(self.layout_widget_buttons) self.layout_buttons.setContentsMargins(0, 0, 0, 0) self.button_select_all = QPushButton(self.layout_widget_buttons) self.button_select_all.setIcon(QIcon(':/icon/check_icon.png')) self.button_select_all.setIconSize(QSize(18, 18)) self.button_select_all.setLayoutDirection(Qt.RightToLeft) self.layout_buttons.addWidget(self.button_select_all) self.button_select_all.setMinimumSize(100, 30) self.button_select_all.setProperty('class', 'Aqua') self.button_deselect_all = QPushButton(self.layout_widget_buttons) self.button_deselect_all.setIcon(QIcon(':/icon/cancel_icon.png')) self.button_deselect_all.setIconSize(QSize(18, 18)) self.button_deselect_all.setLayoutDirection(Qt.RightToLeft) self.layout_buttons.addWidget(self.button_deselect_all) self.button_deselect_all.setMinimumSize(100, 30) self.button_deselect_all.setProperty('class', 'Aqua') self.layout_buttons.addStretch() self.button_uninstall = QPushButton(self.layout_widget_buttons) self.button_uninstall.setIcon(QIcon(':/icon/trash_icon.png')) self.button_uninstall.setIconSize(QSize(18, 18)) self.button_uninstall.setLayoutDirection(Qt.RightToLeft) self.layout_buttons.addWidget(self.button_uninstall) self.button_uninstall.setMinimumSize(100, 30) self.button_uninstall.setProperty('class', 'Grapefruit') self.setCentralWidget(self.centralwidget) self.retranslateUi() QMetaObject.connectSlotsByName(self) def retranslateUi(self): QToolTip.setFont(self.font) self.setWindowTitle(QCoreApplication.translate("Title", "PyDebloatX")) self.label_info.setText(QCoreApplication.translate("Label", "")) self.app_name_list = list( ( # Convert tuple to list, because lupdate ignores initial lists QCoreApplication.translate("AppName", "3D Builder"), QCoreApplication.translate("AppName", "3D Viewer"), QCoreApplication.translate("AppName", "Alarms and Clock"), QCoreApplication.translate("AppName", "Calculator"), QCoreApplication.translate("AppName", "Calendar and Mail"), QCoreApplication.translate("AppName", "Camera"), QCoreApplication.translate("AppName", "Feedback Hub"), QCoreApplication.translate("AppName", "Get Help"), QCoreApplication.translate("AppName", "Groove Music"), QCoreApplication.translate("AppName", "Maps"), QCoreApplication.translate("AppName", "Messaging"), QCoreApplication.translate("AppName", "Mixed Reality Portal"), QCoreApplication.translate("AppName", "Mobile Plans"), QCoreApplication.translate("AppName", "Money"), QCoreApplication.translate("AppName", "Movies && TV"), QCoreApplication.translate("AppName", "News"), QCoreApplication.translate("AppName", "Office"), QCoreApplication.translate("AppName", "OneNote"), QCoreApplication.translate("AppName", "Paint 3D"), QCoreApplication.translate("AppName", "People"), QCoreApplication.translate("AppName", "Photos"), QCoreApplication.translate("AppName", "Print 3D"), QCoreApplication.translate("AppName", "Skype"), QCoreApplication.translate("AppName", "Snip && Sketch"), QCoreApplication.translate("AppName", "Solitaire"), QCoreApplication.translate("AppName", "Sports"), QCoreApplication.translate("AppName", "Spotify"), QCoreApplication.translate("AppName", "Sticky Notes"), QCoreApplication.translate("AppName", "Tips"), QCoreApplication.translate("AppName", "Translator"), QCoreApplication.translate("AppName", "Voice Recorder"), QCoreApplication.translate("AppName", "Weather"), QCoreApplication.translate("AppName", "Xbox"), QCoreApplication.translate("AppName", "Xbox Game Bar"), QCoreApplication.translate("AppName", "Your Phone"))) self.tooltip_list = list(( QCoreApplication.translate( "ToolTip", "View, create, and personalize 3D objects."), QCoreApplication.translate( "ToolTip", "View 3D models and animations in real-time."), QCoreApplication.translate( "ToolTip", "A combination of alarm clock, world clock, timer, and stopwatch." ), QCoreApplication.translate( "ToolTip", "A calculator that includes standard, scientific, and programmer modes, as well as a unit converter." ), QCoreApplication.translate( "ToolTip", "Stay up to date with email and schedule managing."), QCoreApplication.translate( "ToolTip", "Point and shoot to take pictures on Windows 10."), QCoreApplication.translate( "ToolTip", "Provide feedback about Windows and apps by sharing suggestions or problems." ), QCoreApplication.translate( "ToolTip", "Provide a way to ask a question and get recommended solutions or contact assisted support." ), QCoreApplication.translate( "ToolTip", "Listen to music on Windows, iOS, and Android devices."), QCoreApplication.translate( "ToolTip", "Search for places to get directions, business info, and reviews." ), QCoreApplication.translate( "ToolTip", "Quick, reliable SMS, MMS and RCS messaging from your phone."), QCoreApplication.translate( "ToolTip", "Discover Windows Mixed Reality and dive into more than 3,000 games and VR experiences from Steam VR and Microsoft Store." ), QCoreApplication.translate( "ToolTip", "Sign up for a data plan and connect with mobile operators in your area. You will need a supported SIM card." ), QCoreApplication.translate( "ToolTip", "Finance calculators, currency exchange rates and commodity prices from around the world." ), QCoreApplication.translate( "ToolTip", "All your movies and TV shows, all in one place, on all your devices." ), QCoreApplication.translate( "ToolTip", "Deliver breaking news and trusted, in-depth reporting from the world\'s best journalists." ), QCoreApplication.translate( "ToolTip", "Find all your Office apps and files in one place."), QCoreApplication.translate( "ToolTip", "Digital notebook for capturing and organizing everything across your devices." ), QCoreApplication.translate( "ToolTip", "Make 2D masterpieces or 3D models that you can play with from all angles." ), QCoreApplication.translate( "ToolTip", "Connect with all your friends, family, colleagues, and acquaintances in one place." ), QCoreApplication.translate( "ToolTip", "View and edit your photos and videos, make movies, and create albums." ), QCoreApplication.translate( "ToolTip", "Quickly and easily prepare objects for 3D printing on your PC." ), QCoreApplication.translate( "ToolTip", "Instant message, voice or video call application."), QCoreApplication.translate( "ToolTip", "Quickly annotate screenshots, photos and other images and save, paste or share with other apps." ), QCoreApplication.translate( "ToolTip", "Solitaire is one of the most played computer card games of all time." ), QCoreApplication.translate( "ToolTip", "Live scores and in-depth game experiences for more than 150 leagues." ), QCoreApplication.translate( "ToolTip", "Play your favorite songs and albums free on Windows 10 with Spotify." ), QCoreApplication.translate( "ToolTip", "Create notes, type, ink or add a picture, add text formatting, or stick them to the desktop." ), QCoreApplication.translate( "ToolTip", "Provide users with information and tips about operating system features." ), QCoreApplication.translate( "ToolTip", "Translate text and speech, have translated conversations, and even download AI-powered language packs to use offline." ), QCoreApplication.translate( "ToolTip", "Record sounds, lectures, interviews, and other events."), QCoreApplication.translate( "ToolTip", "Latest weather conditions, accurate 10-day and hourly forecasts." ), QCoreApplication.translate( "ToolTip", "Browse the catalogue, view recommendations, and discover PC games with Xbox Game Pass." ), QCoreApplication.translate( "ToolTip", "Instant access to widgets for screen capture and sharing, and chatting with Xbox friends." ), QCoreApplication.translate( "ToolTip", "Link your Android phone and PC to view and reply to text messages, access mobile apps, and receive notifications." ))) self.app_data_list = [{ "name": "*Microsoft.3DBuilder*", "link": "/?PFN=Microsoft.3DBuilder_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.Microsoft3DViewer*", "link": "/?PFN=Microsoft.Microsoft3DViewer_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.WindowsAlarms*", "link": "/?PFN=Microsoft.WindowsAlarms_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.WindowsCalculator*", "link": "/?PFN=Microsoft.WindowsCalculator_8wekyb3d8bbwe", "size": 0 }, { "name": "*microsoft.windowscommunicationsapps*", "link": "/?PFN=Microsoft.windowscommunicationsapps_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.WindowsCamera*", "link": "/?PFN=Microsoft.WindowsCamera_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.WindowsFeedbackHub*", "link": "/?PFN=Microsoft.WindowsFeedbackHub_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.GetHelp*", "link": "/?PFN=Microsoft.Gethelp_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.ZuneMusic*", "link": "/?PFN=Microsoft.ZuneMusic_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.WindowsMaps*", "link": "/?PFN=Microsoft.WindowsMaps_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.Messaging*", "link": "/?PFN=Microsoft.Messaging_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.MixedReality.Portal*", "link": "/?PFN=Microsoft.MixedReality.Portal_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.OneConnect*", "link": "/?PFN=Microsoft.OneConnect_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.BingFinance*", "link": "/?PFN=Microsoft.BingFinance_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.ZuneVideo*", "link": "/?PFN=Microsoft.ZuneVideo_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.BingNews*", "link": "/?PFN=Microsoft.BingNews_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.MicrosoftOfficeHub*", "link": "/?PFN=Microsoft.MicrosoftOfficeHub_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.Office.OneNote*", "link": "/?PFN=Microsoft.Office.OneNote_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.MSPaint*", "link": "/?PFN=Microsoft.MSPaint_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.People*", "link": "/?PFN=Microsoft.People_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.Windows.Photos*", "link": "/?PFN=Microsoft.Windows.Photos_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.Print3D*", "link": "/?PFN=Microsoft.Print3D_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.SkypeApp*", "link": "/?PFN=Microsoft.SkypeApp_kzf8qxf38zg5c", "size": 0 }, { "name": "*Microsoft.ScreenSketch*", "link": "/?PFN=Microsoft.ScreenSketch_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.MicrosoftSolitaireCollection*", "link": "/?PFN=Microsoft.MicrosoftSolitaireCollection_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.BingSports*", "link": "/?PFN=Microsoft.BingSports_8wekyb3d8bbwe", "size": 0 }, { "name": "*SpotifyAB.SpotifyMusic*", "link": "/?PFN=SpotifyAB.SpotifyMusic_zpdnekdrzrea0", "size": 0 }, { "name": "*Microsoft.MicrosoftStickyNotes*", "link": "/?PFN=Microsoft.MicrosoftStickyNotes_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.Getstarted*", "link": "/?PFN=Microsoft.Getstarted_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.BingTranslator*", "link": "/?PFN=Microsoft.BingTranslator_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.WindowsSoundRecorder*", "link": "/?PFN=Microsoft.WindowsSoundRecorder_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.BingWeather*", "link": "/?PFN=Microsoft.BingWeather_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.GamingApp*", "link": "/?PFN=Microsoft.GamingApp_8wekyb3d8bbwe", "size": 0 }, { "name": "*Xbox*", "link": "/?PFN=Microsoft.XboxGameOverlay_8wekyb3d8bbwe", "size": 0 }, { "name": "*Microsoft.YourPhone*", "link": "/?PFN=Microsoft.YourPhone_8wekyb3d8bbwe", "size": 0 }] if version.parse(platform.version()) >= version.parse("10.0.19041"): insort(self.app_name_list, QCoreApplication.translate("AppName", "Cortana")) cortana_index = self.app_name_list.index("Cortana") self.tooltip_list.insert( cortana_index, QCoreApplication.translate("ToolTip", "Personal intelligence assistant.")) self.app_data_list.insert( cortana_index, { "name": "*Microsoft.549981C3F5F10*", "link": "/?PFN=Microsoft.549981C3F5F10_8wekyb3d8bbwe", "size": 0 }) self.checkbox_list = [] for i, _ in enumerate(self.app_name_list): self.checkbox_list.append(QCheckBox()) if i % 3 == 2: self.layout_checkboxes_3.addWidget(self.checkbox_list[i]) elif i % 3 == 1: self.layout_checkboxes_2.addWidget(self.checkbox_list[i]) else: self.layout_checkboxes.addWidget(self.checkbox_list[i]) self.apps_dict = {} for i, checkbox in enumerate(self.checkbox_list): checkbox.setText(self.app_name_list[i]) checkbox.setToolTip(self.tooltip_list[i]) checkbox.setFont(self.font) self.apps_dict[checkbox] = self.app_data_list[i] self.label_space.setText( QCoreApplication.translate("Label", "Total amount of disk space:")) self.label_size.setText(QCoreApplication.translate("Label", "0 MB")) self.button_select_all.setText( QCoreApplication.translate("Button", "Select All")) self.button_deselect_all.setText( QCoreApplication.translate("Button", "Deselect All")) self.button_uninstall.setText( QCoreApplication.translate("Button", "Uninstall"))
class Ui_demoView(object): def setupUi(self, demoView): if not demoView.objectName(): demoView.setObjectName(u"demoView") demoView.resize(570, 550) self.verticalLayout_2 = QVBoxLayout(demoView) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.demoViewGroupBox = QGroupBox(demoView) self.demoViewGroupBox.setObjectName(u"demoViewGroupBox") self.demoViewGroupBox.setFlat(True) self.verticalLayout_6 = QVBoxLayout(self.demoViewGroupBox) self.verticalLayout_6.setObjectName(u"verticalLayout_6") self.verticalLayout_6.setContentsMargins(4, 4, 4, 4) self.demoTreeView = QTreeWidget(self.demoViewGroupBox) __qtreewidgetitem = QTreeWidgetItem() __qtreewidgetitem.setText(0, u"Step") self.demoTreeView.setHeaderItem(__qtreewidgetitem) self.demoTreeView.setObjectName(u"demoTreeView") self.verticalLayout_6.addWidget(self.demoTreeView) self.horizontalLayout_5 = QHBoxLayout() self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") self.demoDuplicateBtn = QPushButton(self.demoViewGroupBox) self.demoDuplicateBtn.setObjectName(u"demoDuplicateBtn") self.horizontalLayout_5.addWidget(self.demoDuplicateBtn) self.demoInsertSectionBtn = QPushButton(self.demoViewGroupBox) self.demoInsertSectionBtn.setObjectName(u"demoInsertSectionBtn") self.horizontalLayout_5.addWidget(self.demoInsertSectionBtn) self.demoDeleteBtn = QPushButton(self.demoViewGroupBox) self.demoDeleteBtn.setObjectName(u"demoDeleteBtn") self.horizontalLayout_5.addWidget(self.demoDeleteBtn) self.demoAddStepBtn = QPushButton(self.demoViewGroupBox) self.demoAddStepBtn.setObjectName(u"demoAddStepBtn") self.horizontalLayout_5.addWidget(self.demoAddStepBtn) self.demoOverflowBtn = QToolButton(self.demoViewGroupBox) self.demoOverflowBtn.setObjectName(u"demoOverflowBtn") self.horizontalLayout_5.addWidget(self.demoOverflowBtn) self.verticalLayout_6.addLayout(self.horizontalLayout_5) self.verticalLayout_2.addWidget(self.demoViewGroupBox) self.metadataGroupBox = QGroupBox(demoView) self.metadataGroupBox.setObjectName(u"metadataGroupBox") self.metadataGroupBox.setMaximumSize(QSize(16777215, 300)) self.metadataGroupBox.setFlat(True) self.metadataGroupBox.setCheckable(False) self.verticalLayout_8 = QVBoxLayout(self.metadataGroupBox) self.verticalLayout_8.setObjectName(u"verticalLayout_8") self.verticalLayout_8.setContentsMargins(4, 4, 4, 4) self.dataStack = QStackedWidget(self.metadataGroupBox) self.dataStack.setObjectName(u"dataStack") self.stepDataL = QWidget() self.stepDataL.setObjectName(u"stepDataL") self.verticalLayout_14 = QVBoxLayout(self.stepDataL) self.verticalLayout_14.setObjectName(u"verticalLayout_14") self.metadataTreeWidget = QTreeWidget(self.stepDataL) self.metadataTreeWidget.setObjectName(u"metadataTreeWidget") self.verticalLayout_14.addWidget(self.metadataTreeWidget) self.stepDataBtnL = QHBoxLayout() self.stepDataBtnL.setObjectName(u"stepDataBtnL") self.pushButton_2 = QPushButton(self.stepDataL) self.pushButton_2.setObjectName(u"pushButton_2") self.stepDataBtnL.addWidget(self.pushButton_2) self.pushButton = QPushButton(self.stepDataL) self.pushButton.setObjectName(u"pushButton") self.stepDataBtnL.addWidget(self.pushButton) self.toolButton = QToolButton(self.stepDataL) self.toolButton.setObjectName(u"toolButton") self.stepDataBtnL.addWidget(self.toolButton) self.verticalLayout_14.addLayout(self.stepDataBtnL) self.dataStack.addWidget(self.stepDataL) self.sectDataL = QWidget() self.sectDataL.setObjectName(u"sectDataL") self.verticalLayout_16 = QVBoxLayout(self.sectDataL) self.verticalLayout_16.setObjectName(u"verticalLayout_16") self.sectionDataTreeW = QTreeWidget(self.sectDataL) self.sectionDataTreeW.setObjectName(u"sectionDataTreeW") self.verticalLayout_16.addWidget(self.sectionDataTreeW) self.sectionDataBtnL = QHBoxLayout() self.sectionDataBtnL.setObjectName(u"sectionDataBtnL") self.pushButton_4 = QPushButton(self.sectDataL) self.pushButton_4.setObjectName(u"pushButton_4") self.sectionDataBtnL.addWidget(self.pushButton_4) self.pushButton_3 = QPushButton(self.sectDataL) self.pushButton_3.setObjectName(u"pushButton_3") self.sectionDataBtnL.addWidget(self.pushButton_3) self.pushButton_5 = QPushButton(self.sectDataL) self.pushButton_5.setObjectName(u"pushButton_5") self.sectionDataBtnL.addWidget(self.pushButton_5) self.toolButton_2 = QToolButton(self.sectDataL) self.toolButton_2.setObjectName(u"toolButton_2") self.sectionDataBtnL.addWidget(self.toolButton_2) self.verticalLayout_16.addLayout(self.sectionDataBtnL) self.dataStack.addWidget(self.sectDataL) self.verticalLayout_8.addWidget(self.dataStack) self.verticalLayout_2.addWidget(self.metadataGroupBox) self.retranslateUi(demoView) self.dataStack.setCurrentIndex(1) QMetaObject.connectSlotsByName(demoView) # setupUi def retranslateUi(self, demoView): demoView.setWindowTitle( QCoreApplication.translate("demoView", u"Form", None)) self.demoViewGroupBox.setTitle( QCoreApplication.translate("demoView", u"Demo (None loaded)", None)) ___qtreewidgetitem = self.demoTreeView.headerItem() ___qtreewidgetitem.setText( 2, QCoreApplication.translate("demoView", u"CI", None)) ___qtreewidgetitem.setText( 1, QCoreApplication.translate("demoView", u"TP", None)) self.demoDuplicateBtn.setText( QCoreApplication.translate("demoView", u"Duplicate", None)) self.demoInsertSectionBtn.setText( QCoreApplication.translate("demoView", u"Insert section", None)) self.demoDeleteBtn.setText( QCoreApplication.translate("demoView", u"-", None)) self.demoAddStepBtn.setText( QCoreApplication.translate("demoView", u"+", None)) self.demoOverflowBtn.setText( QCoreApplication.translate("demoView", u"...", None)) self.metadataGroupBox.setTitle( QCoreApplication.translate("demoView", u"Metadata", None)) ___qtreewidgetitem1 = self.metadataTreeWidget.headerItem() ___qtreewidgetitem1.setText( 1, QCoreApplication.translate("demoView", u"Value", None)) ___qtreewidgetitem1.setText( 0, QCoreApplication.translate("demoView", u"Property", None)) self.pushButton_2.setText( QCoreApplication.translate("demoView", u"Set animated", None)) self.pushButton.setText( QCoreApplication.translate("demoView", u"Add highlight", None)) self.toolButton.setText( QCoreApplication.translate("demoView", u"...", None)) ___qtreewidgetitem2 = self.sectionDataTreeW.headerItem() ___qtreewidgetitem2.setText( 1, QCoreApplication.translate("demoView", u"Value", None)) ___qtreewidgetitem2.setText( 0, QCoreApplication.translate("demoView", u"Property", None)) self.pushButton_4.setText( QCoreApplication.translate("demoView", u"Set Animated", None)) self.pushButton_3.setText( QCoreApplication.translate("demoView", u"Set Guided", None)) self.pushButton_5.setText( QCoreApplication.translate("demoView", u"Set Scroll", None)) self.toolButton_2.setText( QCoreApplication.translate("demoView", u"...", None))
class MineSweeper(QMainWindow): def __init__(self): super().__init__() self.undiscovered_color: str = "#000000" self.discovered_color: str = "#d9d9d9" self.win_timer_color: str = "#e30e0e" self.lose_timer_color: str = "#0cc431" self.curr_time = QTime(00,00,00) self.timer = QTimer() self.timer.timeout.connect(self.time) self.timer_already_started = False self.solved: bool = False self.player_ended: bool = False self.theme: str = "dark" self.list_of_mines: list = [] self.difficulty_slider_default_value: int = 2 self.number_of_mines: int = mines_number(NUMBER_OF_LABELS, self.difficulty_slider_default_value) self.create_GUI() def create_GUI(self) -> None: self.setWindowTitle("MineSweeper 1.1") self.win_massage = QMessageBox(self) self.win_massage.setText("Gratuluji, dokázal jsi nalézt všechny miny") self.setMouseTracking(True) centralWidget = QWidget(self) centralWidget.setStyleSheet("background: white") self.setCentralWidget(centralWidget) self.setFixedSize(X_WINDOW_SIZE + 20, Y_WINDOW_SIZE) layout = QGridLayout(centralWidget) layout.setSpacing(0) layout.setContentsMargins(0, 0, 0, 0) centralWidget.setLayout(layout) self.list_of_labels: list = [] self.list_of_mines = generate_mines(self.number_of_mines, X_SIZE, Y_SIZE) # RESET BUTTON self.reset_button = QPushButton(centralWidget) self.reset_button.setText("RESET") self.reset_button.clicked.connect(self.reset) self.reset_button.setStyleSheet("margin: 3px") self.reset_button.setMinimumSize(0, 50) # TIMER LABEL self.timer_label = QLabel(centralWidget) self.timer_label.setText(f"{self.curr_time.minute():0>2}:{self.curr_time.second():0>2}") self.timer_label.setAlignment(Qt.AlignHCenter) self.timer_label.setStyleSheet("font: 34px") # DIFFICULTY SLIDER self.difficulty_slider = QSlider(centralWidget) self.difficulty_slider.setOrientation(Qt.Horizontal) self.difficulty_slider.setFixedHeight(30) self.difficulty_slider.setRange(1, 10) self.difficulty_slider.setTickInterval(1) self.difficulty_slider.setValue(self.difficulty_slider_default_value) self.difficulty_slider.valueChanged.connect(self.difficulty_label_set) self.difficulty_slider.sliderReleased.connect(self.new_mines_set) # DIFFICULTY LABEL self.difficulty_label = QLabel(centralWidget) self.difficulty_label.setText(str(self.difficulty_slider_default_value)) self.difficulty_label.setAlignment(Qt.AlignCenter) self.difficulty_label.setStyleSheet("font: 20px") for i in range(Y_SIZE): row = [] for j in range(X_SIZE): if (i, j) in self.list_of_mines: mine = True else: mine = False label = Chunk(j, i, mine) label.setFixedSize(FIELD_SQUARE_SIZE, FIELD_SQUARE_SIZE) label.setStyleSheet(f"background: {self.undiscovered_color}; border: 1px solid grey") layout.addWidget(label, i, j) row.append(label) self.list_of_labels.append(row) self.color_theme_combobox = QComboBox(centralWidget) self.color_theme_combobox.addItem("Dark theme", "dark") self.color_theme_combobox.addItem("Light theme", "light") self.color_theme_combobox.addItem("Color theme", "colorful") self.color_theme_combobox.currentIndexChanged.connect(self.theme_change) self.color_theme_combobox.setMinimumHeight(FIELD_SQUARE_SIZE * 2) if self.theme == "dark": self.color_theme_combobox.setCurrentIndex(0) elif self.theme == "light": self.color_theme_combobox.setCurrentIndex(1) else: self.color_theme_combobox.setCurrentIndex(2) layout.addWidget(self.color_theme_combobox, Y_SIZE - 2, X_SIZE, 2, 1) layout.addWidget(self.timer_label, 0, X_SIZE, 3, 1) layout.addWidget(self.reset_button, 2, X_SIZE, 3, 1) layout.addWidget(self.difficulty_slider, Y_SIZE, 1, 1, X_SIZE - 2) layout.addWidget(self.difficulty_label, Y_SIZE, X_SIZE, 1, 1) self.mines_number_surroundings_calculate() def theme_change(self) -> None: if self.color_theme_combobox.currentData() == "light": self.undiscovered_color = LIGHT_THEME["undiscovered_color"] self.discovered_color = LIGHT_THEME["discovered_color"] self.win_timer_color = LIGHT_THEME["win_timer_color"] self.lose_timer_color = LIGHT_THEME["lose_timer_color"] self.theme = "light" if self.color_theme_combobox.currentData() == "dark": self.undiscovered_color = DARK_THEME["undiscovered_color"] self.discovered_color = DARK_THEME["discovered_color"] self.win_timer_color = DARK_THEME["win_timer_color"] self.lose_timer_color = DARK_THEME["lose_timer_color"] self.theme = "dark" if self.color_theme_combobox.currentData() == "colorful": self.undiscovered_color = COLOR_THEME["undiscovered_color"] self.discovered_color = COLOR_THEME["discovered_color"] self.win_timer_color = COLOR_THEME["win_timer_color"] self.lose_timer_color = COLOR_THEME["lose_timer_color"] self.theme = "colorful" for y in range(Y_SIZE): for x in range(X_SIZE): if self.list_of_labels[y][x].marked: pass elif not self.list_of_labels[y][x].discovered: self.list_of_labels[y][x].setStyleSheet(f"background: {self.undiscovered_color}; border: 1px solid grey") elif self.list_of_labels[y][x].discovered: self.list_of_labels[y][x].setStyleSheet(f"background: {self.discovered_color}; border: 1px solid grey") def difficulty_label_set(self): self.difficulty_label.setText(str(self.difficulty_slider.value())) def mousePressEvent(self, QMouseEvent) -> None: if not self.player_ended: y = QMouseEvent.pos().x() x = QMouseEvent.pos().y() if not (x > X_GRID_SIZE or y > Y_GRID_SIZE): x = closest_smaller_number(x, Y_POSSIBLE_VALUES) y = closest_smaller_number(y, X_POSSIBLE_VALUES) x = int(x // FIELD_SQUARE_SIZE) y = int(y // FIELD_SQUARE_SIZE) if QMouseEvent.button() == Qt.LeftButton: if self.list_of_labels[x][y].mine: self.stop_timer() if not self.player_ended: self.list_of_labels[x][y].discovered = True self.list_of_labels[x][y].setStyleSheet(f"background: {self.discovered_color}; border: 1px solid grey") self.list_of_labels[x][y].setPixmap(QPixmap("C:/Data/python/miny/pracovní verze/pictures/bomb_small.png")) self.win_massage.about(self, "PROHRA", "Tentokrát se to bohužel nepovedlo, snad to vyjde příště.") self.player_ended = True else: if not self.timer_already_started: self.start_timer() self.timer_already_started = True self.list_of_labels[x][y].discovered = True self.list_of_labels[x][y].setStyleSheet(f"background: {self.discovered_color}; border: 1px solid grey") self.reveal_area(y, x) self.solved_check() else: if not self.list_of_labels[x][y].discovered: if self.list_of_labels[x][y].marked: self.list_of_labels[x][y].setStyleSheet(f"background: {self.undiscovered_color}; border: 1px solid grey") self.list_of_labels[x][y].marked = False else: self.list_of_labels[x][y].setStyleSheet("background: orange; border: 1px solid grey") self.list_of_labels[x][y].marked = True def mines_number_surroundings_calculate(self) -> None: for x in range(X_SIZE): for y in range(Y_SIZE): self.list_of_labels[x][y].mines_number_surroundings = 0 for i in range(x - 1, x + 2): for j in range(y - 1, y + 2): try: if self.list_of_labels[i][j].mine and i >= 0 and j >= 0: if not (i == x and j == y): self.list_of_labels[x][y].mines_number_surroundings += 1 except IndexError: pass def new_mines_set(self): self.number_of_mines = mines_number(NUMBER_OF_LABELS, self.difficulty_slider.value()) self.list_of_mines = generate_mines(self.number_of_mines, X_SIZE, Y_SIZE) for y in range(Y_SIZE): for x in range(X_SIZE): if (y, x) in self.list_of_mines: self.list_of_labels[y][x].mine = True else: self.list_of_labels[y][x].mine = False self.mines_number_surroundings_calculate() self.label_set() def label_set(self) -> None: for y in range(Y_SIZE): for x in range(X_SIZE): if self.list_of_labels[y][x].discovered: if self.list_of_labels[y][x].mines_number_surroundings == 0: pass else: self.list_of_labels[y][x].setText(str(self.list_of_labels[y][x].mines_number_surroundings)) def reveal_area(self, x: int, y: int) -> None: if self.list_of_labels[y][x].mines_number_surroundings == 0: try: extract = self.list_of_labels[y - 1][x] if not extract.mine and Y_SIZE > y - 1 >= 0 and not extract.discovered: self.list_of_labels[y - 1][x].setStyleSheet(f"background: {self.discovered_color}; border: 1px solid grey") self.list_of_labels[y - 1][x].discovered = True if extract.mines_number_surroundings == 0: self.reveal_area(x, y - 1) except IndexError: pass try: extract = self.list_of_labels[y + 1][x] if not extract.mine and Y_SIZE > y + 1 >= 0 and not extract.discovered: self.list_of_labels[y + 1][x].setStyleSheet(f"background: {self.discovered_color}; border: 1px solid grey") self.list_of_labels[y + 1][x].discovered = True if extract.mines_number_surroundings == 0: self.reveal_area(x, y + 1) except IndexError: pass try: extract = self.list_of_labels[y][x + 1] if not extract.mine and X_SIZE > x + 1 >= 0 and not extract.discovered: self.list_of_labels[y][x + 1].setStyleSheet(f"background: {self.discovered_color}; border: 1px solid grey") self.list_of_labels[y][x + 1].discovered = True if extract.mines_number_surroundings == 0: self.reveal_area(x + 1, y) except IndexError: pass try: extract = self.list_of_labels[y][x - 1] if not extract.mine and X_SIZE - 1 > x - 1 >= 0 and not extract.discovered: self.list_of_labels[y][x - 1].setStyleSheet(f"background: {self.discovered_color}; border: 1px solid grey") self.list_of_labels[y][x - 1].discovered = True if extract.mines_number_surroundings == 0: self.reveal_area(x - 1, y) except IndexError: pass self.label_set() def solved_check(self) -> None: for element in self.list_of_labels: for part in element: if not part.mine and not part.discovered: return self.solved = True self.stop_timer() if not self.player_ended: self.player_ended = True self.win_massage.about(self, "VÝHRA", f"Gratuluji, zvládl/a jsi vyřešit tento problém. Zvládl/a jsi to za {self.curr_time.minute():0>2}:{self.curr_time.second():0>2}") # TIMER FUNCIONS def start_timer(self) -> None: self.difficulty_slider.setDisabled(True) self.timer.start(1000) def stop_timer(self) -> None: self.timer.stop() if not self.solved: self.timer_label.setStyleSheet(f"font: 34px; color: {self.win_timer_color}") else: self.timer_label.setStyleSheet(f"font: 34px; color: {self.lose_timer_color}") def time(self) -> None: self.curr_time = self.curr_time.addSecs(1) self.timer_label.setText(f"{self.curr_time.minute():0>2}:{self.curr_time.second():0>2}") #RESET def reset(self) -> None: self.timer = QTimer() self.curr_time = QTime(00,00,00) self.timer.timeout.connect(self.time) self.solved = False self.timer_already_started = False self.player_ended = False self.difficulty_slider.setDisabled(False) self.difficulty_slider_default_value = self.difficulty_slider.value() self.create_GUI()
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
class Ui_ProfilesDialog_UI(object): def setupUi(self, ProfilesDialog_UI): if not ProfilesDialog_UI.objectName(): ProfilesDialog_UI.setObjectName(u"ProfilesDialog_UI") ProfilesDialog_UI.resize(594, 639) self.gridLayout_2 = QGridLayout(ProfilesDialog_UI) self.gridLayout_2.setObjectName(u"gridLayout_2") self.button_create = QToolButton(ProfilesDialog_UI) self.button_create.setObjectName(u"button_create") icon = QIcon() iconThemeName = u"document-new" if QIcon.hasThemeIcon(iconThemeName): icon = QIcon.fromTheme(iconThemeName) else: icon.addFile(u".", QSize(), QIcon.Normal, QIcon.Off) self.button_create.setIcon(icon) self.gridLayout_2.addWidget(self.button_create, 0, 4, 1, 1) self.label = QLabel(ProfilesDialog_UI) self.label.setObjectName(u"label") self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1) self.button_delete = QToolButton(ProfilesDialog_UI) self.button_delete.setObjectName(u"button_delete") self.button_delete.setEnabled(False) icon1 = QIcon() iconThemeName = u"delete" if QIcon.hasThemeIcon(iconThemeName): icon1 = QIcon.fromTheme(iconThemeName) else: icon1.addFile(u".", QSize(), QIcon.Normal, QIcon.Off) self.button_delete.setIcon(icon1) self.gridLayout_2.addWidget(self.button_delete, 0, 6, 1, 1) self.properties = QGroupBox(ProfilesDialog_UI) self.properties.setObjectName(u"properties") self.gridLayout = QGridLayout(self.properties) self.gridLayout.setObjectName(u"gridLayout") self.aspect_den = QSpinBox(self.properties) self.aspect_den.setObjectName(u"aspect_den") self.aspect_den.setMinimum(1) self.aspect_den.setMaximum(10000) self.gridLayout.addWidget(self.aspect_den, 4, 3, 1, 1) self.size_w = QSpinBox(self.properties) self.size_w.setObjectName(u"size_w") self.size_w.setMinimum(1) self.size_w.setMaximum(10000) self.gridLayout.addWidget(self.size_w, 1, 1, 1, 1) self.size_h = QSpinBox(self.properties) self.size_h.setObjectName(u"size_h") self.size_h.setMinimum(1) self.size_h.setMaximum(10000) self.gridLayout.addWidget(self.size_h, 1, 3, 1, 1) self.fields = QLabel(self.properties) self.fields.setObjectName(u"fields") self.fields.setText(u"interl: 2*fps") self.gridLayout.addWidget(self.fields, 3, 3, 1, 1) self.label_dar = QLabel(self.properties) self.label_dar.setObjectName(u"label_dar") self.label_dar.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) self.gridLayout.addWidget(self.label_dar, 5, 0, 1, 1) self.label_3 = QLabel(self.properties) self.label_3.setObjectName(u"label_3") self.label_3.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1) self.description = QLineEdit(self.properties) self.description.setObjectName(u"description") self.gridLayout.addWidget(self.description, 0, 1, 1, 3) self.colorspace = KComboBox(self.properties) self.colorspace.setObjectName(u"colorspace") self.gridLayout.addWidget(self.colorspace, 7, 1, 1, 3) self.label_8 = QLabel(self.properties) self.label_8.setObjectName(u"label_8") sizePolicy = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.label_8.sizePolicy().hasHeightForWidth()) self.label_8.setSizePolicy(sizePolicy) self.gridLayout.addWidget(self.label_8, 5, 2, 1, 1) self.field_order = QComboBox(self.properties) self.field_order.addItem("") self.field_order.addItem("") self.field_order.setObjectName(u"field_order") self.gridLayout.addWidget(self.field_order, 9, 1, 1, 3) self.display_num = QSpinBox(self.properties) self.display_num.setObjectName(u"display_num") self.display_num.setMinimum(1) self.display_num.setMaximum(10000) self.gridLayout.addWidget(self.display_num, 5, 1, 1, 1) self.label_scanning = QLabel(self.properties) self.label_scanning.setObjectName(u"label_scanning") self.label_scanning.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) self.gridLayout.addWidget(self.label_scanning, 8, 0, 1, 1) self.label_4 = QLabel(self.properties) self.label_4.setObjectName(u"label_4") sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth()) self.label_4.setSizePolicy(sizePolicy) self.gridLayout.addWidget(self.label_4, 2, 2, 1, 1) self.aspect_num = QSpinBox(self.properties) self.aspect_num.setObjectName(u"aspect_num") self.aspect_num.setMinimum(1) self.aspect_num.setMaximum(10000) self.gridLayout.addWidget(self.aspect_num, 4, 1, 1, 1) self.label_6 = QLabel(self.properties) self.label_6.setObjectName(u"label_6") sizePolicy.setHeightForWidth(self.label_6.sizePolicy().hasHeightForWidth()) self.label_6.setSizePolicy(sizePolicy) self.gridLayout.addWidget(self.label_6, 1, 2, 1, 1) self.label_2 = QLabel(self.properties) self.label_2.setObjectName(u"label_2") self.label_2.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1) self.scanning = QComboBox(self.properties) self.scanning.addItem("") self.scanning.addItem("") self.scanning.setObjectName(u"scanning") self.gridLayout.addWidget(self.scanning, 8, 1, 1, 3) self.frame_num = QSpinBox(self.properties) self.frame_num.setObjectName(u"frame_num") self.frame_num.setMinimum(1) self.frame_num.setMaximum(500000) self.gridLayout.addWidget(self.frame_num, 2, 1, 1, 1) self.display_den = QSpinBox(self.properties) self.display_den.setObjectName(u"display_den") self.display_den.setMinimum(1) self.display_den.setMaximum(10000) self.gridLayout.addWidget(self.display_den, 5, 3, 1, 1) self.verticalSpacer = QSpacerItem(105, 17, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout.addItem(self.verticalSpacer, 11, 0, 1, 2) self.label_9 = QLabel(self.properties) self.label_9.setObjectName(u"label_9") self.label_9.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) self.gridLayout.addWidget(self.label_9, 4, 0, 1, 1) self.label_12 = QLabel(self.properties) self.label_12.setObjectName(u"label_12") self.label_12.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) self.gridLayout.addWidget(self.label_12, 7, 0, 1, 1) self.label_5 = QLabel(self.properties) self.label_5.setObjectName(u"label_5") self.label_5.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) self.gridLayout.addWidget(self.label_5, 1, 0, 1, 1) self.label_field_order = QLabel(self.properties) self.label_field_order.setObjectName(u"label_field_order") self.label_field_order.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) self.gridLayout.addWidget(self.label_field_order, 9, 0, 1, 1) self.label_7 = QLabel(self.properties) self.label_7.setObjectName(u"label_7") sizePolicy.setHeightForWidth(self.label_7.sizePolicy().hasHeightForWidth()) self.label_7.setSizePolicy(sizePolicy) self.gridLayout.addWidget(self.label_7, 4, 2, 1, 1) self.frame_den = QSpinBox(self.properties) self.frame_den.setObjectName(u"frame_den") self.frame_den.setMinimum(1) self.frame_den.setMaximum(10000) self.gridLayout.addWidget(self.frame_den, 2, 3, 1, 1) self.label_11 = QLabel(self.properties) self.label_11.setObjectName(u"label_11") self.label_11.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) self.gridLayout.addWidget(self.label_11, 3, 0, 1, 1) self.effect_warning = KMessageWidget(self.properties) self.effect_warning.setObjectName(u"effect_warning") self.effect_warning.setWordWrap(True) self.effect_warning.setCloseButtonVisible(False) self.effect_warning.setMessageType(KMessageWidget.Warning) self.gridLayout.addWidget(self.effect_warning, 10, 1, 1, 3) self.gridLayout_2.addWidget(self.properties, 1, 0, 1, 8) self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.gridLayout_2.addItem(self.horizontalSpacer, 0, 3, 1, 1) self.button_save = QToolButton(ProfilesDialog_UI) self.button_save.setObjectName(u"button_save") self.button_save.setEnabled(False) icon2 = QIcon() iconThemeName = u"document-save" if QIcon.hasThemeIcon(iconThemeName): icon2 = QIcon.fromTheme(iconThemeName) else: icon2.addFile(u".", QSize(), QIcon.Normal, QIcon.Off) self.button_save.setIcon(icon2) self.gridLayout_2.addWidget(self.button_save, 0, 5, 1, 1) self.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.gridLayout_2.addItem(self.horizontalSpacer_2, 3, 3, 1, 2) self.buttonBox = QDialogButtonBox(ProfilesDialog_UI) self.buttonBox.setObjectName(u"buttonBox") self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Close) self.gridLayout_2.addWidget(self.buttonBox, 3, 5, 1, 3) self.profiles_list = QComboBox(ProfilesDialog_UI) self.profiles_list.setObjectName(u"profiles_list") self.gridLayout_2.addWidget(self.profiles_list, 0, 1, 1, 1) self.button_default = QPushButton(ProfilesDialog_UI) self.button_default.setObjectName(u"button_default") self.gridLayout_2.addWidget(self.button_default, 3, 0, 1, 3) self.info_message = KMessageWidget(ProfilesDialog_UI) self.info_message.setObjectName(u"info_message") self.info_message.setWordWrap(True) self.gridLayout_2.addWidget(self.info_message, 2, 0, 1, 8) self.retranslateUi(ProfilesDialog_UI) self.buttonBox.accepted.connect(ProfilesDialog_UI.accept) self.buttonBox.rejected.connect(ProfilesDialog_UI.reject) QMetaObject.connectSlotsByName(ProfilesDialog_UI) # setupUi def retranslateUi(self, ProfilesDialog_UI): ProfilesDialog_UI.setWindowTitle(QCoreApplication.translate("ProfilesDialog_UI", u"Profiles", None)) #if QT_CONFIG(tooltip) self.button_create.setToolTip(QCoreApplication.translate("ProfilesDialog_UI", u"Create new profile", None)) #endif // QT_CONFIG(tooltip) self.button_create.setText(QCoreApplication.translate("ProfilesDialog_UI", u"C", None)) self.label.setText(QCoreApplication.translate("ProfilesDialog_UI", u"Profile:", None)) #if QT_CONFIG(tooltip) self.button_delete.setToolTip(QCoreApplication.translate("ProfilesDialog_UI", u"Delete profile", None)) #endif // QT_CONFIG(tooltip) self.button_delete.setText(QCoreApplication.translate("ProfilesDialog_UI", u"D", None)) self.properties.setTitle(QCoreApplication.translate("ProfilesDialog_UI", u"Properties", None)) self.label_dar.setText(QCoreApplication.translate("ProfilesDialog_UI", u"Display aspect ratio:", None)) self.label_3.setText(QCoreApplication.translate("ProfilesDialog_UI", u"Frame rate:", None)) self.label_8.setText(QCoreApplication.translate("ProfilesDialog_UI", u"/", None)) self.field_order.setItemText(0, QCoreApplication.translate("ProfilesDialog_UI", u"Top Field First", None)) self.field_order.setItemText(1, QCoreApplication.translate("ProfilesDialog_UI", u"Bottom Field First", None)) self.label_scanning.setText(QCoreApplication.translate("ProfilesDialog_UI", u"Scanning:", None)) self.label_4.setText(QCoreApplication.translate("ProfilesDialog_UI", u"/", None)) self.label_6.setText(QCoreApplication.translate("ProfilesDialog_UI", u"x", None)) self.label_2.setText(QCoreApplication.translate("ProfilesDialog_UI", u"Description:", None)) self.scanning.setItemText(0, QCoreApplication.translate("ProfilesDialog_UI", u"Interlaced", None)) self.scanning.setItemText(1, QCoreApplication.translate("ProfilesDialog_UI", u"Progressive", None)) self.label_9.setText(QCoreApplication.translate("ProfilesDialog_UI", u"Pixel aspect ratio:", None)) self.label_12.setText(QCoreApplication.translate("ProfilesDialog_UI", u"Colorspace:", None)) self.label_5.setText(QCoreApplication.translate("ProfilesDialog_UI", u"Size:", None)) self.label_field_order.setText(QCoreApplication.translate("ProfilesDialog_UI", u"Field order:", None)) self.label_7.setText(QCoreApplication.translate("ProfilesDialog_UI", u"/", None)) self.label_11.setText(QCoreApplication.translate("ProfilesDialog_UI", u"Fields per second:", None)) self.effect_warning.setText(QCoreApplication.translate("ProfilesDialog_UI", u"The \"avfilter.fieldorder\" effect is internally used to set the field order, but the effect was not found.\n" "This feature will not work as expected.", None)) #if QT_CONFIG(tooltip) self.button_save.setToolTip(QCoreApplication.translate("ProfilesDialog_UI", u"Save profile", None)) #endif // QT_CONFIG(tooltip) self.button_save.setText(QCoreApplication.translate("ProfilesDialog_UI", u"S", None)) self.button_default.setText(QCoreApplication.translate("ProfilesDialog_UI", u"Use as default", None))
class Ui_MainWindow(object): def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") MainWindow.setWindowModality(Qt.ApplicationModal) MainWindow.resize(1492, 1852) sizePolicy = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth()) MainWindow.setSizePolicy(sizePolicy) MainWindow.setMinimumSize(QSize(700, 700)) MainWindow.setMaximumSize(QSize(16777215, 16777215)) MainWindow.setBaseSize(QSize(600, 600)) font = QFont() font.setPointSize(12) font.setKerning(True) MainWindow.setFont(font) MainWindow.setAutoFillBackground(False) MainWindow.setStyleSheet(u"") MainWindow.setDocumentMode(False) MainWindow.setTabShape(QTabWidget.Rounded) MainWindow.setDockOptions(QMainWindow.AllowTabbedDocks|QMainWindow.AnimatedDocks) MainWindow.setUnifiedTitleAndToolBarOnMac(False) self.action_Quit = QAction(MainWindow) self.action_Quit.setObjectName(u"action_Quit") self.main_widget = QWidget(MainWindow) self.main_widget.setObjectName(u"main_widget") self.main_widget.setEnabled(True) self.main_widget.setMinimumSize(QSize(650, 650)) self.main_widget.setContextMenuPolicy(Qt.DefaultContextMenu) self.main_widget.setAutoFillBackground(False) self.main_widget.setStyleSheet(u"") self.main_layout = QGridLayout(self.main_widget) self.main_layout.setObjectName(u"main_layout") self.horizontalLayout_2 = QHBoxLayout() self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.log_button = QPushButton(self.main_widget) self.log_button.setObjectName(u"log_button") sizePolicy1 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth(self.log_button.sizePolicy().hasHeightForWidth()) self.log_button.setSizePolicy(sizePolicy1) self.log_button.setMinimumSize(QSize(24, 24)) font1 = QFont() font1.setPointSize(9) font1.setBold(True) font1.setKerning(True) self.log_button.setFont(font1) self.log_button.setCursor(QCursor(Qt.PointingHandCursor)) self.log_button.setCheckable(False) self.log_button.setFlat(True) self.horizontalLayout_2.addWidget(self.log_button) self.main_layout.addLayout(self.horizontalLayout_2, 5, 2, 1, 1) self.shuttle_widget = QWidget(self.main_widget) self.shuttle_widget.setObjectName(u"shuttle_widget") self.shuttle_widget.setMinimumSize(QSize(600, 600)) self.shuttle_widget.setMaximumSize(QSize(600, 600)) self.shuttle_widget.setAutoFillBackground(False) self.shuttle_widget.setStyleSheet(u"QWidget#shuttle_widget {background: url(images/ShuttleXpress_Black.png);\n" " background-repeat:no-repeat;}\n" " ") self.button_1 = QCheckBox(self.shuttle_widget) self.button_1.setObjectName(u"button_1") self.button_1.setGeometry(QRect(80, 266, 24, 24)) sizePolicy1.setHeightForWidth(self.button_1.sizePolicy().hasHeightForWidth()) self.button_1.setSizePolicy(sizePolicy1) self.button_1.setMinimumSize(QSize(24, 24)) self.button_1.setFont(font) self.button_1.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.usb_status = QPushButton(self.shuttle_widget) self.usb_status.setObjectName(u"usb_status") self.usb_status.setEnabled(False) self.usb_status.setGeometry(QRect(288, 10, 24, 24)) sizePolicy1.setHeightForWidth(self.usb_status.sizePolicy().hasHeightForWidth()) self.usb_status.setSizePolicy(sizePolicy1) self.usb_status.setMinimumSize(QSize(24, 24)) self.usb_status.setFont(font1) self.usb_status.setCursor(QCursor(Qt.ArrowCursor)) self.usb_status.setAutoFillBackground(False) self.usb_status.setText(u"") icon = QIcon() icon.addFile(u"images/usb_black_24.png", QSize(), QIcon.Disabled, QIcon.Off) icon.addFile(u"images/usb_white_24.png", QSize(), QIcon.Disabled, QIcon.On) self.usb_status.setIcon(icon) self.usb_status.setIconSize(QSize(24, 24)) self.usb_status.setCheckable(True) self.usb_status.setChecked(False) self.usb_status.setFlat(True) self.button_5 = QCheckBox(self.shuttle_widget) self.button_5.setObjectName(u"button_5") self.button_5.setGeometry(QRect(498, 266, 24, 24)) sizePolicy1.setHeightForWidth(self.button_5.sizePolicy().hasHeightForWidth()) self.button_5.setSizePolicy(sizePolicy1) self.button_5.setMinimumSize(QSize(24, 24)) self.button_5.setFont(font) self.button_5.setLayoutDirection(Qt.RightToLeft) self.button_5.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.wheel_pos4 = QRadioButton(self.shuttle_widget) self.wheel_pos4.setObjectName(u"wheel_pos4") self.wheel_pos4.setGeometry(QRect(382, 164, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_pos4.sizePolicy().hasHeightForWidth()) self.wheel_pos4.setSizePolicy(sizePolicy1) self.wheel_pos4.setMinimumSize(QSize(24, 24)) self.wheel_pos4.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.wheel_cent0 = QRadioButton(self.shuttle_widget) self.wheel_cent0.setObjectName(u"wheel_cent0") self.wheel_cent0.setGeometry(QRect(289, 130, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_cent0.sizePolicy().hasHeightForWidth()) self.wheel_cent0.setSizePolicy(sizePolicy1) self.wheel_cent0.setMinimumSize(QSize(24, 24)) self.wheel_cent0.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.wheel_cent0.setChecked(True) self.wheel_pos1 = QRadioButton(self.shuttle_widget) self.wheel_pos1.setObjectName(u"wheel_pos1") self.wheel_pos1.setGeometry(QRect(314, 133, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_pos1.sizePolicy().hasHeightForWidth()) self.wheel_pos1.setSizePolicy(sizePolicy1) self.wheel_pos1.setMinimumSize(QSize(24, 24)) self.wheel_pos1.setStyleSheet(u"color: white;") self.wheel_pos2 = QRadioButton(self.shuttle_widget) self.wheel_pos2.setObjectName(u"wheel_pos2") self.wheel_pos2.setGeometry(QRect(338, 139, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_pos2.sizePolicy().hasHeightForWidth()) self.wheel_pos2.setSizePolicy(sizePolicy1) self.wheel_pos2.setMinimumSize(QSize(24, 24)) self.wheel_pos2.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.dial = QDial(self.shuttle_widget) self.dial.setObjectName(u"dial") self.dial.setGeometry(QRect(197, 178, 216, 216)) sizePolicy2 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred) sizePolicy2.setHorizontalStretch(0) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth(self.dial.sizePolicy().hasHeightForWidth()) self.dial.setSizePolicy(sizePolicy2) self.dial.setMinimumSize(QSize(24, 24)) self.dial.setAutoFillBackground(False) self.dial.setStyleSheet(u"background-color: black;") self.dial.setMinimum(0) self.dial.setMaximum(10) self.dial.setPageStep(1) self.dial.setValue(5) self.dial.setSliderPosition(5) self.dial.setInvertedAppearance(False) self.dial.setInvertedControls(False) self.dial.setWrapping(True) self.dial.setNotchTarget(3.700000000000000) self.dial.setNotchesVisible(False) self.wheel_neg6 = QRadioButton(self.shuttle_widget) self.wheel_neg6.setObjectName(u"wheel_neg6") self.wheel_neg6.setGeometry(QRect(162, 204, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_neg6.sizePolicy().hasHeightForWidth()) self.wheel_neg6.setSizePolicy(sizePolicy1) self.wheel_neg6.setMinimumSize(QSize(24, 24)) self.wheel_neg6.setStyleSheet(u"color: white;") self.wheel_pos5 = QRadioButton(self.shuttle_widget) self.wheel_pos5.setObjectName(u"wheel_pos5") self.wheel_pos5.setGeometry(QRect(400, 182, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_pos5.sizePolicy().hasHeightForWidth()) self.wheel_pos5.setSizePolicy(sizePolicy1) self.wheel_pos5.setMinimumSize(QSize(24, 24)) self.wheel_pos5.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.button_2 = QCheckBox(self.shuttle_widget) self.button_2.setObjectName(u"button_2") self.button_2.setGeometry(QRect(156, 122, 24, 24)) sizePolicy1.setHeightForWidth(self.button_2.sizePolicy().hasHeightForWidth()) self.button_2.setSizePolicy(sizePolicy1) self.button_2.setMinimumSize(QSize(24, 24)) self.button_2.setFont(font) self.button_2.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.wheel_neg5 = QRadioButton(self.shuttle_widget) self.wheel_neg5.setObjectName(u"wheel_neg5") self.wheel_neg5.setGeometry(QRect(178, 182, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_neg5.sizePolicy().hasHeightForWidth()) self.wheel_neg5.setSizePolicy(sizePolicy1) self.wheel_neg5.setMinimumSize(QSize(24, 24)) self.wheel_neg5.setStyleSheet(u"color: white;") self.wheel_pos6 = QRadioButton(self.shuttle_widget) self.wheel_pos6.setObjectName(u"wheel_pos6") self.wheel_pos6.setGeometry(QRect(416, 204, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_pos6.sizePolicy().hasHeightForWidth()) self.wheel_pos6.setSizePolicy(sizePolicy1) self.wheel_pos6.setMinimumSize(QSize(24, 24)) self.wheel_pos6.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.wheel_neg1 = QRadioButton(self.shuttle_widget) self.wheel_neg1.setObjectName(u"wheel_neg1") self.wheel_neg1.setGeometry(QRect(264, 133, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_neg1.sizePolicy().hasHeightForWidth()) self.wheel_neg1.setSizePolicy(sizePolicy1) self.wheel_neg1.setMinimumSize(QSize(24, 24)) self.wheel_neg1.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.button_4 = QCheckBox(self.shuttle_widget) self.button_4.setObjectName(u"button_4") self.button_4.setGeometry(QRect(430, 122, 24, 24)) sizePolicy1.setHeightForWidth(self.button_4.sizePolicy().hasHeightForWidth()) self.button_4.setSizePolicy(sizePolicy1) self.button_4.setMinimumSize(QSize(24, 24)) self.button_4.setFont(font) self.button_4.setLayoutDirection(Qt.RightToLeft) self.button_4.setAutoFillBackground(False) self.button_4.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.wheel_pos7 = QRadioButton(self.shuttle_widget) self.wheel_pos7.setObjectName(u"wheel_pos7") self.wheel_pos7.setGeometry(QRect(427, 229, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_pos7.sizePolicy().hasHeightForWidth()) self.wheel_pos7.setSizePolicy(sizePolicy1) self.wheel_pos7.setMinimumSize(QSize(24, 24)) self.wheel_pos7.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.button_3 = QCheckBox(self.shuttle_widget) self.button_3.setObjectName(u"button_3") self.button_3.setGeometry(QRect(290, 72, 24, 24)) sizePolicy1.setHeightForWidth(self.button_3.sizePolicy().hasHeightForWidth()) self.button_3.setSizePolicy(sizePolicy1) self.button_3.setMinimumSize(QSize(24, 24)) self.button_3.setFont(font) self.button_3.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.button_3.setTristate(False) self.wheel_neg2 = QRadioButton(self.shuttle_widget) self.wheel_neg2.setObjectName(u"wheel_neg2") self.wheel_neg2.setGeometry(QRect(240, 139, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_neg2.sizePolicy().hasHeightForWidth()) self.wheel_neg2.setSizePolicy(sizePolicy1) self.wheel_neg2.setMinimumSize(QSize(24, 24)) self.wheel_neg2.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.wheel_pos3 = QRadioButton(self.shuttle_widget) self.wheel_pos3.setObjectName(u"wheel_pos3") self.wheel_pos3.setGeometry(QRect(361, 149, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_pos3.sizePolicy().hasHeightForWidth()) self.wheel_pos3.setSizePolicy(sizePolicy1) self.wheel_pos3.setMinimumSize(QSize(24, 24)) self.wheel_pos3.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.wheel_neg3 = QRadioButton(self.shuttle_widget) self.wheel_neg3.setObjectName(u"wheel_neg3") self.wheel_neg3.setGeometry(QRect(217, 149, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_neg3.sizePolicy().hasHeightForWidth()) self.wheel_neg3.setSizePolicy(sizePolicy1) self.wheel_neg3.setMinimumSize(QSize(24, 24)) self.wheel_neg3.setStyleSheet(u"color: white;") self.wheel_neg4 = QRadioButton(self.shuttle_widget) self.wheel_neg4.setObjectName(u"wheel_neg4") self.wheel_neg4.setGeometry(QRect(196, 164, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_neg4.sizePolicy().hasHeightForWidth()) self.wheel_neg4.setSizePolicy(sizePolicy1) self.wheel_neg4.setMinimumSize(QSize(24, 24)) self.wheel_neg4.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.wheel_neg7 = QRadioButton(self.shuttle_widget) self.wheel_neg7.setObjectName(u"wheel_neg7") self.wheel_neg7.setGeometry(QRect(151, 229, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_neg7.sizePolicy().hasHeightForWidth()) self.wheel_neg7.setSizePolicy(sizePolicy1) self.wheel_neg7.setMinimumSize(QSize(24, 24)) self.wheel_neg7.setStyleSheet(u"color: white;") self.dial.raise_() self.button_1.raise_() self.usb_status.raise_() self.button_5.raise_() self.wheel_pos4.raise_() self.wheel_cent0.raise_() self.wheel_pos1.raise_() self.wheel_pos2.raise_() self.wheel_neg6.raise_() self.wheel_pos5.raise_() self.button_2.raise_() self.wheel_neg5.raise_() self.wheel_pos6.raise_() self.wheel_neg1.raise_() self.button_4.raise_() self.wheel_pos7.raise_() self.button_3.raise_() self.wheel_neg2.raise_() self.wheel_pos3.raise_() self.wheel_neg3.raise_() self.wheel_neg4.raise_() self.wheel_neg7.raise_() self.main_layout.addWidget(self.shuttle_widget, 3, 2, 1, 1) self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.about_button = QPushButton(self.main_widget) self.about_button.setObjectName(u"about_button") sizePolicy1.setHeightForWidth(self.about_button.sizePolicy().hasHeightForWidth()) self.about_button.setSizePolicy(sizePolicy1) self.about_button.setMinimumSize(QSize(24, 24)) self.about_button.setFont(font1) self.about_button.setCursor(QCursor(Qt.WhatsThisCursor)) self.about_button.setCheckable(False) self.about_button.setFlat(True) self.horizontalLayout.addWidget(self.about_button) self.main_layout.addLayout(self.horizontalLayout, 1, 2, 1, 1) self.horizontalLayout_3 = QHBoxLayout() self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.plug_button = QPushButton(self.main_widget) self.plug_button.setObjectName(u"plug_button") sizePolicy1.setHeightForWidth(self.plug_button.sizePolicy().hasHeightForWidth()) self.plug_button.setSizePolicy(sizePolicy1) self.plug_button.setMinimumSize(QSize(24, 24)) self.plug_button.setFont(font1) self.plug_button.setCursor(QCursor(Qt.PointingHandCursor)) self.plug_button.setCheckable(False) self.plug_button.setFlat(True) self.horizontalLayout_3.addWidget(self.plug_button) self.main_layout.addLayout(self.horizontalLayout_3, 3, 1, 1, 1) self.verticalLayout = QVBoxLayout() self.verticalLayout.setObjectName(u"verticalLayout") self.conf_button = QPushButton(self.main_widget) self.conf_button.setObjectName(u"conf_button") sizePolicy1.setHeightForWidth(self.conf_button.sizePolicy().hasHeightForWidth()) self.conf_button.setSizePolicy(sizePolicy1) self.conf_button.setMinimumSize(QSize(24, 24)) self.conf_button.setFont(font1) self.conf_button.setCursor(QCursor(Qt.PointingHandCursor)) self.conf_button.setCheckable(False) self.conf_button.setFlat(True) self.verticalLayout.addWidget(self.conf_button) self.main_layout.addLayout(self.verticalLayout, 3, 4, 1, 1) MainWindow.setCentralWidget(self.main_widget) self.statusbar = QStatusBar(MainWindow) self.statusbar.setObjectName(u"statusbar") self.statusbar.setMinimumSize(QSize(600, 0)) MainWindow.setStatusBar(self.statusbar) self.about_widget = QDockWidget(MainWindow) self.about_widget.setObjectName(u"about_widget") self.about_widget.setEnabled(True) sizePolicy3 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy3.setHorizontalStretch(0) sizePolicy3.setVerticalStretch(0) sizePolicy3.setHeightForWidth(self.about_widget.sizePolicy().hasHeightForWidth()) self.about_widget.setSizePolicy(sizePolicy3) self.about_widget.setMinimumSize(QSize(600, 600)) self.about_widget.setVisible(True) self.about_widget.setFloating(False) self.about_widget.setFeatures(QDockWidget.DockWidgetClosable|QDockWidget.DockWidgetMovable) self.about_widget.setAllowedAreas(Qt.TopDockWidgetArea) self.about_layout = QWidget() self.about_layout.setObjectName(u"about_layout") sizePolicy3.setHeightForWidth(self.about_layout.sizePolicy().hasHeightForWidth()) self.about_layout.setSizePolicy(sizePolicy3) self.about_layout.setAutoFillBackground(False) self.gridLayout_3 = QGridLayout(self.about_layout) self.gridLayout_3.setObjectName(u"gridLayout_3") self.about_text = QTextEdit(self.about_layout) self.about_text.setObjectName(u"about_text") self.about_text.setFocusPolicy(Qt.WheelFocus) self.about_text.setAcceptDrops(False) self.about_text.setStyleSheet(u"color: white;") self.about_text.setFrameShape(QFrame.StyledPanel) self.about_text.setFrameShadow(QFrame.Sunken) self.about_text.setUndoRedoEnabled(False) self.about_text.setReadOnly(True) self.about_text.setAcceptRichText(True) self.gridLayout_3.addWidget(self.about_text, 0, 0, 1, 1) self.about_widget.setWidget(self.about_layout) MainWindow.addDockWidget(Qt.TopDockWidgetArea, self.about_widget) self.log_widget = QDockWidget(MainWindow) self.log_widget.setObjectName(u"log_widget") self.log_widget.setEnabled(True) self.log_widget.setMinimumSize(QSize(550, 158)) self.log_widget.setFont(font) self.log_widget.setVisible(True) self.log_widget.setFloating(False) self.log_widget.setFeatures(QDockWidget.DockWidgetClosable|QDockWidget.DockWidgetFloatable|QDockWidget.DockWidgetMovable) self.log_widget.setAllowedAreas(Qt.BottomDockWidgetArea) self.log_layout = QWidget() self.log_layout.setObjectName(u"log_layout") sizePolicy4 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) sizePolicy4.setHorizontalStretch(0) sizePolicy4.setVerticalStretch(0) sizePolicy4.setHeightForWidth(self.log_layout.sizePolicy().hasHeightForWidth()) self.log_layout.setSizePolicy(sizePolicy4) self.gridLayout_2 = QGridLayout(self.log_layout) self.gridLayout_2.setObjectName(u"gridLayout_2") self.log_content_layout = QVBoxLayout() self.log_content_layout.setObjectName(u"log_content_layout") self.log_content_layout.setSizeConstraint(QLayout.SetDefaultConstraint) self.log_text = QPlainTextEdit(self.log_layout) self.log_text.setObjectName(u"log_text") sizePolicy4.setHeightForWidth(self.log_text.sizePolicy().hasHeightForWidth()) self.log_text.setSizePolicy(sizePolicy4) self.log_text.setMinimumSize(QSize(0, 0)) self.log_text.setAcceptDrops(False) self.log_text.setFrameShape(QFrame.StyledPanel) self.log_text.setFrameShadow(QFrame.Sunken) self.log_text.setUndoRedoEnabled(False) self.log_text.setReadOnly(True) self.log_content_layout.addWidget(self.log_text) self.buttons_layout = QHBoxLayout() self.buttons_layout.setObjectName(u"buttons_layout") self.buttons_layout.setSizeConstraint(QLayout.SetDefaultConstraint) self.log_clear_button = QToolButton(self.log_layout) self.log_clear_button.setObjectName(u"log_clear_button") icon1 = QIcon() icon1.addFile(u"images/delete-sweep_24.png", QSize(), QIcon.Normal, QIcon.Off) self.log_clear_button.setIcon(icon1) self.log_clear_button.setIconSize(QSize(24, 24)) self.buttons_layout.addWidget(self.log_clear_button) self.log_content_layout.addLayout(self.buttons_layout) self.gridLayout_2.addLayout(self.log_content_layout, 0, 0, 1, 1) self.log_widget.setWidget(self.log_layout) MainWindow.addDockWidget(Qt.BottomDockWidgetArea, self.log_widget) self.config_widget = QDockWidget(MainWindow) self.config_widget.setObjectName(u"config_widget") self.config_widget.setEnabled(True) self.config_widget.setMinimumSize(QSize(250, 600)) self.config_widget.setFloating(False) self.config_widget.setFeatures(QDockWidget.DockWidgetClosable|QDockWidget.DockWidgetFloatable|QDockWidget.DockWidgetMovable) self.config_widget.setAllowedAreas(Qt.RightDockWidgetArea) self.config_layout = QWidget() self.config_layout.setObjectName(u"config_layout") self.gridLayout = QGridLayout(self.config_layout) self.gridLayout.setObjectName(u"gridLayout") self.config_content_layout = QFormLayout() self.config_content_layout.setObjectName(u"config_content_layout") self.gridLayout.addLayout(self.config_content_layout, 0, 0, 1, 1) self.config_widget.setWidget(self.config_layout) MainWindow.addDockWidget(Qt.RightDockWidgetArea, self.config_widget) self.plugins_widget = QDockWidget(MainWindow) self.plugins_widget.setObjectName(u"plugins_widget") self.plugins_widget.setMinimumSize(QSize(250, 600)) self.plugins_widget.setAllowedAreas(Qt.LeftDockWidgetArea) self.dockWidgetContents = QWidget() self.dockWidgetContents.setObjectName(u"dockWidgetContents") self.plugins_widget.setWidget(self.dockWidgetContents) MainWindow.addDockWidget(Qt.LeftDockWidgetArea, self.plugins_widget) self.about_widget.raise_() self.log_widget.raise_() self.retranslateUi(MainWindow) self.usb_status.setDefault(False) QMetaObject.connectSlotsByName(MainWindow) # setupUi def retranslateUi(self, MainWindow): MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"Contour ShuttleXpress", None)) self.action_Quit.setText(QCoreApplication.translate("MainWindow", u"&Quit", None)) #if QT_CONFIG(tooltip) self.log_button.setToolTip("") #endif // QT_CONFIG(tooltip) #if QT_CONFIG(statustip) self.log_button.setStatusTip(QCoreApplication.translate("MainWindow", u"Log", None)) #endif // QT_CONFIG(statustip) self.log_button.setText(QCoreApplication.translate("MainWindow", u"//", None)) #if QT_CONFIG(statustip) self.button_1.setStatusTip(QCoreApplication.translate("MainWindow", u"Button 1", None)) #endif // QT_CONFIG(statustip) self.button_1.setText("") #if QT_CONFIG(tooltip) self.usb_status.setToolTip("") #endif // QT_CONFIG(tooltip) #if QT_CONFIG(statustip) self.usb_status.setStatusTip(QCoreApplication.translate("MainWindow", u"USB connection status", None)) #endif // QT_CONFIG(statustip) #if QT_CONFIG(whatsthis) self.usb_status.setWhatsThis(QCoreApplication.translate("MainWindow", u"USB Status", None)) #endif // QT_CONFIG(whatsthis) #if QT_CONFIG(statustip) self.button_5.setStatusTip(QCoreApplication.translate("MainWindow", u"Button 5", None)) #endif // QT_CONFIG(statustip) self.button_5.setText("") #if QT_CONFIG(statustip) self.wheel_pos4.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: right 4", None)) #endif // QT_CONFIG(statustip) self.wheel_pos4.setText("") #if QT_CONFIG(statustip) self.wheel_cent0.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: center", None)) #endif // QT_CONFIG(statustip) self.wheel_cent0.setText("") #if QT_CONFIG(statustip) self.wheel_pos1.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: right 1", None)) #endif // QT_CONFIG(statustip) self.wheel_pos1.setText("") #if QT_CONFIG(statustip) self.wheel_pos2.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: right 2", None)) #endif // QT_CONFIG(statustip) self.wheel_pos2.setText("") #if QT_CONFIG(statustip) self.dial.setStatusTip(QCoreApplication.translate("MainWindow", u"Dial", None)) #endif // QT_CONFIG(statustip) #if QT_CONFIG(statustip) self.wheel_neg6.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: left 6", None)) #endif // QT_CONFIG(statustip) self.wheel_neg6.setText("") #if QT_CONFIG(statustip) self.wheel_pos5.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: right 5", None)) #endif // QT_CONFIG(statustip) self.wheel_pos5.setText("") #if QT_CONFIG(statustip) self.button_2.setStatusTip(QCoreApplication.translate("MainWindow", u"Button 2", None)) #endif // QT_CONFIG(statustip) self.button_2.setText("") #if QT_CONFIG(statustip) self.wheel_neg5.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: left 5", None)) #endif // QT_CONFIG(statustip) self.wheel_neg5.setText("") #if QT_CONFIG(statustip) self.wheel_pos6.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: right 6", None)) #endif // QT_CONFIG(statustip) self.wheel_pos6.setText("") #if QT_CONFIG(statustip) self.wheel_neg1.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: left 1", None)) #endif // QT_CONFIG(statustip) self.wheel_neg1.setText("") #if QT_CONFIG(statustip) self.button_4.setStatusTip(QCoreApplication.translate("MainWindow", u"Button 4", None)) #endif // QT_CONFIG(statustip) self.button_4.setText("") #if QT_CONFIG(statustip) self.wheel_pos7.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: right 7", None)) #endif // QT_CONFIG(statustip) self.wheel_pos7.setText("") #if QT_CONFIG(statustip) self.button_3.setStatusTip(QCoreApplication.translate("MainWindow", u"Button 3", None)) #endif // QT_CONFIG(statustip) self.button_3.setText("") #if QT_CONFIG(statustip) self.wheel_neg2.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: left 2", None)) #endif // QT_CONFIG(statustip) self.wheel_neg2.setText("") #if QT_CONFIG(statustip) self.wheel_pos3.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: right 3", None)) #endif // QT_CONFIG(statustip) self.wheel_pos3.setText("") #if QT_CONFIG(statustip) self.wheel_neg3.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: left 3", None)) #endif // QT_CONFIG(statustip) self.wheel_neg3.setText("") #if QT_CONFIG(statustip) self.wheel_neg4.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: left 4", None)) #endif // QT_CONFIG(statustip) self.wheel_neg4.setText(QCoreApplication.translate("MainWindow", u"-", None)) #if QT_CONFIG(statustip) self.wheel_neg7.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: left 7", None)) #endif // QT_CONFIG(statustip) self.wheel_neg7.setText("") #if QT_CONFIG(tooltip) self.about_button.setToolTip("") #endif // QT_CONFIG(tooltip) #if QT_CONFIG(statustip) self.about_button.setStatusTip(QCoreApplication.translate("MainWindow", u"About", None)) #endif // QT_CONFIG(statustip) self.about_button.setText(QCoreApplication.translate("MainWindow", u"?", None)) #if QT_CONFIG(tooltip) self.plug_button.setToolTip("") #endif // QT_CONFIG(tooltip) #if QT_CONFIG(statustip) self.plug_button.setStatusTip(QCoreApplication.translate("MainWindow", u"Configuration", None)) #endif // QT_CONFIG(statustip) self.plug_button.setText(QCoreApplication.translate("MainWindow", u"#", None)) #if QT_CONFIG(tooltip) self.conf_button.setToolTip("") #endif // QT_CONFIG(tooltip) #if QT_CONFIG(statustip) self.conf_button.setStatusTip(QCoreApplication.translate("MainWindow", u"Configuration", None)) #endif // QT_CONFIG(statustip) self.conf_button.setText(QCoreApplication.translate("MainWindow", u"=", None)) self.about_widget.setWindowTitle(QCoreApplication.translate("MainWindow", u"About", None)) self.about_text.setDocumentTitle("") self.log_widget.setWindowTitle(QCoreApplication.translate("MainWindow", u"Log", None)) self.log_clear_button.setText(QCoreApplication.translate("MainWindow", u"Clear", None)) self.config_widget.setWindowTitle(QCoreApplication.translate("MainWindow", u"Configuration", None)) self.plugins_widget.setWindowTitle(QCoreApplication.translate("MainWindow", u"Plugins", None))