def setupUi(self, NewLevelDialog): NewLevelDialog.setObjectName("NewLevelDialog") NewLevelDialog.resize(313, 112) self.verticalLayout = QtGui.QVBoxLayout(NewLevelDialog) self.verticalLayout.setObjectName("verticalLayout") self.label = QtGui.QLabel(NewLevelDialog) self.label.setLocale( QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedKingdom)) self.label.setObjectName("label") self.verticalLayout.addWidget(self.label) self.levelName = QtGui.QLineEdit(NewLevelDialog) self.levelName.setMaxLength(100) self.levelName.setObjectName("levelName") self.verticalLayout.addWidget(self.levelName) self.label_2 = QtGui.QLabel(NewLevelDialog) self.label_2.setObjectName("label_2") self.verticalLayout.addWidget(self.label_2) self.buttonBox = QtGui.QDialogButtonBox(NewLevelDialog) self.buttonBox.setLocale( QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedKingdom)) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.verticalLayout.addWidget(self.buttonBox) self.label.setBuddy(self.levelName) self.retranslateUi(NewLevelDialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), NewLevelDialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), NewLevelDialog.reject) QtCore.QMetaObject.connectSlotsByName(NewLevelDialog)
def populate_ui(self): """Load settings and populate dialog""" settings = QtCore.QSettings() self.sendClientActiveCheckBox.setChecked( settings.value("send_client_active", True, type=bool)) self.sendReadStateCheckBox.setChecked( settings.value("send_read_state", True, type=bool)) self.enterSendMessageCheckBox.setChecked( settings.value("enter_send_message", False, type=bool)) lang_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "languages") self.languageComboBox.clear() self.languageComboBox.addItem( QtCore.QLocale.languageToString(QtCore.QLocale("en").language()), "en") for f in glob.glob(os.path.join(lang_path, "*.qm")): file_locale = os.path.splitext( os.path.basename(f))[0].split("_")[-1] file_lang = QtCore.QLocale.languageToString( QtCore.QLocale(file_locale).language()) self.languageComboBox.addItem(file_lang, file_locale) language = settings.value("language") if not language: language = QtCore.QLocale.system().name().split("_")[0] i = self.languageComboBox.findData(language) if i == -1: self.languageComboBox.setCurrentIndex(0) else: self.languageComboBox.setCurrentIndex(i)
def setupUi(self, MainWindow,subj): self.sub = "FRA"+str(subj) MainWindow.setObjectName(_fromUtf8("MainWindow")) MainWindow.setFixedSize(280, 430) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setObjectName(_fromUtf8("centralwidget")) self.ok = QtGui.QPushButton(self.centralwidget) self.ok.setGeometry(QtCore.QRect(200, 370, 50, 20)) self.ok.setObjectName(_fromUtf8("ok")) self.timeEdit = QtGui.QTimeEdit(self.centralwidget) self.timeEdit.setGeometry(QtCore.QRect(180, 75, 70, 20)) self.timeEdit.setLocale(QtCore.QLocale(QtCore.QLocale.Tagalog, QtCore.QLocale.Philippines)) self.timeEdit.setObjectName(_fromUtf8("timeEdit")) self.label_3 = QtGui.QLabel(self.centralwidget) self.label_3.setGeometry(QtCore.QRect(220-50, 120, 121, 20)) self.label_3.setObjectName(_fromUtf8("label_3")) self.back = QtGui.QPushButton(self.centralwidget) self.back.setGeometry(QtCore.QRect(20, 370, 50, 20)) self.back.setObjectName(_fromUtf8("back")) self.pri = QtGui.QPushButton(self.centralwidget) self.pri.setGeometry(QtCore.QRect(140, 370, 50, 20)) self.pri.setObjectName(_fromUtf8("print")) self.label_4 = QtGui.QLabel(self.centralwidget) self.label_4.setGeometry(QtCore.QRect(20, 80, 46, 13)) self.label_4.setObjectName(_fromUtf8("label_4")) self.label_5 = QtGui.QLabel(self.centralwidget) self.label_5.setGeometry(QtCore.QRect(145, 75 , 46, 20)) self.label_5.setObjectName(_fromUtf8("label_5")) self.dateEdit = QtGui.QDateEdit(self.centralwidget) self.dateEdit.setGeometry(QtCore.QRect(50, 75, 80, 20)) self.dateEdit.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) self.dateEdit.setObjectName(_fromUtf8("dateEdit")) self.comboBox = QtGui.QLabel(self.centralwidget) self.comboBox.setGeometry(QtCore.QRect(20, 40, 100, 40)) self.comboBox.setObjectName(_fromUtf8("comboBox")) self.progressBar = QtGui.QProgressBar(self.centralwidget) self.progressBar.setGeometry(QtCore.QRect(120, 100, 140, 20)) self.progressBar.setProperty("value", 24) self.progressBar.setObjectName(_fromUtf8("progressBar")) self.progressBar.setValue(0) self.label = QtGui.QLabel(self.centralwidget) self.label.setGeometry(QtCore.QRect(20, 100, 100, 20)) self.label.setObjectName(_fromUtf8("label")) self.lineEdit = QtGui.QTextEdit(self.centralwidget) self.lineEdit.setGeometry(QtCore.QRect(20, 160, 230, 200)) self.lineEdit.setObjectName(_fromUtf8("lineEdit")) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 346, 21)) self.menubar.setObjectName(_fromUtf8("menubar")) MainWindow.setMenuBar(self.menubar) self.statusbar = QtGui.QStatusBar(MainWindow) self.statusbar.setObjectName(_fromUtf8("statusbar")) MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def test_load_translators(self): from camelot.admin.application_admin import ApplicationAdmin app_admin = ApplicationAdmin() QtCore.QLocale.setDefault(QtCore.QLocale('pt_BR')) self.assertEqual(len(app_admin.get_translator()), 2) QtCore.QLocale.setDefault(QtCore.QLocale('nl_BE')) self.assertEqual(len(app_admin.get_translator()), 1) QtCore.QLocale.setDefault(QtCore.QLocale('pt')) self.assertEqual(len(app_admin.get_translator()), 1)
def setupUi(self, MainWindow): MainWindow.setObjectName(_fromUtf8("MainWindow")) MainWindow.resize(500, 150) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( MainWindow.sizePolicy().hasHeightForWidth()) MainWindow.setSizePolicy(sizePolicy) MainWindow.setMaximumSize(QtCore.QSize(10000, 10000)) MainWindow.setWindowTitle(_fromUtf8("XonStat Tool")) MainWindow.setLocale( QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setObjectName(_fromUtf8("centralwidget")) self.btnImport = QtGui.QPushButton(self.centralwidget) self.btnImport.setGeometry(QtCore.QRect(390, 30, 99, 23)) self.btnImport.setObjectName(_fromUtf8("btnImport")) self.splitter = QtGui.QSplitter(self.centralwidget) self.splitter.setGeometry(QtCore.QRect(10, 10, 371, 36)) self.splitter.setOrientation(QtCore.Qt.Vertical) self.splitter.setObjectName(_fromUtf8("splitter")) self.lbImport = QtGui.QLabel(self.splitter) self.lbImport.setTextFormat(QtCore.Qt.AutoText) self.lbImport.setObjectName(_fromUtf8("lbImport")) self.lineImport = QtGui.QLineEdit(self.splitter) self.lineImport.setObjectName(_fromUtf8("lineImport")) self.splitter_2 = QtGui.QSplitter(self.centralwidget) self.splitter_2.setGeometry(QtCore.QRect(10, 70, 371, 36)) self.splitter_2.setOrientation(QtCore.Qt.Vertical) self.splitter_2.setObjectName(_fromUtf8("splitter_2")) self.lbExport = QtGui.QLabel(self.splitter_2) self.lbExport.setTextFormat(QtCore.Qt.AutoText) self.lbExport.setObjectName(_fromUtf8("lbExport")) self.lineExport = QtGui.QLineEdit(self.splitter_2) self.lineExport.setObjectName(_fromUtf8("lineExport")) self.btnExport = QtGui.QPushButton(self.centralwidget) self.btnExport.setGeometry(QtCore.QRect(390, 90, 99, 23)) self.btnExport.setLocale( QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) self.btnExport.setObjectName(_fromUtf8("btnExport")) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 500, 20)) self.menubar.setObjectName(_fromUtf8("menubar")) MainWindow.setMenuBar(self.menubar) self.statusbar = QtGui.QStatusBar(MainWindow) self.statusbar.setObjectName(_fromUtf8("statusbar")) MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def setupUi(self, TextEditDialog): TextEditDialog.setObjectName("TextEditDialog") TextEditDialog.setWindowModality(QtCore.Qt.ApplicationModal) TextEditDialog.resize(416, 184) TextEditDialog.setFocusPolicy(QtCore.Qt.StrongFocus) self.verticalLayout = QtGui.QVBoxLayout(TextEditDialog) self.verticalLayout.setObjectName("verticalLayout") self.textEdit = QtGui.QTextEdit(TextEditDialog) self.textEdit.setObjectName("textEdit") self.verticalLayout.addWidget(self.textEdit) self.buttonBox = QtGui.QDialogButtonBox(TextEditDialog) self.buttonBox.setLocale( QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedKingdom)) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(TextEditDialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), TextEditDialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), TextEditDialog.reject) QtCore.QMetaObject.connectSlotsByName(TextEditDialog)
def get_translator(self): """Reimplement this method to add application specific translations to your application. The default method returns a list with the default Qt and the default Camelot translator for the current system locale. Call :meth:`QLocale.setDefault` before this method is called if you want to load different translations then the system default. :return: a list of :obj:`QtCore.QTranslator` objects that should be used to translate the application """ translators = [] qt_translator = QtCore.QTranslator() locale_name = QtCore.QLocale().name() logger.info( u'using locale %s'%locale_name ) if qt_translator.load( "qt_" + locale_name, QtCore.QLibraryInfo.location( QtCore.QLibraryInfo.TranslationsPath ) ): translators.append( qt_translator ) camelot_translator = self._load_translator_from_file( 'camelot', os.path.join( '%s/LC_MESSAGES/'%locale_name, 'camelot' ), 'art/translations/' ) if camelot_translator: translators.append( camelot_translator ) else: logger.debug( 'no camelot translations found for %s'%locale_name ) return translators
def setupUi(self, Nonstop): Nonstop.setObjectName(_fromUtf8("Nonstop")) Nonstop.resize(498, 311) Nonstop.setMinimumSize(QtCore.QSize(498, 311)) Nonstop.setMaximumSize(QtCore.QSize(498, 311)) Nonstop.setWindowTitle(QtGui.QApplication.translate("Nonstop", "Nonstop Debate Viewer", None, QtGui.QApplication.UnicodeUTF8)) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/monokuma.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) Nonstop.setWindowIcon(icon) self.buttonBox = QtGui.QDialogButtonBox(Nonstop) self.buttonBox.setGeometry(QtCore.QRect(339, 280, 151, 31)) self.buttonBox.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.lblPreview = QtGui.QLabel(Nonstop) self.lblPreview.setGeometry(QtCore.QRect(9, 9, 480, 272)) self.lblPreview.setFrameShape(QtGui.QFrame.StyledPanel) self.lblPreview.setFrameShadow(QtGui.QFrame.Sunken) self.lblPreview.setText(_fromUtf8("")) self.lblPreview.setObjectName(_fromUtf8("lblPreview")) self.retranslateUi(Nonstop) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), Nonstop.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Nonstop.reject) QtCore.QMetaObject.connectSlotsByName(Nonstop)
def Calendar(): cal = QtGui.QCalendarWidget() cal.setGridVisible(True) cal.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) cal.setFirstDayOfWeek(QtCore.Qt.Monday) cal.setHorizontalHeaderFormat(QtGui.QCalendarWidget.ShortDayNames) return cal
def create_separated_list(string_list): """ Returns a string that represents a join of a list of strings with a localized separator. This function corresponds to QLocale::createSeparatedList which was introduced in Qt 4.8 and implements the algorithm from http://www.unicode.org/reports/tr35/#ListPatterns :param string_list: List of unicode strings """ if LooseVersion(Qt.PYQT_VERSION_STR) >= LooseVersion('4.9') and LooseVersion(Qt.qVersion()) >= LooseVersion('4.8'): return QtCore.QLocale().createSeparatedList(string_list) if not string_list: return '' elif len(string_list) == 1: return string_list[0] elif len(string_list) == 2: return translate('OpenLP.core.lib', '%s and %s', 'Locale list separator: 2 items') % (string_list[0], string_list[1]) else: merged = translate('OpenLP.core.lib', '%s, and %s', 'Locale list separator: end') % (string_list[-2], string_list[-1]) for index in reversed(list(range(1, len(string_list) - 2))): merged = translate('OpenLP.core.lib', '%s, %s', 'Locale list separator: middle') % (string_list[index], merged) return translate('OpenLP.core.lib', '%s, %s', 'Locale list separator: start') % (string_list[0], merged)
def populate(self): self.languages = [] self.clear() localesPath = os.path.join(paths.codePath(), 'translations') configuredLocale = "system" try: configuredLocale = BMConfigParser().get('bitmessagesettings', 'userlocale', "system") except: pass self.addItem( QtGui.QApplication.translate("settingsDialog", "System Settings", "system"), "system") self.setCurrentIndex(0) self.setInsertPolicy(QtGui.QComboBox.InsertAlphabetically) for translationFile in sorted( glob.glob(os.path.join(localesPath, "bitmessage_*.qm"))): localeShort = os.path.split(translationFile)[1].split("_", 1)[1][:-3] locale = QtCore.QLocale(QtCore.QString(localeShort)) if localeShort in LanguageBox.languageName: self.addItem(LanguageBox.languageName[localeShort], localeShort) elif locale.nativeLanguageName() == "": self.addItem(localeShort, localeShort) else: self.addItem(locale.nativeLanguageName(), localeShort) for i in range(self.count()): if self.itemData(i) == configuredLocale: self.setCurrentIndex(i) break
def populate(self): """Populates drop down list with all available languages.""" self.clear() localesPath = os.path.join(paths.codePath(), 'translations') self.addItem(QtGui.QApplication.translate( "settingsDialog", "System Settings", "system"), "system") self.setCurrentIndex(0) self.setInsertPolicy(QtGui.QComboBox.InsertAlphabetically) for translationFile in sorted( glob.glob(os.path.join(localesPath, "bitmessage_*.qm")) ): localeShort = \ os.path.split(translationFile)[1].split("_", 1)[1][:-3] if localeShort in LanguageBox.languageName: self.addItem( LanguageBox.languageName[localeShort], localeShort) else: locale = QtCore.QLocale(localeShort) self.addItem( locale.nativeLanguageName() or localeShort, localeShort) configuredLocale = BMConfigParser().safeGet( 'bitmessagesettings', 'userlocale', "system") for i in range(self.count()): if self.itemData(i) == configuredLocale: self.setCurrentIndex(i) break
def local_time_format(): """Get the local time format and cache it for reuse""" global _local_time_format if not _local_time_format: locale = QtCore.QLocale() _local_time_format = unicode(locale.timeFormat(locale.ShortFormat)) return _local_time_format
def __init__(self, *args, **kwargs): QtGui.QDialog.__init__(self, *args, **kwargs) self.setObjectName("Map Visualizer") self.resize(1000, 500) self.setLocale( QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates))
def setupUi(self, EditLevelDialog): EditLevelDialog.setObjectName("EditLevelDialog") EditLevelDialog.resize(400, 282) EditLevelDialog.setLocale( QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) self.verticalLayout = QtGui.QVBoxLayout(EditLevelDialog) self.verticalLayout.setObjectName("verticalLayout") self.label = QtGui.QLabel(EditLevelDialog) self.label.setObjectName("label") self.verticalLayout.addWidget(self.label) self.levelList = QtGui.QListWidget(EditLevelDialog) self.levelList.setObjectName("levelList") self.verticalLayout.addWidget(self.levelList) self.buttonBox = QtGui.QDialogButtonBox(EditLevelDialog) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(EditLevelDialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), EditLevelDialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), EditLevelDialog.reject) QtCore.QObject.connect( self.levelList, QtCore.SIGNAL("itemDoubleClicked(QListWidgetItem*)"), EditLevelDialog.accept) QtCore.QMetaObject.connectSlotsByName(EditLevelDialog)
def setupUi(self, Form): Form.setObjectName(_fromUtf8("Form")) Form.resize(171, 171) self.lineEdit_ip = QtGui.QLineEdit(Form) self.lineEdit_ip.setGeometry(QtCore.QRect(10, 10, 151, 31)) font = QtGui.QFont() font.setPointSize(12) self.lineEdit_ip.setFont(font) self.lineEdit_ip.setObjectName(_fromUtf8("lineEdit_ip")) self.lineEdit_username = QtGui.QLineEdit(Form) self.lineEdit_username.setGeometry(QtCore.QRect(10, 50, 151, 31)) font = QtGui.QFont() font.setPointSize(12) self.lineEdit_username.setFont(font) self.lineEdit_username.setObjectName(_fromUtf8("lineEdit_username")) self.lineEdit_password = QtGui.QLineEdit(Form) self.lineEdit_password.setGeometry(QtCore.QRect(10, 90, 151, 31)) font = QtGui.QFont() font.setPointSize(12) self.lineEdit_password.setFont(font) self.lineEdit_password.setObjectName(_fromUtf8("lineEdit_password")) self.pushButton_login = QtGui.QPushButton(Form) self.pushButton_login.setGeometry(QtCore.QRect(10, 130, 151, 31)) self.pushButton_login.setLocale(QtCore.QLocale(QtCore.QLocale.Chinese, QtCore.QLocale.China)) self.pushButton_login.setObjectName(_fromUtf8("pushButton_login")) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form)
def setupUi(self, litegrab): litegrab.setObjectName(_fromUtf8("litegrab")) litegrab.resize(500, 300) litegrab.setMinimumSize(QtCore.QSize(0, 0)) litegrab.setLocale( QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) self.verticalLayout = QtGui.QVBoxLayout(litegrab) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.centralWidget = QtGui.QWidget(litegrab) self.centralWidget.setEnabled(True) self.centralWidget.setObjectName(_fromUtf8("centralWidget")) self.liteonoff = QtGui.QDialogButtonBox(self.centralWidget) self.liteonoff.setGeometry(QtCore.QRect(140, 230, 161, 41)) self.liteonoff.setStandardButtons(QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok) self.liteonoff.setObjectName(_fromUtf8("liteonoff")) self.label = QtGui.QLabel(self.centralWidget) self.label.setGeometry(QtCore.QRect(30, 20, 431, 211)) font = QtGui.QFont() font.setPointSize(11) self.label.setFont(font) self.label.setWordWrap(True) self.label.setObjectName(_fromUtf8("label")) self.verticalLayout.addWidget(self.centralWidget) self.retranslateUi(litegrab) QtCore.QMetaObject.connectSlotsByName(litegrab)
def setupUi(self, Dialog): Dialog.setObjectName(_fromUtf8("Dialog")) Dialog.resize(197, 303) Dialog.setLocale( QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) self.gridLayout = QtGui.QGridLayout(Dialog) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.verticalLayout = QtGui.QVBoxLayout() self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.gpcrdb_button = QtGui.QPushButton(Dialog) self.gpcrdb_button.setObjectName(_fromUtf8("gpcrdb_button")) self.verticalLayout.addWidget(self.gpcrdb_button) self.bw_button = QtGui.QPushButton(Dialog) self.bw_button.setObjectName(_fromUtf8("bw_button")) self.verticalLayout.addWidget(self.bw_button) self.both_button = QtGui.QPushButton(Dialog) self.both_button.setObjectName(_fromUtf8("both_button")) self.verticalLayout.addWidget(self.both_button) self.clear_label_button = QtGui.QPushButton(Dialog) self.clear_label_button.setObjectName(_fromUtf8("clear_label_button")) self.verticalLayout.addWidget(self.clear_label_button) self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1) self.retranslateUi(Dialog)
def __init__(self, parent=None, languages=[], field_name='language', **kwargs): """ :param languages: a list of ISO codes with languages that are allowed in the combo box, if the list is empty, all languages are allowed (the default) """ QtGui.QComboBox.__init__(self, parent) AbstractCustomEditor.__init__(self) self.setObjectName(field_name) self.index_by_language = dict() languages = [QtCore.QLocale(lang).language() for lang in languages] if not self.language_choices: for language in range(QtCore.QLocale.C, QtCore.QLocale.Chewa + 1): if languages and (language not in languages): continue language_name = unicode( QtCore.QLocale.languageToString(language)) self.language_choices.append((language, language_name)) self.language_choices.sort(key=lambda x: x[1]) for i, (language, language_name) in enumerate(self.language_choices): self.addItem(language_name, QtCore.QVariant(language)) self.index_by_language[language] = i self.activated.connect(self._activated)
def setupUi(self, SelectUser): SelectUser.setObjectName(_fromUtf8("SelectUser")) SelectUser.setWindowModality(QtCore.Qt.WindowModal) SelectUser.resize(543, 359) SelectUser.setLayoutDirection(QtCore.Qt.RightToLeft) SelectUser.setLocale( QtCore.QLocale(QtCore.QLocale.Arabic, QtCore.QLocale.SaudiArabia)) self.textUserSearcch = QtGui.QLineEdit(SelectUser) self.textUserSearcch.setGeometry(QtCore.QRect(5, 10, 531, 31)) self.textUserSearcch.setAlignment(QtCore.Qt.AlignCenter) self.textUserSearcch.setObjectName(_fromUtf8("textUserSearcch")) self.tableSelectUser = QtGui.QTableWidget(SelectUser) self.tableSelectUser.setGeometry(QtCore.QRect(5, 50, 531, 301)) self.tableSelectUser.setObjectName(_fromUtf8("tableSelectUser")) self.tableSelectUser.setColumnCount(4) self.tableSelectUser.setRowCount(0) item = QtGui.QTableWidgetItem() self.tableSelectUser.setHorizontalHeaderItem(0, item) item = QtGui.QTableWidgetItem() self.tableSelectUser.setHorizontalHeaderItem(1, item) item = QtGui.QTableWidgetItem() self.tableSelectUser.setHorizontalHeaderItem(2, item) item = QtGui.QTableWidgetItem() self.tableSelectUser.setHorizontalHeaderItem(3, item) self.retranslateUi(SelectUser) QtCore.QMetaObject.connectSlotsByName(SelectUser)
def setupUi(self, MainWindow): MainWindow.setObjectName(_fromUtf8("MainWindow")) MainWindow.resize(1363, 949) MainWindow.setFocusPolicy(QtCore.Qt.NoFocus) MainWindow.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu) MainWindow.setStyleSheet( _fromUtf8( "background-color: rgb(60,60,60); QMenuBar{ background-color: rgb(60,60,60)} QMenuBar::Item{background: transparent}; QMenu::Item{background-color: rgb(60,60,60)}; QPushButton{background-color: rgb(A4,A4,A4)};\n" "")) MainWindow.setLocale( QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.USVirginIslands)) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setStyleSheet( _fromUtf8("background-color: rgb(60,60,60)")) self.centralwidget.setObjectName(_fromUtf8("centralwidget")) self.pltView0 = PlotWidget(self.centralwidget) self.pltView0.setGeometry(QtCore.QRect(40, 30, 401, 451)) self.pltView0.setObjectName(_fromUtf8("pltView0")) self.pltView1 = PlotWidget(self.centralwidget) self.pltView1.setGeometry(QtCore.QRect(460, 30, 401, 451)) self.pltView1.setObjectName(_fromUtf8("pltView1")) self.ImageView1 = ImageView(self.centralwidget) self.ImageView1.setGeometry(QtCore.QRect(40, 500, 611, 361)) self.ImageView1.setObjectName(_fromUtf8("ImageView1")) self.ImageView2 = ImageView(self.centralwidget) self.ImageView2.setGeometry(QtCore.QRect(670, 500, 651, 361)) self.ImageView2.setObjectName(_fromUtf8("ImageView2")) self.updateBtn = QtGui.QPushButton(self.centralwidget) self.updateBtn.setGeometry(QtCore.QRect(40, 870, 75, 23)) self.updateBtn.setStyleSheet( _fromUtf8("background-color: rgb(117, 117, 117);")) self.updateBtn.setObjectName(_fromUtf8("updateBtn")) self.pltView2 = PlotWidget(self.centralwidget) self.pltView2.setGeometry(QtCore.QRect(880, 30, 441, 451)) self.pltView2.setObjectName(_fromUtf8("pltView2")) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 1363, 21)) font = QtGui.QFont() font.setStyleStrategy(QtGui.QFont.PreferAntialias) self.menubar.setFont(font) self.menubar.setAutoFillBackground(False) self.menubar.setStyleSheet(_fromUtf8("")) self.menubar.setObjectName(_fromUtf8("menubar")) self.menuFile = QtGui.QMenu(self.menubar) self.menuFile.setStyleSheet( _fromUtf8("background-color: rgb(97, 97, 97);")) self.menuFile.setObjectName(_fromUtf8("menuFile")) MainWindow.setMenuBar(self.menubar) self.statusbar = QtGui.QStatusBar(MainWindow) self.statusbar.setObjectName(_fromUtf8("statusbar")) MainWindow.setStatusBar(self.statusbar) self.actionExit = QtGui.QAction(MainWindow) self.actionExit.setObjectName(_fromUtf8("actionExit")) self.menuFile.addAction(self.actionExit) self.menubar.addAction(self.menuFile.menuAction()) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def __init__(self): self.setObjectName(_fromUtf8("Dialog")) self.resize(754, 446) icon = QtGui.QIcon() icon.addPixmap( QtGui.QPixmap( _fromUtf8("GUI/Icons/Actions-document-new-icon.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.setWindowIcon(icon) self.verticalLayoutWidget = QtGui.QWidget(self) self.verticalLayoutWidget.setGeometry(QtCore.QRect(0, 10, 751, 391)) self.verticalLayoutWidget.setObjectName( _fromUtf8("verticalLayoutWidget")) self.verticalLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget) self.verticalLayout.setMargin(0) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.task_name = QtGui.QLineEdit(self.verticalLayoutWidget) self.task_name.setText(_fromUtf8("")) self.task_name.setObjectName(_fromUtf8("task_name")) self.verticalLayout.addWidget(self.task_name) self.associated_project = QtGui.QComboBox(self.verticalLayoutWidget) self.associated_project.setObjectName(_fromUtf8("associated_project")) self.verticalLayout.addWidget(self.associated_project) self.task_description = QtGui.QTextEdit(self.verticalLayoutWidget) self.task_description.setLocale( QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) self.task_description.setObjectName(_fromUtf8("task_description")) self.verticalLayout.addWidget(self.task_description) self.update_task = QtGui.QPushButton(self) self.update_task.setGeometry(QtCore.QRect(650, 410, 94, 33)) self.update_task.setObjectName(_fromUtf8("update_task"))
def __init__(self, parent, initial_tab=None): QtGui.QDialog.__init__( self, parent, QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowSystemMenuHint) self.setAttribute(QtCore.Qt.WA_DeleteOnClose) self.setupUi(self) self.core__label_test_active_port.setFixedWidth(self._small_icon_size) self.ui_config = configmanager.ConfigManager("qtui.conf") self.core_config = None self.plugins = None self.enabled_plugins = None # load languages self.ui__language.addItem(_("Default"), None) for locale_name in pkg_resources.resource_listdir("deluge", "i18n"): locale_name = locale_name[:-3] locale = QtCore.QLocale(locale_name) if locale != QtCore.QLocale.c(): lang_name = locale.languageToString(locale.language()) if "_" in locale_name: lang_name = "%s (%s)" % ( lang_name, locale.countryToString(locale.country())) self.ui__language.addItem(lang_name, locale_name) # load styles # self.ui__style.addItem(_("Default"), None) # for style_name in QtGui.QStyleFactory.keys(): # self.ui__style.addItem(style_name, style_name) if initial_tab: self.list_categories.setCurrentRow( self.stack_categories.indexOf( getattr(self, "page_" + initial_tab)))
def setupUi(self, EasyCustomLabeling): EasyCustomLabeling.setObjectName(_fromUtf8("EasyCustomLabeling")) EasyCustomLabeling.resize(308, 135) EasyCustomLabeling.setMinimumSize(QtCore.QSize(250, 135)) EasyCustomLabeling.setMaximumSize(QtCore.QSize(350, 135)) EasyCustomLabeling.setWindowOpacity(1.0) EasyCustomLabeling.setLocale( QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) EasyCustomLabeling.setSizeGripEnabled(True) EasyCustomLabeling.setModal(True) self.buttonBox = QtGui.QDialogButtonBox(EasyCustomLabeling) self.buttonBox.setGeometry(QtCore.QRect(100, 100, 191, 23)) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.splitter = QtGui.QSplitter(EasyCustomLabeling) self.splitter.setGeometry(QtCore.QRect(20, 20, 261, 20)) self.splitter.setOrientation(QtCore.Qt.Horizontal) self.splitter.setObjectName(_fromUtf8("splitter")) self.label = QtGui.QLabel(self.splitter) self.label.setLocale( QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) self.label.setObjectName(_fromUtf8("label")) self.labelfield = QtGui.QComboBox(self.splitter) self.labelfield.setObjectName(_fromUtf8("labelfield")) self.label_2 = QtGui.QLabel(EasyCustomLabeling) self.label_2.setGeometry(QtCore.QRect(10, 60, 301, 21)) font = QtGui.QFont() font.setFamily(_fromUtf8("Arial")) font.setPointSize(10) font.setItalic(True) self.label_2.setFont(font) self.label_2.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop) self.label_2.setWordWrap(True) self.label_2.setObjectName(_fromUtf8("label_2")) self.retranslateUi(EasyCustomLabeling) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), EasyCustomLabeling.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), EasyCustomLabeling.reject) QtCore.QMetaObject.connectSlotsByName(EasyCustomLabeling)
def setupUi(self, Dialog): Dialog.setObjectName(_fromUtf8("Dialog")) Dialog.resize(342, 114) Dialog.setWindowTitle(_fromUtf8("")) self.verticalLayout = QtGui.QVBoxLayout(Dialog) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setSizeConstraint( QtGui.QLayout.SetDefaultConstraint) self.horizontalLayout.setMargin(0) self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.label_nombre = QtGui.QLabel(Dialog) self.label_nombre.setObjectName(_fromUtf8("label_nombre")) self.horizontalLayout.addWidget(self.label_nombre) self.lineedit_project_name = QtGui.QLineEdit(Dialog) self.lineedit_project_name.setObjectName( _fromUtf8("lineedit_project_name")) self.horizontalLayout.addWidget(self.lineedit_project_name) self.label_group = QtGui.QLabel(Dialog) self.label_group.setObjectName(_fromUtf8("label_group")) self.horizontalLayout.addWidget(self.label_group) self.combobox_term_group = QtGui.QComboBox(Dialog) self.combobox_term_group.setObjectName( _fromUtf8("combobox_term_group")) self.horizontalLayout.addWidget(self.combobox_term_group) self.verticalLayout.addLayout(self.horizontalLayout) self.horizontalLayout_2 = QtGui.QHBoxLayout() self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) self.label = QtGui.QLabel(Dialog) self.label.setObjectName(_fromUtf8("label")) self.horizontalLayout_2.addWidget(self.label) self.lineedit_log_path = QtGui.QLineEdit(Dialog) self.lineedit_log_path.setMouseTracking(True) self.lineedit_log_path.setAutoFillBackground(True) self.lineedit_log_path.setReadOnly(True) self.lineedit_log_path.setObjectName(_fromUtf8("lineedit_log_path")) self.horizontalLayout_2.addWidget(self.lineedit_log_path) self.button_log_path = QtGui.QPushButton(Dialog) self.button_log_path.setObjectName(_fromUtf8("button_log_path")) self.horizontalLayout_2.addWidget(self.button_log_path) self.verticalLayout.addLayout(self.horizontalLayout_2) self.buttonBox = QtGui.QDialogButtonBox(Dialog) self.buttonBox.setLocale( QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(Dialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), Dialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.reject) QtCore.QMetaObject.connectSlotsByName(Dialog)
def setupUi(self, MainWindow): MainWindowReference = MainWindow MainWindow.setObjectName(_fromUtf8("MainWindow")) MainWindow.resize(705, 491) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( MainWindow.sizePolicy().hasHeightForWidth()) MainWindow.setSizePolicy(sizePolicy) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/icon/moses.ico")), QtGui.QIcon.Normal, QtGui.QIcon.Off) MainWindow.setWindowIcon(icon) MainWindow.setLayoutDirection(QtCore.Qt.LeftToRight) MainWindow.setLocale( QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedKingdom)) self.centralWidget = QtGui.QWidget(MainWindow) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.centralWidget.sizePolicy().hasHeightForWidth()) self.centralWidget.setSizePolicy(sizePolicy) self.centralWidget.setObjectName(_fromUtf8("centralWidget")) verticalLayout = QtGui.QVBoxLayout(self.centralWidget) verticalLayout.setObjectName(_fromUtf8("verticalLayout")) groupBox = QtGui.QGroupBox() groupBox.setObjectName(_fromUtf8("groupBox")) gridLayout = QtGui.QGridLayout(groupBox) gridLayout.setObjectName(_fromUtf8("gridLayout")) groupBox.setStyleSheet("border-image: url(docker.png);") self.progressBar = MyCustomWidget(self.centralWidget) verticalLayout.addWidget(groupBox) verticalLayout.addWidget(self.progressBar) self.labelInfo = QtGui.QLabel(self.centralWidget) self.labelInfo.setTextFormat(QtCore.Qt.AutoText) self.labelInfo.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.labelInfo.setObjectName(_fromUtf8("labelInfo")) label_texts = [ "Warning: This could take up to 4 hours, and there's a reboot incoming", "Okay, no more reboots. Just hours of slow install. You can sit back and enjoy now." ] self.labelInfo.setText(label_texts[os.path.isfile("current.txt")]) verticalLayout.addWidget(self.labelInfo) MainWindow.setCentralWidget(self.centralWidget) MainWindow.setWindowTitle( _translate("MainWindow", "Dockerizing Moses in Windows", None)) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def float_from_string(s): if not s: return None locale = QtCore.QLocale() f, ok = locale.toFloat(s) if not ok: raise ParsingError() return f
def addRowData(self, table, i, title, values, style=None): locale = QtCore.QLocale() table.setText(i, 0, title, style, CReportBase.AlignLeft) table.setText(i, 3, values[0], style) table.setText(i, 5, locale.toString(float(values[1]), 'f', 2), style) table.setText(i, 6, locale.toString(float(values[2]), 'f', 2), style) table.setText(i, 7, locale.toString(float(values[3]), 'f', 2), style) table.setText(i, 8, locale.toString(float(values[4]), 'f', 2), style)
def setupUi(self, dlgConfigComm): dlgConfigComm.setObjectName("dlgConfigComm") dlgConfigComm.resize(326, 135) dlgConfigComm.setLocale( QtCore.QLocale(QtCore.QLocale.Portuguese, QtCore.QLocale.Brazil)) dlgConfigComm.setModal(True) self.buttonBox = QtGui.QDialogButtonBox(dlgConfigComm) self.buttonBox.setGeometry(QtCore.QRect(120, 90, 181, 32)) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.lblCanal = QtGui.QLabel(dlgConfigComm) self.lblCanal.setGeometry(QtCore.QRect(91, 30, 70, 30)) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.lblCanal.sizePolicy().hasHeightForWidth()) self.lblCanal.setSizePolicy(sizePolicy) self.lblCanal.setMinimumSize(QtCore.QSize(61, 0)) font = QtGui.QFont() font.setPointSize(14) self.lblCanal.setFont(font) self.lblCanal.setLocale( QtCore.QLocale(QtCore.QLocale.Portuguese, QtCore.QLocale.Brazil)) self.lblCanal.setObjectName("lblCanal") self.qsbCanal = QtGui.QSpinBox(dlgConfigComm) self.qsbCanal.setGeometry(QtCore.QRect(170, 30, 70, 30)) font = QtGui.QFont() font.setPointSize(12) self.qsbCanal.setFont(font) self.qsbCanal.setLocale( QtCore.QLocale(QtCore.QLocale.Portuguese, QtCore.QLocale.Brazil)) self.qsbCanal.setMinimum(3) self.qsbCanal.setMaximum(27) self.qsbCanal.setObjectName("qsbCanal") self.lblCanal.setBuddy(self.qsbCanal) self.retranslateUi(dlgConfigComm) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), dlgConfigComm.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), dlgConfigComm.reject) QtCore.QMetaObject.connectSlotsByName(dlgConfigComm)
def setupUi(self, login): login.setObjectName(_fromUtf8("login")) login.resize(308, 448) font = QtGui.QFont() font.setFamily(_fromUtf8("Droid Arabic Kufi")) login.setFont(font) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/images/login.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) login.setWindowIcon(icon) login.setWindowOpacity(0.98) login.setLayoutDirection(QtCore.Qt.RightToLeft) login.setLocale(QtCore.QLocale(QtCore.QLocale.Arabic, QtCore.QLocale.Jordan)) self.label = QtGui.QLabel(login) self.label.setEnabled(True) self.label.setGeometry(QtCore.QRect(24, 40, 271, 211)) self.label.setMouseTracking(False) self.label.setAcceptDrops(False) self.label.setAutoFillBackground(False) self.label.setFrameShadow(QtGui.QFrame.Plain) self.label.setText(_fromUtf8("")) self.label.setPixmap(QtGui.QPixmap(_fromUtf8(":/images/login.png"))) self.label.setScaledContents(True) self.label.setMargin(0) self.label.setObjectName(_fromUtf8("label")) self.linEditUser = QtGui.QLineEdit(login) self.linEditUser.setEnabled(True) self.linEditUser.setGeometry(QtCore.QRect(16, 270, 281, 29)) self.linEditUser.setMaxLength(20) self.linEditUser.setAlignment(QtCore.Qt.AlignCenter) self.linEditUser.setReadOnly(False) self.linEditUser.setObjectName(_fromUtf8("linEditUser")) self.lineEditPassword = QtGui.QLineEdit(login) self.lineEditPassword.setGeometry(QtCore.QRect(16, 320, 281, 31)) self.lineEditPassword.setLayoutDirection(QtCore.Qt.RightToLeft) self.lineEditPassword.setMaxLength(25) self.lineEditPassword.setAlignment(QtCore.Qt.AlignCenter) self.lineEditPassword.setObjectName(_fromUtf8("lineEditPassword")) self.labReturnPass = QtGui.QLabel(login) self.labReturnPass.setGeometry(QtCore.QRect(84, 360, 211, 31)) self.labReturnPass.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.labReturnPass.setObjectName(_fromUtf8("labReturnPass")) self.btnLogin = QtGui.QPushButton(login) self.btnLogin.setGeometry(QtCore.QRect(7, 398, 121, 41)) self.btnLogin.setObjectName(_fromUtf8("btnLogin")) self.btnClose = QtGui.QPushButton(login) self.btnClose.setGeometry(QtCore.QRect(177, 398, 121, 41)) self.btnClose.setObjectName(_fromUtf8("btnClose")) self.labLoginUser = QtGui.QLabel(login) self.labLoginUser.setGeometry(QtCore.QRect(0, 0, 308, 31)) self.labLoginUser.setStyleSheet(_fromUtf8("")) self.labLoginUser.setAlignment(QtCore.Qt.AlignCenter) self.labLoginUser.setObjectName(_fromUtf8("labLoginUser")) self.retranslateUi(login) QtCore.QMetaObject.connectSlotsByName(login) login.setTabOrder(self.btnClose, self.linEditUser) login.setTabOrder(self.linEditUser, self.lineEditPassword) login.setTabOrder(self.lineEditPassword, self.btnLogin)