def translateUI(self): self.setTitle(_("Typographical Quotes")) self.languageLabel.setText(_("Quotes to use:")) self.primaryLabel.setText(_("Primary (double) quotes:")) self.secondaryLabel.setText(_("Secondary (single) quotes:")) curlang = po.setup.current() qformat = "{0} {1.primary.left} {1.primary.right} {1.secondary.left} {1.secondary.right}" self.languageCombo.setItemText(0, qformat.format( _("Current language"), lasptyqu.quotes(curlang) or lasptyqu.default())) self.languageCombo.setItemText(1, _("Custom quotes (enter below)")) for i, lang in enumerate(self._langs[2:], 2): self.languageCombo.setItemText(i, qformat.format( language_names.languageName(lang, curlang), lasptyqu.quotes(lang)))
def loadSettings(self): s = QSettings() s.beginGroup("typographical_quotes") lang = s.value("language", "current", type("")) try: index = self._langs.index(lang) except ValueError: index = 0 self.languageCombo.setCurrentIndex(index) default = lasptyqu.default() self.primaryLeft.setText(s.value("primary_left", default.primary.left, type(""))) self.primaryRight.setText(s.value("primary_right", default.primary.right, type(""))) self.secondaryLeft.setText(s.value("secondary_left", default.secondary.left, type(""))) self.secondaryRight.setText(s.value("secondary_right", default.secondary.right, type("")))
def loadSettings(self): s = QSettings() s.beginGroup("typographical_quotes") lang = s.value("language", "current", str) try: index = self._langs.index(lang) except ValueError: index = 0 self.languageCombo.setCurrentIndex(index) default = lasptyqu.default() self.primaryLeft.setText(s.value("primary_left", default.primary.left, str)) self.primaryRight.setText(s.value("primary_right", default.primary.right, str)) self.secondaryLeft.setText(s.value("secondary_left", default.secondary.left, str)) self.secondaryRight.setText(s.value("secondary_right", default.secondary.right, str))