def retranslateUi(self, audioOp): self.comboBox.setItemText(0, QCoreApplication.translate("Form", u"Mixed section and step audio", None)) self.comboBox.setItemText(1, QCoreApplication.translate("Form", u"Section audio only", None)) self.comboBox.setItemText(2, QCoreApplication.translate("Form", u"Step audio only", None)) self.label_8.setText(QCoreApplication.translate("Form", u"Audio attachment behavior", None)) pass
def pausePushButtonPressed(self, button): if self.status == "downloading": answer = download.downloadPause(self.gid) # if aria2 did not respond , then this function is checking for aria2 # availability , and if aria2 disconnected then aria2Disconnected is # executed if not (answer): version_answer = download.aria2Version() if version_answer == 'did not respond': self.parent.aria2Disconnected() download.downloadStop(self.gid, self.parent) notifySend("Aria2 disconnected!", "Persepolis is trying to connect! be patient!", 10000, 'warning', parent=self.parent) else: notifySend( QCoreApplication.translate("progress_src_ui_tr", "Aria2 did not respond!"), QCoreApplication.translate("progress_src_ui_tr", "Try again!"), 10000, 'critical', parent=self.parent)
def __init__(self, persepolis_setting): super().__init__(persepolis_setting) # status_tab self.status_tab = QWidget() status_tab_verticalLayout = QVBoxLayout(self.status_tab) # video_status_label self.video_status_label = QLabel(self.status_tab) status_tab_verticalLayout.addWidget(self.video_status_label) # audio_status_label self.audio_status_label = QLabel(self.status_tab) status_tab_verticalLayout.addWidget(self.audio_status_label) # muxing_status_label self.muxing_status_label = QLabel(self.status_tab) status_tab_verticalLayout.addWidget(self.muxing_status_label) self.progress_tabWidget.addTab(self.status_tab, "") # set status_tab as default tab self.progress_tabWidget.setCurrentIndex(2) # labels self.video_status_label.setText(QCoreApplication.translate( "video_finder_progress_ui_tr", "<b>Video file status: </b>")) self.audio_status_label.setText(QCoreApplication.translate( "video_finder_progress_ui_tr", "<b>Audio file status: </b>")) self.muxing_status_label.setText(QCoreApplication.translate( "video_finder_progress_ui_tr", "<b>Mixing status: </b>")) self.progress_tabWidget.setTabText(self.progress_tabWidget.indexOf( self.status_tab), QCoreApplication.translate("setting_ui_tr", "Status"))
def __init__(self, parent, dict, persepolis_setting): super().__init__(persepolis_setting) self.persepolis_setting = persepolis_setting self.dict = dict self.parent = parent # add support for other languages locale = str(self.persepolis_setting.value('settings/locale')) QLocale.setDefault(QLocale(locale)) self.translator = QTranslator() if self.translator.load(':/translations/locales/ui_' + locale, 'ts'): QCoreApplication.installTranslator(self.translator) # connecting buttons self.open_pushButtun.clicked.connect(self.openFile) self.open_folder_pushButtun.clicked.connect(self.openFolder) self.ok_pushButton.clicked.connect(self.okButtonPressed) # labels # find gid gid = self.dict['gid'] # get file_path from data base self.add_link_dict = self.parent.persepolis_db.searchGidInAddLinkTable(gid) file_path = self.add_link_dict['download_path'] # save_as self.save_as_lineEdit.setText(file_path) self.save_as_lineEdit.setToolTip(file_path) # link link = str(self.dict['link']) self.link_lineEdit.setText(link) self.link_lineEdit.setToolTip(link) # file_name window_title = str(self.dict['file_name']) file_name = QCoreApplication.translate("after_download_src_ui_tr", "<b>File name</b>: ") + \ window_title self.setWindowTitle(window_title) self.file_name_label.setText(file_name) # size size = QCoreApplication.translate("after_download_src_ui_tr", "<b>Size</b>: ") + str(self.dict['size']) self.size_label.setText(size) # disable link_lineEdit and save_as_lineEdit self.link_lineEdit.setEnabled(False) self.save_as_lineEdit.setEnabled(False) # set window size and position size = self.persepolis_setting.value( 'AfterDownloadWindow/size', QSize(570, 290)) position = self.persepolis_setting.value( 'AfterDownloadWindow/position', QPoint(300, 300)) self.resize(size) self.move(position)
def uninstall(self): """Create threads to uninstall selected apps after confirmation.""" apps = len(self.selected_apps) confirm_uninstall = QCoreApplication.translate("MessageBox", "Uninstall %n app(s)?", "", apps) space_freed_text = QCoreApplication.translate( "MessageBox", "MB of space will be freed.") msg_uninstall = f"{confirm_uninstall}\n\n{self.total_size:.2f} {space_freed_text}" if self.message_box(msg_uninstall, 2) == QMessageBox.Yes: for widget in self.main_widgets: widget.setEnabled(False) ui.label_info.hide() self.progress = 0 ui.progressbar.setMaximum(apps) ui.progressbar.show() self.new_thread_list = [] for item, i in enumerate(self.selected_apps): i.setEnabled(False) i.setChecked(False) self.new_thread_list.append(UninstallApps(self.apps_dict, i)) self.new_thread_list[item].signals.progress_signal.connect( self.uninstall_progress) self.newPoolThread = RunThreadPool(self.new_thread_list) self.newPoolThread.start()
def stopPushButtonPressed(self, button): # cancel shut down progress dictionary = { 'category': self.video_finder_plus_gid, 'shutdown': 'canceled' } self.parent.temp_db.updateQueueTable(dictionary) answer = download.downloadStop(self.gid, self.parent) # if aria2 did not respond , then this function is checking for aria2 # availability , and if aria2 disconnected then aria2Disconnected is # executed if answer == 'None': version_answer = download.aria2Version() if version_answer == 'did not respond': self.parent.aria2Disconnected() notifySend(QCoreApplication.translate("progress_src_ui_tr", "Aria2 disconnected!"), QCoreApplication.translate( "progress_src_ui_tr", "Persepolis is trying to connect! be patient!"), 10000, 'warning', parent=self.parent)
def retranslateUi(self, CategoryReportWidget): CategoryReportWidget.setWindowTitle( QCoreApplication.translate("CategoryReportWidget", u"Report by category", None)) self.ReportCategoryLbl.setText( QCoreApplication.translate("CategoryReportWidget", u"Category:", None))
def __init__(self, persepolis_setting): super().__init__() icon = QIcon() self.persepolis_setting = persepolis_setting # add support for other languages locale = str(self.persepolis_setting.value('settings/locale')) QLocale.setDefault(QLocale(locale)) self.translator = QTranslator() if self.translator.load(':/translations/locales/ui_' + locale, 'ts'): QCoreApplication.installTranslator(self.translator) self.setWindowIcon( QIcon.fromTheme('persepolis', QIcon(':/persepolis.svg'))) self.setWindowTitle( QCoreApplication.translate("setting_ui_tr", 'Preferences')) # set ui direction ui_direction = self.persepolis_setting.value('ui_direction') if ui_direction == 'rtl': self.setLayoutDirection(Qt.RightToLeft) elif ui_direction in 'ltr': self.setLayoutDirection(Qt.LeftToRight) global icons icons = ':/' + str( self.persepolis_setting.value('settings/icons')) + '/' window_verticalLayout = QVBoxLayout(self) self.pressKeyLabel = QLabel(self) window_verticalLayout.addWidget(self.pressKeyLabel) self.capturedKeyLabel = QLabel(self) window_verticalLayout.addWidget(self.capturedKeyLabel) # window buttons buttons_horizontalLayout = QHBoxLayout() buttons_horizontalLayout.addStretch(1) self.cancel_pushButton = QPushButton(self) self.cancel_pushButton.setIcon(QIcon(icons + 'remove')) buttons_horizontalLayout.addWidget(self.cancel_pushButton) self.ok_pushButton = QPushButton(self) self.ok_pushButton.setIcon(QIcon(icons + 'ok')) buttons_horizontalLayout.addWidget(self.ok_pushButton) window_verticalLayout.addLayout(buttons_horizontalLayout) # labels self.pressKeyLabel.setText( QCoreApplication.translate("setting_ui_tr", "Press new keys")) self.cancel_pushButton.setText( QCoreApplication.translate("setting_ui_tr", "Cancel")) self.ok_pushButton.setText( QCoreApplication.translate("setting_ui_tr", "OK"))
def retranslateUi(self, Dialog): Dialog.setWindowTitle( QCoreApplication.translate("Dialog", u"Dialog", None)) self.lbl_falhaLogar.setText( QCoreApplication.translate("Dialog", u"Falha ao logar usu\u00e1rio", None)) self.pushButton.setText( QCoreApplication.translate("Dialog", u"Ok", None))
def retranslateUi(self, HoldingsWidget): HoldingsWidget.setWindowTitle( QCoreApplication.translate("HoldingsWidget", u"Holdings", None)) self.HoldingsDate.setDisplayFormat( QCoreApplication.translate("HoldingsWidget", u"dd/MM/yyyy", None)) self.HoldingsCurrencyLbl.setText( QCoreApplication.translate("HoldingsWidget", u"Common currency:", None))
def retranslateUi(self, DealsReportWidget): DealsReportWidget.setWindowTitle( QCoreApplication.translate("DealsReportWidget", u"Deals", None)) self.ReportGroupCheck.setText( QCoreApplication.translate("DealsReportWidget", u"Group dates", None)) self.ReportAccountLbl.setText( QCoreApplication.translate("DealsReportWidget", u"Account:", None))
def retranslateUi(self, Dialog): Dialog.setWindowTitle( QCoreApplication.translate("Dialog", u"About {application_name}", None)) self.version_label.setText( QCoreApplication.translate("Dialog", u"Zero Play Version:", None)) self.version.setText(QCoreApplication.translate( "Dialog", u"0.0", None))
def retranslateUi(self, Dialog): Dialog.setWindowTitle( QCoreApplication.translate("Dialog", u"Dialog", None)) self.tbCreate.setText( QCoreApplication.translate("Dialog", u"\u65b0\u5efa", None)) self.tbAdd.setText( QCoreApplication.translate("Dialog", u"\u6dfb\u52a0", None)) self.tbRemove.setText( QCoreApplication.translate("Dialog", u"\u5220\u9664", None))
def retranslateUi(self, SelectAccountDlg): SelectAccountDlg.setWindowTitle( QCoreApplication.translate("SelectAccountDlg", u"Please select account", None)) self.DescriptionLbl.setText( QCoreApplication.translate("SelectAccountDlg", u"TextLabel", None)) self.ReuseAccount.setText( QCoreApplication.translate( "SelectAccountDlg", u"Use the same account for given currency", None))
def retranslateUi(self, MainWindow): MainWindow.setWindowTitle( QCoreApplication.translate( "MainWindow", u"\u0418\u043c\u043f\u043e\u0440\u0442 \u0413\u0410\u0420", None)) self.groupBox.setTitle( QCoreApplication.translate( "MainWindow", u"\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b", None)) self.label.setText( QCoreApplication.translate("MainWindow", u"URL", None)) self.label_2.setText( QCoreApplication.translate("MainWindow", u"\u041f\u043e\u0440\u0442", None)) self.label_3.setText( QCoreApplication.translate("MainWindow", u"\u0418\u043c\u044f \u0411\u0414", None)) self.label_4.setText( QCoreApplication.translate( "MainWindow", u"\u0418\u043c\u044f \u0440\u043e\u043b\u0438", None)) self.label_5.setText( QCoreApplication.translate( "MainWindow", u"\u041f\u0430\u0440\u043e\u043b\u044c", None)) self.groupBox_2.setTitle( QCoreApplication.translate( "MainWindow", u"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0430", None)) self.pushButton.setText( QCoreApplication.translate( "MainWindow", u"\u0418\u043c\u043f\u043e\u0440\u0442", None))
def retranslateUi(self, Setting): Setting.setWindowTitle( QCoreApplication.translate("Setting", u"\u8bbe\u7f6e", None)) self.label_8.setText( QCoreApplication.translate( "Setting", u"CPU\u6570\u91cf\uff08CPU\u6a21\u5f0f\u53ef\u7528\uff09", None)) self.threadSelect.setItemText( 0, QCoreApplication.translate("Setting", u"Auto", None)) self.label_3.setText( QCoreApplication.translate("Setting", u"CPU/GPU", None)) self.label.setText( QCoreApplication.translate("Setting", u"Language", None)) self.languageSelect.setItemText( 0, QCoreApplication.translate("Setting", u"Auto", None)) self.languageSelect.setItemText( 1, QCoreApplication.translate("Setting", u"\u4e2d\u6587\u7b80\u4f53", None)) self.languageSelect.setItemText( 2, QCoreApplication.translate("Setting", u"\u4e2d\u6587\u7e41\u4f53", None)) self.languageSelect.setItemText( 3, QCoreApplication.translate("Setting", u"English", None))
def retranslateUi(self, shellTab): self.label.setText( QCoreApplication.translate("Form", u"Background", None)) #if QT_CONFIG(statustip) self.shellImgPath.setStatusTip( QCoreApplication.translate( "Form", u"Filepath of image to be used as shell for demo assets", None)) #endif // QT_CONFIG(statustip) self.shellBrowseImgBtn.setText( QCoreApplication.translate("Form", u"Browse", None)) self.label_2.setText( QCoreApplication.translate("Form", u"Coordinates of assets on shell", None)) self.label_3.setText(QCoreApplication.translate("Form", u"X", None)) self.label_4.setText(QCoreApplication.translate("Form", u"Y", None)) self.label_5.setText( QCoreApplication.translate("Form", u"Dimensions of assets on shell", None)) self.label_7.setText(QCoreApplication.translate( "Form", u"Width", None)) self.label_6.setText( QCoreApplication.translate("Form", u"Height", None)) pass
def retranslateUi(self, centralTabs): centralTabs.setWindowTitle( QCoreApplication.translate("centralTabs", u"Form", None)) centralTabs.setTabText( centralTabs.indexOf(self.demoPage), QCoreApplication.translate("centralTabs", u"Demo Utilities", None)) centralTabs.setTabText( centralTabs.indexOf(self.scriptsPage), QCoreApplication.translate("centralTabs", u"Script Studio", None)) centralTabs.setTabText( centralTabs.indexOf(self.productionPage), QCoreApplication.translate("centralTabs", u"Production", None))
def decodeError(orginal_msg): messages = { 'JAL_SQL_MSG_0001': QCoreApplication.translate( "Error", "Investment account should have associated broker assigned"), 'JAL_SQL_MSG_0002': QCoreApplication.translate("Error", "Can't delete predefined category") } if orginal_msg[:4] != 'JAL_': return orginal_msg code = orginal_msg[:16] return messages[code]
def retranslateUi(self, Form): Form.setWindowTitle( QCoreApplication.translate("Form", u"headers editor", None)) self.lineEdit_headers_path.setPlaceholderText( QCoreApplication.translate("Form", u"headers.json", None)) #if QT_CONFIG(tooltip) self.pushButton_select.setToolTip( QCoreApplication.translate( "Form", u"<html><head/><body><p>load headers.json file</p></body></html>", None)) #endif // QT_CONFIG(tooltip) self.pushButton_select.setText( QCoreApplication.translate("Form", u"select", None)) #if QT_CONFIG(tooltip) self.pushButton_save.setToolTip( QCoreApplication.translate( "Form", u"<html><head/><body><p>save to headers.json</p></body></html>", None)) #endif // QT_CONFIG(tooltip) self.pushButton_save.setText( QCoreApplication.translate("Form", u"save", None)) #if QT_CONFIG(tooltip) self.pushButton_add.setToolTip( QCoreApplication.translate( "Form", u"<html><head/><body><p>add a group of header key-value</p></body></html>", None)) #endif // QT_CONFIG(tooltip) self.pushButton_add.setText( QCoreApplication.translate("Form", u"add", None))
def retranslateUi(self, AssetDialog): AssetDialog.setWindowTitle(QCoreApplication.translate("AssetDialog", u"Asset", None)) self.SymbolsLabel.setText(QCoreApplication.translate("AssetDialog", u"Symbols", None)) self.AddSymbolButton.setText("") self.RemoveSymbolButton.setText("") self.DataLbl.setText(QCoreApplication.translate("AssetDialog", u"Extra data", None)) self.AddDataButton.setText("") self.RemoveDataButton.setText("") self.NameLbl.setText(QCoreApplication.translate("AssetDialog", u"Name:", None)) self.isinLbl.setText(QCoreApplication.translate("AssetDialog", u"ISIN:", None)) self.CancelButton.setText(QCoreApplication.translate("AssetDialog", u"Cancel", None)) self.OkButton.setText(QCoreApplication.translate("AssetDialog", u"OK", None)) self.BaseLbl.setText(QCoreApplication.translate("AssetDialog", u"Base asset:", None)) self.TypeLbl.setText(QCoreApplication.translate("AssetDialog", u"Type: ", None)) self.CountryLbl.setText(QCoreApplication.translate("AssetDialog", u"Country: ", None))
def retranslateUi(self, sectionOp): __sortingEnabled = self.sectionRulesListWidget.isSortingEnabled() self.sectionRulesListWidget.setSortingEnabled(False) ___qlistwidgetitem = self.sectionRulesListWidget.item(0) ___qlistwidgetitem.setText( QCoreApplication.translate("Form", u"Step has TP, next step without TP", None)) ___qlistwidgetitem1 = self.sectionRulesListWidget.item(1) ___qlistwidgetitem1.setText( QCoreApplication.translate("Form", u"Step has TP, next step with TP", None)) ___qlistwidgetitem2 = self.sectionRulesListWidget.item(2) ___qlistwidgetitem2.setText( QCoreApplication.translate( "Form", u"Step has TP, previous step without TP", None)) ___qlistwidgetitem3 = self.sectionRulesListWidget.item(3) ___qlistwidgetitem3.setText( QCoreApplication.translate("Form", u"Step has TP, previous step with TP", None)) ___qlistwidgetitem4 = self.sectionRulesListWidget.item(4) ___qlistwidgetitem4.setText( QCoreApplication.translate("Form", u"Step has fade-in", None)) ___qlistwidgetitem5 = self.sectionRulesListWidget.item(5) ___qlistwidgetitem5.setText( QCoreApplication.translate("Form", u"Step has jump box", None)) ___qlistwidgetitem6 = self.sectionRulesListWidget.item(6) ___qlistwidgetitem6.setText( QCoreApplication.translate("Form", u"Step TP contains text pattern...", None)) self.sectionRulesListWidget.setSortingEnabled(__sortingEnabled) self.label_10.setText( QCoreApplication.translate("Form", u"Insert new section on...", None)) self.sectionCoverageLabel.setText( QCoreApplication.translate( "Form", u"Covers 0 steps in selected sections/steps", None)) self.label_11.setText( QCoreApplication.translate( "Form", u"May not match number of audio soundbites (audio not imported)", None)) pass
def submitClicked(self, button=None): # Clear media list self.media_comboBox.clear() self.format_selection_frame.hide() self.advanced_format_selection_checkBox.hide() self.advanced_format_selection_frame.hide() self.video_format_selection_comboBox.clear() self.audio_format_selection_comboBox.clear() self.change_name_lineEdit.clear() self.threadPool.clear() self.change_name_checkBox.setChecked(False) self.video_audio_list.clear() self.no_video_list.clear() self.no_audio_list.clear() self.url_submit_pushButtontton.setEnabled(False) self.status_box_textEdit.setText( QCoreApplication.translate("ytaddlink_src_ui_tr", 'Fetching Media Info...')) self.status_box_textEdit.show() self.ok_pushButton.setEnabled(False) self.download_later_pushButton.setEnabled(False) dictionary_to_send = deepcopy(self.plugin_add_link_dictionary) # More options more_options = self.collectMoreOptions() for k in more_options.keys(): dictionary_to_send[k] = more_options[k] dictionary_to_send['link'] = self.link_lineEdit.text() fetcher_thread = MediaListFetcherThread(self.fetchedResult, dictionary_to_send, self) self.parent.threadPool.append(fetcher_thread) self.parent.threadPool[len(self.parent.threadPool) - 1].start()
def callBack(self, keys): # do nothing if keys is empty if not (keys): return # check that if shortcut used before. if keys in self.shortcuts_list: self.msgBox = QMessageBox() self.msgBox.setText( QCoreApplication.translate( "setting_src_ui_tr", "<b><center>This shortcut has been used before!\ Use another one!</center></b>")) self.msgBox.setIcon(QMessageBox.Warning) reply = self.msgBox.exec_() # set new shortcut else: selected_row = self.shortcut_table.selectionModel().selectedRows( )[0].row() item = QTableWidgetItem(keys) # align center item.setTextAlignment(0x0004 | 0x0080) # insert item in shortcut_table self.shortcut_table.setItem(selected_row, 1, item) # set keys in shortcuts_list self.shortcuts_list[selected_row] = keys
def retranslateUi(self, AboutForm): AboutForm.setWindowTitle(QCoreApplication.translate("AboutForm", u"Form", None)) self.label_8.setText(QCoreApplication.translate("AboutForm", u"<a href=\"https://github.com/tonquer/waifu2x-vulkan\"> waifu2x-vulkan</a>", None)) self.label.setText(QCoreApplication.translate("AboutForm", u"waifu2x-GUI-demo v1.0.1", None)) self.label_2.setText("") self.label_4.setText(QCoreApplication.translate("AboutForm", u"\u9879\u76ee\u5f00\u6e90\u5730\u5740\uff1a", None)) self.label_7.setText(QCoreApplication.translate("AboutForm", u"waifu2x\u5730\u5740", None)) self.label_6.setText(QCoreApplication.translate("AboutForm", u"1.1.1", None)) self.label_5.setText(QCoreApplication.translate("AboutForm", u"waifu2x\u7248\u672c\uff1a", None)) self.label_3.setText(QCoreApplication.translate("AboutForm", u"<a href=\"https://github.com/tonquer/waifu2x-ncnn-vulkan--GUI\"> waifu2x-ncnn-vulkan-GUI</a>", None))
def urlChanged(self, value): if ' ' in value or value == '': self.url_submit_pushButtontton.setEnabled(False) self.url_submit_pushButtontton.setToolTip( QCoreApplication.translate("ytaddlink_src_ui_tr", 'Please enter a valid video link')) else: self.url_submit_pushButtontton.setEnabled(True) self.url_submit_pushButtontton.setToolTip('')
def show_updates(self, latest_version): """Show updates.""" if version.parse(latest_version) > version.parse(__version__): msg_update = QCoreApplication.translate( "MessageBox", "PyDebloatX {0} is available.\n\nVisit download page?").format( latest_version) if self.message_box(msg_update, 2) == QMessageBox.Yes: webbrowser.open_new( 'https://github.com/Teraskull/PyDebloatX/releases')
def updateCheck(self, button): self.check_button.setText( QCoreApplication.translate("update_src_ui_tr", 'Checking...')) try: # get information dictionary from github updatesource = requests.get( 'https://persepolisdm.github.io/version') updatesource_text = updatesource.text updatesource_dict = ast.literal_eval(updatesource_text) # get latest stable version server_version = updatesource_dict['version'] # Comparison if float(server_version) > float(self.client_version): self.status_label.setText( QCoreApplication.translate( "update_src_ui_tr", 'A newer Persepolis release is available')) if os_type == OS.WINDOWS: self.winUpdatedl() # this function download latest release # find system architect if platform.architecture()[0] == '64bit': osCommands.xdgOpen(updatesource_dict['win64dlurl']) elif platform.architecture()[0] == '32bit': osCommands.xdgOpen(updatesource_dict['win32dlurl']) elif os_type == OS.OSX: osCommands.xdgOpen( updatesource_dict['macdlurl'] ) # it will download latest release for mac elif float(server_version) == float(self.client_version): self.status_label.setText( QCoreApplication.translate( "update_src_ui_tr", 'Latest version is installed :)')) elif float(server_version) < float(self.client_version): self.status_label.setText( QCoreApplication.translate("update_src_ui_tr", 'You are using beta version')) except Exception as e: self.status_label.setText( QCoreApplication.translate( "update_src_ui_tr", 'An error occurred while checking for updates.')) self.check_button.setText( QCoreApplication.translate("update_src_ui_tr", 'Check for new update'))
def retranslateUi(self, Dialog): Dialog.setWindowTitle(QCoreApplication.translate("Dialog", u"popup_hyperv", None)) ___qtablewidgetitem = self.tableWidget.horizontalHeaderItem(0) ___qtablewidgetitem.setText(QCoreApplication.translate("Dialog", u"\u529f\u80fd", None)); ___qtablewidgetitem1 = self.tableWidget.horizontalHeaderItem(1) ___qtablewidgetitem1.setText(QCoreApplication.translate("Dialog", u"\u8bf4\u660e", None)); ___qtablewidgetitem2 = self.tableWidget.horizontalHeaderItem(2) ___qtablewidgetitem2.setText(QCoreApplication.translate("Dialog", u"\u5f53\u524d\u503c", None)); ___qtablewidgetitem3 = self.tableWidget.horizontalHeaderItem(3) ___qtablewidgetitem3.setText(QCoreApplication.translate("Dialog", u"\u4fee\u6539", None)); self.pushButton.setText(QCoreApplication.translate("Dialog", u"\u5237\u65b0", None)) self.pushButton_2.setText(QCoreApplication.translate("Dialog", u"\u4fee\u6539", None))
def SetTranslateEngineItem(self, comboBox: QComboBox): """设定当前支持的翻译引擎。 Args: comboBox (QComboBox): [description] """ comboBox.clear() length = len(self.transalteEngine) for i in range(0, length): comboBox.insertItem( i, QCoreApplication.translate("Translator", self.transalteEngine[i], None)) return