def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") MainWindow.resize(353, 223) self.actionsetting = QAction(MainWindow) self.actionsetting.setObjectName(u"actionsetting") self.actionabout = QAction(MainWindow) self.actionabout.setObjectName(u"actionabout") self.actionimg_convert = QAction(MainWindow) self.actionimg_convert.setObjectName(u"actionimg_convert") self.centralwidget = QWidget(MainWindow) self.centralwidget.setObjectName(u"centralwidget") self.gridLayout_4 = QGridLayout(self.centralwidget) self.gridLayout_4.setObjectName(u"gridLayout_4") self.gridLayout_3 = QGridLayout() self.gridLayout_3.setObjectName(u"gridLayout_3") self.stackedWidget = QStackedWidget(self.centralwidget) self.stackedWidget.setObjectName(u"stackedWidget") self.stackedWidget.setMinimumSize(QSize(0, 0)) self.gridLayout_3.addWidget(self.stackedWidget, 0, 0, 1, 1) self.gridLayout_4.addLayout(self.gridLayout_3, 0, 0, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QMenuBar(MainWindow) self.menubar.setObjectName(u"menubar") self.menubar.setGeometry(QRect(0, 0, 353, 22)) self.menuabout = QMenu(self.menubar) self.menuabout.setObjectName(u"menuabout") MainWindow.setMenuBar(self.menubar) self.statusbar = QStatusBar(MainWindow) self.statusbar.setObjectName(u"statusbar") MainWindow.setStatusBar(self.statusbar) self.menubar.addAction(self.menuabout.menuAction()) self.menuabout.addAction(self.actionabout) self.retranslateUi(MainWindow) self.stackedWidget.setCurrentIndex(-1) QMetaObject.connectSlotsByName(MainWindow)
def __init__(self): super().__init__() # Create Widgets self.question = QLabel(Text="Press Start", Alignment=QtCore.Qt.AlignCenter, Font=QtGui.QFont("", 30)) self.label_correct = QLabel(Alignment=QtCore.Qt.AlignCenter) self.button_quit = QPushButton("Quit", Visible=False) self.button_start = QPushButton("Start") lcd_height = 40 self.lcd_total = QLCDNumber(SegmentStyle=QLCDNumber.Flat, FixedHeight=lcd_height) self.lcd_score = QLCDNumber(SegmentStyle=QLCDNumber.Flat, FixedHeight=lcd_height) self.stack = QStackedWidget() self.page1 = Page1Widget() self.page2 = Page2Widget() self.page3 = Page3Widget() self.stack.addWidget(self.page1) self.stack.addWidget(self.page2) self.stack.addWidget(self.page3) # Make Layout self.layout = QGridLayout(self) self.layout.addWidget(self.question, 2, 0, 1, 2) self.layout.addWidget(self.label_correct, 1, 0, 1, 2) self.layout.addWidget(self.lcd_total, 0, 0) self.layout.addWidget(self.lcd_score, 0, 1) self.layout.addWidget(self.stack, 3, 0, 1, 2) self.layout.addWidget(self.button_quit, 4, 0) self.layout.addWidget(self.button_start, 4, 1) # Connect Callbacks self.button_quit.clicked.connect(self.on_quit_pressed) self.button_start.clicked.connect(self.on_start_pressed) self.page2.ans_buttons[0].clicked.connect(self.on_ans_button0_clicked) self.page2.ans_buttons[1].clicked.connect(self.on_ans_button1_clicked) self.page2.ans_buttons[2].clicked.connect(self.on_ans_button2_clicked) self.page3.line_edit.returnPressed.connect(self.on_answer_given)
def __init__(self, window_width=None, window_height=None): super(MainWindow, self).__init__() if window_width != None and window_height != None: self.window_width = window_width self.window_height = window_height self.resize(window_width, window_height) self.stack_of_widget = QStackedWidget() self.central_widget = QWidget() self.main_layout = QVBoxLayout() self.username = "" # ui widgets self.message_visable_field = QTextEdit() self.message_input_field = QTextEdit() self.send_message = QPushButton("Send my message!") self.login_screen = LoginScreen() self.login_screen.auth_button.clicked.connect(self.login_button_click) # show all widgets self.build_ui()
class Ui_MainWindow(object): def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") MainWindow.resize(353, 223) self.actionsetting = QAction(MainWindow) self.actionsetting.setObjectName(u"actionsetting") self.actionabout = QAction(MainWindow) self.actionabout.setObjectName(u"actionabout") self.actionimg_convert = QAction(MainWindow) self.actionimg_convert.setObjectName(u"actionimg_convert") self.centralwidget = QWidget(MainWindow) self.centralwidget.setObjectName(u"centralwidget") self.gridLayout_4 = QGridLayout(self.centralwidget) self.gridLayout_4.setObjectName(u"gridLayout_4") self.gridLayout_3 = QGridLayout() self.gridLayout_3.setObjectName(u"gridLayout_3") self.stackedWidget = QStackedWidget(self.centralwidget) self.stackedWidget.setObjectName(u"stackedWidget") self.stackedWidget.setMinimumSize(QSize(0, 0)) self.gridLayout_3.addWidget(self.stackedWidget, 0, 0, 1, 1) self.gridLayout_4.addLayout(self.gridLayout_3, 0, 0, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QMenuBar(MainWindow) self.menubar.setObjectName(u"menubar") self.menubar.setGeometry(QRect(0, 0, 353, 22)) self.menuabout = QMenu(self.menubar) self.menuabout.setObjectName(u"menuabout") MainWindow.setMenuBar(self.menubar) self.statusbar = QStatusBar(MainWindow) self.statusbar.setObjectName(u"statusbar") MainWindow.setStatusBar(self.statusbar) self.menubar.addAction(self.menuabout.menuAction()) self.menuabout.addAction(self.actionabout) self.retranslateUi(MainWindow) self.stackedWidget.setCurrentIndex(-1) QMetaObject.connectSlotsByName(MainWindow) # setupUi def retranslateUi(self, MainWindow): MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"Waifu2x-GUI", None)) self.actionsetting.setText(QCoreApplication.translate("MainWindow", u"setting", None)) self.actionabout.setText(QCoreApplication.translate("MainWindow", u"about", None)) self.actionimg_convert.setText(QCoreApplication.translate("MainWindow", u"img convert", None)) self.menuabout.setTitle(QCoreApplication.translate("MainWindow", u"\u5de5\u5177", None))
class MainWindow(QMainWindow): def __init__(self, window_width=None, window_height=None): super(MainWindow, self).__init__() if window_width != None and window_height != None: self.window_width = window_width self.window_height = window_height self.resize(window_width, window_height) self.stack_of_widget = QStackedWidget() self.central_widget = QWidget() self.main_layout = QVBoxLayout() self.username = "" # ui widgets self.message_visable_field = QTextEdit() self.message_input_field = QTextEdit() self.send_message = QPushButton("Send my message!") self.login_screen = LoginScreen() self.login_screen.auth_button.clicked.connect(self.login_button_click) # show all widgets self.build_ui() def build_ui(self): self.message_visable_field.setFont(QFont("Roboto", 12)) self.message_visable_field.setReadOnly(True) self.message_input_field.setFont(QFont("Roboto", 11)) self.message_input_field.setPlaceholderText( "Input your message here...") self.message_input_field.setMinimumHeight(50) self.message_input_field.setMaximumHeight(50) self.send_message.setFont(QFont("Roboto", 11)) self.send_message.clicked.connect(self.send_message_button_clicked) self.main_layout.addWidget(self.message_visable_field) self.main_layout.addWidget(self.message_input_field) self.main_layout.addWidget(self.send_message) self.central_widget.setLayout(self.main_layout) self.stack_of_widget.addWidget(self.login_screen) self.setMaximumSize(self.minimumSize()) self.stack_of_widget.addWidget(self.central_widget) self.setCentralWidget(self.stack_of_widget) def send_message_button_clicked(self): """ send a client message to the server, and append to the list message. """ message = self.message_input_field.toPlainText() if message != '': # send message to the server r_type = RequestInfo(type_request="MessageRequest", request_ts=f"{datetime.now()}") r_data = MessageRequest(from_=self.username, to="all", message=message) request = Request(request=[r_type], data=[r_data]) client_worker.send(request.json()) self.message_visable_field.append('You: ' + message) self.message_input_field.clear() def login_button_click(self): self.username = self.login_screen.login_field.text() r_type = RequestInfo(type_request="AuthRequest", request_ts=f"{datetime.now()}") r_data = AuthRequest( login=f"{self.username}", password=f"{self.login_screen.password_field.text()}") request = Request(request=[r_type], data=[r_data]) client_worker.send(request.json()) @Slot(str) def recieved_message_handler(self, message): msg = json.loads(message) print(msg) response = Request(**msg) if response.request[0].type_request == "AuthResponse": data = AuthResponse(**response.data[0]) if data.access is True: self.show_main_screen() elif response.request[0].type_request == "MessageRequest": data = MessageRequest(**response.data[0]) if data.to == "all": self.message_visable_field.append( f"[{data.from_}]: {data.message}") def show_main_screen(self): self.stack_of_widget.setCurrentWidget(self.central_widget) self.setMinimumSize(self.window_width, self.window_height) self.resize(self.minimumSize()) def closeEvent(self, event): client_worker.close() network_thread.exit() network_thread.wait(500) if network_thread.isRunning() is True: network_thread.terminate()
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 MainWidget(QWidget): def __init__(self, parent: QWidget, model: Model) -> None: super().__init__(parent) logger.add(self.log) settings = QSettings() self.mainlayout = QVBoxLayout() self.mainlayout.setContentsMargins(5, 5, 5, 5) self.setLayout(self.mainlayout) # summary summarylayout = FlowLayout() summarylayout.setContentsMargins(0, 0, 0, 0) self.summary = QWidget() self.summary.setLayout(summarylayout) self.mainlayout.addWidget(self.summary) self.summary.setVisible( settings.value('showSummary', 'True') == 'True') detailslayout = QHBoxLayout() detailslayout.setContentsMargins(1, 0, 0, 0) detailslayout.setAlignment(Qt.AlignLeft | Qt.AlignVCenter) detailslayout.setSpacing(15) details = QWidget() details.setLayout(detailslayout) summarylayout.addWidget(details) self.modstotal = QLabel() detailslayout.addWidget(self.modstotal) self.modsenabled = QLabel() detailslayout.addWidget(self.modsenabled) self.overridden = QLabel() detailslayout.addWidget(self.overridden) self.conflicts = QLabel() detailslayout.addWidget(self.conflicts) buttonslayout = QHBoxLayout() buttonslayout.setContentsMargins(0, 0, 0, 0) buttonslayout.setAlignment(Qt.AlignRight | Qt.AlignVCenter) buttons = QWidget() buttons.setLayout(buttonslayout) summarylayout.addWidget(buttons) self.startscriptmerger = QPushButton('Start Script Merger') self.startscriptmerger.setContentsMargins(0, 0, 0, 0) self.startscriptmerger.setMinimumWidth(140) self.startscriptmerger.setIcon( QIcon(str(getRuntimePath('resources/icons/script.ico')))) self.startscriptmerger.clicked.connect(lambda: [ openExecutable(Path(str(settings.value('scriptMergerPath'))), True) ]) self.startscriptmerger.setEnabled( verifyScriptMergerPath( Path(str(settings.value('scriptMergerPath')))) is not None) buttonslayout.addWidget(self.startscriptmerger) self.startgame = QPushButton('Start Game') self.startgame.setContentsMargins(0, 0, 0, 0) self.startgame.setMinimumWidth(100) self.startgame.setIcon( QIcon(str(getRuntimePath('resources/icons/w3b.ico')))) buttonslayout.addWidget(self.startgame) # splitter self.splitter = QSplitter(Qt.Vertical) self.stack = QStackedWidget() self.splitter.addWidget(self.stack) # mod list widget self.modlistwidget = QWidget() self.modlistlayout = QVBoxLayout() self.modlistlayout.setContentsMargins(0, 0, 0, 0) self.modlistwidget.setLayout(self.modlistlayout) self.stack.addWidget(self.modlistwidget) # search bar self.searchbar = QLineEdit() self.searchbar.setPlaceholderText('Search...') self.modlistlayout.addWidget(self.searchbar) # mod list self.modlist = ModList(self, model) self.modlistlayout.addWidget(self.modlist) self.searchbar.textChanged.connect(lambda e: self.modlist.setFilter(e)) # welcome message welcomelayout = QVBoxLayout() welcomelayout.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter) welcomewidget = QWidget() welcomewidget.setLayout(welcomelayout) welcomewidget.dragEnterEvent = self.modlist.dragEnterEvent # type: ignore welcomewidget.dragMoveEvent = self.modlist.dragMoveEvent # type: ignore welcomewidget.dragLeaveEvent = self.modlist.dragLeaveEvent # type: ignore welcomewidget.dropEvent = self.modlist.dropEvent # type: ignore welcomewidget.setAcceptDrops(True) icon = QIcon(str(getRuntimePath('resources/icons/open-folder.ico'))) iconpixmap = icon.pixmap(32, 32) icon = QLabel() icon.setPixmap(iconpixmap) icon.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter) icon.setContentsMargins(4, 4, 4, 4) welcomelayout.addWidget(icon) welcome = QLabel('''<p><font> No mod installed yet. Drag a mod into this area to get started! </font></p>''') welcome.setAttribute(Qt.WA_TransparentForMouseEvents) welcome.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter) welcomelayout.addWidget(welcome) self.stack.addWidget(welcomewidget) # output log self.output = QTextEdit(self) self.output.setTextInteractionFlags(Qt.NoTextInteraction) self.output.setReadOnly(True) self.output.setContextMenuPolicy(Qt.NoContextMenu) self.output.setPlaceholderText('Program output...') self.splitter.addWidget(self.output) # TODO: enhancement: show indicator if scripts have to be merged self.splitter.setStretchFactor(0, 1) self.splitter.setStretchFactor(1, 0) self.mainlayout.addWidget(self.splitter) # TODO: incomplete: make start game button functional if len(model): self.stack.setCurrentIndex(0) self.splitter.setSizes([self.splitter.size().height(), 50]) else: self.stack.setCurrentIndex(1) self.splitter.setSizes([self.splitter.size().height(), 0]) model.updateCallbacks.append(self.modelUpdateEvent) asyncio.create_task(model.loadInstalled()) def keyPressEvent(self, event: QKeyEvent) -> None: if event.key() == Qt.Key_Escape: self.modlist.setFocus() self.searchbar.setText('') elif event.matches(QKeySequence.Find): self.searchbar.setFocus() elif event.matches(QKeySequence.Paste): self.pasteEvent() # TODO: enhancement: add start game / start script merger shortcuts else: super().keyPressEvent(event) def pasteEvent(self) -> None: clipboard = QApplication.clipboard().text().splitlines() if len(clipboard) == 1 and isValidNexusModsUrl(clipboard[0]): self.parentWidget().showDownloadModDialog() else: urls = [ url for url in QApplication.clipboard().text().splitlines() if len(str(url.strip())) ] if all( isValidModDownloadUrl(url) or isValidFileUrl(url) for url in urls): asyncio.create_task(self.modlist.checkInstallFromURLs(urls)) def modelUpdateEvent(self, model: Model) -> None: total = len(model) enabled = len([mod for mod in model if model[mod].enabled]) overridden = sum( len(file) for file in model.conflicts.bundled.values()) conflicts = sum(len(file) for file in model.conflicts.scripts.values()) self.modstotal.setText( f'<font color="#73b500" size="4">{total}</font> \ <font color="#888" text-align="center">Installed Mod{"" if total == 1 else "s"}</font>' ) self.modsenabled.setText( f'<font color="#73b500" size="4">{enabled}</font> \ <font color="#888">Enabled Mod{"" if enabled == 1 else "s"}</font>' ) self.overridden.setText( f'<font color="{"#b08968" if overridden > 0 else "#84C318"}" size="4">{overridden}</font> \ <font color="#888">Overridden File{"" if overridden == 1 else "s"}</font> ' ) self.conflicts.setText( f'<font color="{"#E55934" if conflicts > 0 else "#aad576"}" size="4">{conflicts}</font> \ <font color="#888">Unresolved Conflict{"" if conflicts == 1 else "s"}</font> ' ) if len(model) > 0: if self.stack.currentIndex() != 0: self.stack.setCurrentIndex(0) self.repaint() else: if self.stack.currentIndex() != 1: self.stack.setCurrentIndex(1) self.repaint() def unhideOutput(self) -> None: if self.splitter.sizes()[1] < 10: self.splitter.setSizes([self.splitter.size().height(), 50]) def unhideModList(self) -> None: if self.splitter.sizes()[0] < 10: self.splitter.setSizes([50, self.splitter.size().height()]) def log(self, message: Any) -> None: # format log messages to user readable output settings = QSettings() record = message.record message = record['message'] extra = record['extra'] level = record['level'].name.lower() name = str(extra['name'] ) if 'name' in extra and extra['name'] is not None else '' path = str(extra['path'] ) if 'path' in extra and extra['path'] is not None else '' dots = bool( extra['dots'] ) if 'dots' in extra and extra['dots'] is not None else False newline = bool( extra['newline'] ) if 'newline' in extra and extra['newline'] is not None else False output = bool( extra['output'] ) if 'output' in extra and extra['output'] is not None else bool( message) modlist = bool( extra['modlist'] ) if 'modlist' in extra and extra['modlist'] is not None else False if level in ['debug' ] and settings.value('debugOutput', 'False') != 'True': if newline: self.output.append(f'') return n = '<br>' if newline else '' d = '...' if dots else '' if len(name) and len(path): path = f' ({path})' if output: message = html.escape(message, quote=True) if level in ['success', 'error', 'warning']: message = f'<strong>{message}</strong>' if level in ['success']: message = f'<font color="#04c45e">{message}</font>' if level in ['error', 'critical']: message = f'<font color="#ee3b3b">{message}</font>' if level in ['warning']: message = f'<font color="#ff6500">{message}</font>' if level in ['debug', 'trace']: message = f'<font color="#aaa">{message}</font>' path = f'<font color="#aaa">{path}</font>' if path else '' d = f'<font color="#aaa">{d}</font>' if d else '' time = record['time'].astimezone( tz=None).strftime('%Y-%m-%d %H:%M:%S') message = f'<font color="#aaa">{time}</font> {message}' self.output.append( f'{n}{message.strip()}{" " if name or path else ""}{name}{path}{d}' ) else: self.output.append(f'') self.output.verticalScrollBar().setValue( self.output.verticalScrollBar().maximum()) self.output.repaint() if modlist: self.unhideModList() if settings.value('unhideOutput', 'True') == 'True' and output: self.unhideOutput()
def getStackWidget(self): # Returns a newly initialised QStackedWidget return QStackedWidget(self)
class Ui_opsWidget(object): def setupUi(self, opsWidget): if not opsWidget.objectName(): opsWidget.setObjectName(u"opsWidget") opsWidget.resize(498, 576) self.verticalLayout_4 = QVBoxLayout(opsWidget) self.verticalLayout_4.setObjectName(u"verticalLayout_4") self.horizontalLayout_5 = QHBoxLayout() self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") self.horizontalLayout_5.setSizeConstraint(QLayout.SetMinimumSize) self.verticalGroupBox_3 = QGroupBox(opsWidget) self.verticalGroupBox_3.setObjectName(u"verticalGroupBox_3") self.verticalGroupBox_3.setContextMenuPolicy(Qt.ActionsContextMenu) self.verticalLayout_2 = QVBoxLayout(self.verticalGroupBox_3) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.horizontalLayout_2 = QHBoxLayout() self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.label_3 = QLabel(self.verticalGroupBox_3) self.label_3.setObjectName(u"label_3") sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.label_3.sizePolicy().hasHeightForWidth()) self.label_3.setSizePolicy(sizePolicy) self.horizontalLayout_2.addWidget(self.label_3) self.horizontalSpacer_3 = QSpacerItem(463, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout_2.addItem(self.horizontalSpacer_3) self.label_6 = QLabel(self.verticalGroupBox_3) self.label_6.setObjectName(u"label_6") self.horizontalLayout_2.addWidget(self.label_6) self.comboBox_3 = QComboBox(self.verticalGroupBox_3) self.comboBox_3.addItem("") self.comboBox_3.addItem("") self.comboBox_3.addItem("") self.comboBox_3.addItem("") self.comboBox_3.addItem("") self.comboBox_3.addItem("") self.comboBox_3.addItem("") self.comboBox_3.addItem("") self.comboBox_3.setObjectName(u"comboBox_3") self.horizontalLayout_2.addWidget(self.comboBox_3) self.toolButton_3 = QToolButton(self.verticalGroupBox_3) self.toolButton_3.setObjectName(u"toolButton_3") self.horizontalLayout_2.addWidget(self.toolButton_3) self.verticalLayout_2.addLayout(self.horizontalLayout_2) self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.label_2 = QLabel(self.verticalGroupBox_3) self.label_2.setObjectName(u"label_2") sizePolicy.setHeightForWidth( self.label_2.sizePolicy().hasHeightForWidth()) self.label_2.setSizePolicy(sizePolicy) self.horizontalLayout.addWidget(self.label_2) self.horizontalSpacer_2 = QSpacerItem(463, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout.addItem(self.horizontalSpacer_2) self.label_4 = QLabel(self.verticalGroupBox_3) self.label_4.setObjectName(u"label_4") self.horizontalLayout.addWidget(self.label_4) self.comboBox_2 = QComboBox(self.verticalGroupBox_3) self.comboBox_2.addItem("") self.comboBox_2.addItem("") self.comboBox_2.addItem("") self.comboBox_2.addItem("") self.comboBox_2.addItem("") self.comboBox_2.addItem("") self.comboBox_2.addItem("") self.comboBox_2.addItem("") self.comboBox_2.setObjectName(u"comboBox_2") self.horizontalLayout.addWidget(self.comboBox_2) self.toolButton = QToolButton(self.verticalGroupBox_3) self.toolButton.setObjectName(u"toolButton") self.horizontalLayout.addWidget(self.toolButton) self.verticalLayout_2.addLayout(self.horizontalLayout) self.targetLayout = QHBoxLayout() self.targetLayout.setObjectName(u"targetLayout") self.label = QLabel(self.verticalGroupBox_3) self.label.setObjectName(u"label") self.targetLayout.addWidget(self.label) self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.targetLayout.addItem(self.horizontalSpacer) self.label_5 = QLabel(self.verticalGroupBox_3) self.label_5.setObjectName(u"label_5") self.targetLayout.addWidget(self.label_5) self.comboBox = QComboBox(self.verticalGroupBox_3) self.comboBox.setObjectName(u"comboBox") self.targetLayout.addWidget(self.comboBox) self.toolButton_2 = QToolButton(self.verticalGroupBox_3) self.toolButton_2.setObjectName(u"toolButton_2") self.targetLayout.addWidget(self.toolButton_2) self.verticalLayout_2.addLayout(self.targetLayout) self.horizontalLayout_5.addWidget(self.verticalGroupBox_3) self.horizontalSpacer_4 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout_5.addItem(self.horizontalSpacer_4) self.verticalGroupBox_2 = QGroupBox(opsWidget) self.verticalGroupBox_2.setObjectName(u"verticalGroupBox_2") self.verticalLayout_5 = QVBoxLayout(self.verticalGroupBox_2) self.verticalLayout_5.setObjectName(u"verticalLayout_5") self.allDemoCheck = QCheckBox(self.verticalGroupBox_2) self.allDemoCheck.setObjectName(u"allDemoCheck") self.allDemoCheck.setMaximumSize(QSize(10000, 16777215)) self.verticalLayout_5.addWidget(self.allDemoCheck) self.allStepsCheck = QCheckBox(self.verticalGroupBox_2) self.allStepsCheck.setObjectName(u"allStepsCheck") sizePolicy1 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.allStepsCheck.sizePolicy().hasHeightForWidth()) self.allStepsCheck.setSizePolicy(sizePolicy1) self.allStepsCheck.setMinimumSize(QSize(180, 0)) self.allStepsCheck.setLayoutDirection(Qt.LeftToRight) self.verticalLayout_5.addWidget(self.allStepsCheck) self.checkBox_2 = QCheckBox(self.verticalGroupBox_2) self.checkBox_2.setObjectName(u"checkBox_2") self.verticalLayout_5.addWidget(self.checkBox_2) self.checkBox = QCheckBox(self.verticalGroupBox_2) self.checkBox.setObjectName(u"checkBox") self.verticalLayout_5.addWidget(self.checkBox) self.matchSubstringCheck = QCheckBox(self.verticalGroupBox_2) self.matchSubstringCheck.setObjectName(u"matchSubstringCheck") self.verticalLayout_5.addWidget(self.matchSubstringCheck) self.lineEdit = QLineEdit(self.verticalGroupBox_2) self.lineEdit.setObjectName(u"lineEdit") self.verticalLayout_5.addWidget(self.lineEdit) self.horizontalLayout_5.addWidget(self.verticalGroupBox_2) self.verticalLayout_4.addLayout(self.horizontalLayout_5) self.groupBox = QGroupBox(opsWidget) self.groupBox.setObjectName(u"groupBox") self.verticalLayout = QVBoxLayout(self.groupBox) self.verticalLayout.setObjectName(u"verticalLayout") self.stepParams = QStackedWidget(self.groupBox) self.stepParams.setObjectName(u"stepParams") self.stepParamsVl = QWidget() self.stepParamsVl.setObjectName(u"stepParamsVl") self.verticalLayout_7 = QVBoxLayout(self.stepParamsVl) self.verticalLayout_7.setObjectName(u"verticalLayout_7") self.stepParams.addWidget(self.stepParamsVl) self.verticalLayout.addWidget(self.stepParams) self.verticalLayout_4.addWidget(self.groupBox) self.retranslateUi(opsWidget) QMetaObject.connectSlotsByName(opsWidget) # setupUi def retranslateUi(self, opsWidget): self.verticalGroupBox_3.setTitle( QCoreApplication.translate("opsWidget", u"Task Info", None)) self.label_3.setText( QCoreApplication.translate("opsWidget", u"Index", None)) self.label_6.setText( QCoreApplication.translate("opsWidget", u"Index:", None)) self.comboBox_3.setItemText( 0, QCoreApplication.translate("opsWidget", u"Shell", None)) self.comboBox_3.setItemText( 1, QCoreApplication.translate("opsWidget", u"Insert", None)) self.comboBox_3.setItemText( 2, QCoreApplication.translate("opsWidget", u"Crop", None)) self.comboBox_3.setItemText( 3, QCoreApplication.translate("opsWidget", u"Section", None)) self.comboBox_3.setItemText( 4, QCoreApplication.translate("opsWidget", u"Add Audio", None)) self.comboBox_3.setItemText( 5, QCoreApplication.translate("opsWidget", u"Pacing", None)) self.comboBox_3.setItemText( 6, QCoreApplication.translate("opsWidget", u"Add Text", None)) self.comboBox_3.setItemText( 7, QCoreApplication.translate("opsWidget", u"Render", None)) self.toolButton_3.setText( QCoreApplication.translate("opsWidget", u"...", None)) self.label_2.setText( QCoreApplication.translate("opsWidget", u"Task", None)) self.label_4.setText( QCoreApplication.translate("opsWidget", u"Current:", None)) self.comboBox_2.setItemText( 0, QCoreApplication.translate("opsWidget", u"Shell", None)) self.comboBox_2.setItemText( 1, QCoreApplication.translate("opsWidget", u"Insert", None)) self.comboBox_2.setItemText( 2, QCoreApplication.translate("opsWidget", u"Crop", None)) self.comboBox_2.setItemText( 3, QCoreApplication.translate("opsWidget", u"Section", None)) self.comboBox_2.setItemText( 4, QCoreApplication.translate("opsWidget", u"Add Audio", None)) self.comboBox_2.setItemText( 5, QCoreApplication.translate("opsWidget", u"Pacing", None)) self.comboBox_2.setItemText( 6, QCoreApplication.translate("opsWidget", u"Add Text", None)) self.comboBox_2.setItemText( 7, QCoreApplication.translate("opsWidget", u"Render", None)) self.toolButton.setText( QCoreApplication.translate("opsWidget", u"...", None)) self.label.setText( QCoreApplication.translate("opsWidget", u"Target", None)) self.label_5.setText( QCoreApplication.translate("opsWidget", u"Demo:", None)) self.toolButton_2.setText( QCoreApplication.translate("opsWidget", u"...", None)) self.verticalGroupBox_2.setTitle( QCoreApplication.translate("opsWidget", u"Step Targets", None)) self.allDemoCheck.setText( QCoreApplication.translate("opsWidget", u"Apply to all demos", None)) self.allStepsCheck.setText( QCoreApplication.translate("opsWidget", u"Apply to all steps", None)) self.checkBox_2.setText( QCoreApplication.translate( "opsWidget", u"Apply to all steps of marked sections", None)) self.checkBox.setText( QCoreApplication.translate("opsWidget", u"Apply to marked steps", None)) self.matchSubstringCheck.setText( QCoreApplication.translate( "opsWidget", u"Apply to steps with title containing:", None)) self.groupBox.setTitle( QCoreApplication.translate("opsWidget", u"Parameters", None)) pass
def setupUi(self, Dialog): if not Dialog.objectName(): Dialog.setObjectName(u"Dialog") Dialog.resize(688, 530) Dialog.setMinimumSize(QSize(600, 0)) Dialog.setMaximumSize(QSize(1000000, 16777215)) self.verticalLayout = QVBoxLayout(Dialog) self.verticalLayout.setObjectName(u"verticalLayout") self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.verticalFrame = QFrame(Dialog) self.verticalFrame.setObjectName(u"verticalFrame") self.verticalFrame.setMaximumSize(QSize(250, 16777215)) self.verticalLayout_2 = QVBoxLayout(self.verticalFrame) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.label = QLabel(self.verticalFrame) self.label.setObjectName(u"label") self.verticalLayout_2.addWidget(self.label) self.treeWidget = QTreeWidget(self.verticalFrame) QTreeWidgetItem(self.treeWidget) QTreeWidgetItem(self.treeWidget) QTreeWidgetItem(self.treeWidget) self.treeWidget.setObjectName(u"treeWidget") font = QFont() font.setFamilies([u"Segoe UI"]) font.setPointSize(10) self.treeWidget.setFont(font) self.treeWidget.setFrameShape(QFrame.VLine) self.treeWidget.setFrameShadow(QFrame.Plain) self.treeWidget.setTabKeyNavigation(True) self.treeWidget.setAlternatingRowColors(False) self.verticalLayout_2.addWidget(self.treeWidget) self.horizontalLayout.addWidget(self.verticalFrame) self.line = QFrame(Dialog) self.line.setObjectName(u"line") self.line.setFrameShape(QFrame.VLine) self.line.setFrameShadow(QFrame.Sunken) self.horizontalLayout.addWidget(self.line) self.stackedWidget = QStackedWidget(Dialog) self.stackedWidget.setObjectName(u"stackedWidget") self.page = QWidget() self.page.setObjectName(u"page") self.verticalLayout_3 = QVBoxLayout(self.page) self.verticalLayout_3.setObjectName(u"verticalLayout_3") self.groupBox = QGroupBox(self.page) self.groupBox.setObjectName(u"groupBox") self.formLayout_4 = QFormLayout(self.groupBox) self.formLayout_4.setObjectName(u"formLayout_4") self.label_2 = QLabel(self.groupBox) self.label_2.setObjectName(u"label_2") self.formLayout_4.setWidget(0, QFormLayout.LabelRole, self.label_2) self.comboBox = QComboBox(self.groupBox) self.comboBox.addItem("") self.comboBox.addItem("") self.comboBox.addItem("") self.comboBox.setObjectName(u"comboBox") self.formLayout_4.setWidget(0, QFormLayout.FieldRole, self.comboBox) self.verticalLayout_3.addWidget(self.groupBox) self.groupBox_2 = QGroupBox(self.page) self.groupBox_2.setObjectName(u"groupBox_2") self.formLayout_3 = QFormLayout(self.groupBox_2) self.formLayout_3.setObjectName(u"formLayout_3") self.label_3 = QLabel(self.groupBox_2) self.label_3.setObjectName(u"label_3") self.formLayout_3.setWidget(1, QFormLayout.LabelRole, self.label_3) self.spinBox = QSpinBox(self.groupBox_2) self.spinBox.setObjectName(u"spinBox") self.spinBox.setValue(11) self.formLayout_3.setWidget(1, QFormLayout.FieldRole, self.spinBox) self.label_4 = QLabel(self.groupBox_2) self.label_4.setObjectName(u"label_4") self.formLayout_3.setWidget(0, QFormLayout.LabelRole, self.label_4) self.fontComboBox = QFontComboBox(self.groupBox_2) self.fontComboBox.setObjectName(u"fontComboBox") self.formLayout_3.setWidget(0, QFormLayout.FieldRole, self.fontComboBox) self.verticalLayout_3.addWidget(self.groupBox_2) self.stackedWidget.addWidget(self.page) self.page_2 = QWidget() self.page_2.setObjectName(u"page_2") self.verticalLayout_5 = QVBoxLayout(self.page_2) self.verticalLayout_5.setObjectName(u"verticalLayout_5") self.verticalLayout_4 = QVBoxLayout() self.verticalLayout_4.setObjectName(u"verticalLayout_4") self.verticalLayout_5.addLayout(self.verticalLayout_4) self.stackedWidget.addWidget(self.page_2) self.horizontalLayout.addWidget(self.stackedWidget) self.verticalLayout.addLayout(self.horizontalLayout) self.buttonBox = QDialogButtonBox(Dialog) self.buttonBox.setObjectName(u"buttonBox") self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Apply | QDialogButtonBox.Close | QDialogButtonBox.Save) self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(Dialog) self.buttonBox.accepted.connect(Dialog.accept) self.buttonBox.rejected.connect(Dialog.reject) self.stackedWidget.setCurrentIndex(0) QMetaObject.connectSlotsByName(Dialog)
class Ui_Dialog(object): def setupUi(self, Dialog): if not Dialog.objectName(): Dialog.setObjectName(u"Dialog") Dialog.resize(688, 530) Dialog.setMinimumSize(QSize(600, 0)) Dialog.setMaximumSize(QSize(1000000, 16777215)) self.verticalLayout = QVBoxLayout(Dialog) self.verticalLayout.setObjectName(u"verticalLayout") self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.verticalFrame = QFrame(Dialog) self.verticalFrame.setObjectName(u"verticalFrame") self.verticalFrame.setMaximumSize(QSize(250, 16777215)) self.verticalLayout_2 = QVBoxLayout(self.verticalFrame) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.label = QLabel(self.verticalFrame) self.label.setObjectName(u"label") self.verticalLayout_2.addWidget(self.label) self.treeWidget = QTreeWidget(self.verticalFrame) QTreeWidgetItem(self.treeWidget) QTreeWidgetItem(self.treeWidget) QTreeWidgetItem(self.treeWidget) self.treeWidget.setObjectName(u"treeWidget") font = QFont() font.setFamilies([u"Segoe UI"]) font.setPointSize(10) self.treeWidget.setFont(font) self.treeWidget.setFrameShape(QFrame.VLine) self.treeWidget.setFrameShadow(QFrame.Plain) self.treeWidget.setTabKeyNavigation(True) self.treeWidget.setAlternatingRowColors(False) self.verticalLayout_2.addWidget(self.treeWidget) self.horizontalLayout.addWidget(self.verticalFrame) self.line = QFrame(Dialog) self.line.setObjectName(u"line") self.line.setFrameShape(QFrame.VLine) self.line.setFrameShadow(QFrame.Sunken) self.horizontalLayout.addWidget(self.line) self.stackedWidget = QStackedWidget(Dialog) self.stackedWidget.setObjectName(u"stackedWidget") self.page = QWidget() self.page.setObjectName(u"page") self.verticalLayout_3 = QVBoxLayout(self.page) self.verticalLayout_3.setObjectName(u"verticalLayout_3") self.groupBox = QGroupBox(self.page) self.groupBox.setObjectName(u"groupBox") self.formLayout_4 = QFormLayout(self.groupBox) self.formLayout_4.setObjectName(u"formLayout_4") self.label_2 = QLabel(self.groupBox) self.label_2.setObjectName(u"label_2") self.formLayout_4.setWidget(0, QFormLayout.LabelRole, self.label_2) self.comboBox = QComboBox(self.groupBox) self.comboBox.addItem("") self.comboBox.addItem("") self.comboBox.addItem("") self.comboBox.setObjectName(u"comboBox") self.formLayout_4.setWidget(0, QFormLayout.FieldRole, self.comboBox) self.verticalLayout_3.addWidget(self.groupBox) self.groupBox_2 = QGroupBox(self.page) self.groupBox_2.setObjectName(u"groupBox_2") self.formLayout_3 = QFormLayout(self.groupBox_2) self.formLayout_3.setObjectName(u"formLayout_3") self.label_3 = QLabel(self.groupBox_2) self.label_3.setObjectName(u"label_3") self.formLayout_3.setWidget(1, QFormLayout.LabelRole, self.label_3) self.spinBox = QSpinBox(self.groupBox_2) self.spinBox.setObjectName(u"spinBox") self.spinBox.setValue(11) self.formLayout_3.setWidget(1, QFormLayout.FieldRole, self.spinBox) self.label_4 = QLabel(self.groupBox_2) self.label_4.setObjectName(u"label_4") self.formLayout_3.setWidget(0, QFormLayout.LabelRole, self.label_4) self.fontComboBox = QFontComboBox(self.groupBox_2) self.fontComboBox.setObjectName(u"fontComboBox") self.formLayout_3.setWidget(0, QFormLayout.FieldRole, self.fontComboBox) self.verticalLayout_3.addWidget(self.groupBox_2) self.stackedWidget.addWidget(self.page) self.page_2 = QWidget() self.page_2.setObjectName(u"page_2") self.verticalLayout_5 = QVBoxLayout(self.page_2) self.verticalLayout_5.setObjectName(u"verticalLayout_5") self.verticalLayout_4 = QVBoxLayout() self.verticalLayout_4.setObjectName(u"verticalLayout_4") self.verticalLayout_5.addLayout(self.verticalLayout_4) self.stackedWidget.addWidget(self.page_2) self.horizontalLayout.addWidget(self.stackedWidget) self.verticalLayout.addLayout(self.horizontalLayout) self.buttonBox = QDialogButtonBox(Dialog) self.buttonBox.setObjectName(u"buttonBox") self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Apply | QDialogButtonBox.Close | QDialogButtonBox.Save) self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(Dialog) self.buttonBox.accepted.connect(Dialog.accept) self.buttonBox.rejected.connect(Dialog.reject) self.stackedWidget.setCurrentIndex(0) QMetaObject.connectSlotsByName(Dialog) # setupUi def retranslateUi(self, Dialog): Dialog.setWindowTitle( QCoreApplication.translate("Dialog", u"Dialog", None)) self.label.setText( QCoreApplication.translate("Dialog", u"Preferences", None)) ___qtreewidgetitem = self.treeWidget.headerItem() ___qtreewidgetitem.setText( 0, QCoreApplication.translate("Dialog", u"General", None)) __sortingEnabled = self.treeWidget.isSortingEnabled() self.treeWidget.setSortingEnabled(False) ___qtreewidgetitem1 = self.treeWidget.topLevelItem(0) ___qtreewidgetitem1.setText( 0, QCoreApplication.translate("Dialog", u"Appearance", None)) ___qtreewidgetitem2 = self.treeWidget.topLevelItem(1) ___qtreewidgetitem2.setText( 0, QCoreApplication.translate("Dialog", u"Behavior", None)) ___qtreewidgetitem3 = self.treeWidget.topLevelItem(2) ___qtreewidgetitem3.setText( 0, QCoreApplication.translate("Dialog", u"Advanced", None)) self.treeWidget.setSortingEnabled(__sortingEnabled) self.groupBox.setTitle( QCoreApplication.translate("Dialog", u"Theme", None)) self.label_2.setText( QCoreApplication.translate("Dialog", u"Window style", None)) self.comboBox.setItemText( 0, QCoreApplication.translate("Dialog", u"Native", None)) self.comboBox.setItemText( 1, QCoreApplication.translate("Dialog", u"Fusion", None)) self.comboBox.setItemText( 2, QCoreApplication.translate("Dialog", u"Fusion dark", None)) self.groupBox_2.setTitle( QCoreApplication.translate("Dialog", u"Accessibility", None)) self.label_3.setText( QCoreApplication.translate("Dialog", u"Font size", None)) self.label_4.setText( QCoreApplication.translate("Dialog", u"Font", None))
def setupUi(self, OperationsWidget): if not OperationsWidget.objectName(): OperationsWidget.setObjectName(u"OperationsWidget") OperationsWidget.resize(1232, 552) self.verticalLayout_4 = QVBoxLayout(OperationsWidget) self.verticalLayout_4.setSpacing(0) self.verticalLayout_4.setObjectName(u"verticalLayout_4") self.verticalLayout_4.setContentsMargins(0, 0, 0, 0) self.BalanceOperationsSplitter = QSplitter(OperationsWidget) self.BalanceOperationsSplitter.setObjectName( u"BalanceOperationsSplitter") sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.BalanceOperationsSplitter.sizePolicy().hasHeightForWidth()) self.BalanceOperationsSplitter.setSizePolicy(sizePolicy) self.BalanceOperationsSplitter.setOrientation(Qt.Horizontal) self.BalanceBox = QGroupBox(self.BalanceOperationsSplitter) self.BalanceBox.setObjectName(u"BalanceBox") sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy1.setHorizontalStretch(1) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.BalanceBox.sizePolicy().hasHeightForWidth()) self.BalanceBox.setSizePolicy(sizePolicy1) self.BalanceBox.setMaximumSize(QSize(16777215, 16777215)) self.verticalLayout = QVBoxLayout(self.BalanceBox) self.verticalLayout.setObjectName(u"verticalLayout") self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.BalanceConfigFrame = QFrame(self.BalanceBox) self.BalanceConfigFrame.setObjectName(u"BalanceConfigFrame") self.BalanceConfigFrame.setMinimumSize(QSize(408, 0)) self.BalanceConfigFrame.setMaximumSize(QSize(16777215, 44)) self.BalanceConfigFrame.setFrameShape(QFrame.Panel) self.BalanceConfigFrame.setFrameShadow(QFrame.Plain) self.BalanceConfigFrame.setLineWidth(0) self.horizontalLayout_2 = QHBoxLayout(self.BalanceConfigFrame) self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.horizontalLayout_2.setContentsMargins(2, 2, 2, 2) self.BalanceDate = QDateEdit(self.BalanceConfigFrame) self.BalanceDate.setObjectName(u"BalanceDate") self.BalanceDate.setDateTime( QDateTime(QDate(2020, 11, 25), QTime(21, 0, 0))) self.BalanceDate.setCalendarPopup(True) self.BalanceDate.setTimeSpec(Qt.UTC) self.horizontalLayout_2.addWidget(self.BalanceDate) self.CurrencyLbl = QLabel(self.BalanceConfigFrame) self.CurrencyLbl.setObjectName(u"CurrencyLbl") self.CurrencyLbl.setLayoutDirection(Qt.LeftToRight) self.CurrencyLbl.setAlignment(Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter) self.horizontalLayout_2.addWidget(self.CurrencyLbl) self.BalancesCurrencyCombo = CurrencyComboBox(self.BalanceConfigFrame) self.BalancesCurrencyCombo.setObjectName(u"BalancesCurrencyCombo") self.horizontalLayout_2.addWidget(self.BalancesCurrencyCombo) self.ShowInactiveCheckBox = QCheckBox(self.BalanceConfigFrame) self.ShowInactiveCheckBox.setObjectName(u"ShowInactiveCheckBox") self.horizontalLayout_2.addWidget(self.ShowInactiveCheckBox) self.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout_2.addItem(self.horizontalSpacer_2) self.verticalLayout.addWidget(self.BalanceConfigFrame) self.BalancesTableView = QTableView(self.BalanceBox) self.BalancesTableView.setObjectName(u"BalancesTableView") self.BalancesTableView.setFrameShape(QFrame.Panel) self.BalancesTableView.setEditTriggers( QAbstractItemView.EditKeyPressed | QAbstractItemView.SelectedClicked) self.BalancesTableView.setAlternatingRowColors(True) self.BalancesTableView.setSelectionMode(QAbstractItemView.NoSelection) self.BalancesTableView.setGridStyle(Qt.DotLine) self.BalancesTableView.setWordWrap(False) self.BalancesTableView.verticalHeader().setVisible(False) self.BalancesTableView.verticalHeader().setMinimumSectionSize(20) self.BalancesTableView.verticalHeader().setDefaultSectionSize(20) self.verticalLayout.addWidget(self.BalancesTableView) self.BalanceOperationsSplitter.addWidget(self.BalanceBox) self.OperationsBox = QGroupBox(self.BalanceOperationsSplitter) self.OperationsBox.setObjectName(u"OperationsBox") sizePolicy2 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy2.setHorizontalStretch(4) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth( self.OperationsBox.sizePolicy().hasHeightForWidth()) self.OperationsBox.setSizePolicy(sizePolicy2) self.OperationsBox.setContextMenuPolicy(Qt.DefaultContextMenu) self.verticalLayout_2 = QVBoxLayout(self.OperationsBox) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.verticalLayout_2.setContentsMargins(0, 0, 0, 0) self.OperationConfigFrame = QFrame(self.OperationsBox) self.OperationConfigFrame.setObjectName(u"OperationConfigFrame") self.OperationConfigFrame.setEnabled(True) self.OperationConfigFrame.setMinimumSize(QSize(0, 0)) self.OperationConfigFrame.setFrameShape(QFrame.Panel) self.OperationConfigFrame.setFrameShadow(QFrame.Plain) self.OperationConfigFrame.setLineWidth(0) self.horizontalLayout_3 = QHBoxLayout(self.OperationConfigFrame) self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.horizontalLayout_3.setContentsMargins(2, 2, 2, 2) self.DateRange = DateRangeSelector(self.OperationConfigFrame) self.DateRange.setObjectName(u"DateRange") self.DateRange.setProperty("ItemsList", u"week;month;quarter;year;all") self.horizontalLayout_3.addWidget(self.DateRange) self.AccountLbl = QLabel(self.OperationConfigFrame) self.AccountLbl.setObjectName(u"AccountLbl") self.horizontalLayout_3.addWidget(self.AccountLbl) self.ChooseAccountBtn = AccountButton(self.OperationConfigFrame) self.ChooseAccountBtn.setObjectName(u"ChooseAccountBtn") self.horizontalLayout_3.addWidget(self.ChooseAccountBtn) self.SearchLbl = QLabel(self.OperationConfigFrame) self.SearchLbl.setObjectName(u"SearchLbl") self.horizontalLayout_3.addWidget(self.SearchLbl) self.SearchString = QLineEdit(self.OperationConfigFrame) self.SearchString.setObjectName(u"SearchString") self.horizontalLayout_3.addWidget(self.SearchString) self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout_3.addItem(self.horizontalSpacer) self.verticalLayout_2.addWidget(self.OperationConfigFrame) self.OperationsDetailsSplitter = QSplitter(self.OperationsBox) self.OperationsDetailsSplitter.setObjectName( u"OperationsDetailsSplitter") self.OperationsDetailsSplitter.setOrientation(Qt.Vertical) self.OperationsTableView = QTableView(self.OperationsDetailsSplitter) self.OperationsTableView.setObjectName(u"OperationsTableView") sizePolicy3 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) sizePolicy3.setHorizontalStretch(0) sizePolicy3.setVerticalStretch(4) sizePolicy3.setHeightForWidth( self.OperationsTableView.sizePolicy().hasHeightForWidth()) self.OperationsTableView.setSizePolicy(sizePolicy3) self.OperationsTableView.setAlternatingRowColors(True) self.OperationsTableView.setSelectionMode( QAbstractItemView.ExtendedSelection) self.OperationsTableView.setSelectionBehavior( QAbstractItemView.SelectRows) self.OperationsTableView.setWordWrap(False) self.OperationsDetailsSplitter.addWidget(self.OperationsTableView) self.OperationsTableView.verticalHeader().setVisible(False) self.OperationsTableView.verticalHeader().setMinimumSectionSize(20) self.OperationsTableView.verticalHeader().setDefaultSectionSize(20) self.OperationDetails = QFrame(self.OperationsDetailsSplitter) self.OperationDetails.setObjectName(u"OperationDetails") sizePolicy4 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy4.setHorizontalStretch(0) sizePolicy4.setVerticalStretch(1) sizePolicy4.setHeightForWidth( self.OperationDetails.sizePolicy().hasHeightForWidth()) self.OperationDetails.setSizePolicy(sizePolicy4) self.OperationDetails.setMinimumSize(QSize(0, 100)) self.OperationDetails.setMaximumSize(QSize(16777215, 300)) self.OperationDetails.setFrameShape(QFrame.Panel) self.OperationDetails.setFrameShadow(QFrame.Sunken) self.OperationDetails.setLineWidth(1) self.horizontalLayout_4 = QHBoxLayout(self.OperationDetails) self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0) self.OperationsTabs = QStackedWidget(self.OperationDetails) self.OperationsTabs.setObjectName(u"OperationsTabs") self.NoOperation = QWidget() self.NoOperation.setObjectName(u"NoOperation") self.OperationsTabs.addWidget(self.NoOperation) self.IncomeSpending = IncomeSpendingWidget() self.IncomeSpending.setObjectName(u"IncomeSpending") self.OperationsTabs.addWidget(self.IncomeSpending) self.Dividend = DividendWidget() self.Dividend.setObjectName(u"Dividend") self.OperationsTabs.addWidget(self.Dividend) self.Trade = TradeWidget() self.Trade.setObjectName(u"Trade") self.OperationsTabs.addWidget(self.Trade) self.Transfer = TransferWidget() self.Transfer.setObjectName(u"Transfer") self.OperationsTabs.addWidget(self.Transfer) self.CorporateAction = CorporateActionWidget() self.CorporateAction.setObjectName(u"CorporateAction") self.OperationsTabs.addWidget(self.CorporateAction) self.horizontalLayout_4.addWidget(self.OperationsTabs) self.OperationsButtons = QFrame(self.OperationDetails) self.OperationsButtons.setObjectName(u"OperationsButtons") self.verticalLayout_3 = QVBoxLayout(self.OperationsButtons) self.verticalLayout_3.setSpacing(2) self.verticalLayout_3.setObjectName(u"verticalLayout_3") self.verticalLayout_3.setContentsMargins(2, 2, 2, 2) self.NewOperationBtn = QPushButton(self.OperationsButtons) self.NewOperationBtn.setObjectName(u"NewOperationBtn") self.verticalLayout_3.addWidget(self.NewOperationBtn) self.CopyOperationBtn = QPushButton(self.OperationsButtons) self.CopyOperationBtn.setObjectName(u"CopyOperationBtn") self.verticalLayout_3.addWidget(self.CopyOperationBtn) self.DeleteOperationBtn = QPushButton(self.OperationsButtons) self.DeleteOperationBtn.setObjectName(u"DeleteOperationBtn") self.verticalLayout_3.addWidget(self.DeleteOperationBtn) self.verticalSpacer_4 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) self.verticalLayout_3.addItem(self.verticalSpacer_4) self.horizontalLayout_4.addWidget(self.OperationsButtons) self.OperationsDetailsSplitter.addWidget(self.OperationDetails) self.verticalLayout_2.addWidget(self.OperationsDetailsSplitter) self.BalanceOperationsSplitter.addWidget(self.OperationsBox) self.verticalLayout_4.addWidget(self.BalanceOperationsSplitter) self.retranslateUi(OperationsWidget) self.OperationsTabs.setCurrentIndex(5) QMetaObject.connectSlotsByName(OperationsWidget)
def setupUi(self, opsWidget): if not opsWidget.objectName(): opsWidget.setObjectName(u"opsWidget") opsWidget.resize(484, 788) self.opLayout = QVBoxLayout(opsWidget) self.opLayout.setObjectName(u"opLayout") self.operationSelect = QGroupBox(opsWidget) self.operationSelect.setObjectName(u"operationSelect") self.operationSelect.setEnabled(True) self.operationSelect.setFlat(True) self.verticalLayout_3 = QVBoxLayout(self.operationSelect) self.verticalLayout_3.setSpacing(10) self.verticalLayout_3.setObjectName(u"verticalLayout_3") self.verticalLayout_3.setContentsMargins(4, 4, 4, 4) self.formLayout = QFormLayout() self.formLayout.setObjectName(u"formLayout") self.formLayout.setVerticalSpacing(10) self.formLayout.setContentsMargins(5, 20, 5, 20) self.applyOpLabel = QLabel(self.operationSelect) self.applyOpLabel.setObjectName(u"applyOpLabel") self.formLayout.setWidget(1, QFormLayout.LabelRole, self.applyOpLabel) self.opCombo = QComboBox(self.operationSelect) self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.setObjectName(u"opCombo") self.opCombo.setEnabled(True) self.formLayout.setWidget(1, QFormLayout.FieldRole, self.opCombo) self.applyToLabel = QLabel(self.operationSelect) self.applyToLabel.setObjectName(u"applyToLabel") self.formLayout.setWidget(2, QFormLayout.LabelRole, self.applyToLabel) self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.verticalLayout_18 = QVBoxLayout() self.verticalLayout_18.setObjectName(u"verticalLayout_18") self.horizontalLayout_2 = QHBoxLayout() self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.allDemoCheck = QCheckBox(self.operationSelect) self.allDemoCheck.setObjectName(u"allDemoCheck") self.allDemoCheck.setMaximumSize(QSize(10000, 16777215)) self.horizontalLayout_2.addWidget(self.allDemoCheck) self.allStepsCheck = QCheckBox(self.operationSelect) self.allStepsCheck.setObjectName(u"allStepsCheck") sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.allStepsCheck.sizePolicy().hasHeightForWidth()) self.allStepsCheck.setSizePolicy(sizePolicy) self.allStepsCheck.setMinimumSize(QSize(180, 0)) self.allStepsCheck.setLayoutDirection(Qt.LeftToRight) self.horizontalLayout_2.addWidget(self.allStepsCheck) self.verticalLayout_18.addLayout(self.horizontalLayout_2) self.matchSubstringCheck = QCheckBox(self.operationSelect) self.matchSubstringCheck.setObjectName(u"matchSubstringCheck") self.verticalLayout_18.addWidget(self.matchSubstringCheck) self.horizontalLayout_13 = QHBoxLayout() self.horizontalLayout_13.setObjectName(u"horizontalLayout_13") self.label_16 = QLabel(self.operationSelect) self.label_16.setObjectName(u"label_16") self.label_16.setEnabled(False) self.horizontalLayout_13.addWidget(self.label_16) self.matchSubstringText = QLineEdit(self.operationSelect) self.matchSubstringText.setObjectName(u"matchSubstringText") self.matchSubstringText.setEnabled(False) self.horizontalLayout_13.addWidget(self.matchSubstringText) self.verticalLayout_18.addLayout(self.horizontalLayout_13) self.horizontalLayout.addLayout(self.verticalLayout_18) self.formLayout.setLayout(2, QFormLayout.FieldRole, self.horizontalLayout) self.applyDemoLabel = QLabel(self.operationSelect) self.applyDemoLabel.setObjectName(u"applyDemoLabel") self.formLayout.setWidget(0, QFormLayout.LabelRole, self.applyDemoLabel) self.demoTargetCombo = QComboBox(self.operationSelect) self.demoTargetCombo.setObjectName(u"demoTargetCombo") self.formLayout.setWidget(0, QFormLayout.FieldRole, self.demoTargetCombo) self.verticalLayout_3.addLayout(self.formLayout) self.opLayout.addWidget(self.operationSelect) self.groupBox_6 = QGroupBox(opsWidget) self.groupBox_6.setObjectName(u"groupBox_6") self.groupBox_6.setEnabled(True) self.groupBox_6.setFlat(True) self.verticalLayout = QVBoxLayout(self.groupBox_6) self.verticalLayout.setObjectName(u"verticalLayout") self.verticalLayout.setContentsMargins(4, 4, 4, 4) self.opsParamsStack = QStackedWidget(self.groupBox_6) self.opsParamsStack.setObjectName(u"opsParamsStack") self.opsParamsStack.setAutoFillBackground(False) self.shellTab = QWidget() self.shellTab.setObjectName(u"shellTab") self.shellTab.setAutoFillBackground(False) self.formLayout_2 = QFormLayout(self.shellTab) self.formLayout_2.setObjectName(u"formLayout_2") self.formLayout_2.setLabelAlignment(Qt.AlignLeading | Qt.AlignLeft | Qt.AlignVCenter) self.formLayout_2.setFormAlignment(Qt.AlignLeading | Qt.AlignLeft | Qt.AlignVCenter) self.formLayout_2.setVerticalSpacing(40) self.formLayout_2.setContentsMargins(-1, 11, -1, -1) self.label = QLabel(self.shellTab) self.label.setObjectName(u"label") self.formLayout_2.setWidget(0, QFormLayout.LabelRole, self.label) self.horizontalLayout_4 = QHBoxLayout() self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") self.shellImgPath = QLineEdit(self.shellTab) self.shellImgPath.setObjectName(u"shellImgPath") self.horizontalLayout_4.addWidget(self.shellImgPath) self.shellBrowseImgBtn = QPushButton(self.shellTab) self.shellBrowseImgBtn.setObjectName(u"shellBrowseImgBtn") self.horizontalLayout_4.addWidget(self.shellBrowseImgBtn) self.formLayout_2.setLayout(0, QFormLayout.FieldRole, self.horizontalLayout_4) self.label_2 = QLabel(self.shellTab) self.label_2.setObjectName(u"label_2") self.formLayout_2.setWidget(1, QFormLayout.LabelRole, self.label_2) self.horizontalLayout_7 = QHBoxLayout() self.horizontalLayout_7.setObjectName(u"horizontalLayout_7") self.label_3 = QLabel(self.shellTab) self.label_3.setObjectName(u"label_3") self.label_3.setAlignment(Qt.AlignCenter) self.horizontalLayout_7.addWidget(self.label_3) self.shellFgX = QSpinBox(self.shellTab) self.shellFgX.setObjectName(u"shellFgX") self.shellFgX.setMaximum(100000000) self.horizontalLayout_7.addWidget(self.shellFgX) self.label_4 = QLabel(self.shellTab) self.label_4.setObjectName(u"label_4") self.label_4.setAlignment(Qt.AlignCenter) self.horizontalLayout_7.addWidget(self.label_4) self.shellFgY = QSpinBox(self.shellTab) self.shellFgY.setObjectName(u"shellFgY") self.shellFgY.setMaximum(100000000) self.horizontalLayout_7.addWidget(self.shellFgY) self.formLayout_2.setLayout(1, QFormLayout.FieldRole, self.horizontalLayout_7) self.label_5 = QLabel(self.shellTab) self.label_5.setObjectName(u"label_5") self.formLayout_2.setWidget(2, QFormLayout.LabelRole, self.label_5) self.horizontalLayout_8 = QHBoxLayout() self.horizontalLayout_8.setObjectName(u"horizontalLayout_8") self.label_7 = QLabel(self.shellTab) self.label_7.setObjectName(u"label_7") self.label_7.setAlignment(Qt.AlignCenter) self.horizontalLayout_8.addWidget(self.label_7) self.shellFgW = QSpinBox(self.shellTab) self.shellFgW.setObjectName(u"shellFgW") self.shellFgW.setMaximum(100000000) self.horizontalLayout_8.addWidget(self.shellFgW) self.label_6 = QLabel(self.shellTab) self.label_6.setObjectName(u"label_6") self.label_6.setAlignment(Qt.AlignCenter) self.horizontalLayout_8.addWidget(self.label_6) self.shellFgH = QSpinBox(self.shellTab) self.shellFgH.setObjectName(u"shellFgH") self.shellFgH.setMaximum(10000000) self.horizontalLayout_8.addWidget(self.shellFgH) self.formLayout_2.setLayout(2, QFormLayout.FieldRole, self.horizontalLayout_8) self.opsParamsStack.addWidget(self.shellTab) self.insertTab = QWidget() self.insertTab.setObjectName(u"insertTab") self.formLayout_3 = QFormLayout(self.insertTab) self.formLayout_3.setObjectName(u"formLayout_3") self.formLayout_3.setVerticalSpacing(40) self.formLayout_3.setContentsMargins(-1, 40, -1, -1) self.label_32 = QLabel(self.insertTab) self.label_32.setObjectName(u"label_32") self.formLayout_3.setWidget(0, QFormLayout.LabelRole, self.label_32) self.horizontalLayout_20 = QHBoxLayout() self.horizontalLayout_20.setObjectName(u"horizontalLayout_20") self.insertImgPath = QLineEdit(self.insertTab) self.insertImgPath.setObjectName(u"insertImgPath") self.horizontalLayout_20.addWidget(self.insertImgPath) self.insertBrowseImgBtn = QPushButton(self.insertTab) self.insertBrowseImgBtn.setObjectName(u"insertBrowseImgBtn") self.horizontalLayout_20.addWidget(self.insertBrowseImgBtn) self.formLayout_3.setLayout(0, QFormLayout.FieldRole, self.horizontalLayout_20) self.label_13 = QLabel(self.insertTab) self.label_13.setObjectName(u"label_13") self.formLayout_3.setWidget(1, QFormLayout.LabelRole, self.label_13) self.horizontalLayout_18 = QHBoxLayout() self.horizontalLayout_18.setObjectName(u"horizontalLayout_18") self.label_26 = QLabel(self.insertTab) self.label_26.setObjectName(u"label_26") self.label_26.setAlignment(Qt.AlignCenter) self.horizontalLayout_18.addWidget(self.label_26) self.insertFgX = QSpinBox(self.insertTab) self.insertFgX.setObjectName(u"insertFgX") sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.insertFgX.sizePolicy().hasHeightForWidth()) self.insertFgX.setSizePolicy(sizePolicy1) self.insertFgX.setMaximum(10000000) self.horizontalLayout_18.addWidget(self.insertFgX) self.label_29 = QLabel(self.insertTab) self.label_29.setObjectName(u"label_29") self.label_29.setAlignment(Qt.AlignCenter) self.horizontalLayout_18.addWidget(self.label_29) self.insertFgY = QSpinBox(self.insertTab) self.insertFgY.setObjectName(u"insertFgY") self.insertFgY.setMaximum(10000000) self.horizontalLayout_18.addWidget(self.insertFgY) self.formLayout_3.setLayout(1, QFormLayout.FieldRole, self.horizontalLayout_18) self.label_12 = QLabel(self.insertTab) self.label_12.setObjectName(u"label_12") self.formLayout_3.setWidget(2, QFormLayout.LabelRole, self.label_12) self.horizontalLayout_21 = QHBoxLayout() self.horizontalLayout_21.setObjectName(u"horizontalLayout_21") self.label_33 = QLabel(self.insertTab) self.label_33.setObjectName(u"label_33") self.label_33.setAlignment(Qt.AlignCenter) self.horizontalLayout_21.addWidget(self.label_33) self.insertFgW = QSpinBox(self.insertTab) self.insertFgW.setObjectName(u"insertFgW") self.insertFgW.setBaseSize(QSize(1920, 0)) self.insertFgW.setMaximum(1000000) self.insertFgW.setValue(1920) self.horizontalLayout_21.addWidget(self.insertFgW) self.label_34 = QLabel(self.insertTab) self.label_34.setObjectName(u"label_34") self.label_34.setAlignment(Qt.AlignCenter) self.horizontalLayout_21.addWidget(self.label_34) self.insertFgH = QSpinBox(self.insertTab) self.insertFgH.setObjectName(u"insertFgH") self.insertFgH.setMaximum(1000000000) self.insertFgH.setValue(1080) self.horizontalLayout_21.addWidget(self.insertFgH) self.formLayout_3.setLayout(2, QFormLayout.FieldRole, self.horizontalLayout_21) self.opsParamsStack.addWidget(self.insertTab) self.sectionTab = QWidget() self.sectionTab.setObjectName(u"sectionTab") self.formLayout_6 = QFormLayout(self.sectionTab) self.formLayout_6.setObjectName(u"formLayout_6") self.sectionRulesListWidget = QListWidget(self.sectionTab) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) self.sectionRulesListWidget.setObjectName(u"sectionRulesListWidget") self.sectionRulesListWidget.setMaximumSize(QSize(16777215, 100)) self.formLayout_6.setWidget(1, QFormLayout.FieldRole, self.sectionRulesListWidget) self.label_10 = QLabel(self.sectionTab) self.label_10.setObjectName(u"label_10") self.label_10.setMaximumSize(QSize(16777215, 20)) self.formLayout_6.setWidget(0, QFormLayout.FieldRole, self.label_10) self.sectionCoverageLabel = QLabel(self.sectionTab) self.sectionCoverageLabel.setObjectName(u"sectionCoverageLabel") self.sectionCoverageLabel.setMaximumSize(QSize(16777215, 20)) self.formLayout_6.setWidget(2, QFormLayout.FieldRole, self.sectionCoverageLabel) self.label_11 = QLabel(self.sectionTab) self.label_11.setObjectName(u"label_11") self.label_11.setMaximumSize(QSize(16777215, 20)) self.formLayout_6.setWidget(3, QFormLayout.FieldRole, self.label_11) self.opsParamsStack.addWidget(self.sectionTab) self.audioTab = QWidget() self.audioTab.setObjectName(u"audioTab") self.formLayout_8 = QFormLayout(self.audioTab) self.formLayout_8.setObjectName(u"formLayout_8") self.comboBox = QComboBox(self.audioTab) self.comboBox.addItem("") self.comboBox.addItem("") self.comboBox.addItem("") self.comboBox.setObjectName(u"comboBox") self.formLayout_8.setWidget(0, QFormLayout.FieldRole, self.comboBox) self.label_8 = QLabel(self.audioTab) self.label_8.setObjectName(u"label_8") self.formLayout_8.setWidget(0, QFormLayout.LabelRole, self.label_8) self.opsParamsStack.addWidget(self.audioTab) self.cropTab = QWidget() self.cropTab.setObjectName(u"cropTab") self.formLayout_4 = QFormLayout(self.cropTab) self.formLayout_4.setObjectName(u"formLayout_4") self.formLayout_4.setVerticalSpacing(40) self.formLayout_4.setContentsMargins(-1, 40, -1, -1) self.label_14 = QLabel(self.cropTab) self.label_14.setObjectName(u"label_14") self.formLayout_4.setWidget(0, QFormLayout.LabelRole, self.label_14) self.horizontalLayout_19 = QHBoxLayout() self.horizontalLayout_19.setObjectName(u"horizontalLayout_19") self.label_30 = QLabel(self.cropTab) self.label_30.setObjectName(u"label_30") self.label_30.setAlignment(Qt.AlignCenter) self.horizontalLayout_19.addWidget(self.label_30) self.spinBox_21 = QSpinBox(self.cropTab) self.spinBox_21.setObjectName(u"spinBox_21") self.horizontalLayout_19.addWidget(self.spinBox_21) self.label_31 = QLabel(self.cropTab) self.label_31.setObjectName(u"label_31") self.label_31.setAlignment(Qt.AlignCenter) self.horizontalLayout_19.addWidget(self.label_31) self.spinBox_22 = QSpinBox(self.cropTab) self.spinBox_22.setObjectName(u"spinBox_22") self.horizontalLayout_19.addWidget(self.spinBox_22) self.formLayout_4.setLayout(0, QFormLayout.FieldRole, self.horizontalLayout_19) self.label_15 = QLabel(self.cropTab) self.label_15.setObjectName(u"label_15") self.formLayout_4.setWidget(1, QFormLayout.LabelRole, self.label_15) self.horizontalLayout_22 = QHBoxLayout() self.horizontalLayout_22.setObjectName(u"horizontalLayout_22") self.label_35 = QLabel(self.cropTab) self.label_35.setObjectName(u"label_35") self.label_35.setAlignment(Qt.AlignCenter) self.horizontalLayout_22.addWidget(self.label_35) self.spinBox_25 = QSpinBox(self.cropTab) self.spinBox_25.setObjectName(u"spinBox_25") self.horizontalLayout_22.addWidget(self.spinBox_25) self.label_36 = QLabel(self.cropTab) self.label_36.setObjectName(u"label_36") self.label_36.setAlignment(Qt.AlignCenter) self.horizontalLayout_22.addWidget(self.label_36) self.spinBox_26 = QSpinBox(self.cropTab) self.spinBox_26.setObjectName(u"spinBox_26") self.horizontalLayout_22.addWidget(self.spinBox_26) self.formLayout_4.setLayout(1, QFormLayout.FieldRole, self.horizontalLayout_22) self.opsParamsStack.addWidget(self.cropTab) self.composeTab = QWidget() self.composeTab.setObjectName(u"composeTab") self.verticalLayout_12 = QVBoxLayout(self.composeTab) self.verticalLayout_12.setObjectName(u"verticalLayout_12") self.verticalLayout_11 = QVBoxLayout() self.verticalLayout_11.setObjectName(u"verticalLayout_11") self.verticalLayout_12.addLayout(self.verticalLayout_11) self.opsParamsStack.addWidget(self.composeTab) self.resizeTab = QWidget() self.resizeTab.setObjectName(u"resizeTab") self.verticalLayout_10 = QVBoxLayout(self.resizeTab) self.verticalLayout_10.setObjectName(u"verticalLayout_10") self.verticalLayout_9 = QVBoxLayout() self.verticalLayout_9.setObjectName(u"verticalLayout_9") self.verticalLayout_10.addLayout(self.verticalLayout_9) self.opsParamsStack.addWidget(self.resizeTab) self.pacingTab = QWidget() self.pacingTab.setObjectName(u"pacingTab") self.verticalLayout_5 = QVBoxLayout(self.pacingTab) self.verticalLayout_5.setObjectName(u"verticalLayout_5") self.verticalLayout_5.setContentsMargins(0, 0, 0, 0) self.tabWidget = QTabWidget(self.pacingTab) self.tabWidget.setObjectName(u"tabWidget") self.tab = QWidget() self.tab.setObjectName(u"tab") self.tabWidget.addTab(self.tab, "") self.tab_2 = QWidget() self.tab_2.setObjectName(u"tab_2") self.tabWidget.addTab(self.tab_2, "") self.verticalLayout_5.addWidget(self.tabWidget) self.opsParamsStack.addWidget(self.pacingTab) self.animateTab = QWidget() self.animateTab.setObjectName(u"animateTab") self.verticalLayout_14 = QVBoxLayout(self.animateTab) self.verticalLayout_14.setObjectName(u"verticalLayout_14") self.verticalLayout_13 = QVBoxLayout() self.verticalLayout_13.setObjectName(u"verticalLayout_13") self.verticalLayout_14.addLayout(self.verticalLayout_13) self.opsParamsStack.addWidget(self.animateTab) self.renderTab = QWidget() self.renderTab.setObjectName(u"renderTab") self.verticalLayout_4 = QVBoxLayout(self.renderTab) self.verticalLayout_4.setObjectName(u"verticalLayout_4") self.verticalLayout_4.setContentsMargins(0, 0, 0, 0) self.renderTabTabs = QTabWidget(self.renderTab) self.renderTabTabs.setObjectName(u"renderTabTabs") self.renderTabVideoTab = QWidget() self.renderTabVideoTab.setObjectName(u"renderTabVideoTab") self.verticalLayout_2 = QVBoxLayout(self.renderTabVideoTab) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.verticalLayout_2.setContentsMargins(5, 5, 5, 5) self.scrollArea = QScrollArea(self.renderTabVideoTab) self.scrollArea.setObjectName(u"scrollArea") self.scrollArea.setFrameShape(QFrame.Panel) self.scrollArea.setFrameShadow(QFrame.Plain) self.scrollArea.setLineWidth(0) self.scrollArea.setWidgetResizable(True) self.scrollAreaWidgetContents = QWidget() self.scrollAreaWidgetContents.setObjectName( u"scrollAreaWidgetContents") self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 438, 412)) self.formLayout_10 = QFormLayout(self.scrollAreaWidgetContents) self.formLayout_10.setObjectName(u"formLayout_10") self.videoTitleLabel = QLabel(self.scrollAreaWidgetContents) self.videoTitleLabel.setObjectName(u"videoTitleLabel") self.formLayout_10.setWidget(0, QFormLayout.LabelRole, self.videoTitleLabel) self.renderOutputTitle = QLineEdit(self.scrollAreaWidgetContents) self.renderOutputTitle.setObjectName(u"renderOutputTitle") self.formLayout_10.setWidget(0, QFormLayout.FieldRole, self.renderOutputTitle) self.videoDirectoryLabel = QLabel(self.scrollAreaWidgetContents) self.videoDirectoryLabel.setObjectName(u"videoDirectoryLabel") self.formLayout_10.setWidget(1, QFormLayout.LabelRole, self.videoDirectoryLabel) self.renderOutputDir = QLineEdit(self.scrollAreaWidgetContents) self.renderOutputDir.setObjectName(u"renderOutputDir") self.formLayout_10.setWidget(1, QFormLayout.FieldRole, self.renderOutputDir) self.videoFormatLabel = QLabel(self.scrollAreaWidgetContents) self.videoFormatLabel.setObjectName(u"videoFormatLabel") self.formLayout_10.setWidget(2, QFormLayout.LabelRole, self.videoFormatLabel) self.renderOutputFormat = QComboBox(self.scrollAreaWidgetContents) self.renderOutputFormat.addItem("") self.renderOutputFormat.addItem("") self.renderOutputFormat.setObjectName(u"renderOutputFormat") self.formLayout_10.setWidget(2, QFormLayout.FieldRole, self.renderOutputFormat) self.scrollArea.setWidget(self.scrollAreaWidgetContents) self.verticalLayout_2.addWidget(self.scrollArea) self.renderTabTabs.addTab(self.renderTabVideoTab, "") self.renderTabAudioTab = QWidget() self.renderTabAudioTab.setObjectName(u"renderTabAudioTab") self.verticalLayout_6 = QVBoxLayout(self.renderTabAudioTab) self.verticalLayout_6.setObjectName(u"verticalLayout_6") self.scrollArea_2 = QScrollArea(self.renderTabAudioTab) self.scrollArea_2.setObjectName(u"scrollArea_2") self.scrollArea_2.setWidgetResizable(True) self.scrollAreaWidgetContents_2 = QWidget() self.scrollAreaWidgetContents_2.setObjectName( u"scrollAreaWidgetContents_2") self.scrollAreaWidgetContents_2.setGeometry(QRect(0, 0, 428, 402)) self.formLayout_11 = QFormLayout(self.scrollAreaWidgetContents_2) self.formLayout_11.setObjectName(u"formLayout_11") self.scrollArea_2.setWidget(self.scrollAreaWidgetContents_2) self.verticalLayout_6.addWidget(self.scrollArea_2) self.renderTabTabs.addTab(self.renderTabAudioTab, "") self.renderTabPacingTab = QWidget() self.renderTabPacingTab.setObjectName(u"renderTabPacingTab") self.verticalLayout_8 = QVBoxLayout(self.renderTabPacingTab) self.verticalLayout_8.setObjectName(u"verticalLayout_8") self.scrollArea_3 = QScrollArea(self.renderTabPacingTab) self.scrollArea_3.setObjectName(u"scrollArea_3") self.scrollArea_3.setWidgetResizable(True) self.scrollAreaWidgetContents_3 = QWidget() self.scrollAreaWidgetContents_3.setObjectName( u"scrollAreaWidgetContents_3") self.scrollAreaWidgetContents_3.setGeometry(QRect(0, 0, 428, 402)) self.formLayout_12 = QFormLayout(self.scrollAreaWidgetContents_3) self.formLayout_12.setObjectName(u"formLayout_12") self.scrollArea_3.setWidget(self.scrollAreaWidgetContents_3) self.verticalLayout_8.addWidget(self.scrollArea_3) self.renderTabTabs.addTab(self.renderTabPacingTab, "") self.verticalLayout_4.addWidget(self.renderTabTabs) self.opsParamsStack.addWidget(self.renderTab) self.extraTab = QWidget() self.extraTab.setObjectName(u"extraTab") self.formLayout_7 = QFormLayout(self.extraTab) self.formLayout_7.setObjectName(u"formLayout_7") self.opsParamsStack.addWidget(self.extraTab) self.verticalLayout.addWidget(self.opsParamsStack) self.opLayout.addWidget(self.groupBox_6) self.horizontalLayout_9 = QHBoxLayout() self.horizontalLayout_9.setObjectName(u"horizontalLayout_9") self.horizontalLayout_9.setContentsMargins(10, 10, 10, 10) self.resetStepParamsBtn = QPushButton(opsWidget) self.resetStepParamsBtn.setObjectName(u"resetStepParamsBtn") self.horizontalLayout_9.addWidget(self.resetStepParamsBtn) self.saveStepParamsBtn = QPushButton(opsWidget) self.saveStepParamsBtn.setObjectName(u"saveStepParamsBtn") self.horizontalLayout_9.addWidget(self.saveStepParamsBtn) self.opLayout.addLayout(self.horizontalLayout_9) self.retranslateUi(opsWidget) self.opCombo.currentIndexChanged.connect( self.opsParamsStack.setCurrentIndex) self.opsParamsStack.setCurrentIndex(9) self.renderTabTabs.setCurrentIndex(0) QMetaObject.connectSlotsByName(opsWidget)
class Ui_opsWidget(object): def setupUi(self, opsWidget): if not opsWidget.objectName(): opsWidget.setObjectName(u"opsWidget") opsWidget.resize(484, 788) self.opLayout = QVBoxLayout(opsWidget) self.opLayout.setObjectName(u"opLayout") self.operationSelect = QGroupBox(opsWidget) self.operationSelect.setObjectName(u"operationSelect") self.operationSelect.setEnabled(True) self.operationSelect.setFlat(True) self.verticalLayout_3 = QVBoxLayout(self.operationSelect) self.verticalLayout_3.setSpacing(10) self.verticalLayout_3.setObjectName(u"verticalLayout_3") self.verticalLayout_3.setContentsMargins(4, 4, 4, 4) self.formLayout = QFormLayout() self.formLayout.setObjectName(u"formLayout") self.formLayout.setVerticalSpacing(10) self.formLayout.setContentsMargins(5, 20, 5, 20) self.applyOpLabel = QLabel(self.operationSelect) self.applyOpLabel.setObjectName(u"applyOpLabel") self.formLayout.setWidget(1, QFormLayout.LabelRole, self.applyOpLabel) self.opCombo = QComboBox(self.operationSelect) self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.setObjectName(u"opCombo") self.opCombo.setEnabled(True) self.formLayout.setWidget(1, QFormLayout.FieldRole, self.opCombo) self.applyToLabel = QLabel(self.operationSelect) self.applyToLabel.setObjectName(u"applyToLabel") self.formLayout.setWidget(2, QFormLayout.LabelRole, self.applyToLabel) self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.verticalLayout_18 = QVBoxLayout() self.verticalLayout_18.setObjectName(u"verticalLayout_18") self.horizontalLayout_2 = QHBoxLayout() self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.allDemoCheck = QCheckBox(self.operationSelect) self.allDemoCheck.setObjectName(u"allDemoCheck") self.allDemoCheck.setMaximumSize(QSize(10000, 16777215)) self.horizontalLayout_2.addWidget(self.allDemoCheck) self.allStepsCheck = QCheckBox(self.operationSelect) self.allStepsCheck.setObjectName(u"allStepsCheck") sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.allStepsCheck.sizePolicy().hasHeightForWidth()) self.allStepsCheck.setSizePolicy(sizePolicy) self.allStepsCheck.setMinimumSize(QSize(180, 0)) self.allStepsCheck.setLayoutDirection(Qt.LeftToRight) self.horizontalLayout_2.addWidget(self.allStepsCheck) self.verticalLayout_18.addLayout(self.horizontalLayout_2) self.matchSubstringCheck = QCheckBox(self.operationSelect) self.matchSubstringCheck.setObjectName(u"matchSubstringCheck") self.verticalLayout_18.addWidget(self.matchSubstringCheck) self.horizontalLayout_13 = QHBoxLayout() self.horizontalLayout_13.setObjectName(u"horizontalLayout_13") self.label_16 = QLabel(self.operationSelect) self.label_16.setObjectName(u"label_16") self.label_16.setEnabled(False) self.horizontalLayout_13.addWidget(self.label_16) self.matchSubstringText = QLineEdit(self.operationSelect) self.matchSubstringText.setObjectName(u"matchSubstringText") self.matchSubstringText.setEnabled(False) self.horizontalLayout_13.addWidget(self.matchSubstringText) self.verticalLayout_18.addLayout(self.horizontalLayout_13) self.horizontalLayout.addLayout(self.verticalLayout_18) self.formLayout.setLayout(2, QFormLayout.FieldRole, self.horizontalLayout) self.applyDemoLabel = QLabel(self.operationSelect) self.applyDemoLabel.setObjectName(u"applyDemoLabel") self.formLayout.setWidget(0, QFormLayout.LabelRole, self.applyDemoLabel) self.demoTargetCombo = QComboBox(self.operationSelect) self.demoTargetCombo.setObjectName(u"demoTargetCombo") self.formLayout.setWidget(0, QFormLayout.FieldRole, self.demoTargetCombo) self.verticalLayout_3.addLayout(self.formLayout) self.opLayout.addWidget(self.operationSelect) self.groupBox_6 = QGroupBox(opsWidget) self.groupBox_6.setObjectName(u"groupBox_6") self.groupBox_6.setEnabled(True) self.groupBox_6.setFlat(True) self.verticalLayout = QVBoxLayout(self.groupBox_6) self.verticalLayout.setObjectName(u"verticalLayout") self.verticalLayout.setContentsMargins(4, 4, 4, 4) self.opsParamsStack = QStackedWidget(self.groupBox_6) self.opsParamsStack.setObjectName(u"opsParamsStack") self.opsParamsStack.setAutoFillBackground(False) self.shellTab = QWidget() self.shellTab.setObjectName(u"shellTab") self.shellTab.setAutoFillBackground(False) self.formLayout_2 = QFormLayout(self.shellTab) self.formLayout_2.setObjectName(u"formLayout_2") self.formLayout_2.setLabelAlignment(Qt.AlignLeading | Qt.AlignLeft | Qt.AlignVCenter) self.formLayout_2.setFormAlignment(Qt.AlignLeading | Qt.AlignLeft | Qt.AlignVCenter) self.formLayout_2.setVerticalSpacing(40) self.formLayout_2.setContentsMargins(-1, 11, -1, -1) self.label = QLabel(self.shellTab) self.label.setObjectName(u"label") self.formLayout_2.setWidget(0, QFormLayout.LabelRole, self.label) self.horizontalLayout_4 = QHBoxLayout() self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") self.shellImgPath = QLineEdit(self.shellTab) self.shellImgPath.setObjectName(u"shellImgPath") self.horizontalLayout_4.addWidget(self.shellImgPath) self.shellBrowseImgBtn = QPushButton(self.shellTab) self.shellBrowseImgBtn.setObjectName(u"shellBrowseImgBtn") self.horizontalLayout_4.addWidget(self.shellBrowseImgBtn) self.formLayout_2.setLayout(0, QFormLayout.FieldRole, self.horizontalLayout_4) self.label_2 = QLabel(self.shellTab) self.label_2.setObjectName(u"label_2") self.formLayout_2.setWidget(1, QFormLayout.LabelRole, self.label_2) self.horizontalLayout_7 = QHBoxLayout() self.horizontalLayout_7.setObjectName(u"horizontalLayout_7") self.label_3 = QLabel(self.shellTab) self.label_3.setObjectName(u"label_3") self.label_3.setAlignment(Qt.AlignCenter) self.horizontalLayout_7.addWidget(self.label_3) self.shellFgX = QSpinBox(self.shellTab) self.shellFgX.setObjectName(u"shellFgX") self.shellFgX.setMaximum(100000000) self.horizontalLayout_7.addWidget(self.shellFgX) self.label_4 = QLabel(self.shellTab) self.label_4.setObjectName(u"label_4") self.label_4.setAlignment(Qt.AlignCenter) self.horizontalLayout_7.addWidget(self.label_4) self.shellFgY = QSpinBox(self.shellTab) self.shellFgY.setObjectName(u"shellFgY") self.shellFgY.setMaximum(100000000) self.horizontalLayout_7.addWidget(self.shellFgY) self.formLayout_2.setLayout(1, QFormLayout.FieldRole, self.horizontalLayout_7) self.label_5 = QLabel(self.shellTab) self.label_5.setObjectName(u"label_5") self.formLayout_2.setWidget(2, QFormLayout.LabelRole, self.label_5) self.horizontalLayout_8 = QHBoxLayout() self.horizontalLayout_8.setObjectName(u"horizontalLayout_8") self.label_7 = QLabel(self.shellTab) self.label_7.setObjectName(u"label_7") self.label_7.setAlignment(Qt.AlignCenter) self.horizontalLayout_8.addWidget(self.label_7) self.shellFgW = QSpinBox(self.shellTab) self.shellFgW.setObjectName(u"shellFgW") self.shellFgW.setMaximum(100000000) self.horizontalLayout_8.addWidget(self.shellFgW) self.label_6 = QLabel(self.shellTab) self.label_6.setObjectName(u"label_6") self.label_6.setAlignment(Qt.AlignCenter) self.horizontalLayout_8.addWidget(self.label_6) self.shellFgH = QSpinBox(self.shellTab) self.shellFgH.setObjectName(u"shellFgH") self.shellFgH.setMaximum(10000000) self.horizontalLayout_8.addWidget(self.shellFgH) self.formLayout_2.setLayout(2, QFormLayout.FieldRole, self.horizontalLayout_8) self.opsParamsStack.addWidget(self.shellTab) self.insertTab = QWidget() self.insertTab.setObjectName(u"insertTab") self.formLayout_3 = QFormLayout(self.insertTab) self.formLayout_3.setObjectName(u"formLayout_3") self.formLayout_3.setVerticalSpacing(40) self.formLayout_3.setContentsMargins(-1, 40, -1, -1) self.label_32 = QLabel(self.insertTab) self.label_32.setObjectName(u"label_32") self.formLayout_3.setWidget(0, QFormLayout.LabelRole, self.label_32) self.horizontalLayout_20 = QHBoxLayout() self.horizontalLayout_20.setObjectName(u"horizontalLayout_20") self.insertImgPath = QLineEdit(self.insertTab) self.insertImgPath.setObjectName(u"insertImgPath") self.horizontalLayout_20.addWidget(self.insertImgPath) self.insertBrowseImgBtn = QPushButton(self.insertTab) self.insertBrowseImgBtn.setObjectName(u"insertBrowseImgBtn") self.horizontalLayout_20.addWidget(self.insertBrowseImgBtn) self.formLayout_3.setLayout(0, QFormLayout.FieldRole, self.horizontalLayout_20) self.label_13 = QLabel(self.insertTab) self.label_13.setObjectName(u"label_13") self.formLayout_3.setWidget(1, QFormLayout.LabelRole, self.label_13) self.horizontalLayout_18 = QHBoxLayout() self.horizontalLayout_18.setObjectName(u"horizontalLayout_18") self.label_26 = QLabel(self.insertTab) self.label_26.setObjectName(u"label_26") self.label_26.setAlignment(Qt.AlignCenter) self.horizontalLayout_18.addWidget(self.label_26) self.insertFgX = QSpinBox(self.insertTab) self.insertFgX.setObjectName(u"insertFgX") sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.insertFgX.sizePolicy().hasHeightForWidth()) self.insertFgX.setSizePolicy(sizePolicy1) self.insertFgX.setMaximum(10000000) self.horizontalLayout_18.addWidget(self.insertFgX) self.label_29 = QLabel(self.insertTab) self.label_29.setObjectName(u"label_29") self.label_29.setAlignment(Qt.AlignCenter) self.horizontalLayout_18.addWidget(self.label_29) self.insertFgY = QSpinBox(self.insertTab) self.insertFgY.setObjectName(u"insertFgY") self.insertFgY.setMaximum(10000000) self.horizontalLayout_18.addWidget(self.insertFgY) self.formLayout_3.setLayout(1, QFormLayout.FieldRole, self.horizontalLayout_18) self.label_12 = QLabel(self.insertTab) self.label_12.setObjectName(u"label_12") self.formLayout_3.setWidget(2, QFormLayout.LabelRole, self.label_12) self.horizontalLayout_21 = QHBoxLayout() self.horizontalLayout_21.setObjectName(u"horizontalLayout_21") self.label_33 = QLabel(self.insertTab) self.label_33.setObjectName(u"label_33") self.label_33.setAlignment(Qt.AlignCenter) self.horizontalLayout_21.addWidget(self.label_33) self.insertFgW = QSpinBox(self.insertTab) self.insertFgW.setObjectName(u"insertFgW") self.insertFgW.setBaseSize(QSize(1920, 0)) self.insertFgW.setMaximum(1000000) self.insertFgW.setValue(1920) self.horizontalLayout_21.addWidget(self.insertFgW) self.label_34 = QLabel(self.insertTab) self.label_34.setObjectName(u"label_34") self.label_34.setAlignment(Qt.AlignCenter) self.horizontalLayout_21.addWidget(self.label_34) self.insertFgH = QSpinBox(self.insertTab) self.insertFgH.setObjectName(u"insertFgH") self.insertFgH.setMaximum(1000000000) self.insertFgH.setValue(1080) self.horizontalLayout_21.addWidget(self.insertFgH) self.formLayout_3.setLayout(2, QFormLayout.FieldRole, self.horizontalLayout_21) self.opsParamsStack.addWidget(self.insertTab) self.sectionTab = QWidget() self.sectionTab.setObjectName(u"sectionTab") self.formLayout_6 = QFormLayout(self.sectionTab) self.formLayout_6.setObjectName(u"formLayout_6") self.sectionRulesListWidget = QListWidget(self.sectionTab) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) self.sectionRulesListWidget.setObjectName(u"sectionRulesListWidget") self.sectionRulesListWidget.setMaximumSize(QSize(16777215, 100)) self.formLayout_6.setWidget(1, QFormLayout.FieldRole, self.sectionRulesListWidget) self.label_10 = QLabel(self.sectionTab) self.label_10.setObjectName(u"label_10") self.label_10.setMaximumSize(QSize(16777215, 20)) self.formLayout_6.setWidget(0, QFormLayout.FieldRole, self.label_10) self.sectionCoverageLabel = QLabel(self.sectionTab) self.sectionCoverageLabel.setObjectName(u"sectionCoverageLabel") self.sectionCoverageLabel.setMaximumSize(QSize(16777215, 20)) self.formLayout_6.setWidget(2, QFormLayout.FieldRole, self.sectionCoverageLabel) self.label_11 = QLabel(self.sectionTab) self.label_11.setObjectName(u"label_11") self.label_11.setMaximumSize(QSize(16777215, 20)) self.formLayout_6.setWidget(3, QFormLayout.FieldRole, self.label_11) self.opsParamsStack.addWidget(self.sectionTab) self.audioTab = QWidget() self.audioTab.setObjectName(u"audioTab") self.formLayout_8 = QFormLayout(self.audioTab) self.formLayout_8.setObjectName(u"formLayout_8") self.comboBox = QComboBox(self.audioTab) self.comboBox.addItem("") self.comboBox.addItem("") self.comboBox.addItem("") self.comboBox.setObjectName(u"comboBox") self.formLayout_8.setWidget(0, QFormLayout.FieldRole, self.comboBox) self.label_8 = QLabel(self.audioTab) self.label_8.setObjectName(u"label_8") self.formLayout_8.setWidget(0, QFormLayout.LabelRole, self.label_8) self.opsParamsStack.addWidget(self.audioTab) self.cropTab = QWidget() self.cropTab.setObjectName(u"cropTab") self.formLayout_4 = QFormLayout(self.cropTab) self.formLayout_4.setObjectName(u"formLayout_4") self.formLayout_4.setVerticalSpacing(40) self.formLayout_4.setContentsMargins(-1, 40, -1, -1) self.label_14 = QLabel(self.cropTab) self.label_14.setObjectName(u"label_14") self.formLayout_4.setWidget(0, QFormLayout.LabelRole, self.label_14) self.horizontalLayout_19 = QHBoxLayout() self.horizontalLayout_19.setObjectName(u"horizontalLayout_19") self.label_30 = QLabel(self.cropTab) self.label_30.setObjectName(u"label_30") self.label_30.setAlignment(Qt.AlignCenter) self.horizontalLayout_19.addWidget(self.label_30) self.spinBox_21 = QSpinBox(self.cropTab) self.spinBox_21.setObjectName(u"spinBox_21") self.horizontalLayout_19.addWidget(self.spinBox_21) self.label_31 = QLabel(self.cropTab) self.label_31.setObjectName(u"label_31") self.label_31.setAlignment(Qt.AlignCenter) self.horizontalLayout_19.addWidget(self.label_31) self.spinBox_22 = QSpinBox(self.cropTab) self.spinBox_22.setObjectName(u"spinBox_22") self.horizontalLayout_19.addWidget(self.spinBox_22) self.formLayout_4.setLayout(0, QFormLayout.FieldRole, self.horizontalLayout_19) self.label_15 = QLabel(self.cropTab) self.label_15.setObjectName(u"label_15") self.formLayout_4.setWidget(1, QFormLayout.LabelRole, self.label_15) self.horizontalLayout_22 = QHBoxLayout() self.horizontalLayout_22.setObjectName(u"horizontalLayout_22") self.label_35 = QLabel(self.cropTab) self.label_35.setObjectName(u"label_35") self.label_35.setAlignment(Qt.AlignCenter) self.horizontalLayout_22.addWidget(self.label_35) self.spinBox_25 = QSpinBox(self.cropTab) self.spinBox_25.setObjectName(u"spinBox_25") self.horizontalLayout_22.addWidget(self.spinBox_25) self.label_36 = QLabel(self.cropTab) self.label_36.setObjectName(u"label_36") self.label_36.setAlignment(Qt.AlignCenter) self.horizontalLayout_22.addWidget(self.label_36) self.spinBox_26 = QSpinBox(self.cropTab) self.spinBox_26.setObjectName(u"spinBox_26") self.horizontalLayout_22.addWidget(self.spinBox_26) self.formLayout_4.setLayout(1, QFormLayout.FieldRole, self.horizontalLayout_22) self.opsParamsStack.addWidget(self.cropTab) self.composeTab = QWidget() self.composeTab.setObjectName(u"composeTab") self.verticalLayout_12 = QVBoxLayout(self.composeTab) self.verticalLayout_12.setObjectName(u"verticalLayout_12") self.verticalLayout_11 = QVBoxLayout() self.verticalLayout_11.setObjectName(u"verticalLayout_11") self.verticalLayout_12.addLayout(self.verticalLayout_11) self.opsParamsStack.addWidget(self.composeTab) self.resizeTab = QWidget() self.resizeTab.setObjectName(u"resizeTab") self.verticalLayout_10 = QVBoxLayout(self.resizeTab) self.verticalLayout_10.setObjectName(u"verticalLayout_10") self.verticalLayout_9 = QVBoxLayout() self.verticalLayout_9.setObjectName(u"verticalLayout_9") self.verticalLayout_10.addLayout(self.verticalLayout_9) self.opsParamsStack.addWidget(self.resizeTab) self.pacingTab = QWidget() self.pacingTab.setObjectName(u"pacingTab") self.verticalLayout_5 = QVBoxLayout(self.pacingTab) self.verticalLayout_5.setObjectName(u"verticalLayout_5") self.verticalLayout_5.setContentsMargins(0, 0, 0, 0) self.tabWidget = QTabWidget(self.pacingTab) self.tabWidget.setObjectName(u"tabWidget") self.tab = QWidget() self.tab.setObjectName(u"tab") self.tabWidget.addTab(self.tab, "") self.tab_2 = QWidget() self.tab_2.setObjectName(u"tab_2") self.tabWidget.addTab(self.tab_2, "") self.verticalLayout_5.addWidget(self.tabWidget) self.opsParamsStack.addWidget(self.pacingTab) self.animateTab = QWidget() self.animateTab.setObjectName(u"animateTab") self.verticalLayout_14 = QVBoxLayout(self.animateTab) self.verticalLayout_14.setObjectName(u"verticalLayout_14") self.verticalLayout_13 = QVBoxLayout() self.verticalLayout_13.setObjectName(u"verticalLayout_13") self.verticalLayout_14.addLayout(self.verticalLayout_13) self.opsParamsStack.addWidget(self.animateTab) self.renderTab = QWidget() self.renderTab.setObjectName(u"renderTab") self.verticalLayout_4 = QVBoxLayout(self.renderTab) self.verticalLayout_4.setObjectName(u"verticalLayout_4") self.verticalLayout_4.setContentsMargins(0, 0, 0, 0) self.renderTabTabs = QTabWidget(self.renderTab) self.renderTabTabs.setObjectName(u"renderTabTabs") self.renderTabVideoTab = QWidget() self.renderTabVideoTab.setObjectName(u"renderTabVideoTab") self.verticalLayout_2 = QVBoxLayout(self.renderTabVideoTab) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.verticalLayout_2.setContentsMargins(5, 5, 5, 5) self.scrollArea = QScrollArea(self.renderTabVideoTab) self.scrollArea.setObjectName(u"scrollArea") self.scrollArea.setFrameShape(QFrame.Panel) self.scrollArea.setFrameShadow(QFrame.Plain) self.scrollArea.setLineWidth(0) self.scrollArea.setWidgetResizable(True) self.scrollAreaWidgetContents = QWidget() self.scrollAreaWidgetContents.setObjectName( u"scrollAreaWidgetContents") self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 438, 412)) self.formLayout_10 = QFormLayout(self.scrollAreaWidgetContents) self.formLayout_10.setObjectName(u"formLayout_10") self.videoTitleLabel = QLabel(self.scrollAreaWidgetContents) self.videoTitleLabel.setObjectName(u"videoTitleLabel") self.formLayout_10.setWidget(0, QFormLayout.LabelRole, self.videoTitleLabel) self.renderOutputTitle = QLineEdit(self.scrollAreaWidgetContents) self.renderOutputTitle.setObjectName(u"renderOutputTitle") self.formLayout_10.setWidget(0, QFormLayout.FieldRole, self.renderOutputTitle) self.videoDirectoryLabel = QLabel(self.scrollAreaWidgetContents) self.videoDirectoryLabel.setObjectName(u"videoDirectoryLabel") self.formLayout_10.setWidget(1, QFormLayout.LabelRole, self.videoDirectoryLabel) self.renderOutputDir = QLineEdit(self.scrollAreaWidgetContents) self.renderOutputDir.setObjectName(u"renderOutputDir") self.formLayout_10.setWidget(1, QFormLayout.FieldRole, self.renderOutputDir) self.videoFormatLabel = QLabel(self.scrollAreaWidgetContents) self.videoFormatLabel.setObjectName(u"videoFormatLabel") self.formLayout_10.setWidget(2, QFormLayout.LabelRole, self.videoFormatLabel) self.renderOutputFormat = QComboBox(self.scrollAreaWidgetContents) self.renderOutputFormat.addItem("") self.renderOutputFormat.addItem("") self.renderOutputFormat.setObjectName(u"renderOutputFormat") self.formLayout_10.setWidget(2, QFormLayout.FieldRole, self.renderOutputFormat) self.scrollArea.setWidget(self.scrollAreaWidgetContents) self.verticalLayout_2.addWidget(self.scrollArea) self.renderTabTabs.addTab(self.renderTabVideoTab, "") self.renderTabAudioTab = QWidget() self.renderTabAudioTab.setObjectName(u"renderTabAudioTab") self.verticalLayout_6 = QVBoxLayout(self.renderTabAudioTab) self.verticalLayout_6.setObjectName(u"verticalLayout_6") self.scrollArea_2 = QScrollArea(self.renderTabAudioTab) self.scrollArea_2.setObjectName(u"scrollArea_2") self.scrollArea_2.setWidgetResizable(True) self.scrollAreaWidgetContents_2 = QWidget() self.scrollAreaWidgetContents_2.setObjectName( u"scrollAreaWidgetContents_2") self.scrollAreaWidgetContents_2.setGeometry(QRect(0, 0, 428, 402)) self.formLayout_11 = QFormLayout(self.scrollAreaWidgetContents_2) self.formLayout_11.setObjectName(u"formLayout_11") self.scrollArea_2.setWidget(self.scrollAreaWidgetContents_2) self.verticalLayout_6.addWidget(self.scrollArea_2) self.renderTabTabs.addTab(self.renderTabAudioTab, "") self.renderTabPacingTab = QWidget() self.renderTabPacingTab.setObjectName(u"renderTabPacingTab") self.verticalLayout_8 = QVBoxLayout(self.renderTabPacingTab) self.verticalLayout_8.setObjectName(u"verticalLayout_8") self.scrollArea_3 = QScrollArea(self.renderTabPacingTab) self.scrollArea_3.setObjectName(u"scrollArea_3") self.scrollArea_3.setWidgetResizable(True) self.scrollAreaWidgetContents_3 = QWidget() self.scrollAreaWidgetContents_3.setObjectName( u"scrollAreaWidgetContents_3") self.scrollAreaWidgetContents_3.setGeometry(QRect(0, 0, 428, 402)) self.formLayout_12 = QFormLayout(self.scrollAreaWidgetContents_3) self.formLayout_12.setObjectName(u"formLayout_12") self.scrollArea_3.setWidget(self.scrollAreaWidgetContents_3) self.verticalLayout_8.addWidget(self.scrollArea_3) self.renderTabTabs.addTab(self.renderTabPacingTab, "") self.verticalLayout_4.addWidget(self.renderTabTabs) self.opsParamsStack.addWidget(self.renderTab) self.extraTab = QWidget() self.extraTab.setObjectName(u"extraTab") self.formLayout_7 = QFormLayout(self.extraTab) self.formLayout_7.setObjectName(u"formLayout_7") self.opsParamsStack.addWidget(self.extraTab) self.verticalLayout.addWidget(self.opsParamsStack) self.opLayout.addWidget(self.groupBox_6) self.horizontalLayout_9 = QHBoxLayout() self.horizontalLayout_9.setObjectName(u"horizontalLayout_9") self.horizontalLayout_9.setContentsMargins(10, 10, 10, 10) self.resetStepParamsBtn = QPushButton(opsWidget) self.resetStepParamsBtn.setObjectName(u"resetStepParamsBtn") self.horizontalLayout_9.addWidget(self.resetStepParamsBtn) self.saveStepParamsBtn = QPushButton(opsWidget) self.saveStepParamsBtn.setObjectName(u"saveStepParamsBtn") self.horizontalLayout_9.addWidget(self.saveStepParamsBtn) self.opLayout.addLayout(self.horizontalLayout_9) self.retranslateUi(opsWidget) self.opCombo.currentIndexChanged.connect( self.opsParamsStack.setCurrentIndex) self.opsParamsStack.setCurrentIndex(9) self.renderTabTabs.setCurrentIndex(0) QMetaObject.connectSlotsByName(opsWidget) # setupUi def retranslateUi(self, opsWidget): self.operationSelect.setTitle( QCoreApplication.translate("opsWidget", u"Operation", None)) self.applyOpLabel.setText( QCoreApplication.translate("opsWidget", u"Operation", None)) self.opCombo.setItemText( 0, QCoreApplication.translate("opsWidget", u"Shell", None)) self.opCombo.setItemText( 1, QCoreApplication.translate("opsWidget", u"Insert", None)) self.opCombo.setItemText( 2, QCoreApplication.translate("opsWidget", u"Section", None)) self.opCombo.setItemText( 3, QCoreApplication.translate("opsWidget", u"Audio", None)) self.opCombo.setItemText( 4, QCoreApplication.translate("opsWidget", u"Crop", None)) self.opCombo.setItemText( 5, QCoreApplication.translate("opsWidget", u"Compose Demos", None)) self.opCombo.setItemText( 6, QCoreApplication.translate("opsWidget", u"Resize", None)) self.opCombo.setItemText( 7, QCoreApplication.translate("opsWidget", u"Add pacing", None)) self.opCombo.setItemText( 8, QCoreApplication.translate("opsWidget", u"Animate scroll steps", None)) self.opCombo.setItemText( 9, QCoreApplication.translate("opsWidget", u"Render to video", None)) self.applyToLabel.setText( QCoreApplication.translate("opsWidget", u"Apply to:", None)) self.allDemoCheck.setText( QCoreApplication.translate("opsWidget", u"Apply to all demos", None)) self.allStepsCheck.setText( QCoreApplication.translate("opsWidget", u"Apply to all steps", None)) self.matchSubstringCheck.setText( QCoreApplication.translate( "opsWidget", u"Apply to steps with matching substring:", None)) self.label_16.setText( QCoreApplication.translate("opsWidget", u"Steps containing:", None)) self.applyDemoLabel.setText( QCoreApplication.translate("opsWidget", u"Demo", None)) self.groupBox_6.setTitle( QCoreApplication.translate("opsWidget", u"Parameters", None)) self.label.setText( QCoreApplication.translate("opsWidget", u"Background", None)) #if QT_CONFIG(statustip) self.shellImgPath.setStatusTip( QCoreApplication.translate( "opsWidget", u"Filepath of image to be used as shell for demo assets", None)) #endif // QT_CONFIG(statustip) self.shellBrowseImgBtn.setText( QCoreApplication.translate("opsWidget", u"Browse", None)) self.label_2.setText( QCoreApplication.translate("opsWidget", u"Coordinates of assets on shell", None)) self.label_3.setText( QCoreApplication.translate("opsWidget", u"X", None)) self.label_4.setText( QCoreApplication.translate("opsWidget", u"Y", None)) self.label_5.setText( QCoreApplication.translate("opsWidget", u"Dimensions of assets on shell", None)) self.label_7.setText( QCoreApplication.translate("opsWidget", u"Width", None)) self.label_6.setText( QCoreApplication.translate("opsWidget", u"Height", None)) self.label_32.setText( QCoreApplication.translate("opsWidget", u"Image to paste", None)) self.insertBrowseImgBtn.setText( QCoreApplication.translate("opsWidget", u"Browse", None)) self.label_13.setText( QCoreApplication.translate("opsWidget", u"Coords of image on assets", None)) self.label_26.setText( QCoreApplication.translate("opsWidget", u"X", None)) self.label_29.setText( QCoreApplication.translate("opsWidget", u"Y", None)) self.label_12.setText( QCoreApplication.translate("opsWidget", u"Dimensions of image on assets", None)) self.label_33.setText( QCoreApplication.translate("opsWidget", u"Width", None)) self.label_34.setText( QCoreApplication.translate("opsWidget", u"Height", None)) __sortingEnabled = self.sectionRulesListWidget.isSortingEnabled() self.sectionRulesListWidget.setSortingEnabled(False) ___qlistwidgetitem = self.sectionRulesListWidget.item(0) ___qlistwidgetitem.setText( QCoreApplication.translate("opsWidget", u"Step has TP, next step without TP", None)) ___qlistwidgetitem1 = self.sectionRulesListWidget.item(1) ___qlistwidgetitem1.setText( QCoreApplication.translate("opsWidget", u"Step has TP, next step with TP", None)) ___qlistwidgetitem2 = self.sectionRulesListWidget.item(2) ___qlistwidgetitem2.setText( QCoreApplication.translate( "opsWidget", u"Step has TP, previous step without TP", None)) ___qlistwidgetitem3 = self.sectionRulesListWidget.item(3) ___qlistwidgetitem3.setText( QCoreApplication.translate("opsWidget", u"Step has TP, previous step with TP", None)) ___qlistwidgetitem4 = self.sectionRulesListWidget.item(4) ___qlistwidgetitem4.setText( QCoreApplication.translate("opsWidget", u"Step has fade-in", None)) ___qlistwidgetitem5 = self.sectionRulesListWidget.item(5) ___qlistwidgetitem5.setText( QCoreApplication.translate("opsWidget", u"Step has jump box", None)) ___qlistwidgetitem6 = self.sectionRulesListWidget.item(6) ___qlistwidgetitem6.setText( QCoreApplication.translate("opsWidget", u"Step TP contains text pattern...", None)) self.sectionRulesListWidget.setSortingEnabled(__sortingEnabled) self.label_10.setText( QCoreApplication.translate("opsWidget", u"Insert new section on...", None)) self.sectionCoverageLabel.setText( QCoreApplication.translate( "opsWidget", u"Covers 0 steps in selected sections/steps", None)) self.label_11.setText( QCoreApplication.translate( "opsWidget", u"May not match number of audio soundbites (audio not imported)", None)) self.comboBox.setItemText( 0, QCoreApplication.translate("opsWidget", u"Mixed section and step audio", None)) self.comboBox.setItemText( 1, QCoreApplication.translate("opsWidget", u"Section audio only", None)) self.comboBox.setItemText( 2, QCoreApplication.translate("opsWidget", u"Step audio only", None)) self.label_8.setText( QCoreApplication.translate("opsWidget", u"Audio attachment behavior", None)) self.label_14.setText( QCoreApplication.translate("opsWidget", u"Crop start coordinates", None)) self.label_30.setText( QCoreApplication.translate("opsWidget", u"X", None)) self.label_31.setText( QCoreApplication.translate("opsWidget", u"Y", None)) self.label_15.setText( QCoreApplication.translate("opsWidget", u"Crop dimensions", None)) self.label_35.setText( QCoreApplication.translate("opsWidget", u"Width", None)) self.label_36.setText( QCoreApplication.translate("opsWidget", u"Height", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.tab), QCoreApplication.translate("opsWidget", u"Tab 1", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.tab_2), QCoreApplication.translate("opsWidget", u"Tab 2", None)) self.videoTitleLabel.setText( QCoreApplication.translate("opsWidget", u"Video Title", None)) self.videoDirectoryLabel.setText( QCoreApplication.translate("opsWidget", u"Video Directory", None)) self.videoFormatLabel.setText( QCoreApplication.translate("opsWidget", u"Video Format", None)) self.renderOutputFormat.setItemText( 0, QCoreApplication.translate("opsWidget", u"avi", None)) self.renderOutputFormat.setItemText( 1, QCoreApplication.translate("opsWidget", u"mp4", None)) self.renderTabTabs.setTabText( self.renderTabTabs.indexOf(self.renderTabVideoTab), QCoreApplication.translate("opsWidget", u"Video", None)) self.renderTabTabs.setTabText( self.renderTabTabs.indexOf(self.renderTabAudioTab), QCoreApplication.translate("opsWidget", u"Audio", None)) self.renderTabTabs.setTabText( self.renderTabTabs.indexOf(self.renderTabPacingTab), QCoreApplication.translate("opsWidget", u"Pacing", None)) self.resetStepParamsBtn.setText( QCoreApplication.translate("opsWidget", u"Reset to default", None)) self.saveStepParamsBtn.setText( QCoreApplication.translate("opsWidget", u"Save step parameters", None)) pass
def setupUi(self, VehicleRentalDlg): if not VehicleRentalDlg.objectName(): VehicleRentalDlg.setObjectName(u"VehicleRentalDlg") VehicleRentalDlg.resize(206, 246) self.gridLayout = QGridLayout(VehicleRentalDlg) # ifndef Q_OS_MAC self.gridLayout.setSpacing(6) # endif # ifndef Q_OS_MAC self.gridLayout.setContentsMargins(9, 9, 9, 9) # endif self.gridLayout.setObjectName(u"gridLayout") self.buttonBox = QDialogButtonBox(VehicleRentalDlg) self.buttonBox.setObjectName(u"buttonBox") self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) self.gridLayout.addWidget(self.buttonBox, 4, 0, 1, 1) self.spacerItem = QSpacerItem(188, 16, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout.addItem(self.spacerItem, 3, 0, 1, 1) self.hboxLayout = QHBoxLayout() # ifndef Q_OS_MAC self.hboxLayout.setSpacing(6) # endif self.hboxLayout.setContentsMargins(0, 0, 0, 0) self.hboxLayout.setObjectName(u"hboxLayout") self.label_6 = QLabel(VehicleRentalDlg) self.label_6.setObjectName(u"label_6") self.hboxLayout.addWidget(self.label_6) self.mileageLabel = QLabel(VehicleRentalDlg) self.mileageLabel.setObjectName(u"mileageLabel") self.mileageLabel.setFrameShape(QFrame.StyledPanel) self.mileageLabel.setFrameShadow(QFrame.Sunken) self.mileageLabel.setAlignment(Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter) self.hboxLayout.addWidget(self.mileageLabel) self.gridLayout.addLayout(self.hboxLayout, 2, 0, 1, 1) self.stackedWidget = QStackedWidget(VehicleRentalDlg) self.stackedWidget.setObjectName(u"stackedWidget") self.page_2 = QWidget() self.page_2.setObjectName(u"page_2") self.gridLayout1 = QGridLayout(self.page_2) # ifndef Q_OS_MAC self.gridLayout1.setSpacing(6) # endif # ifndef Q_OS_MAC self.gridLayout1.setContentsMargins(9, 9, 9, 9) # endif self.gridLayout1.setObjectName(u"gridLayout1") self.colorComboBox = QComboBox(self.page_2) self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.setObjectName(u"colorComboBox") self.gridLayout1.addWidget(self.colorComboBox, 0, 1, 1, 1) self.label_4 = QLabel(self.page_2) self.label_4.setObjectName(u"label_4") self.gridLayout1.addWidget(self.label_4, 0, 0, 1, 1) self.label_5 = QLabel(self.page_2) self.label_5.setObjectName(u"label_5") self.gridLayout1.addWidget(self.label_5, 1, 0, 1, 1) self.seatsSpinBox = QSpinBox(self.page_2) self.seatsSpinBox.setObjectName(u"seatsSpinBox") self.seatsSpinBox.setAlignment(Qt.AlignRight) self.seatsSpinBox.setMinimum(2) self.seatsSpinBox.setMaximum(12) self.seatsSpinBox.setValue(4) self.gridLayout1.addWidget(self.seatsSpinBox, 1, 1, 1, 1) self.stackedWidget.addWidget(self.page_2) self.page = QWidget() self.page.setObjectName(u"page") self.gridLayout2 = QGridLayout(self.page) # ifndef Q_OS_MAC self.gridLayout2.setSpacing(6) # endif # ifndef Q_OS_MAC self.gridLayout2.setContentsMargins(9, 9, 9, 9) # endif self.gridLayout2.setObjectName(u"gridLayout2") self.weightSpinBox = QSpinBox(self.page) self.weightSpinBox.setObjectName(u"weightSpinBox") self.weightSpinBox.setAlignment(Qt.AlignRight) self.weightSpinBox.setMinimum(1) self.weightSpinBox.setMaximum(8) self.gridLayout2.addWidget(self.weightSpinBox, 0, 1, 1, 1) self.label_3 = QLabel(self.page) self.label_3.setObjectName(u"label_3") self.gridLayout2.addWidget(self.label_3, 1, 0, 1, 1) self.label_2 = QLabel(self.page) self.label_2.setObjectName(u"label_2") self.gridLayout2.addWidget(self.label_2, 0, 0, 1, 1) self.volumeSpinBox = QSpinBox(self.page) self.volumeSpinBox.setObjectName(u"volumeSpinBox") self.volumeSpinBox.setAlignment(Qt.AlignRight) self.volumeSpinBox.setMinimum(4) self.volumeSpinBox.setMaximum(22) self.volumeSpinBox.setValue(10) self.gridLayout2.addWidget(self.volumeSpinBox, 1, 1, 1, 1) self.stackedWidget.addWidget(self.page) self.gridLayout.addWidget(self.stackedWidget, 1, 0, 1, 1) self.hboxLayout1 = QHBoxLayout() # ifndef Q_OS_MAC self.hboxLayout1.setSpacing(6) # endif self.hboxLayout1.setContentsMargins(0, 0, 0, 0) self.hboxLayout1.setObjectName(u"hboxLayout1") self.label = QLabel(VehicleRentalDlg) self.label.setObjectName(u"label") self.hboxLayout1.addWidget(self.label) self.vehicleComboBox = QComboBox(VehicleRentalDlg) self.vehicleComboBox.addItem("") self.vehicleComboBox.addItem("") self.vehicleComboBox.setObjectName(u"vehicleComboBox") self.hboxLayout1.addWidget(self.vehicleComboBox) self.gridLayout.addLayout(self.hboxLayout1, 0, 0, 1, 1) # if QT_CONFIG(shortcut) self.label_4.setBuddy(self.colorComboBox) self.label_5.setBuddy(self.seatsSpinBox) self.label_3.setBuddy(self.volumeSpinBox) self.label_2.setBuddy(self.seatsSpinBox) self.label.setBuddy(self.vehicleComboBox) # endif // QT_CONFIG(shortcut) self.retranslateUi(VehicleRentalDlg) self.vehicleComboBox.currentIndexChanged.connect( self.stackedWidget.setCurrentIndex) self.buttonBox.accepted.connect(VehicleRentalDlg.accept) self.buttonBox.rejected.connect(VehicleRentalDlg.reject) self.stackedWidget.setCurrentIndex(0) QMetaObject.connectSlotsByName(VehicleRentalDlg)
class Ui_VehicleRentalDlg(object): def setupUi(self, VehicleRentalDlg): if not VehicleRentalDlg.objectName(): VehicleRentalDlg.setObjectName(u"VehicleRentalDlg") VehicleRentalDlg.resize(206, 246) self.gridLayout = QGridLayout(VehicleRentalDlg) # ifndef Q_OS_MAC self.gridLayout.setSpacing(6) # endif # ifndef Q_OS_MAC self.gridLayout.setContentsMargins(9, 9, 9, 9) # endif self.gridLayout.setObjectName(u"gridLayout") self.buttonBox = QDialogButtonBox(VehicleRentalDlg) self.buttonBox.setObjectName(u"buttonBox") self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) self.gridLayout.addWidget(self.buttonBox, 4, 0, 1, 1) self.spacerItem = QSpacerItem(188, 16, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout.addItem(self.spacerItem, 3, 0, 1, 1) self.hboxLayout = QHBoxLayout() # ifndef Q_OS_MAC self.hboxLayout.setSpacing(6) # endif self.hboxLayout.setContentsMargins(0, 0, 0, 0) self.hboxLayout.setObjectName(u"hboxLayout") self.label_6 = QLabel(VehicleRentalDlg) self.label_6.setObjectName(u"label_6") self.hboxLayout.addWidget(self.label_6) self.mileageLabel = QLabel(VehicleRentalDlg) self.mileageLabel.setObjectName(u"mileageLabel") self.mileageLabel.setFrameShape(QFrame.StyledPanel) self.mileageLabel.setFrameShadow(QFrame.Sunken) self.mileageLabel.setAlignment(Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter) self.hboxLayout.addWidget(self.mileageLabel) self.gridLayout.addLayout(self.hboxLayout, 2, 0, 1, 1) self.stackedWidget = QStackedWidget(VehicleRentalDlg) self.stackedWidget.setObjectName(u"stackedWidget") self.page_2 = QWidget() self.page_2.setObjectName(u"page_2") self.gridLayout1 = QGridLayout(self.page_2) # ifndef Q_OS_MAC self.gridLayout1.setSpacing(6) # endif # ifndef Q_OS_MAC self.gridLayout1.setContentsMargins(9, 9, 9, 9) # endif self.gridLayout1.setObjectName(u"gridLayout1") self.colorComboBox = QComboBox(self.page_2) self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.setObjectName(u"colorComboBox") self.gridLayout1.addWidget(self.colorComboBox, 0, 1, 1, 1) self.label_4 = QLabel(self.page_2) self.label_4.setObjectName(u"label_4") self.gridLayout1.addWidget(self.label_4, 0, 0, 1, 1) self.label_5 = QLabel(self.page_2) self.label_5.setObjectName(u"label_5") self.gridLayout1.addWidget(self.label_5, 1, 0, 1, 1) self.seatsSpinBox = QSpinBox(self.page_2) self.seatsSpinBox.setObjectName(u"seatsSpinBox") self.seatsSpinBox.setAlignment(Qt.AlignRight) self.seatsSpinBox.setMinimum(2) self.seatsSpinBox.setMaximum(12) self.seatsSpinBox.setValue(4) self.gridLayout1.addWidget(self.seatsSpinBox, 1, 1, 1, 1) self.stackedWidget.addWidget(self.page_2) self.page = QWidget() self.page.setObjectName(u"page") self.gridLayout2 = QGridLayout(self.page) # ifndef Q_OS_MAC self.gridLayout2.setSpacing(6) # endif # ifndef Q_OS_MAC self.gridLayout2.setContentsMargins(9, 9, 9, 9) # endif self.gridLayout2.setObjectName(u"gridLayout2") self.weightSpinBox = QSpinBox(self.page) self.weightSpinBox.setObjectName(u"weightSpinBox") self.weightSpinBox.setAlignment(Qt.AlignRight) self.weightSpinBox.setMinimum(1) self.weightSpinBox.setMaximum(8) self.gridLayout2.addWidget(self.weightSpinBox, 0, 1, 1, 1) self.label_3 = QLabel(self.page) self.label_3.setObjectName(u"label_3") self.gridLayout2.addWidget(self.label_3, 1, 0, 1, 1) self.label_2 = QLabel(self.page) self.label_2.setObjectName(u"label_2") self.gridLayout2.addWidget(self.label_2, 0, 0, 1, 1) self.volumeSpinBox = QSpinBox(self.page) self.volumeSpinBox.setObjectName(u"volumeSpinBox") self.volumeSpinBox.setAlignment(Qt.AlignRight) self.volumeSpinBox.setMinimum(4) self.volumeSpinBox.setMaximum(22) self.volumeSpinBox.setValue(10) self.gridLayout2.addWidget(self.volumeSpinBox, 1, 1, 1, 1) self.stackedWidget.addWidget(self.page) self.gridLayout.addWidget(self.stackedWidget, 1, 0, 1, 1) self.hboxLayout1 = QHBoxLayout() # ifndef Q_OS_MAC self.hboxLayout1.setSpacing(6) # endif self.hboxLayout1.setContentsMargins(0, 0, 0, 0) self.hboxLayout1.setObjectName(u"hboxLayout1") self.label = QLabel(VehicleRentalDlg) self.label.setObjectName(u"label") self.hboxLayout1.addWidget(self.label) self.vehicleComboBox = QComboBox(VehicleRentalDlg) self.vehicleComboBox.addItem("") self.vehicleComboBox.addItem("") self.vehicleComboBox.setObjectName(u"vehicleComboBox") self.hboxLayout1.addWidget(self.vehicleComboBox) self.gridLayout.addLayout(self.hboxLayout1, 0, 0, 1, 1) # if QT_CONFIG(shortcut) self.label_4.setBuddy(self.colorComboBox) self.label_5.setBuddy(self.seatsSpinBox) self.label_3.setBuddy(self.volumeSpinBox) self.label_2.setBuddy(self.seatsSpinBox) self.label.setBuddy(self.vehicleComboBox) # endif // QT_CONFIG(shortcut) self.retranslateUi(VehicleRentalDlg) self.vehicleComboBox.currentIndexChanged.connect( self.stackedWidget.setCurrentIndex) self.buttonBox.accepted.connect(VehicleRentalDlg.accept) self.buttonBox.rejected.connect(VehicleRentalDlg.reject) self.stackedWidget.setCurrentIndex(0) QMetaObject.connectSlotsByName(VehicleRentalDlg) # setupUi def retranslateUi(self, VehicleRentalDlg): VehicleRentalDlg.setWindowTitle( QCoreApplication.translate("VehicleRentalDlg", u"Vehicle Rental", None)) self.label_6.setText( QCoreApplication.translate("VehicleRentalDlg", u"Max. Mileage:", None)) self.mileageLabel.setText( QCoreApplication.translate("VehicleRentalDlg", u"1000 miles", None)) self.colorComboBox.setItemText( 0, QCoreApplication.translate("VehicleRentalDlg", u"Black", None)) self.colorComboBox.setItemText( 1, QCoreApplication.translate("VehicleRentalDlg", u"Blue", None)) self.colorComboBox.setItemText( 2, QCoreApplication.translate("VehicleRentalDlg", u"Green", None)) self.colorComboBox.setItemText( 3, QCoreApplication.translate("VehicleRentalDlg", u"Red", None)) self.colorComboBox.setItemText( 4, QCoreApplication.translate("VehicleRentalDlg", u"Silver", None)) self.colorComboBox.setItemText( 5, QCoreApplication.translate("VehicleRentalDlg", u"White", None)) self.colorComboBox.setItemText( 6, QCoreApplication.translate("VehicleRentalDlg", u"Yellow", None)) self.label_4.setText( QCoreApplication.translate("VehicleRentalDlg", u"Co&lor:", None)) self.label_5.setText( QCoreApplication.translate("VehicleRentalDlg", u"&Seats:", None)) self.weightSpinBox.setSuffix( QCoreApplication.translate("VehicleRentalDlg", u" tons", None)) self.label_3.setText( QCoreApplication.translate("VehicleRentalDlg", u"Volu&me:", None)) self.label_2.setText( QCoreApplication.translate("VehicleRentalDlg", u"&Weight:", None)) self.volumeSpinBox.setSuffix( QCoreApplication.translate("VehicleRentalDlg", u" cu m", None)) self.label.setText( QCoreApplication.translate("VehicleRentalDlg", u"&Vehicle Type:", None)) self.vehicleComboBox.setItemText( 0, QCoreApplication.translate("VehicleRentalDlg", u"Car", None)) self.vehicleComboBox.setItemText( 1, QCoreApplication.translate("VehicleRentalDlg", u"Van", None))
else: print('option was not selected') return print(answer) def selectOption(self, x, option): originalStyle = 'background-color:rgb(241, 213, 232);color:black;' selectedStyle = 'background-color:rgb(50, 50, 50);' if x: if self.selectedOption: self.selectedOption.setChecked(False) self.selectedOption.setStyleSheet(originalStyle) option.setStyleSheet(selectedStyle) self.selectedOption = option else: option.setStyleSheet(originalStyle) self.selectedOption = None if __name__=='__main__': app = QApplication(sys.argv) quizwindow = QuizWindow() widgets = QStackedWidget() widgets.addWidget(quizwindow) widgets.setFixedWidth(800) widgets.setFixedHeight(600) widgets.show() sys.exit(app.exec_())
def setupUi(self, Form): if not Form.objectName(): Form.setObjectName(u"Form") Form.resize(403, 803) self.verticalLayout = QVBoxLayout(Form) self.verticalLayout.setObjectName(u"verticalLayout") self.viewTabs = QTabWidget(Form) self.viewTabs.setObjectName(u"viewTabs") self.viewTabs.setDocumentMode(False) self.viewTabs.setMovable(True) self.demoView = QWidget() self.demoView.setObjectName(u"demoView") self.verticalLayout_9 = QVBoxLayout(self.demoView) self.verticalLayout_9.setObjectName(u"verticalLayout_9") self.demoViewGroupBox = QGroupBox(self.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_9.addWidget(self.demoViewGroupBox) self.dataFrame = QGroupBox(self.demoView) self.dataFrame.setObjectName(u"dataFrame") self.dataFrame.setMaximumSize(QSize(16777215, 300)) self.dataFrame.setFlat(True) self.dataFrame.setCheckable(False) self.verticalLayout_8 = QVBoxLayout(self.dataFrame) self.verticalLayout_8.setObjectName(u"verticalLayout_8") self.verticalLayout_8.setContentsMargins(4, 4, 4, 4) self.dataStack = QStackedWidget(self.dataFrame) 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_9.addWidget(self.dataFrame) self.viewTabs.addTab(self.demoView, "") self.objectViewTabWPage2_2 = QWidget() self.objectViewTabWPage2_2.setObjectName(u"objectViewTabWPage2_2") self.viewTabs.addTab(self.objectViewTabWPage2_2, "") self.verticalLayout.addWidget(self.viewTabs) self.retranslateUi(Form) self.viewTabs.setCurrentIndex(0) self.dataStack.setCurrentIndex(0) QMetaObject.connectSlotsByName(Form)
def buttonTitle(self): stack = QStackedWidget(self) stack.addWidget(WindowSearch("搜索全部/Search")) self.window().changeWindow(stack)
class UIMainWindow: """ The central class responsible for initializing most of the values stored in the PatientDictContainer model and defining the visual layout of the main window of OnkoDICOM. No class has access to the attributes belonging to this class, except for the class's ActionHandler, which is used to trigger actions within the main window. Components of this class (i.e. QWidget child classes such as StructureTab, DicomView, DicomTree, etc.) should not be able to reference this class, and rather should exist independently and only be able to communicate with the PatientDictContainer model. If a component needs to communicate with another component, that should be accomplished by emitting signals within that components, and having the slots for those signals within this class (as demonstrated by the update_views() method of this class). If a class needs to trigger one of the actions defined in the ActionHandler, then the instance of the ActionHandler itself can safely be passed into the class. """ pyradi_trigger = QtCore.Signal(str, dict, str) # Connect to GUIController image_fusion_main_window = QtCore.Signal() def setup_ui(self, main_window_instance): self.main_window_instance = main_window_instance self.call_class = MainPageCallClass() self.add_on_options_controller = AddOptions(self) ########################################## # IMPLEMENTATION OF THE MAIN PAGE VIEW # ########################################## if platform.system() == 'Darwin': self.stylesheet_path = "res/stylesheet.qss" else: self.stylesheet_path = "res/stylesheet-win-linux.qss" self.stylesheet = open(resource_path(self.stylesheet_path)).read() window_icon = QIcon() window_icon.addPixmap(QPixmap(resource_path( "res/images/icon.ico")), QIcon.Normal, QIcon.Off) self.main_window_instance.setMinimumSize(1080, 700) self.main_window_instance.setObjectName("MainOnkoDicomWindowInstance") self.main_window_instance.setWindowIcon(window_icon) self.main_window_instance.setStyleSheet(self.stylesheet) self.setup_central_widget() self.setup_actions() # Create SUV2ROI object and connect signals self.suv2roi = SUV2ROI() self.suv2roi_progress_window = \ ProgressWindow(self.main_window_instance, QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) self.suv2roi_progress_window.signal_loaded.connect( self.on_loaded_suv2roi) def setup_actions(self): if hasattr(self, 'toolbar'): self.main_window_instance.removeToolBar(self.toolbar) self.action_handler = ActionHandler(self) self.menubar = MenuBar(self.action_handler) self.main_window_instance.setMenuBar(self.menubar) self.toolbar = Toolbar(self.action_handler) self.main_window_instance.addToolBar( QtCore.Qt.TopToolBarArea, self.toolbar) self.main_window_instance.setWindowTitle("OnkoDICOM") def setup_central_widget(self): patient_dict_container = PatientDictContainer() self.central_widget = QtWidgets.QWidget() self.central_widget_layout = QVBoxLayout() self.patient_bar = PatientBar() splitter = QtWidgets.QSplitter(QtCore.Qt.Horizontal) # Left panel contains stuctures tab, isodoses tab, # and structure information self.left_panel = QtWidgets.QTabWidget() self.left_panel.setMinimumWidth(300) self.left_panel.setMaximumWidth(500) # Add structures tab to left panel if not hasattr(self, 'structures_tab'): self.structures_tab = StructureTab() self.structures_tab.request_update_structures.connect( self.update_views) else: self.structures_tab.update_ui() self.left_panel.addTab(self.structures_tab, "Structures") if patient_dict_container.has_modality("rtdose"): self.isodoses_tab = IsodoseTab() self.isodoses_tab.request_update_isodoses.connect( self.update_views) self.isodoses_tab.request_update_ui.connect( self.structures_tab.fixed_container_structure_modified) self.left_panel.addTab(self.isodoses_tab, "Isodoses") elif hasattr(self, 'isodoses_tab'): del self.isodoses_tab # Right panel contains the different tabs of DICOM view, DVH, # clinical data, DICOM tree self.right_panel = QtWidgets.QTabWidget() # Create a Dicom View containing single-slice and 3-slice views self.dicom_view = DicomStackedWidget(self.format_data) roi_color_dict = self.structures_tab.color_dict if hasattr( self, 'structures_tab') else None iso_color_dict = self.isodoses_tab.color_dict if hasattr( self, 'isodoses_tab') else None self.dicom_single_view = DicomAxialView( roi_color=roi_color_dict, iso_color=iso_color_dict) self.dicom_axial_view = DicomAxialView( is_four_view=True, roi_color=roi_color_dict, iso_color=iso_color_dict, metadata_formatted=True, cut_line_color=QtGui.QColor(255, 0, 0)) self.dicom_sagittal_view = DicomSagittalView( roi_color=roi_color_dict, iso_color=iso_color_dict, cut_line_color=QtGui.QColor(0, 255, 0)) self.dicom_coronal_view = DicomCoronalView( roi_color=roi_color_dict, iso_color=iso_color_dict, cut_line_color=QtGui.QColor(0, 0, 255)) self.three_dimension_view = DicomView3D() # Rescale the size of the scenes inside the 3-slice views self.dicom_axial_view.zoom = INITIAL_FOUR_VIEW_ZOOM self.dicom_sagittal_view.zoom = INITIAL_FOUR_VIEW_ZOOM self.dicom_coronal_view.zoom = INITIAL_FOUR_VIEW_ZOOM self.dicom_axial_view.update_view(zoom_change=True) self.dicom_sagittal_view.update_view(zoom_change=True) self.dicom_coronal_view.update_view(zoom_change=True) self.dicom_four_views = QWidget() self.dicom_four_views_layout = QGridLayout() for i in range(2): self.dicom_four_views_layout.setColumnStretch(i, 1) self.dicom_four_views_layout.setRowStretch(i, 1) self.dicom_four_views_layout.addWidget(self.dicom_axial_view, 0, 0) self.dicom_four_views_layout.addWidget(self.dicom_sagittal_view, 0, 1) self.dicom_four_views_layout.addWidget(self.dicom_coronal_view, 1, 0) self.dicom_four_views_layout.addWidget(self.three_dimension_view, 1, 1) self.dicom_four_views.setLayout(self.dicom_four_views_layout) self.dicom_view.addWidget(self.dicom_four_views) self.dicom_view.addWidget(self.dicom_single_view) self.dicom_view.setCurrentWidget(self.dicom_single_view) # Add DICOM View to right panel as a tab self.right_panel.addTab(self.dicom_view, "DICOM View") # Add PETVT View to right panel as a tab self.pet_ct_tab = PetCtView() self.right_panel.addTab(self.pet_ct_tab, "PET/CT View") # Add DVH tab to right panel as a tab if patient_dict_container.has_modality("rtdose"): self.dvh_tab = DVHTab() self.right_panel.addTab(self.dvh_tab, "DVH") elif hasattr(self, 'dvh_tab'): del self.dvh_tab # Add DICOM Tree View tab self.dicom_tree = DicomTreeView() self.right_panel.addTab(self.dicom_tree, "DICOM Tree") # Connect SUV2ROI signal to handler function self.dicom_single_view.suv2roi_signal.connect(self.perform_suv2roi) # Add clinical data tab self.call_class.display_clinical_data(self.right_panel) splitter.addWidget(self.left_panel) splitter.addWidget(self.right_panel) # Create footer self.footer = QtWidgets.QWidget() self.create_footer() # Set layout self.central_widget_layout.addWidget(self.patient_bar) self.central_widget_layout.addWidget(splitter) self.central_widget_layout.addWidget(self.footer) self.central_widget.setLayout(self.central_widget_layout) self.main_window_instance.setCentralWidget(self.central_widget) def create_footer(self): self.footer.setFixedHeight(15) layout_footer = QtWidgets.QHBoxLayout(self.footer) layout_footer.setContentsMargins(0, 0, 0, 0) label_footer = QtWidgets.QLabel("@OnkoDICOM2021") label_footer.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignRight) layout_footer.addWidget(label_footer) def update_views(self, update_3d_window=False): """ This function is a slot for signals to request the updating of the DICOM View and DVH tabs in order to reflect changes made by other components of the main window (for example, when a structure in the structures tab is selected, this method needs to be called in order for the DICOM view window to be updated to show the new region of interest. :param update_3d_window: a boolean to mark if 3d model needs to be updated """ self.dicom_single_view.update_view() self.dicom_axial_view.update_view() self.dicom_coronal_view.update_view() self.dicom_sagittal_view.update_view() if update_3d_window: self.three_dimension_view.update_view() if hasattr(self, 'dvh_tab'): self.dvh_tab.update_plot() if hasattr(self, 'pet_ct_tab'): if self.pet_ct_tab.initialised: self.pet_ct_tab.update_view() if hasattr(self, 'image_fusion_view'): if self.image_fusion_view_axial is not None: self.image_fusion_single_view.update_view() self.image_fusion_view_axial.update_view() self.image_fusion_view_coronal.update_view() self.image_fusion_view_sagittal.update_view() def toggle_cut_lines(self): if self.dicom_axial_view.horizontal_view is None or \ self.dicom_axial_view.vertical_view is None or \ self.dicom_coronal_view.horizontal_view is None or \ self.dicom_coronal_view.vertical_view is None or \ self.dicom_sagittal_view.horizontal_view is None or \ self.dicom_sagittal_view.vertical_view is None: self.dicom_axial_view.set_views(self.dicom_coronal_view, self.dicom_sagittal_view) self.dicom_coronal_view.set_views(self.dicom_axial_view, self.dicom_sagittal_view) self.dicom_sagittal_view.set_views(self.dicom_axial_view, self.dicom_coronal_view) else: self.dicom_axial_view.set_views(None, None) self.dicom_coronal_view.set_views(None, None) self.dicom_sagittal_view.set_views(None, None) if hasattr(self, 'image_fusion_view'): if self.image_fusion_view is not None: if self.image_fusion_view_axial.horizontal_view is None or \ self.image_fusion_view_axial.vertical_view is None or \ self.image_fusion_view_coronal.horizontal_view is None \ or self.image_fusion_view_coronal.vertical_view is None \ or \ self.image_fusion_view_sagittal.horizontal_view is None \ or \ self.image_fusion_view_sagittal.vertical_view is None: self.image_fusion_view_axial.set_views( self.image_fusion_view_coronal, self.image_fusion_view_sagittal) self.image_fusion_view_coronal.set_views( self.image_fusion_view_axial, self.image_fusion_view_sagittal) self.image_fusion_view_sagittal.set_views( self.image_fusion_view_axial, self.image_fusion_view_coronal) else: self.image_fusion_view_axial.set_views(None, None) self.image_fusion_view_coronal.set_views(None, None) self.image_fusion_view_sagittal.set_views(None, None) def zoom_in(self, is_four_view, image_reg_single, image_reg_four): """ This function calls the zooming in function on the four view's views or the single view depending on what view is showing on screen. is_four_view: Whether the four view is showing """ if is_four_view: self.dicom_axial_view.zoom_in() self.dicom_coronal_view.zoom_in() self.dicom_sagittal_view.zoom_in() else: self.dicom_single_view.zoom_in() if image_reg_single: self.image_fusion_single_view.zoom_in() if image_reg_four: self.image_fusion_view_axial.zoom_in() self.image_fusion_view_coronal.zoom_in() self.image_fusion_view_sagittal.zoom_in() if self.pet_ct_tab.initialised: self.pet_ct_tab.zoom_in() def zoom_out(self, is_four_view, image_reg_single, image_reg_four): """ This function calls the zooming out function on the four view's views or the single view depending on what view is showing on screen. is_four_view: Whether the four view is showing """ if is_four_view: self.dicom_axial_view.zoom_out() self.dicom_coronal_view.zoom_out() self.dicom_sagittal_view.zoom_out() else: self.dicom_single_view.zoom_out() if image_reg_single: self.image_fusion_single_view.zoom_out() if image_reg_four: self.image_fusion_view_axial.zoom_out() self.image_fusion_view_coronal.zoom_out() self.image_fusion_view_sagittal.zoom_out() if self.pet_ct_tab.initialised: self.pet_ct_tab.zoom_out() def format_data(self, size): """ This function is used to update the meta data's font size and margin based on the height and width of the viewports. size: The size of the DicomStackedWidget """ self.dicom_axial_view.format_metadata(size) def create_image_fusion_tab(self): """ This function is used to create the tab for image fusion. Function checks if the moving dict container contains rtss to load rtss. Views are created and stacked into three window view. """ # Set a flag for Zooming self.action_handler.has_image_registration_four = True # Instance of Moving Model moving_dict_container = MovingDictContainer() if moving_dict_container.has_modality("rtss"): if len(self.structures_tab.rois.items()) == 0: self.structures_tab.update_ui(moving=True) # else: # TODO: Display both ROIs in the same tab self.image_fusion_single_view \ = ImageFusionAxialView() self.image_fusion_view = QStackedWidget() self.image_fusion_view_axial = ImageFusionAxialView( metadata_formatted=False, cut_line_color=QtGui.QColor(255, 0, 0)) self.image_fusion_view_sagittal = ImageFusionSagittalView( cut_line_color=QtGui.QColor(0, 255, 0)) self.image_fusion_view_coronal = ImageFusionCoronalView( cut_line_color=QtGui.QColor(0, 0, 255)) self.image_fusion_roi_transfer_option_view = ROITransferOptionView( self.structures_tab.fixed_container_structure_modified, self.structures_tab.moving_container_structure_modified) # Rescale the size of the scenes inside the 3-slice views self.image_fusion_view_axial.zoom = INITIAL_FOUR_VIEW_ZOOM self.image_fusion_view_sagittal.zoom = INITIAL_FOUR_VIEW_ZOOM self.image_fusion_view_coronal.zoom = INITIAL_FOUR_VIEW_ZOOM self.image_fusion_view_axial.update_view(zoom_change=True) self.image_fusion_view_sagittal.update_view(zoom_change=True) self.image_fusion_view_coronal.update_view(zoom_change=True) self.image_fusion_four_views = QWidget() self.image_fusion_four_views_layout = QGridLayout() for i in range(2): self.image_fusion_four_views_layout.setColumnStretch(i, 1) self.image_fusion_four_views_layout.setRowStretch(i, 1) self.image_fusion_four_views_layout.addWidget( self.image_fusion_view_axial, 0, 0) self.image_fusion_four_views_layout.addWidget( self.image_fusion_view_sagittal, 0, 1) self.image_fusion_four_views_layout.addWidget( self.image_fusion_view_coronal, 1, 0) self.image_fusion_four_views_layout.addWidget( self.image_fusion_roi_transfer_option_view, 1, 1 ) self.image_fusion_four_views.setLayout( self.image_fusion_four_views_layout) self.image_fusion_view.addWidget(self.image_fusion_four_views) self.image_fusion_view.addWidget(self.image_fusion_single_view) self.image_fusion_view.setCurrentWidget(self.image_fusion_four_views) # Add Image Fusion Tab self.right_panel.addTab(self.image_fusion_view, "Image Fusion") self.right_panel.setCurrentWidget(self.image_fusion_view) # Update the Add On Option GUI self.add_on_options_controller.update_ui() def perform_suv2roi(self): """ Performs the SUV2ROI process. """ # Get patient weight - needs to run first as GUI cannot run in # threads, like the ProgressBar patient_dict_container = PatientDictContainer() dataset = patient_dict_container.dataset[0] self.suv2roi.get_patient_weight(dataset) if self.suv2roi.patient_weight is None: return # Start the SUV2ROI process self.suv2roi_progress_window.start(self.suv2roi.start_conversion) def on_loaded_suv2roi(self): """ Called when progress bar has finished. Closes the progress window and refreshes the main screen. """ if self.suv2roi.suv2roi_status: patient_dict_container = PatientDictContainer() self.structures_tab.fixed_container_structure_modified(( patient_dict_container.get('dataset_rtss'), {"draw": None})) else: # Alert user that SUV2ROI failed and for what reason if self.suv2roi.failure_reason == "UNIT": failure_reason = \ "PET units are not Bq/mL. OnkoDICOM can currently only\n" \ "perform SUV2ROI on PET images stored in these units." elif self.suv2roi.failure_reason == "DECY": failure_reason = \ "PET is not decay corrected. OnkoDICOM can currently " \ "only\nperform SUV2ROI on PET images that are decay " \ "corrected." else: failure_reason = "The SUV2ROI process has failed." button_reply = \ QtWidgets.QMessageBox( QtWidgets.QMessageBox.Icon.Warning, "SUV2ROI Failed", failure_reason, QtWidgets.QMessageBox.StandardButton.Ok, self) button_reply.button( QtWidgets.QMessageBox.StandardButton.Ok).setStyleSheet( self.stylesheet) button_reply.exec_() # Close progress window self.suv2roi_progress_window.close()
def setupUi(self, opsWidget): if not opsWidget.objectName(): opsWidget.setObjectName(u"opsWidget") opsWidget.resize(498, 576) self.verticalLayout_4 = QVBoxLayout(opsWidget) self.verticalLayout_4.setObjectName(u"verticalLayout_4") self.horizontalLayout_5 = QHBoxLayout() self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") self.horizontalLayout_5.setSizeConstraint(QLayout.SetMinimumSize) self.verticalGroupBox_3 = QGroupBox(opsWidget) self.verticalGroupBox_3.setObjectName(u"verticalGroupBox_3") self.verticalGroupBox_3.setContextMenuPolicy(Qt.ActionsContextMenu) self.verticalLayout_2 = QVBoxLayout(self.verticalGroupBox_3) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.horizontalLayout_2 = QHBoxLayout() self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.label_3 = QLabel(self.verticalGroupBox_3) self.label_3.setObjectName(u"label_3") sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.label_3.sizePolicy().hasHeightForWidth()) self.label_3.setSizePolicy(sizePolicy) self.horizontalLayout_2.addWidget(self.label_3) self.horizontalSpacer_3 = QSpacerItem(463, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout_2.addItem(self.horizontalSpacer_3) self.label_6 = QLabel(self.verticalGroupBox_3) self.label_6.setObjectName(u"label_6") self.horizontalLayout_2.addWidget(self.label_6) self.comboBox_3 = QComboBox(self.verticalGroupBox_3) self.comboBox_3.addItem("") self.comboBox_3.addItem("") self.comboBox_3.addItem("") self.comboBox_3.addItem("") self.comboBox_3.addItem("") self.comboBox_3.addItem("") self.comboBox_3.addItem("") self.comboBox_3.addItem("") self.comboBox_3.setObjectName(u"comboBox_3") self.horizontalLayout_2.addWidget(self.comboBox_3) self.toolButton_3 = QToolButton(self.verticalGroupBox_3) self.toolButton_3.setObjectName(u"toolButton_3") self.horizontalLayout_2.addWidget(self.toolButton_3) self.verticalLayout_2.addLayout(self.horizontalLayout_2) self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.label_2 = QLabel(self.verticalGroupBox_3) self.label_2.setObjectName(u"label_2") sizePolicy.setHeightForWidth( self.label_2.sizePolicy().hasHeightForWidth()) self.label_2.setSizePolicy(sizePolicy) self.horizontalLayout.addWidget(self.label_2) self.horizontalSpacer_2 = QSpacerItem(463, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout.addItem(self.horizontalSpacer_2) self.label_4 = QLabel(self.verticalGroupBox_3) self.label_4.setObjectName(u"label_4") self.horizontalLayout.addWidget(self.label_4) self.comboBox_2 = QComboBox(self.verticalGroupBox_3) self.comboBox_2.addItem("") self.comboBox_2.addItem("") self.comboBox_2.addItem("") self.comboBox_2.addItem("") self.comboBox_2.addItem("") self.comboBox_2.addItem("") self.comboBox_2.addItem("") self.comboBox_2.addItem("") self.comboBox_2.setObjectName(u"comboBox_2") self.horizontalLayout.addWidget(self.comboBox_2) self.toolButton = QToolButton(self.verticalGroupBox_3) self.toolButton.setObjectName(u"toolButton") self.horizontalLayout.addWidget(self.toolButton) self.verticalLayout_2.addLayout(self.horizontalLayout) self.targetLayout = QHBoxLayout() self.targetLayout.setObjectName(u"targetLayout") self.label = QLabel(self.verticalGroupBox_3) self.label.setObjectName(u"label") self.targetLayout.addWidget(self.label) self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.targetLayout.addItem(self.horizontalSpacer) self.label_5 = QLabel(self.verticalGroupBox_3) self.label_5.setObjectName(u"label_5") self.targetLayout.addWidget(self.label_5) self.comboBox = QComboBox(self.verticalGroupBox_3) self.comboBox.setObjectName(u"comboBox") self.targetLayout.addWidget(self.comboBox) self.toolButton_2 = QToolButton(self.verticalGroupBox_3) self.toolButton_2.setObjectName(u"toolButton_2") self.targetLayout.addWidget(self.toolButton_2) self.verticalLayout_2.addLayout(self.targetLayout) self.horizontalLayout_5.addWidget(self.verticalGroupBox_3) self.horizontalSpacer_4 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout_5.addItem(self.horizontalSpacer_4) self.verticalGroupBox_2 = QGroupBox(opsWidget) self.verticalGroupBox_2.setObjectName(u"verticalGroupBox_2") self.verticalLayout_5 = QVBoxLayout(self.verticalGroupBox_2) self.verticalLayout_5.setObjectName(u"verticalLayout_5") self.allDemoCheck = QCheckBox(self.verticalGroupBox_2) self.allDemoCheck.setObjectName(u"allDemoCheck") self.allDemoCheck.setMaximumSize(QSize(10000, 16777215)) self.verticalLayout_5.addWidget(self.allDemoCheck) self.allStepsCheck = QCheckBox(self.verticalGroupBox_2) self.allStepsCheck.setObjectName(u"allStepsCheck") sizePolicy1 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.allStepsCheck.sizePolicy().hasHeightForWidth()) self.allStepsCheck.setSizePolicy(sizePolicy1) self.allStepsCheck.setMinimumSize(QSize(180, 0)) self.allStepsCheck.setLayoutDirection(Qt.LeftToRight) self.verticalLayout_5.addWidget(self.allStepsCheck) self.checkBox_2 = QCheckBox(self.verticalGroupBox_2) self.checkBox_2.setObjectName(u"checkBox_2") self.verticalLayout_5.addWidget(self.checkBox_2) self.checkBox = QCheckBox(self.verticalGroupBox_2) self.checkBox.setObjectName(u"checkBox") self.verticalLayout_5.addWidget(self.checkBox) self.matchSubstringCheck = QCheckBox(self.verticalGroupBox_2) self.matchSubstringCheck.setObjectName(u"matchSubstringCheck") self.verticalLayout_5.addWidget(self.matchSubstringCheck) self.lineEdit = QLineEdit(self.verticalGroupBox_2) self.lineEdit.setObjectName(u"lineEdit") self.verticalLayout_5.addWidget(self.lineEdit) self.horizontalLayout_5.addWidget(self.verticalGroupBox_2) self.verticalLayout_4.addLayout(self.horizontalLayout_5) self.groupBox = QGroupBox(opsWidget) self.groupBox.setObjectName(u"groupBox") self.verticalLayout = QVBoxLayout(self.groupBox) self.verticalLayout.setObjectName(u"verticalLayout") self.stepParams = QStackedWidget(self.groupBox) self.stepParams.setObjectName(u"stepParams") self.stepParamsVl = QWidget() self.stepParamsVl.setObjectName(u"stepParamsVl") self.verticalLayout_7 = QVBoxLayout(self.stepParamsVl) self.verticalLayout_7.setObjectName(u"verticalLayout_7") self.stepParams.addWidget(self.stepParamsVl) self.verticalLayout.addWidget(self.stepParams) self.verticalLayout_4.addWidget(self.groupBox) self.retranslateUi(opsWidget) QMetaObject.connectSlotsByName(opsWidget)
def create_image_fusion_tab(self): """ This function is used to create the tab for image fusion. Function checks if the moving dict container contains rtss to load rtss. Views are created and stacked into three window view. """ # Set a flag for Zooming self.action_handler.has_image_registration_four = True # Instance of Moving Model moving_dict_container = MovingDictContainer() if moving_dict_container.has_modality("rtss"): if len(self.structures_tab.rois.items()) == 0: self.structures_tab.update_ui(moving=True) # else: # TODO: Display both ROIs in the same tab self.image_fusion_single_view \ = ImageFusionAxialView() self.image_fusion_view = QStackedWidget() self.image_fusion_view_axial = ImageFusionAxialView( metadata_formatted=False, cut_line_color=QtGui.QColor(255, 0, 0)) self.image_fusion_view_sagittal = ImageFusionSagittalView( cut_line_color=QtGui.QColor(0, 255, 0)) self.image_fusion_view_coronal = ImageFusionCoronalView( cut_line_color=QtGui.QColor(0, 0, 255)) self.image_fusion_roi_transfer_option_view = ROITransferOptionView( self.structures_tab.fixed_container_structure_modified, self.structures_tab.moving_container_structure_modified) # Rescale the size of the scenes inside the 3-slice views self.image_fusion_view_axial.zoom = INITIAL_FOUR_VIEW_ZOOM self.image_fusion_view_sagittal.zoom = INITIAL_FOUR_VIEW_ZOOM self.image_fusion_view_coronal.zoom = INITIAL_FOUR_VIEW_ZOOM self.image_fusion_view_axial.update_view(zoom_change=True) self.image_fusion_view_sagittal.update_view(zoom_change=True) self.image_fusion_view_coronal.update_view(zoom_change=True) self.image_fusion_four_views = QWidget() self.image_fusion_four_views_layout = QGridLayout() for i in range(2): self.image_fusion_four_views_layout.setColumnStretch(i, 1) self.image_fusion_four_views_layout.setRowStretch(i, 1) self.image_fusion_four_views_layout.addWidget( self.image_fusion_view_axial, 0, 0) self.image_fusion_four_views_layout.addWidget( self.image_fusion_view_sagittal, 0, 1) self.image_fusion_four_views_layout.addWidget( self.image_fusion_view_coronal, 1, 0) self.image_fusion_four_views_layout.addWidget( self.image_fusion_roi_transfer_option_view, 1, 1 ) self.image_fusion_four_views.setLayout( self.image_fusion_four_views_layout) self.image_fusion_view.addWidget(self.image_fusion_four_views) self.image_fusion_view.addWidget(self.image_fusion_single_view) self.image_fusion_view.setCurrentWidget(self.image_fusion_four_views) # Add Image Fusion Tab self.right_panel.addTab(self.image_fusion_view, "Image Fusion") self.right_panel.setCurrentWidget(self.image_fusion_view) # Update the Add On Option GUI self.add_on_options_controller.update_ui()
def setupUi(self, SlideshowClip_UI): if not SlideshowClip_UI.objectName(): SlideshowClip_UI.setObjectName(u"SlideshowClip_UI") SlideshowClip_UI.resize(354, 631) self.gridLayout_4 = QGridLayout(SlideshowClip_UI) self.gridLayout_4.setObjectName(u"gridLayout_4") self.gridLayout_4.setVerticalSpacing(6) self.icon_list = QListWidget(SlideshowClip_UI) self.icon_list.setObjectName(u"icon_list") self.gridLayout_4.addWidget(self.icon_list, 12, 0, 1, 4) self.animation = KComboBox(SlideshowClip_UI) self.animation.setObjectName(u"animation") sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.animation.sizePolicy().hasHeightForWidth()) self.animation.setSizePolicy(sizePolicy) self.gridLayout_4.addWidget(self.animation, 10, 2, 1, 2) self.slide_crop = QCheckBox(SlideshowClip_UI) self.slide_crop.setObjectName(u"slide_crop") self.gridLayout_4.addWidget(self.slide_crop, 4, 0, 1, 2) self.label_3 = QLabel(SlideshowClip_UI) self.label_3.setObjectName(u"label_3") self.gridLayout_4.addWidget(self.label_3, 0, 0, 1, 1) self.label_2 = QLabel(SlideshowClip_UI) self.label_2.setObjectName(u"label_2") self.gridLayout_4.addWidget(self.label_2, 2, 0, 1, 2) self.horizontalLayout_2 = QHBoxLayout() self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.clip_duration = QLineEdit(SlideshowClip_UI) self.clip_duration.setObjectName(u"clip_duration") self.horizontalLayout_2.addWidget(self.clip_duration) self.clip_duration_frames = QSpinBox(SlideshowClip_UI) self.clip_duration_frames.setObjectName(u"clip_duration_frames") sizePolicy1 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.clip_duration_frames.sizePolicy().hasHeightForWidth()) self.clip_duration_frames.setSizePolicy(sizePolicy1) self.clip_duration_frames.setMinimum(1) self.clip_duration_frames.setMaximum(256000) self.horizontalLayout_2.addWidget(self.clip_duration_frames) self.gridLayout_4.addLayout(self.horizontalLayout_2, 2, 2, 1, 1) self.luma_softness = QSlider(SlideshowClip_UI) self.luma_softness.setObjectName(u"luma_softness") self.luma_softness.setEnabled(False) self.luma_softness.setMaximum(100) self.luma_softness.setOrientation(Qt.Horizontal) self.gridLayout_4.addWidget(self.luma_softness, 8, 2, 1, 2) self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.luma_duration = QLineEdit(SlideshowClip_UI) self.luma_duration.setObjectName(u"luma_duration") self.horizontalLayout.addWidget(self.luma_duration) self.luma_duration_frames = QSpinBox(SlideshowClip_UI) self.luma_duration_frames.setObjectName(u"luma_duration_frames") self.luma_duration_frames.setEnabled(False) sizePolicy1.setHeightForWidth( self.luma_duration_frames.sizePolicy().hasHeightForWidth()) self.luma_duration_frames.setSizePolicy(sizePolicy1) self.luma_duration_frames.setMinimum(1) self.luma_duration_frames.setMaximum(256000) self.horizontalLayout.addWidget(self.luma_duration_frames) self.gridLayout_4.addLayout(self.horizontalLayout, 5, 2, 1, 2) self.luma_fade = QCheckBox(SlideshowClip_UI) self.luma_fade.setObjectName(u"luma_fade") self.luma_fade.setEnabled(False) self.gridLayout_4.addWidget(self.luma_fade, 7, 0, 1, 1) self.slide_fade = QCheckBox(SlideshowClip_UI) self.slide_fade.setObjectName(u"slide_fade") self.gridLayout_4.addWidget(self.slide_fade, 5, 0, 1, 1) self.luma_file = KComboBox(SlideshowClip_UI) self.luma_file.setObjectName(u"luma_file") self.luma_file.setEnabled(False) self.gridLayout_4.addWidget(self.luma_file, 7, 2, 1, 2) self.label_softness = QLabel(SlideshowClip_UI) self.label_softness.setObjectName(u"label_softness") self.label_softness.setEnabled(False) self.gridLayout_4.addWidget(self.label_softness, 8, 0, 1, 1) self.groupBox = QGroupBox(SlideshowClip_UI) self.groupBox.setObjectName(u"groupBox") self.gridLayout = QGridLayout(self.groupBox) self.gridLayout.setObjectName(u"gridLayout") self.gridLayout.setVerticalSpacing(0) self.method_mime = QRadioButton(self.groupBox) self.method_mime.setObjectName(u"method_mime") self.method_mime.setChecked(True) self.gridLayout.addWidget(self.method_mime, 0, 0, 1, 1) self.method_pattern = QRadioButton(self.groupBox) self.method_pattern.setObjectName(u"method_pattern") self.gridLayout.addWidget(self.method_pattern, 0, 1, 1, 1) self.stackedWidget = QStackedWidget(self.groupBox) self.stackedWidget.setObjectName(u"stackedWidget") self.page = QWidget() self.page.setObjectName(u"page") self.gridLayout_2 = QGridLayout(self.page) self.gridLayout_2.setObjectName(u"gridLayout_2") self.label = QLabel(self.page) self.label.setObjectName(u"label") self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1) self.verticalSpacer_2 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout_2.addItem(self.verticalSpacer_2, 2, 2, 1, 1) self.label_4 = QLabel(self.page) self.label_4.setObjectName(u"label_4") self.gridLayout_2.addWidget(self.label_4, 1, 0, 1, 1) self.folder_url = KUrlRequester(self.page) self.folder_url.setObjectName(u"folder_url") self.gridLayout_2.addWidget(self.folder_url, 0, 1, 1, 2) self.image_type = KComboBox(self.page) self.image_type.setObjectName(u"image_type") self.gridLayout_2.addWidget(self.image_type, 1, 1, 1, 2) self.stackedWidget.addWidget(self.page) self.page_2 = QWidget() self.page_2.setObjectName(u"page_2") self.gridLayout_3 = QGridLayout(self.page_2) self.gridLayout_3.setObjectName(u"gridLayout_3") self.label_5 = QLabel(self.page_2) self.label_5.setObjectName(u"label_5") self.gridLayout_3.addWidget(self.label_5, 0, 0, 1, 1) self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout_3.addItem(self.verticalSpacer, 1, 2, 1, 1) self.pattern_url = KUrlRequester(self.page_2) self.pattern_url.setObjectName(u"pattern_url") self.gridLayout_3.addWidget(self.pattern_url, 0, 1, 1, 2) self.stackedWidget.addWidget(self.page_2) self.gridLayout.addWidget(self.stackedWidget, 1, 0, 1, 2) self.gridLayout_4.addWidget(self.groupBox, 1, 0, 1, 4) self.buttonBox = QDialogButtonBox(SlideshowClip_UI) self.buttonBox.setObjectName(u"buttonBox") self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) self.gridLayout_4.addWidget(self.buttonBox, 14, 2, 1, 2) self.slide_loop = QCheckBox(SlideshowClip_UI) self.slide_loop.setObjectName(u"slide_loop") self.gridLayout_4.addWidget(self.slide_loop, 3, 0, 1, 1) self.clip_name = QLineEdit(SlideshowClip_UI) self.clip_name.setObjectName(u"clip_name") self.gridLayout_4.addWidget(self.clip_name, 0, 1, 1, 3) self.horizontalLayout_3 = QHBoxLayout() self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.show_thumbs = QCheckBox(SlideshowClip_UI) self.show_thumbs.setObjectName(u"show_thumbs") self.horizontalLayout_3.addWidget(self.show_thumbs) self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout_3.addItem(self.horizontalSpacer) self.label_info = QLabel(SlideshowClip_UI) self.label_info.setObjectName(u"label_info") self.horizontalLayout_3.addWidget(self.label_info) self.gridLayout_4.addLayout(self.horizontalLayout_3, 13, 0, 1, 4) self.clip_duration_format = KComboBox(SlideshowClip_UI) self.clip_duration_format.setObjectName(u"clip_duration_format") self.gridLayout_4.addWidget(self.clip_duration_format, 2, 3, 1, 1) self.label_6 = QLabel(SlideshowClip_UI) self.label_6.setObjectName(u"label_6") self.gridLayout_4.addWidget(self.label_6, 10, 0, 1, 1) self.low_pass = QCheckBox(SlideshowClip_UI) self.low_pass.setObjectName(u"low_pass") self.low_pass.setEnabled(False) self.gridLayout_4.addWidget(self.low_pass, 11, 0, 1, 4) self.retranslateUi(SlideshowClip_UI) self.buttonBox.accepted.connect(SlideshowClip_UI.accept) self.buttonBox.rejected.connect(SlideshowClip_UI.reject) self.stackedWidget.setCurrentIndex(0) QMetaObject.connectSlotsByName(SlideshowClip_UI)
def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") MainWindow.resize(911, 607) self.action_open = QAction(MainWindow) self.action_open.setObjectName(u"action_open") self.action_open.setVisible(False) self.action_comparison = QAction(MainWindow) self.action_comparison.setObjectName(u"action_comparison") self.action_comparison.setVisible(False) self.action_plot = QAction(MainWindow) self.action_plot.setObjectName(u"action_plot") self.action_training_session = QAction(MainWindow) self.action_training_session.setObjectName(u"action_training_session") self.action_training_session.setVisible(False) self.action_game = QAction(MainWindow) self.action_game.setObjectName(u"action_game") self.action_save = QAction(MainWindow) self.action_save.setObjectName(u"action_save") self.action_save.setVisible(False) self.action_save_log = QAction(MainWindow) self.action_save_log.setObjectName(u"action_save_log") self.action_save_log.setVisible(False) self.action_coordinates = QAction(MainWindow) self.action_coordinates.setObjectName(u"action_coordinates") self.action_coordinates.setCheckable(True) self.action_about = QAction(MainWindow) self.action_about.setObjectName(u"action_about") self.action_new_db = QAction(MainWindow) self.action_new_db.setObjectName(u"action_new_db") self.action_open_db = QAction(MainWindow) self.action_open_db.setObjectName(u"action_open_db") self.centralwidget = QWidget(MainWindow) self.centralwidget.setObjectName(u"centralwidget") self.verticalLayout_2 = QVBoxLayout(self.centralwidget) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.stacked_widget = QStackedWidget(self.centralwidget) self.stacked_widget.setObjectName(u"stacked_widget") self.game_page = QWidget() self.game_page.setObjectName(u"game_page") self.gridLayout_3 = QGridLayout(self.game_page) self.gridLayout_3.setObjectName(u"gridLayout_3") self.connect4 = QPushButton(self.game_page) self.connect4.setObjectName(u"connect4") sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.MinimumExpanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.connect4.sizePolicy().hasHeightForWidth()) self.connect4.setSizePolicy(sizePolicy) self.gridLayout_3.addWidget(self.connect4, 0, 1, 1, 1) self.tic_tac_toe = QPushButton(self.game_page) self.tic_tac_toe.setObjectName(u"tic_tac_toe") sizePolicy1 = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.tic_tac_toe.sizePolicy().hasHeightForWidth()) self.tic_tac_toe.setSizePolicy(sizePolicy1) self.gridLayout_3.addWidget(self.tic_tac_toe, 0, 0, 1, 1) self.othello = QPushButton(self.game_page) self.othello.setObjectName(u"othello") sizePolicy.setHeightForWidth( self.othello.sizePolicy().hasHeightForWidth()) self.othello.setSizePolicy(sizePolicy) self.gridLayout_3.addWidget(self.othello, 1, 0, 1, 1) self.stacked_widget.addWidget(self.game_page) self.players_page = QWidget() self.players_page.setObjectName(u"players_page") self.verticalLayout = QVBoxLayout(self.players_page) self.verticalLayout.setObjectName(u"verticalLayout") self.player_layout = QGridLayout() self.player_layout.setObjectName(u"player_layout") self.searches_lock2 = QCheckBox(self.players_page) self.searches_lock2.setObjectName(u"searches_lock2") self.player_layout.addWidget(self.searches_lock2, 2, 4, 1, 1) self.player1 = QComboBox(self.players_page) self.player1.setObjectName(u"player1") sizePolicy2 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed) sizePolicy2.setHorizontalStretch(0) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth( self.player1.sizePolicy().hasHeightForWidth()) self.player1.setSizePolicy(sizePolicy2) self.player_layout.addWidget(self.player1, 1, 1, 1, 1) self.cancel = QPushButton(self.players_page) self.cancel.setObjectName(u"cancel") self.player_layout.addWidget(self.cancel, 4, 0, 1, 1) self.searches_label1 = QLabel(self.players_page) self.searches_label1.setObjectName(u"searches_label1") sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred) sizePolicy3.setHorizontalStretch(0) sizePolicy3.setVerticalStretch(0) sizePolicy3.setHeightForWidth( self.searches_label1.sizePolicy().hasHeightForWidth()) self.searches_label1.setSizePolicy(sizePolicy3) self.player_layout.addWidget(self.searches_label1, 1, 3, 1, 1) self.player2 = QComboBox(self.players_page) self.player2.setObjectName(u"player2") sizePolicy2.setHeightForWidth( self.player2.sizePolicy().hasHeightForWidth()) self.player2.setSizePolicy(sizePolicy2) self.player_layout.addWidget(self.player2, 2, 1, 1, 1) self.searches_lock1 = QCheckBox(self.players_page) self.searches_lock1.setObjectName(u"searches_lock1") self.player_layout.addWidget(self.searches_lock1, 1, 4, 1, 1) self.game_label = QLabel(self.players_page) self.game_label.setObjectName(u"game_label") sizePolicy4 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy4.setHorizontalStretch(0) sizePolicy4.setVerticalStretch(0) sizePolicy4.setHeightForWidth( self.game_label.sizePolicy().hasHeightForWidth()) self.game_label.setSizePolicy(sizePolicy4) self.player_layout.addWidget(self.game_label, 0, 0, 1, 1) self.game_name = QLabel(self.players_page) self.game_name.setObjectName(u"game_name") self.player_layout.addWidget(self.game_name, 0, 1, 1, 4) self.searches_label2 = QLabel(self.players_page) self.searches_label2.setObjectName(u"searches_label2") self.player_layout.addWidget(self.searches_label2, 2, 3, 1, 1) self.player_label1 = QLabel(self.players_page) self.player_label1.setObjectName(u"player_label1") sizePolicy4.setHeightForWidth( self.player_label1.sizePolicy().hasHeightForWidth()) self.player_label1.setSizePolicy(sizePolicy4) self.player_layout.addWidget(self.player_label1, 1, 0, 1, 1) self.searches1 = QSpinBox(self.players_page) self.searches1.setObjectName(u"searches1") sizePolicy5 = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed) sizePolicy5.setHorizontalStretch(0) sizePolicy5.setVerticalStretch(0) sizePolicy5.setHeightForWidth( self.searches1.sizePolicy().hasHeightForWidth()) self.searches1.setSizePolicy(sizePolicy5) self.searches1.setMaximum(1000000) self.player_layout.addWidget(self.searches1, 1, 2, 1, 1) self.player_label2 = QLabel(self.players_page) self.player_label2.setObjectName(u"player_label2") self.player_layout.addWidget(self.player_label2, 2, 0, 1, 1) self.shuffle_players = QCheckBox(self.players_page) self.shuffle_players.setObjectName(u"shuffle_players") self.player_layout.addWidget(self.shuffle_players, 3, 1, 1, 4) self.searches2 = QSpinBox(self.players_page) self.searches2.setObjectName(u"searches2") sizePolicy5.setHeightForWidth( self.searches2.sizePolicy().hasHeightForWidth()) self.searches2.setSizePolicy(sizePolicy5) self.searches2.setMaximum(1000000) self.player_layout.addWidget(self.searches2, 2, 2, 1, 1) self.start = QPushButton(self.players_page) self.start.setObjectName(u"start") self.player_layout.addWidget(self.start, 4, 1, 1, 4) self.player_layout.setColumnStretch(1, 10) self.player_layout.setColumnStretch(2, 1) self.verticalLayout.addLayout(self.player_layout) self.stacked_widget.addWidget(self.players_page) self.humans_page = QWidget() self.humans_page.setObjectName(u"humans_page") self.gridLayout = QGridLayout(self.humans_page) self.gridLayout.setObjectName(u"gridLayout") self.close_humans = QPushButton(self.humans_page) self.close_humans.setObjectName(u"close_humans") sizePolicy4.setHeightForWidth( self.close_humans.sizePolicy().hasHeightForWidth()) self.close_humans.setSizePolicy(sizePolicy4) self.gridLayout.addWidget(self.close_humans, 1, 1, 1, 1) self.players_label = QLabel(self.humans_page) self.players_label.setObjectName(u"players_label") self.gridLayout.addWidget(self.players_label, 0, 0, 1, 1) self.new_human = QPushButton(self.humans_page) self.new_human.setObjectName(u"new_human") sizePolicy4.setHeightForWidth( self.new_human.sizePolicy().hasHeightForWidth()) self.new_human.setSizePolicy(sizePolicy4) self.gridLayout.addWidget(self.new_human, 1, 3, 1, 1) self.players_table = QTableWidget(self.humans_page) self.players_table.setObjectName(u"players_table") self.gridLayout.addWidget(self.players_table, 0, 1, 1, 3) self.spacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.gridLayout.addItem(self.spacer, 1, 2, 1, 1) self.stacked_widget.addWidget(self.humans_page) self.rules_page = QWidget() self.rules_page.setObjectName(u"rules_page") self.gridLayout_4 = QGridLayout(self.rules_page) self.gridLayout_4.setObjectName(u"gridLayout_4") self.rules_text = QTextBrowser(self.rules_page) self.rules_text.setObjectName(u"rules_text") self.gridLayout_4.addWidget(self.rules_text, 0, 0, 1, 1) self.rules_close = QPushButton(self.rules_page) self.rules_close.setObjectName(u"rules_close") sizePolicy4.setHeightForWidth( self.rules_close.sizePolicy().hasHeightForWidth()) self.rules_close.setSizePolicy(sizePolicy4) self.gridLayout_4.addWidget(self.rules_close, 1, 0, 1, 1) self.stacked_widget.addWidget(self.rules_page) self.display_page = QWidget() self.display_page.setObjectName(u"display_page") self.gridLayout_2 = QGridLayout(self.display_page) self.gridLayout_2.setObjectName(u"gridLayout_2") self.toggle_review = QPushButton(self.display_page) self.toggle_review.setObjectName(u"toggle_review") sizePolicy4.setHeightForWidth( self.toggle_review.sizePolicy().hasHeightForWidth()) self.toggle_review.setSizePolicy(sizePolicy4) self.gridLayout_2.addWidget(self.toggle_review, 3, 2, 1, 1) self.move_history = QComboBox(self.display_page) self.move_history.setObjectName(u"move_history") sizePolicy6 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed) sizePolicy6.setHorizontalStretch(1) sizePolicy6.setVerticalStretch(0) sizePolicy6.setHeightForWidth( self.move_history.sizePolicy().hasHeightForWidth()) self.move_history.setSizePolicy(sizePolicy6) self.gridLayout_2.addWidget(self.move_history, 3, 1, 1, 1) self.choices = QTableWidget(self.display_page) self.choices.setObjectName(u"choices") sizePolicy7 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred) sizePolicy7.setHorizontalStretch(0) sizePolicy7.setVerticalStretch(0) sizePolicy7.setHeightForWidth( self.choices.sizePolicy().hasHeightForWidth()) self.choices.setSizePolicy(sizePolicy7) self.gridLayout_2.addWidget(self.choices, 1, 0, 1, 3) self.resume_here = QPushButton(self.display_page) self.resume_here.setObjectName(u"resume_here") sizePolicy5.setHeightForWidth( self.resume_here.sizePolicy().hasHeightForWidth()) self.resume_here.setSizePolicy(sizePolicy5) self.gridLayout_2.addWidget(self.resume_here, 3, 0, 1, 1) self.game_display = QLabel(self.display_page) self.game_display.setObjectName(u"game_display") self.gridLayout_2.addWidget(self.game_display, 0, 0, 1, 3) self.stacked_widget.addWidget(self.display_page) self.plot_strength_page = QWidget() self.plot_strength_page.setObjectName(u"plot_strength_page") self.gridLayout_5 = QGridLayout(self.plot_strength_page) self.gridLayout_5.setObjectName(u"gridLayout_5") self.label = QLabel(self.plot_strength_page) self.label.setObjectName(u"label") self.gridLayout_5.addWidget(self.label, 0, 0, 1, 1) self.plot_game = QComboBox(self.plot_strength_page) self.plot_game.setObjectName(u"plot_game") self.gridLayout_5.addWidget(self.plot_game, 0, 1, 1, 2) self.lineEdit = QLineEdit(self.plot_strength_page) self.lineEdit.setObjectName(u"lineEdit") self.gridLayout_5.addWidget(self.lineEdit, 2, 1, 1, 2) self.label_2 = QLabel(self.plot_strength_page) self.label_2.setObjectName(u"label_2") self.gridLayout_5.addWidget(self.label_2, 3, 0, 1, 1) self.lineEdit_2 = QLineEdit(self.plot_strength_page) self.lineEdit_2.setObjectName(u"lineEdit_2") self.gridLayout_5.addWidget(self.lineEdit_2, 3, 1, 1, 2) self.reset_plot = QPushButton(self.plot_strength_page) self.reset_plot.setObjectName(u"reset_plot") self.gridLayout_5.addWidget(self.reset_plot, 6, 2, 1, 1) self.start_stop_plot = QPushButton(self.plot_strength_page) self.start_stop_plot.setObjectName(u"start_stop_plot") self.gridLayout_5.addWidget(self.start_stop_plot, 6, 1, 1, 1) self.strengths_label = QLabel(self.plot_strength_page) self.strengths_label.setObjectName(u"strengths_label") self.gridLayout_5.addWidget(self.strengths_label, 2, 0, 1, 1) self.label_3 = QLabel(self.plot_strength_page) self.label_3.setObjectName(u"label_3") self.gridLayout_5.addWidget(self.label_3, 4, 0, 1, 1) self.lineEdit_3 = QLineEdit(self.plot_strength_page) self.lineEdit_3.setObjectName(u"lineEdit_3") self.gridLayout_5.addWidget(self.lineEdit_3, 4, 1, 1, 2) self.stacked_widget.addWidget(self.plot_strength_page) self.plot_history_page = QWidget() self.plot_history_page.setObjectName(u"plot_history_page") self.gridLayout_6 = QGridLayout(self.plot_history_page) self.gridLayout_6.setObjectName(u"gridLayout_6") self.label_4 = QLabel(self.plot_history_page) self.label_4.setObjectName(u"label_4") self.gridLayout_6.addWidget(self.label_4, 0, 0, 1, 1) self.history_game = QComboBox(self.plot_history_page) self.history_game.setObjectName(u"history_game") self.gridLayout_6.addWidget(self.history_game, 0, 1, 1, 1) self.gridLayout_6.setColumnStretch(0, 1) self.gridLayout_6.setColumnStretch(1, 8) self.stacked_widget.addWidget(self.plot_history_page) self.verticalLayout_2.addWidget(self.stacked_widget) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QMenuBar(MainWindow) self.menubar.setObjectName(u"menubar") self.menubar.setGeometry(QRect(0, 0, 911, 22)) self.menu_file = QMenu(self.menubar) self.menu_file.setObjectName(u"menu_file") self.menu_new = QMenu(self.menu_file) self.menu_new.setObjectName(u"menu_new") self.menu_view = QMenu(self.menubar) self.menu_view.setObjectName(u"menu_view") self.menu_help = QMenu(self.menubar) self.menu_help.setObjectName(u"menu_help") self.menu_rules = QMenu(self.menu_help) self.menu_rules.setObjectName(u"menu_rules") MainWindow.setMenuBar(self.menubar) self.statusbar = QStatusBar(MainWindow) self.statusbar.setObjectName(u"statusbar") MainWindow.setStatusBar(self.statusbar) self.menubar.addAction(self.menu_file.menuAction()) self.menubar.addAction(self.menu_view.menuAction()) self.menubar.addAction(self.menu_help.menuAction()) self.menu_file.addAction(self.menu_new.menuAction()) self.menu_file.addAction(self.action_open) self.menu_file.addAction(self.action_save) self.menu_file.addAction(self.action_save_log) self.menu_file.addAction(self.action_new_db) self.menu_file.addAction(self.action_open_db) self.menu_new.addAction(self.action_game) self.menu_new.addAction(self.action_comparison) self.menu_new.addAction(self.action_plot) self.menu_new.addAction(self.action_training_session) self.menu_view.addAction(self.action_coordinates) self.menu_help.addAction(self.action_about) self.menu_help.addAction(self.menu_rules.menuAction()) self.retranslateUi(MainWindow) self.stacked_widget.setCurrentIndex(2) QMetaObject.connectSlotsByName(MainWindow)
def __init__(self, parent: QWidget, model: Model) -> None: super().__init__(parent) logger.add(self.log) settings = QSettings() self.mainlayout = QVBoxLayout() self.mainlayout.setContentsMargins(5, 5, 5, 5) self.setLayout(self.mainlayout) # summary summarylayout = FlowLayout() summarylayout.setContentsMargins(0, 0, 0, 0) self.summary = QWidget() self.summary.setLayout(summarylayout) self.mainlayout.addWidget(self.summary) self.summary.setVisible( settings.value('showSummary', 'True') == 'True') detailslayout = QHBoxLayout() detailslayout.setContentsMargins(1, 0, 0, 0) detailslayout.setAlignment(Qt.AlignLeft | Qt.AlignVCenter) detailslayout.setSpacing(15) details = QWidget() details.setLayout(detailslayout) summarylayout.addWidget(details) self.modstotal = QLabel() detailslayout.addWidget(self.modstotal) self.modsenabled = QLabel() detailslayout.addWidget(self.modsenabled) self.overridden = QLabel() detailslayout.addWidget(self.overridden) self.conflicts = QLabel() detailslayout.addWidget(self.conflicts) buttonslayout = QHBoxLayout() buttonslayout.setContentsMargins(0, 0, 0, 0) buttonslayout.setAlignment(Qt.AlignRight | Qt.AlignVCenter) buttons = QWidget() buttons.setLayout(buttonslayout) summarylayout.addWidget(buttons) self.startscriptmerger = QPushButton('Start Script Merger') self.startscriptmerger.setContentsMargins(0, 0, 0, 0) self.startscriptmerger.setMinimumWidth(140) self.startscriptmerger.setIcon( QIcon(str(getRuntimePath('resources/icons/script.ico')))) self.startscriptmerger.clicked.connect(lambda: [ openExecutable(Path(str(settings.value('scriptMergerPath'))), True) ]) self.startscriptmerger.setEnabled( verifyScriptMergerPath( Path(str(settings.value('scriptMergerPath')))) is not None) buttonslayout.addWidget(self.startscriptmerger) self.startgame = QPushButton('Start Game') self.startgame.setContentsMargins(0, 0, 0, 0) self.startgame.setMinimumWidth(100) self.startgame.setIcon( QIcon(str(getRuntimePath('resources/icons/w3b.ico')))) buttonslayout.addWidget(self.startgame) # splitter self.splitter = QSplitter(Qt.Vertical) self.stack = QStackedWidget() self.splitter.addWidget(self.stack) # mod list widget self.modlistwidget = QWidget() self.modlistlayout = QVBoxLayout() self.modlistlayout.setContentsMargins(0, 0, 0, 0) self.modlistwidget.setLayout(self.modlistlayout) self.stack.addWidget(self.modlistwidget) # search bar self.searchbar = QLineEdit() self.searchbar.setPlaceholderText('Search...') self.modlistlayout.addWidget(self.searchbar) # mod list self.modlist = ModList(self, model) self.modlistlayout.addWidget(self.modlist) self.searchbar.textChanged.connect(lambda e: self.modlist.setFilter(e)) # welcome message welcomelayout = QVBoxLayout() welcomelayout.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter) welcomewidget = QWidget() welcomewidget.setLayout(welcomelayout) welcomewidget.dragEnterEvent = self.modlist.dragEnterEvent # type: ignore welcomewidget.dragMoveEvent = self.modlist.dragMoveEvent # type: ignore welcomewidget.dragLeaveEvent = self.modlist.dragLeaveEvent # type: ignore welcomewidget.dropEvent = self.modlist.dropEvent # type: ignore welcomewidget.setAcceptDrops(True) icon = QIcon(str(getRuntimePath('resources/icons/open-folder.ico'))) iconpixmap = icon.pixmap(32, 32) icon = QLabel() icon.setPixmap(iconpixmap) icon.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter) icon.setContentsMargins(4, 4, 4, 4) welcomelayout.addWidget(icon) welcome = QLabel('''<p><font> No mod installed yet. Drag a mod into this area to get started! </font></p>''') welcome.setAttribute(Qt.WA_TransparentForMouseEvents) welcome.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter) welcomelayout.addWidget(welcome) self.stack.addWidget(welcomewidget) # output log self.output = QTextEdit(self) self.output.setTextInteractionFlags(Qt.NoTextInteraction) self.output.setReadOnly(True) self.output.setContextMenuPolicy(Qt.NoContextMenu) self.output.setPlaceholderText('Program output...') self.splitter.addWidget(self.output) # TODO: enhancement: show indicator if scripts have to be merged self.splitter.setStretchFactor(0, 1) self.splitter.setStretchFactor(1, 0) self.mainlayout.addWidget(self.splitter) # TODO: incomplete: make start game button functional if len(model): self.stack.setCurrentIndex(0) self.splitter.setSizes([self.splitter.size().height(), 50]) else: self.stack.setCurrentIndex(1) self.splitter.setSizes([self.splitter.size().height(), 0]) model.updateCallbacks.append(self.modelUpdateEvent) asyncio.create_task(model.loadInstalled())
def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") MainWindow.resize(1120, 700) self.actionOpen_Ops = QAction(MainWindow) self.actionOpen_Ops.setObjectName(u"actionOpen_Ops") self.actionOpen_Demo = QAction(MainWindow) self.actionOpen_Demo.setObjectName(u"actionOpen_Demo") self.actionOpen_Audio = QAction(MainWindow) self.actionOpen_Audio.setObjectName(u"actionOpen_Audio") self.actionImport_Script = QAction(MainWindow) self.actionImport_Script.setObjectName(u"actionImport_Script") self.actionSave_Ops = QAction(MainWindow) self.actionSave_Ops.setObjectName(u"actionSave_Ops") self.actionPreferences = QAction(MainWindow) self.actionPreferences.setObjectName(u"actionPreferences") self.actionView_metadata = QAction(MainWindow) self.actionView_metadata.setObjectName(u"actionView_metadata") self.actionRename = QAction(MainWindow) self.actionRename.setObjectName(u"actionRename") self.actionExport_to_XML = QAction(MainWindow) self.actionExport_to_XML.setObjectName(u"actionExport_to_XML") self.actionOperations = QAction(MainWindow) self.actionOperations.setObjectName(u"actionOperations") self.actionMetadata_editor = QAction(MainWindow) self.actionMetadata_editor.setObjectName(u"actionMetadata_editor") self.actionProduction_editor = QAction(MainWindow) self.actionProduction_editor.setObjectName(u"actionProduction_editor") self.actionAbout = QAction(MainWindow) self.actionAbout.setObjectName(u"actionAbout") self.actionHow_to_use = QAction(MainWindow) self.actionHow_to_use.setObjectName(u"actionHow_to_use") self.actionQuit = QAction(MainWindow) self.actionQuit.setObjectName(u"actionQuit") self.actionPreferences_2 = QAction(MainWindow) self.actionPreferences_2.setObjectName(u"actionPreferences_2") self.centralwidget = QWidget(MainWindow) self.centralwidget.setObjectName(u"centralwidget") self.verticalLayout = QVBoxLayout(self.centralwidget) self.verticalLayout.setSpacing(4) self.verticalLayout.setObjectName(u"verticalLayout") self.verticalLayout.setContentsMargins(4, 4, 4, 4) self.centralTabs = QStackedWidget(self.centralwidget) self.centralTabs.setObjectName(u"centralTabs") self.centralTabs.setMouseTracking(True) self.centralTabs.setAcceptDrops(True) self.centralTabs.setLineWidth(0) self.editStackPage = QWidget() self.editStackPage.setObjectName(u"editStackPage") self.horizontalLayout_3 = QHBoxLayout(self.editStackPage) self.horizontalLayout_3.setSpacing(2) self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.horizontalLayout_3.setContentsMargins(4, 4, 4, 4) self.dataView = QTabWidget(self.editStackPage) self.dataView.setObjectName(u"dataView") sizePolicy = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.dataView.sizePolicy().hasHeightForWidth()) self.dataView.setSizePolicy(sizePolicy) self.dataView.setMinimumSize(QSize(300, 0)) self.demoDataPage = DemoPage() self.demoDataPage.setObjectName(u"demoDataPage") self.verticalLayout_6 = QVBoxLayout(self.demoDataPage) self.verticalLayout_6.setObjectName(u"verticalLayout_6") self.verticalLayout_6.setContentsMargins(4, 4, 4, 4) self.groupBox_3 = QGroupBox(self.demoDataPage) self.groupBox_3.setObjectName(u"groupBox_3") self.verticalLayout_6.addWidget(self.groupBox_3) self.groupBox_4 = QGroupBox(self.demoDataPage) self.groupBox_4.setObjectName(u"groupBox_4") self.verticalLayout_6.addWidget(self.groupBox_4) self.dataView.addTab(self.demoDataPage, "") self.tab_5 = QWidget() self.tab_5.setObjectName(u"tab_5") self.dataView.addTab(self.tab_5, "") self.horizontalLayout_3.addWidget(self.dataView) self.tabWidget = QTabWidget(self.editStackPage) self.tabWidget.setObjectName(u"tabWidget") self.tabWidget.setEnabled(False) self.tabWidget.setAcceptDrops(True) self.tabWidget.setElideMode(Qt.ElideNone) self.tabWidget.setDocumentMode(False) self.tabWidget.setTabsClosable(False) self.tabWidget.setMovable(True) self.tabWidget.setTabBarAutoHide(False) self.horizontalLayout_3.addWidget(self.tabWidget) self.viewTabs = QTabWidget(self.editStackPage) self.viewTabs.setObjectName(u"viewTabs") self.viewTabs.setMinimumSize(QSize(0, 0)) self.viewTabs.setMaximumSize(QSize(16555215, 16777215)) self.demoViewTab = QWidget() self.demoViewTab.setObjectName(u"demoViewTab") self.verticalLayout_8 = QVBoxLayout(self.demoViewTab) self.verticalLayout_8.setSpacing(1) self.verticalLayout_8.setObjectName(u"verticalLayout_8") self.verticalLayout_8.setContentsMargins(4, 4, 4, 4) self.groupBox = QGroupBox(self.demoViewTab) self.groupBox.setObjectName(u"groupBox") self.verticalLayout_8.addWidget(self.groupBox) self.groupBox_2 = QGroupBox(self.demoViewTab) self.groupBox_2.setObjectName(u"groupBox_2") self.verticalLayout_8.addWidget(self.groupBox_2) self.viewTabs.addTab(self.demoViewTab, "") self.metadataViewTab = QWidget() self.metadataViewTab.setObjectName(u"metadataViewTab") self.viewTabs.addTab(self.metadataViewTab, "") self.horizontalLayout_3.addWidget(self.viewTabs) self.centralTabs.addWidget(self.editStackPage) self.tabWidget.raise_() self.dataView.raise_() self.viewTabs.raise_() self.centralTabsPage2 = QWidget() self.centralTabsPage2.setObjectName(u"centralTabsPage2") self.horizontalLayout_2 = QHBoxLayout(self.centralTabsPage2) self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.horizontalLayout_2.addLayout(self.horizontalLayout) self.centralTabs.addWidget(self.centralTabsPage2) self.verticalLayout.addWidget(self.centralTabs) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QMenuBar(MainWindow) self.menubar.setObjectName(u"menubar") self.menubar.setGeometry(QRect(0, 0, 1120, 22)) self.menuFile = QMenu(self.menubar) self.menuFile.setObjectName(u"menuFile") self.menuEdit = QMenu(self.menubar) self.menuEdit.setObjectName(u"menuEdit") self.menuDemo = QMenu(self.menubar) self.menuDemo.setObjectName(u"menuDemo") self.menuView = QMenu(self.menubar) self.menuView.setObjectName(u"menuView") self.menuTools = QMenu(self.menubar) self.menuTools.setObjectName(u"menuTools") self.menuWindow = QMenu(self.menubar) self.menuWindow.setObjectName(u"menuWindow") self.menuHelp = QMenu(self.menubar) self.menuHelp.setObjectName(u"menuHelp") MainWindow.setMenuBar(self.menubar) self.statusbar = QStatusBar(MainWindow) self.statusbar.setObjectName(u"statusbar") MainWindow.setStatusBar(self.statusbar) self.menubar.addAction(self.menuFile.menuAction()) self.menubar.addAction(self.menuEdit.menuAction()) self.menubar.addAction(self.menuDemo.menuAction()) self.menubar.addAction(self.menuView.menuAction()) self.menubar.addAction(self.menuTools.menuAction()) self.menubar.addAction(self.menuWindow.menuAction()) self.menubar.addAction(self.menuHelp.menuAction()) self.menuFile.addAction(self.actionOpen_Ops) self.menuFile.addAction(self.actionSave_Ops) self.menuFile.addSeparator() self.menuFile.addAction(self.actionOpen_Demo) self.menuFile.addAction(self.actionOpen_Audio) self.menuFile.addAction(self.actionImport_Script) self.menuFile.addSeparator() self.menuEdit.addAction(self.actionPreferences) self.menuDemo.addAction(self.actionView_metadata) self.menuDemo.addAction(self.actionRename) self.menuDemo.addAction(self.actionExport_to_XML) self.menuView.addAction(self.actionOperations) self.menuView.addAction(self.actionMetadata_editor) self.menuView.addAction(self.actionProduction_editor) self.menuTools.addAction(self.actionPreferences_2) self.menuWindow.addAction(self.actionQuit) self.menuHelp.addAction(self.actionAbout) self.menuHelp.addAction(self.actionHow_to_use) self.retranslateUi(MainWindow) self.dataView.setCurrentIndex(1) self.viewTabs.setCurrentIndex(0) QMetaObject.connectSlotsByName(MainWindow)
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)
class MainWidget(QWidget): data = None current_question = None current_correct_answer = None buttons_choices = None question_mode = None answer_mode = None correct_questions = 0 total_questions = 0 def __init__(self): super().__init__() # Create Widgets self.question = QLabel(Text="Press Start", Alignment=QtCore.Qt.AlignCenter, Font=QtGui.QFont("", 30)) self.label_correct = QLabel(Alignment=QtCore.Qt.AlignCenter) self.button_quit = QPushButton("Quit", Visible=False) self.button_start = QPushButton("Start") lcd_height = 40 self.lcd_total = QLCDNumber(SegmentStyle=QLCDNumber.Flat, FixedHeight=lcd_height) self.lcd_score = QLCDNumber(SegmentStyle=QLCDNumber.Flat, FixedHeight=lcd_height) self.stack = QStackedWidget() self.page1 = Page1Widget() self.page2 = Page2Widget() self.page3 = Page3Widget() self.stack.addWidget(self.page1) self.stack.addWidget(self.page2) self.stack.addWidget(self.page3) # Make Layout self.layout = QGridLayout(self) self.layout.addWidget(self.question, 2, 0, 1, 2) self.layout.addWidget(self.label_correct, 1, 0, 1, 2) self.layout.addWidget(self.lcd_total, 0, 0) self.layout.addWidget(self.lcd_score, 0, 1) self.layout.addWidget(self.stack, 3, 0, 1, 2) self.layout.addWidget(self.button_quit, 4, 0) self.layout.addWidget(self.button_start, 4, 1) # Connect Callbacks self.button_quit.clicked.connect(self.on_quit_pressed) self.button_start.clicked.connect(self.on_start_pressed) self.page2.ans_buttons[0].clicked.connect(self.on_ans_button0_clicked) self.page2.ans_buttons[1].clicked.connect(self.on_ans_button1_clicked) self.page2.ans_buttons[2].clicked.connect(self.on_ans_button2_clicked) self.page3.line_edit.returnPressed.connect(self.on_answer_given) def update_questions_from_selection(self): selected_groups = [] for i in range(self.page1.list_groups.count()): item = self.page1.list_groups.item(i) if item.checkState(): selected_groups.append(item.text()) if len(selected_groups) == 0: self.data = data else: self.data = data.loc[data['Group'].isin(selected_groups), :] def on_quit_pressed(self): self.button_start.setVisible(True) self.button_quit.setVisible(False) self.question.clear() self.stack.setCurrentIndex(0) def on_start_pressed(self): self.update_questions_from_selection() self.button_start.setVisible(False) self.button_quit.setVisible(True) self.total_questions = -1 self.correct_questions = 0 self.stack.setCurrentIndex(int(self.page1.spinbox_level.text())) self.question_mode = MODES[self.page1.dropdown_quest.currentIndex()] self.answer_mode = MODES[self.page1.dropdown_ans.currentIndex()] self.update_question() def update_score(self): self.lcd_total.display(self.total_questions) self.lcd_score.display(self.correct_questions) def get_also_string(self): also_mode = self.page1.dropdown_also.currentText() if also_mode == "----": return "" return self.current_question[also_mode] def update_question(self): self.total_questions += 1 self.update_score() picked_questions = self.data.sample(frac=1).iloc[:3] self.current_question = picked_questions.iloc[0] self.current_correct_answer = self.current_question[self.answer_mode] also_string = " " + self.get_also_string() self.question.setText(self.current_question[self.question_mode] + also_string) self.buttons_choices = list(picked_questions[self.answer_mode]) random.shuffle(self.buttons_choices) for button, answer in zip(self.page2.ans_buttons, self.buttons_choices): button.setText(answer) def correct_answer(self): self.correct_questions += 1 self.label_correct.setText("Correct!") self.label_correct.setStyleSheet("QLabel { background-color : green;}") def wrong_answer(self): wrong_string = (f"Wrong: {self.current_question[self.question_mode]} " f"= {self.current_correct_answer}") self.label_correct.setText(wrong_string) self.label_correct.setStyleSheet("QLabel { background-color : red;}") def on_answer_given(self): given_answer = self.page3.line_edit.text() if given_answer == self.current_correct_answer: self.correct_answer() else: self.wrong_answer() self.question.setText(self.page3.line_edit.text()) self.page3.line_edit.clear() self.update_question() def after_button_clicked(self, ans_id): if self.buttons_choices[ans_id] == self.current_correct_answer: self.correct_answer() else: self.wrong_answer() self.update_question() def on_ans_button0_clicked(self): self.after_button_clicked(0) def on_ans_button1_clicked(self): self.after_button_clicked(1) def on_ans_button2_clicked(self): self.after_button_clicked(2)