def __init__(self): super().__init__() # Create Widgets self.dropdown_quest = QComboBox() self.dropdown_quest.addItems(MODES) self.dropdown_quest.setCurrentText("Romaji") self.dropdown_ans = QComboBox() self.dropdown_ans.addItems(MODES) self.dropdown_also = QComboBox() self.dropdown_also.addItem("----") self.dropdown_also.addItems(MODES) self.spinbox_level = QSpinBox(Minimum=1, Maximum=2) self.list_groups = QListWidget(FixedWidth=W * .6) for group_name in GROUPS: item = QListWidgetItem(group_name) item.setCheckState(QtCore.Qt.Unchecked) self.list_groups.addItem(item) # Make Layout self.sub_layout = QVBoxLayout() self.sub_layout.addWidget(QLabel('Question:')) self.sub_layout.addWidget(self.dropdown_quest) self.sub_layout.addWidget(QLabel('Answer:')) self.sub_layout.addWidget(self.dropdown_ans) self.sub_layout.addWidget(QLabel('Also:')) self.sub_layout.addWidget(self.dropdown_also) self.sub_layout.addWidget(QLabel('Level:')) self.sub_layout.addWidget(self.spinbox_level) self.layout = QHBoxLayout(self) self.layout.addLayout(self.sub_layout) self.layout.addWidget(self.list_groups)
def __init__(self): super(MainWindow, self).__init__() # 左边的菜单项 menu_widget = QListWidget() for i in range(10): item = QListWidgetItem(f"item {i}") item.setTextAlignment(Qt.AlignCenter) menu_widget.addItem(item) _placeholder = "text_widget" text_widget = QLabel(_placeholder) button = QPushButton("Click") # 横向布局 content_layout = QVBoxLayout() content_layout.addWidget(text_widget) content_layout.addWidget(button) main_widget = QWidget() main_widget.setLayout(content_layout) layout = QHBoxLayout() layout.addWidget(menu_widget, 1) layout.addWidget(main_widget, 4) self.setLayout(layout)
def add_item(self, text): """add editable text item need to use item widget to make it editable :param text str: content of the item """ item = QListWidgetItem(text) item.setFlags(item.flags() | Qt.ItemIsEditable | Qt.ItemIsSelectable) self.addItem(item)
def add_header_key_value(self): ''' 添加一对key value ''' item = QListWidgetItem(self.listWidget_headers_key) lineedit = CustomLineEdit(item, 'header_key', self.listWidget_headers_key.count(), '', self) self.listWidget_headers_key.setItemWidget(item, lineedit) item = QListWidgetItem(self.listWidget_headers_value) lineedit = CustomLineEdit(item, 'header_value', self.listWidget_headers_value.count(), '', self) self.listWidget_headers_value.setItemWidget(item, lineedit)
def show_key_value(self): ''' 创建对应的编辑列表 ''' self.listWidget_headers_key.clear() self.listWidget_headers_value.clear() for header_key, header_value in self.config.items(): # 设置 header_key 到 listWidget_headers_key item = QListWidgetItem(self.listWidget_headers_key) lineedit = CustomLineEdit(item, 'header_key', self.listWidget_headers_key.count(), header_key, self) self.listWidget_headers_key.setItemWidget(item, lineedit) # 设置 header_value 到 listWidget_headers_value item = QListWidgetItem(self.listWidget_headers_value) lineedit = CustomLineEdit(item, 'header_value', self.listWidget_headers_value.count(), header_value, self) self.listWidget_headers_value.setItemWidget(item, lineedit)
def update_timelines(self): self.ui.timelineList.clear() for timeline in self.timeline_manager.timelines.values(): self.ui.timelineList.addItem(QListWidgetItem(timeline.name)) self.ui.timelineList.sortItems()
def __init__(self, tab, config_path, options): self.options = options self.selected = [] super().__init__(tab, config_path, defer_initial_ui_update=True) self.selectionMode = self.MultiSelection # add options for opt in options: if isinstance(opt, str): self.addItem(QListWidgetItem(opt)) else: group_header = QListWidgetItem(opt["group"]) group_header.setFlags(Qt.ItemFlag.NoItemFlags) group_header.setForeground(Qt.black) header_font = QFont() header_font.setWeight(QFont.Bold) group_header.setFont(header_font) self.addItem(group_header) for group_opt in opt["entries"]: self.addItem(QListWidgetItem(group_opt)) self.on_config_changed(self.main_window.config)
def init_patient_A_initial_roi_list(self): """ Initialize the layout for patient A's roi list """ self.patient_A_initial_rois_list_widget = QListWidget(self) self.patient_A_initial_rois_list_widget.itemDoubleClicked.connect( self.patient_A_initial_roi_double_clicked) for idx in self.fixed_image_initial_rois: roi_label = QListWidgetItem( self.fixed_image_initial_rois[idx]['name']) roi_label.setForeground(Qt.darkGreen) roi_label.setData(Qt.UserRole, self.fixed_image_initial_rois[idx]) self.patient_A_initial_rois_list_widget.addItem(roi_label) self.transfer_roi_window_grid_layout.addWidget( self.patient_A_initial_rois_list_widget, 1, 0)
def patient_B_to_A_rois_double_clicked(self, item): """ This function is triggered when a roi in "B to A" list is double-clicked. """ roi_to_remove = item.data(Qt.UserRole) to_delete_value = roi_to_remove['name'] self.moving_to_fixed_rois.pop(to_delete_value) self.patient_B_rois_to_A_list_widget.clear() for key, value in self.moving_to_fixed_rois.items(): roi_label = QListWidgetItem(value) roi_label.setForeground(Qt.red) roi_label.setData(Qt.UserRole, {'name': key}) self.patient_B_rois_to_A_list_widget.addItem(roi_label) if self.transfer_list_is_empty(): self.save_button.setDisabled(True)
def patient_B_initial_roi_double_clicked(self, item): """ This function is triggered when a roi in patient B's roi list is double-clicked. """ roi_to_add = item.data(Qt.UserRole) transferred_roi_name = roi_to_add['name'] # If the clicked roi is already transferred, return if transferred_roi_name in self.moving_to_fixed_rois.keys(): QMessageBox.about(self, "Transfer Failed", "Chosen ROI has already been transferred!") return # Create a set to store all current roi names in target patient # including both initial rois name and added roi names so far patient_A_current_roi_name_list = set() for item in self.moving_to_fixed_rois.values(): patient_A_current_roi_name_list.add(item) for idx in self.fixed_image_initial_rois: patient_A_current_roi_name_list.add( self.fixed_image_initial_rois[idx]['name']) # Check if clicked roi name has duplicate in # target patient's roi names list if transferred_roi_name in patient_A_current_roi_name_list: # if add suffix is ticked, iteratively try adding suffix # from _A to _Z, stop when no duplicate found if self.add_suffix: transferred_roi_name = generate_non_duplicated_name( transferred_roi_name, patient_A_current_roi_name_list) else: QMessageBox.about( self, "Transfer Failed", "Duplicated ROI name. " "Please consider adding suffix.") return # Add clicked roi to transferred list self.moving_to_fixed_rois[roi_to_add['name']] = transferred_roi_name roi_label = QListWidgetItem(transferred_roi_name) roi_label.setForeground(Qt.red) roi_label.setData(Qt.UserRole, roi_to_add) self.patient_B_rois_to_A_list_widget.addItem(roi_label) self.save_button.setDisabled(False)
def setupUi(self, sectionOp): if not sectionOp.objectName(): sectionOp.setObjectName(u"sectionOp") self.formLayout_6 = QFormLayout(sectionOp) self.formLayout_6.setObjectName(u"formLayout_6") self.sectionRulesListWidget = QListWidget(sectionOp) 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(sectionOp) 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(sectionOp) self.sectionCoverageLabel.setObjectName(u"sectionCoverageLabel") self.sectionCoverageLabel.setMaximumSize(QSize(16777215, 20)) self.formLayout_6.setWidget(2, QFormLayout.FieldRole, self.sectionCoverageLabel) self.label_11 = QLabel(sectionOp) 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.retranslateUi(sectionOp) QMetaObject.connectSlotsByName(sectionOp)
def search_bar(self): text = self.ui.SearchBar.text() n = 0 results = [] # ! not part of search - joke if text == "wii bric": self.ui.listAppsWidget.clear() item = QListWidgetItem() item.setText("Wii Pong\n" "9.000MiB | 9.0.0.0 | Danbo | Wii Pong") item.setIcon(QIcon(resource_path("assets/gui/icons/bricks.png"))) self.ui.listAppsWidget.addItem(item) self.close_the_shop() return # Filter items with search term for i in self.ui.listAppsWidget.findItems(text, Qt.MatchContains): if self.current_category == "all" and (self.current_developer in i.data(Qt.UserRole)["coder"]): results.append(i.text()) n += 1 elif i.data(Qt.UserRole)["category"] == self.current_category and (self.current_developer in i.data(Qt.UserRole)["coder"]): results.append(i.text()) n += 1 else: pass # Get All Items for i in self.ui.listAppsWidget.findItems("", Qt.MatchContains): # Hide and unhide! if i.text() in results: i.setHidden(False) else: i.setHidden(True) if text == "": if n == 1: self.ui.AppsAmountLabel.setText(f"{n} App") else: self.ui.AppsAmountLabel.setText(f"{n} Apps") else: if n == 1: self.ui.AppsAmountLabel.setText(f"{n} Result") else: self.ui.AppsAmountLabel.setText(f"{n} Results")
def put_data_in_list(self, data: List[Dict]): for item in data: display_text = f"{item['state_name']}\t\t{item['occ_title']}" list_item = QListWidgetItem(display_text, listview=self.list_control)
def display_visualization(self): conn, cursor = open_db(self.db_name_from_visual_btn) cursor.execute( 'SELECT school_state, student_size_2018 FROM school_export') table = cursor.fetchall() self.list_control.clear() num_grads_in_state = { "AK": 0, "AL": 0, "AR": 0, "AS": 0, "AZ": 0, "CA": 0, "CO": 0, "CT": 0, "DC": 0, "DE": 0, "FL": 0, "FM": 0, "GA": 0, "GU": 0, "HI": 0, "IA": 0, "ID": 0, "IL": 0, "IN": 0, "KS": 0, "KY": 0, "LA": 0, "MA": 0, "MD": 0, "ME": 0, "MH": 0, "MI": 0, "MN": 0, "MO": 0, "MP": 0, "MS": 0, "MT": 0, "NC": 0, "ND": 0, "NE": 0, "NH": 0, "NJ": 0, "NM": 0, "NV": 0, "NY": 0, "OH": 0, "OK": 0, "OR": 0, "PA": 0, "PR": 0, "PW": 0, "RI": 0, "SC": 0, "SD": 0, "TN": 0, "TX": 0, "UT": 0, "VA": 0, "VI": 0, "VT": 0, "WA": 0, "WI": 0, "WV": 0, "WY": 0 } for idx, row in enumerate(table): if row[1] is None: continue else: state_abbr_from_table = row[0] student_size_2018 = row[1] state_total = num_grads_in_state[state_abbr_from_table] num_grads_in_state[ state_abbr_from_table] = state_total + student_size_2018 # Dividing by 4 years here - to simplify the size of a senior graduating class for student_total_2018 in num_grads_in_state: num_grads_in_state[student_total_2018] = num_grads_in_state[ student_total_2018] / 4 # DATA ANALYSIS - PART 1B num_jobs_in_state = { "AK": 0, "AL": 0, "AR": 0, "AS": 0, "AZ": 0, "CA": 0, "CO": 0, "CT": 0, "DC": 0, "DE": 0, "FL": 0, "FM": 0, "GA": 0, "GU": 0, "HI": 0, "IA": 0, "ID": 0, "IL": 0, "IN": 0, "KS": 0, "KY": 0, "LA": 0, "MA": 0, "MD": 0, "ME": 0, "MH": 0, "MI": 0, "MN": 0, "MO": 0, "MP": 0, "MS": 0, "MT": 0, "NC": 0, "ND": 0, "NE": 0, "NH": 0, "NJ": 0, "NM": 0, "NV": 0, "NY": 0, "OH": 0, "OK": 0, "OR": 0, "PA": 0, "PR": 0, "PW": 0, "RI": 0, "SC": 0, "SD": 0, "TN": 0, "TX": 0, "UT": 0, "VA": 0, "VI": 0, "VT": 0, "WA": 0, "WI": 0, "WV": 0, "WY": 0 } cursor.execute( 'SELECT area_title, occ_code, tot_emp FROM jobdata_by_state') table = cursor.fetchall() for idx, row in enumerate(table): check_occ_code = row[1] check_occ_code = int(check_occ_code[:2]) if 30 <= check_occ_code <= 49: continue else: state_from_school_export = str(row[0]) abbr_state = abbreviate_state(state_from_school_export) tot_emp_jobs_in_state = int(row[2]) tot_emp = num_jobs_in_state[abbr_state] num_jobs_in_state[abbr_state] = tot_emp + tot_emp_jobs_in_state compare_total_jobs_to_grads = { k: (num_jobs_in_state[k] / num_grads_in_state[k]) for k in num_jobs_in_state } display_data = open("display_map_data.csv", "w+") display_data.writelines("state,data\n") for key in compare_total_jobs_to_grads: total_jobs_rounded = (round(compare_total_jobs_to_grads[key], 2)) if total_jobs_rounded == 0: display_data.writelines(f"{key}, {total_jobs_rounded}\n") else: display_data.writelines(f"{key}, {total_jobs_rounded}\n") display_data.close() # DATA ANALYSIS PART 2A repayment_2016_dict = { "AK": 0, "AL": 0, "AR": 0, "AS": 0, "AZ": 0, "CA": 0, "CO": 0, "CT": 0, "DC": 0, "DE": 0, "FL": 0, "FM": 0, "GA": 0, "GU": 0, "HI": 0, "IA": 0, "ID": 0, "IL": 0, "IN": 0, "KS": 0, "KY": 0, "LA": 0, "MA": 0, "MD": 0, "ME": 0, "MH": 0, "MI": 0, "MN": 0, "MO": 0, "MP": 0, "MS": 0, "MT": 0, "NC": 0, "ND": 0, "NE": 0, "NH": 0, "NJ": 0, "NM": 0, "NV": 0, "NY": 0, "OH": 0, "OK": 0, "OR": 0, "PA": 0, "PR": 0, "PW": 0, "RI": 0, "SC": 0, "SD": 0, "TN": 0, "TX": 0, "UT": 0, "VA": 0, "VI": 0, "VT": 0, "WA": 0, "WI": 0, "WV": 0, "WY": 0 } cursor.execute( 'SELECT school_state, repayment_repayment_cohort_3_year_declining_balance_2016 FROM school_export' ) table = cursor.fetchall() for idx, row in enumerate(table): if row[1] is None: continue else: state_from_school_export = str(row[0]) repayment_2016_data = row[1] repayment_2016_data_tot_sum = repayment_2016_dict[ state_from_school_export] repayment_2016_dict[ state_from_school_export] = repayment_2016_data + repayment_2016_data_tot_sum for key in repayment_2016_dict: if repayment_2016_dict[key] == 0: repayment_2016_dict[ key] = 0.0001 # States with 0 data get this due to dividing by 0 # DATA ANALYSIS - PART 2B a_pc25_dict = { "AK": 0, "AL": 0, "AR": 0, "AS": 0, "AZ": 0, "CA": 0, "CO": 0, "CT": 0, "DC": 0, "DE": 0, "FL": 0, "FM": 0, "GA": 0, "GU": 0, "HI": 0, "IA": 0, "ID": 0, "IL": 0, "IN": 0, "KS": 0, "KY": 0, "LA": 0, "MA": 0, "MD": 0, "ME": 0, "MH": 0, "MI": 0, "MN": 0, "MO": 0, "MP": 0, "MS": 0, "MT": 0, "NC": 0, "ND": 0, "NE": 0, "NH": 0, "NJ": 0, "NM": 0, "NV": 0, "NY": 0, "OH": 0, "OK": 0, "OR": 0, "PA": 0, "PR": 0, "PW": 0, "RI": 0, "SC": 0, "SD": 0, "TN": 0, "TX": 0, "UT": 0, "VA": 0, "VI": 0, "VT": 0, "WA": 0, "WI": 0, "WV": 0, "WY": 0 } cursor.execute('SELECT area_title, a_pct25 FROM jobdata_by_state') table = cursor.fetchall() for idx, row in enumerate(table): a_pct25_from_job_date_by_state = str(row[0]) abbr_state = abbreviate_state(a_pct25_from_job_date_by_state) current_a_pct25 = row[1] tot_ann_pct25_dict = a_pc25_dict[abbr_state] a_pc25_dict[abbr_state] = current_a_pct25 + tot_ann_pct25_dict compare_a_pct25_to_2016_repayment = { k: (a_pc25_dict[k] / repayment_2016_dict[k]) for k in a_pc25_dict } display_data = open("display_map_data2.csv", "w+") display_data.writelines("state,data\n") for key in compare_a_pct25_to_2016_repayment: if key in ("GU", "VI" ): # Omitting Guam & Virgin Islands due to skewing data continue else: tot_apc25_2016_repay_rounded = (round( compare_a_pct25_to_2016_repayment[key], 2)) display_data.writelines( f"{key}, {tot_apc25_2016_repay_rounded}\n") display_data.close() if self.analysis_type1_checkbox.isChecked(): type_of_analysis = "1" else: type_of_analysis = "2" if self.render_map_checkbox.isChecked(): DisplayMap.display_map(type_of_analysis) else: if type_of_analysis == "1": for key in compare_total_jobs_to_grads: total_jobs_rounded = (round( compare_total_jobs_to_grads[key], 2)) if total_jobs_rounded == 0: display_text = f"State: {key}\t Total jobs: {num_jobs_in_state[key]}\t\t Total college grads: " \ f"{num_grads_in_state[key]}\t\t {total_jobs_rounded} jobs available " \ f"per graduating student" else: display_text = f"State: {key}\t Total jobs: {num_jobs_in_state[key]}\t Total college grads: " \ f"{num_grads_in_state[key]}\t\t {total_jobs_rounded} jobs available " \ f"per graduating student" list_item = QListWidgetItem(display_text, listview=self.list_control) list_item.setForeground(Qt.darkRed) else: for key in compare_a_pct25_to_2016_repayment: apc25_to_2016_repay_rounded = (round( compare_a_pct25_to_2016_repayment[key], 2)) repay_2016_rounded = (round(repayment_2016_dict[key], 2)) if apc25_to_2016_repay_rounded == 0: display_text = f"State: {key}\t 3 year graduate cohort declining balance percent: " \ f"{repayment_2016_dict[key]}\t 25% salary: {a_pc25_dict[key]}\t\t Result: " \ f"{apc25_to_2016_repay_rounded}" else: display_text = f"State: {key}\t 3 year graduate cohort declining balance percent: " \ f"{repay_2016_rounded}\t 25% salary: {a_pc25_dict[key]}\t Result: " \ f"{apc25_to_2016_repay_rounded}" list_item = QListWidgetItem(display_text, listview=self.list_control) list_item.setForeground(Qt.darkBlue) close_db(conn)
def text_visualization(self): self.list_control.clear() conn, cursor = jobs.open_db("jobs_db.sqlite") if self.order_selector_text.currentText() == "ASC": data_visualization_per_state = jobs.query_run('''SELECT state_abrev, state_name, ''' + ''' total(jobs.employment) as employment, total(school.size_2018/4), round(avg(school.repayment_cohort),3) as repayment_cohort, round(avg(jobs.salary_25th_percentile)) as averge_entry_salary FROM school JOIN states using(state_abrev) JOIN jobs using(state_name) GROUP BY state_name ORDER BY employment ASC;''', cursor) elif self.order_selector_text.currentText() == "DESC": data_visualization_per_state = jobs.query_run('''SELECT state_abrev, state_name, ''' + ''' total(jobs.employment) as employment, total(school.size_2018/4), round(avg(school.repayment_cohort),3) as repayment_cohort, round(avg(jobs.salary_25th_percentile)) as averge_entry_salary FROM school JOIN states using(state_abrev) JOIN jobs using(state_name) GROUP BY state_name ORDER BY employment DESC;''', cursor) else: data_visualization_per_state = jobs.query_run('''SELECT state_abrev, state_name, ''' + ''' total(jobs.employment) as employment, total(school.size_2018/4), round(avg(school.repayment_cohort),3) as repayment_cohort, round(avg(jobs.salary_25th_percentile)) as averge_entry_salary FROM school JOIN states using(state_abrev) JOIN jobs using(state_name) GROUP BY state_name ;''', cursor) QListWidgetItem("State", listview=self.list_control) for state in data_visualization_per_state: state_display_data = f"{state[0]}, {state[1]}" grad_employ_data = f"Employment/Graduates: {state[2]/state[3]}" repayment_data = f"Average Entry Salary/Average Declining Balance Percent: {state[5]/state[4]}" state_item = QListWidgetItem(state_display_data, listview=self.list_control) grad_item = QListWidgetItem(grad_employ_data, listview=self.list_control) repayment_item = QListWidgetItem(repayment_data, listview=self.list_control) grad_item.setForeground(Qt.darkGreen) repayment_item.setForeground(Qt.blue) state_item.setForeground(Qt.white) state_item.setBackground(Qt.black) self.list_control.show() jobs.close_db(conn)
def selection_changed(self): try: if not splash.isHidden(): splash.showMessage(f"Finishing (2/2) - Loading first app..", color=splash_color) except NameError: pass try: data = self.ui.listAppsWidget.currentItem().data(Qt.UserRole) app_name = data["internal_name"] except Exception: app_name = None if app_name is not None: # Set active tab to first self.ui.tabMetadata.setCurrentIndex(0) # Set loading animation self.ui.HomebrewIconLabel.setMovie(self.spinner) # Clear supported controllers listview: self.ui.SupportedControllersListWidget.clear() # Set data data = self.ui.listAppsWidget.currentItem().data(Qt.UserRole) # check if send to wii is supported if utils.is_supported_by_wiiload(data): self.ui.WiiLoadButton.setEnabled(True) self.ui.WiiLoadButton.setText("Send to Wii") else: self.ui.WiiLoadButton.setEnabled(False) self.ui.WiiLoadButton.setText("Send Not Supported") # -- Get actual metadata # App Name self.ui.appname.setText(data["display_name"]) self.ui.SelectionInfoBox.setTitle("Metadata: " + data["display_name"]) self.ui.label_displayname.setText(data["display_name"]) # File Size try: self.ui.filesize.setText(metadata.file_size(data["extracted"])) except KeyError: self.ui.filesize.setText("Unknown") # Category self.ui.HomebrewCategoryLabel.setText(metadata.category_display_name(data["category"])) # Release Date self.ui.releasedate.setText(datetime.fromtimestamp(int(data["release_date"])).strftime('%B %e, %Y at %R')) # Controllers controllers = metadata.parse_controllers(data["controllers"]) # Add icons for Wii Remotes if controllers[0] > 1: item = QListWidgetItem() item.setText(f"{str(controllers[0])} Wii Remotes") item.setIcon(QIcon(resource_path(f"assets/gui/icons/controllers/{str(controllers[0])}WiiRemote.png"))) item.setToolTip(f"This app supports up to {str(controllers[0])} Wii Remotes.") self.ui.SupportedControllersListWidget.addItem(item) elif controllers[0] == 1: item = QListWidgetItem() item.setText(f"1 Wii Remote") item.setIcon(QIcon(resource_path(f"assets/gui/icons/controllers/1WiiRemote.png"))) item.setToolTip("This app supports a single Wii Remote.") self.ui.SupportedControllersListWidget.addItem(item) if controllers[1] is True: item = QListWidgetItem() item.setText(f"Nunchuk") item.setIcon(QIcon(resource_path(f"assets/gui/icons/controllers/Nunchuk.png"))) item.setToolTip("This app can be used with a Nunchuk.") self.ui.SupportedControllersListWidget.addItem(item) if controllers[2] is True: item = QListWidgetItem() item.setText(f"Classic Controller") item.setIcon(QIcon(resource_path(f"assets/gui/icons/controllers/ClassicController.png"))) item.setToolTip("This app can be used with a Classic Controller.") self.ui.SupportedControllersListWidget.addItem(item) if controllers[3] is True: item = QListWidgetItem() item.setText(f"GameCube Controller") item.setIcon(QIcon(resource_path(f"assets/gui/icons/controllers/GamecubeController.png"))) item.setToolTip("This app can be used with a Gamecube Controller.") self.ui.SupportedControllersListWidget.addItem(item) if controllers[4] is True: item = QListWidgetItem() item.setText(f"Wii Zapper") item.setIcon(QIcon(resource_path(f"assets/gui/icons/controllers/WiiZapper.png"))) item.setToolTip("This app can be used with a Wii Zapper.") self.ui.SupportedControllersListWidget.addItem(item) if controllers[5] is True: item = QListWidgetItem() item.setText(f"USB Keyboard") item.setIcon(QIcon(resource_path(f"assets/gui/icons/controllers/USBKeyboard.png"))) item.setToolTip("This app can be used with a USB Keyboard.") self.ui.SupportedControllersListWidget.addItem(item) if controllers[6] is True: item = QListWidgetItem() item.setText(f"SDHC Card") item.setIcon(QIcon(resource_path(f"assets/gui/icons/controllers/SDHC.png"))) item.setToolTip("This app is confirmed to support SDHC cards.") self.ui.SupportedControllersListWidget.addItem(item) # Version self.ui.version.setText(data["version"]) # Coder self.ui.developer.setText(data["coder"]) # Short Description if data["short_description"] == "": self.ui.label_description.setText("No description specified.") else: self.ui.label_description.setText(data["short_description"]) # Long Description self.ui.longDescriptionBrowser.setText(data["long_description"]) # File Name Line Edit self.ui.FileNameLineEdit.setText(app_name + ".zip") self.ui.progressBar.setValue(0) self.repaint() # Load icon t = threading.Thread(target=self.load_icon, args=[app_name, HOST]) t.start() self.status_message("Ready to download")
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)
def previewInput(self, item: QListWidgetItem): QDesktopServices.openUrl( QUrl.fromLocalFile(str(self._input_folder / item.text())))
def put_data_in_list(self, data: list[dict]): for item in data: display_text = f"{item['state_name']}\t\t{item['median_income']}" list_item = QListWidgetItem(display_text, listview=self.list_control)
def updateHighlightInput(self, item: QListWidgetItem): self._shared_states.hovered = item.text() self.refreshOutputBgcolor()