From 0e4d382b4cc528a0e892c257e6433334064d3cb3 Mon Sep 17 00:00:00 2001 From: Bob Swift Date: Thu, 6 Dec 2018 16:16:49 -0700 Subject: [PATCH] Mark temporary workaround with TODO and comment original code --- picard/ui/options/general.py | 6 ++++-- picard/ui/options/interface.py | 18 +++++++++++------- picard/util/checkupdate.py | 6 ++++-- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/picard/ui/options/general.py b/picard/ui/options/general.py index 2f6fbe484..e9ea3d665 100644 --- a/picard/ui/options/general.py +++ b/picard/ui/options/general.py @@ -76,8 +76,10 @@ class GeneralOptionsPage(OptionsPage): self.ui.check_for_updates.setChecked(config.setting["check_for_updates"]) self.ui.update_level.clear() for level, description in PROGRAM_UPDATE_LEVELS.items(): - temp_text = description['title'] - self.ui.update_level.addItem(_(temp_text), level) + # TODO: Remove temporary workaround once https://github.com/python-babel/babel/issues/415 has been resolved. + babel_415_workaround = description['title'] + self.ui.update_level.addItem(_(babel_415_workaround), level) + #self.ui.update_level.addItem(description['title'], level) self.ui.update_level.setCurrentIndex(self.ui.update_level.findData(config.setting["update_level"])) self.ui.update_check_days.setValue(config.setting["update_check_days"]) else: diff --git a/picard/ui/options/interface.py b/picard/ui/options/interface.py index 56b38ea7e..4d99c2dcf 100644 --- a/picard/ui/options/interface.py +++ b/picard/ui/options/interface.py @@ -218,8 +218,10 @@ class InterfaceOptionsPage(OptionsPage): list_item = ToolbarListItem(action) list_item.setToolTip(_('Drag and Drop to re-order')) if action in self.TOOLBAR_BUTTONS: - temp_text = self.TOOLBAR_BUTTONS[action]['label'] - list_item.setText(_(temp_text)) + # TODO: Remove temporary workaround once https://github.com/python-babel/babel/issues/415 has been resolved. + babel_415_workaround = self.TOOLBAR_BUTTONS[action]['label'] + list_item.setText(_(babel_415_workaround)) + #list_item.setText(self.TOOLBAR_BUTTONS[action]['label']) list_item.setIcon(icontheme.lookup(self._get_icon_from_name(action), icontheme.ICON_SIZE_MENU)) else: list_item.setText(self.SEPARATOR) @@ -288,12 +290,14 @@ class AddActionDialog(QtWidgets.QDialog): layout = QtWidgets.QVBoxLayout(self) - temp_list = [] + # TODO: Remove temporary workaround once https://github.com/python-babel/babel/issues/415 has been resolved. + babel_415_workaround_list = [] for action in action_list: - temp_text = self.parent().TOOLBAR_BUTTONS[action]['label'] - temp_list.append([_(temp_text), action]) - - self.action_list = sorted(temp_list) + babel_415_workaround = self.parent().TOOLBAR_BUTTONS[action]['label'] + temp_list.append([_(babel_415_workaround), action]) + self.action_list = sorted(babel_415_workaround_list) + #self.action_list = sorted([[self.parent().TOOLBAR_BUTTONS[action]['label'], action] + # for action in action_list]) self.combo_box = QtWidgets.QComboBox(self) self.combo_box.addItems([label for label, action in self.action_list]) diff --git a/picard/util/checkupdate.py b/picard/util/checkupdate.py index 8d2225427..e84329fe3 100644 --- a/picard/util/checkupdate.py +++ b/picard/util/checkupdate.py @@ -144,13 +144,15 @@ class UpdateCheckManager(QtCore.QObject): webbrowser2.open(self._available_versions[key]['urls']['download']) else: if self._show_always: - update_level_text = PROGRAM_UPDATE_LEVELS[self._update_level]['title'] if self._update_level in PROGRAM_UPDATE_LEVELS else 'unknown' + # TODO: Remove temporary workaround once https://github.com/python-babel/babel/issues/415 has been resolved. + babel_415_workaround = PROGRAM_UPDATE_LEVELS[self._update_level]['title'] if self._update_level in PROGRAM_UPDATE_LEVELS else 'unknown' QMessageBox.information( self._parent, _("Picard Update"), _("There is no update currently available for your subscribed update level: {update_level}\n\n" "Your version: {picard_old_version}\n").format( - update_level=_(update_level_text), + update_level=_(babel_415_workaround), + #update_level=PROGRAM_UPDATE_LEVELS[self._update_level]['title'] if self._update_level in PROGRAM_UPDATE_LEVELS else _('unknown'), picard_old_version=PICARD_FANCY_VERSION_STR, ), QMessageBox.Ok, QMessageBox.Ok