From b2f4e52ea4cdadbd24fe3d95e66bd2eb9b28a0d9 Mon Sep 17 00:00:00 2001 From: Bee Date: Thu, 18 Dec 2025 01:29:07 -0500 Subject: [PATCH 1/7] fix: use translations for thumbnail size combobox Fixes bug where the thumbnail size combobox options don't get translated --- src/tagstudio/qt/views/main_window.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/tagstudio/qt/views/main_window.py b/src/tagstudio/qt/views/main_window.py index a4c0485a5..b900ae794 100644 --- a/src/tagstudio/qt/views/main_window.py +++ b/src/tagstudio/qt/views/main_window.py @@ -443,14 +443,6 @@ def rebuild_open_recent_library_menu( # View Component class MainWindow(QMainWindow): - THUMB_SIZES: list[tuple[str, int]] = [ - (Translations["home.thumbnail_size.extra_large"], 256), - (Translations["home.thumbnail_size.large"], 192), - (Translations["home.thumbnail_size.medium"], 128), - (Translations["home.thumbnail_size.small"], 96), - (Translations["home.thumbnail_size.mini"], 76), - ] - def __init__(self, driver: "QtDriver", parent: QWidget | None = None) -> None: super().__init__(parent) self.rm = ResourceManager() @@ -669,8 +661,11 @@ def setup_extra_input_bar(self): self.thumb_size_combobox.setMinimumWidth(128) self.thumb_size_combobox.setMaximumWidth(352) self.extra_input_layout.addWidget(self.thumb_size_combobox) - for size in MainWindow.THUMB_SIZES: - self.thumb_size_combobox.addItem(size[0], size[1]) + self.thumb_size_combobox.addItem(Translations["home.thumbnail_size.extra_large"], 256) + self.thumb_size_combobox.addItem(Translations["home.thumbnail_size.large"], 192) + self.thumb_size_combobox.addItem(Translations["home.thumbnail_size.medium"], 128) + self.thumb_size_combobox.addItem(Translations["home.thumbnail_size.small"], 96) + self.thumb_size_combobox.addItem(Translations["home.thumbnail_size.mini"], 76) self.thumb_size_combobox.setCurrentIndex(2) # Default: Medium self.central_layout.addLayout(self.extra_input_layout, 5, 0, 1, 1) From 8dade82689e7b469a0f34f076c7f4686ebf3ead8 Mon Sep 17 00:00:00 2001 From: Bee Date: Fri, 20 Feb 2026 00:36:42 -0500 Subject: [PATCH 2/7] fix: translates setting options Properly uses the translation keys for the setting options, in a very similar way to the thumbnail options Fun Fact: this was already fixed in #945, but got unfixed in #1077. The comment was left behind, so I tidied that up too --- src/tagstudio/qt/mixed/settings_panel.py | 96 ++++++++++++------------ 1 file changed, 50 insertions(+), 46 deletions(-) diff --git a/src/tagstudio/qt/mixed/settings_panel.py b/src/tagstudio/qt/mixed/settings_panel.py index 609ed5b05..1b77d58c7 100644 --- a/src/tagstudio/qt/mixed/settings_panel.py +++ b/src/tagstudio/qt/mixed/settings_panel.py @@ -39,32 +39,6 @@ class SettingsPanel(PanelWidget): driver: "QtDriver" - filepath_option_map: dict[ShowFilepathOption, str] = { - ShowFilepathOption.SHOW_FULL_PATHS: Translations["settings.filepath.option.full"], - ShowFilepathOption.SHOW_RELATIVE_PATHS: Translations["settings.filepath.option.relative"], - ShowFilepathOption.SHOW_FILENAMES_ONLY: Translations["settings.filepath.option.name"], - } - - theme_map: dict[Theme, str] = { - Theme.SYSTEM: Translations["settings.theme.system"], - Theme.DARK: Translations["settings.theme.dark"], - Theme.LIGHT: Translations["settings.theme.light"], - } - - splash_map: dict[Splash, str] = { - Splash.DEFAULT: Translations["settings.splash.option.default"], - Splash.RANDOM: Translations["settings.splash.option.random"], - Splash.CLASSIC: Translations["settings.splash.option.classic"], - Splash.GOO_GEARS: Translations["settings.splash.option.goo_gears"], - Splash.NINETY_FIVE: Translations["settings.splash.option.ninety_five"], - } - - tag_click_action_map: dict[TagClickActionOption, str] = { - TagClickActionOption.OPEN_EDIT: Translations["settings.tag_click_action.open_edit"], - TagClickActionOption.SET_SEARCH: Translations["settings.tag_click_action.set_search"], - TagClickActionOption.ADD_TO_SEARCH: Translations["settings.tag_click_action.add_to_search"], - } - date_format_map: dict[str, str] = { "%d/%m/%y": "21/08/24", "%d/%m/%Y": "21/08/2024", @@ -85,8 +59,6 @@ class SettingsPanel(PanelWidget): def __init__(self, driver: "QtDriver"): super().__init__() - # set these "constants" because language will be loaded from config shortly after startup - # and we want to use the current language for the dropdowns self.driver = driver self.setMinimumSize(400, 500) @@ -206,25 +178,43 @@ def on_page_size_changed(): # Show Filepath self.filepath_combobox = QComboBox() - for k in SettingsPanel.filepath_option_map: - self.filepath_combobox.addItem(SettingsPanel.filepath_option_map[k], k) + self.filepath_combobox.addItem( + Translations["settings.filepath.option.full"], + ShowFilepathOption.SHOW_FULL_PATHS + ) + self.filepath_combobox.addItem( + Translations["settings.filepath.option.relative"], + ShowFilepathOption.SHOW_RELATIVE_PATHS + ) + self.filepath_combobox.addItem( + Translations["settings.filepath.option.name"], + ShowFilepathOption.SHOW_FILENAMES_ONLY + ) filepath_option: ShowFilepathOption = self.driver.settings.show_filepath - if filepath_option not in SettingsPanel.filepath_option_map: + if self.filepath_combobox.findData(filepath_option) == -1: filepath_option = ShowFilepathOption.DEFAULT - self.filepath_combobox.setCurrentIndex( - list(SettingsPanel.filepath_option_map.keys()).index(filepath_option) - ) + self.filepath_combobox.setCurrentIndex(self.filepath_combobox.findData(filepath_option)) form_layout.addRow(Translations["settings.filepath.label"], self.filepath_combobox) # Tag Click Action self.tag_click_action_combobox = QComboBox() - for k in SettingsPanel.tag_click_action_map: - self.tag_click_action_combobox.addItem(SettingsPanel.tag_click_action_map[k], k) + self.tag_click_action_combobox.addItem( + Translations["settings.tag_click_action.open_edit"], + TagClickActionOption.OPEN_EDIT + ) + self.tag_click_action_combobox.addItem( + Translations["settings.tag_click_action.set_search"], + TagClickActionOption.SET_SEARCH + ) + self.tag_click_action_combobox.addItem( + Translations["settings.tag_click_action.add_to_search"], + TagClickActionOption.ADD_TO_SEARCH + ) tag_click_action = self.driver.settings.tag_click_action - if tag_click_action not in SettingsPanel.tag_click_action_map: + if self.tag_click_action_combobox.findData(tag_click_action) == -1: tag_click_action = TagClickActionOption.DEFAULT self.tag_click_action_combobox.setCurrentIndex( - list(SettingsPanel.tag_click_action_map.keys()).index(tag_click_action) + self.tag_click_action_combobox.findData(tag_click_action) ) form_layout.addRow( Translations["settings.tag_click_action.label"], self.tag_click_action_combobox @@ -232,23 +222,37 @@ def on_page_size_changed(): # Dark Mode self.theme_combobox = QComboBox() - for k in SettingsPanel.theme_map: - self.theme_combobox.addItem(SettingsPanel.theme_map[k], k) + self.theme_combobox.addItem(Translations["settings.theme.system"], Theme.SYSTEM) + self.theme_combobox.addItem(Translations["settings.theme.dark"], Theme.DARK) + self.theme_combobox.addItem(Translations["settings.theme.light"], Theme.LIGHT) theme = self.driver.settings.theme - if theme not in SettingsPanel.theme_map: + if self.theme_combobox.findData(theme) == -1: theme = Theme.DEFAULT - self.theme_combobox.setCurrentIndex(list(SettingsPanel.theme_map.keys()).index(theme)) + self.theme_combobox.setCurrentIndex(self.theme_combobox.findData(theme)) self.theme_combobox.currentIndexChanged.connect(self.__update_restart_label) form_layout.addRow(Translations["settings.theme.label"], self.theme_combobox) # Splash Screen self.splash_combobox = QComboBox() - for k in SettingsPanel.splash_map: - self.splash_combobox.addItem(SettingsPanel.splash_map[k], k) + self.splash_combobox.addItem( + Translations["settings.splash.option.default"], Splash.DEFAULT + ) + self.splash_combobox.addItem( + Translations["settings.splash.option.random"], Splash.RANDOM + ) + self.splash_combobox.addItem( + Translations["settings.splash.option.classic"], Splash.CLASSIC + ) + self.splash_combobox.addItem( + Translations["settings.splash.option.goo_gears"], Splash.GOO_GEARS + ) + self.splash_combobox.addItem( + Translations["settings.splash.option.ninety_five"], Splash.NINETY_FIVE + ) splash = self.driver.settings.splash - if splash not in SettingsPanel.splash_map: + if self.splash_combobox.findData(splash) == -1: splash = Splash.DEFAULT - self.splash_combobox.setCurrentIndex(list(SettingsPanel.splash_map.keys()).index(splash)) + self.splash_combobox.setCurrentIndex(self.splash_combobox.findData(splash)) form_layout.addRow(Translations["settings.splash.label"], self.splash_combobox) # Date Format From 893707f0a81fd351bae5258371e55ea9b5808608 Mon Sep 17 00:00:00 2001 From: Bee Date: Fri, 20 Feb 2026 00:44:58 -0500 Subject: [PATCH 3/7] fix ruff format errors imo this looks worse because the spacing isn't consistent, but whatever --- src/tagstudio/qt/mixed/settings_panel.py | 28 ++++++++---------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/src/tagstudio/qt/mixed/settings_panel.py b/src/tagstudio/qt/mixed/settings_panel.py index 1b77d58c7..1836c0005 100644 --- a/src/tagstudio/qt/mixed/settings_panel.py +++ b/src/tagstudio/qt/mixed/settings_panel.py @@ -179,16 +179,14 @@ def on_page_size_changed(): # Show Filepath self.filepath_combobox = QComboBox() self.filepath_combobox.addItem( - Translations["settings.filepath.option.full"], - ShowFilepathOption.SHOW_FULL_PATHS + Translations["settings.filepath.option.full"], ShowFilepathOption.SHOW_FULL_PATHS ) self.filepath_combobox.addItem( Translations["settings.filepath.option.relative"], - ShowFilepathOption.SHOW_RELATIVE_PATHS + ShowFilepathOption.SHOW_RELATIVE_PATHS, ) self.filepath_combobox.addItem( - Translations["settings.filepath.option.name"], - ShowFilepathOption.SHOW_FILENAMES_ONLY + Translations["settings.filepath.option.name"], ShowFilepathOption.SHOW_FILENAMES_ONLY ) filepath_option: ShowFilepathOption = self.driver.settings.show_filepath if self.filepath_combobox.findData(filepath_option) == -1: @@ -199,16 +197,14 @@ def on_page_size_changed(): # Tag Click Action self.tag_click_action_combobox = QComboBox() self.tag_click_action_combobox.addItem( - Translations["settings.tag_click_action.open_edit"], - TagClickActionOption.OPEN_EDIT + Translations["settings.tag_click_action.open_edit"], TagClickActionOption.OPEN_EDIT ) self.tag_click_action_combobox.addItem( - Translations["settings.tag_click_action.set_search"], - TagClickActionOption.SET_SEARCH + Translations["settings.tag_click_action.set_search"], TagClickActionOption.SET_SEARCH ) self.tag_click_action_combobox.addItem( Translations["settings.tag_click_action.add_to_search"], - TagClickActionOption.ADD_TO_SEARCH + TagClickActionOption.ADD_TO_SEARCH, ) tag_click_action = self.driver.settings.tag_click_action if self.tag_click_action_combobox.findData(tag_click_action) == -1: @@ -234,15 +230,9 @@ def on_page_size_changed(): # Splash Screen self.splash_combobox = QComboBox() - self.splash_combobox.addItem( - Translations["settings.splash.option.default"], Splash.DEFAULT - ) - self.splash_combobox.addItem( - Translations["settings.splash.option.random"], Splash.RANDOM - ) - self.splash_combobox.addItem( - Translations["settings.splash.option.classic"], Splash.CLASSIC - ) + self.splash_combobox.addItem(Translations["settings.splash.option.default"], Splash.DEFAULT) + self.splash_combobox.addItem(Translations["settings.splash.option.random"], Splash.RANDOM) + self.splash_combobox.addItem(Translations["settings.splash.option.classic"], Splash.CLASSIC) self.splash_combobox.addItem( Translations["settings.splash.option.goo_gears"], Splash.GOO_GEARS ) From 03ef6750a6d3acd1005bd552f78124afa65a1903 Mon Sep 17 00:00:00 2001 From: Bee Date: Fri, 20 Feb 2026 01:12:23 -0500 Subject: [PATCH 4/7] fix: keys for color, tag search, folder to tags Fixes the color placeholder, the "all tags" in tag search, and the description of the folder to tags macro not being translated These ones are all 1 or 2 line fixes --- src/tagstudio/qt/mixed/color_box.py | 2 +- src/tagstudio/qt/mixed/folders_to_tags.py | 6 +----- src/tagstudio/qt/mixed/tag_search.py | 3 ++- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/tagstudio/qt/mixed/color_box.py b/src/tagstudio/qt/mixed/color_box.py index 20866c438..451465e0f 100644 --- a/src/tagstudio/qt/mixed/color_box.py +++ b/src/tagstudio/qt/mixed/color_box.py @@ -121,7 +121,7 @@ def set_colors(self, colors: Iterable[TagColorGroup]): TagColorGroup( slug="slug", namespace=self.namespace, - name="Color", + name=Translations["color.placeholder"], primary="#FFFFFF", secondary=None, ) diff --git a/src/tagstudio/qt/mixed/folders_to_tags.py b/src/tagstudio/qt/mixed/folders_to_tags.py index f7051f775..0e17f7c89 100644 --- a/src/tagstudio/qt/mixed/folders_to_tags.py +++ b/src/tagstudio/qt/mixed/folders_to_tags.py @@ -184,13 +184,9 @@ def __init__(self, library: "Library", driver: "QtDriver"): self.title_widget.setStyleSheet("font-weight:bold;font-size:14px;padding-top: 6px") self.title_widget.setAlignment(Qt.AlignmentFlag.AlignCenter) - self.desc_widget = QLabel() + self.desc_widget = QLabel(Translations["folders_to_tags.description"]) self.desc_widget.setObjectName("descriptionLabel") self.desc_widget.setWordWrap(True) - self.desc_widget.setText( - """Creates tags based on your folder structure and applies them to your entries. - This tree shows all tags to be created and which entries they will be applied to.""" - ) self.desc_widget.setAlignment(Qt.AlignmentFlag.AlignCenter) self.open_close_button_w = QWidget() diff --git a/src/tagstudio/qt/mixed/tag_search.py b/src/tagstudio/qt/mixed/tag_search.py index 3a3e120b4..da8cc6a6e 100644 --- a/src/tagstudio/qt/mixed/tag_search.py +++ b/src/tagstudio/qt/mixed/tag_search.py @@ -70,7 +70,7 @@ class TagSearchPanel(PanelWidget): is_tag_chooser: bool exclude: list[int] - _limit_items: list[int | str] = [25, 50, 100, 250, 500, Translations["tag.all_tags"]] + _limit_items: list[int | str] = [25, 50, 100, 250, 500] _default_limit_idx: int = 0 # 50 Tag Limit (Default) cur_limit_idx: int = _default_limit_idx tag_limit: int | str = _limit_items[_default_limit_idx] @@ -105,6 +105,7 @@ def __init__( self.limit_combobox = QComboBox() self.limit_combobox.setEditable(False) self.limit_combobox.addItems([str(x) for x in TagSearchPanel._limit_items]) + self.limit_combobox.addItem(Translations["tag.all_tags"]) self.limit_combobox.setCurrentIndex(TagSearchPanel._default_limit_idx) self.limit_combobox.currentIndexChanged.connect(self.update_limit) self.previous_limit: int = ( From ca92ecc078bcbadc96b7d59fdcb6b34b1c8a41b3 Mon Sep 17 00:00:00 2001 From: Bee Date: Fri, 20 Feb 2026 01:31:11 -0500 Subject: [PATCH 5/7] fix/feat: dialogs with non-translated text The dialogs now have translated keys for all of their text. This does change a couple things: - Deleting tags is a Warning message now, like deleting fields - The 2 buttons for the field deletion dialog have swapped positions - The "OK" button on the deleting tags dialog now uses the `generic.remove` key to be similar to deleting fields - Deleting fields uses Standard Buttons (like deleting tags) because whatever it was doing previously was unnecessarily confusing --- src/tagstudio/qt/mixed/field_containers.py | 13 ++++++------- src/tagstudio/qt/mixed/tag_database.py | 5 +++-- src/tagstudio/qt/ts_qt.py | 10 ++++++---- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/tagstudio/qt/mixed/field_containers.py b/src/tagstudio/qt/mixed/field_containers.py index ae8df9107..fe9bb66d2 100644 --- a/src/tagstudio/qt/mixed/field_containers.py +++ b/src/tagstudio/qt/mixed/field_containers.py @@ -479,13 +479,12 @@ def update_field(self, field: BaseField, content: str) -> None: def remove_message_box(self, prompt: str, callback: Callable) -> None: remove_mb = QMessageBox() remove_mb.setText(prompt) - remove_mb.setWindowTitle("Remove Field") + remove_mb.setWindowTitle(Translations["library.field.remove"]) remove_mb.setIcon(QMessageBox.Icon.Warning) - cancel_button = remove_mb.addButton( - Translations["generic.cancel_alt"], QMessageBox.ButtonRole.DestructiveRole - ) - remove_mb.addButton("&Remove", QMessageBox.ButtonRole.RejectRole) + cancel_button = remove_mb.addButton(QMessageBox.Cancel) + cancel_button.setText(Translations["generic.cancel_alt"]) + remove_mb.addButton(QMessageBox.Ok).setText(Translations["generic.remove_alt"]) remove_mb.setEscapeButton(cancel_button) - result = remove_mb.exec_() - if result == QMessageBox.ButtonRole.ActionRole.value: + result = remove_mb.exec() + if result == QMessageBox.Ok: callback() diff --git a/src/tagstudio/qt/mixed/tag_database.py b/src/tagstudio/qt/mixed/tag_database.py index 180cee9c7..66acfd7e6 100644 --- a/src/tagstudio/qt/mixed/tag_database.py +++ b/src/tagstudio/qt/mixed/tag_database.py @@ -60,11 +60,12 @@ def delete_tag(self, tag: Tag): return message_box = QMessageBox( - QMessageBox.Question, # type: ignore + QMessageBox.Warning, # type: ignore Translations["tag.remove"], Translations.format("tag.confirm_delete", tag_name=self.lib.tag_display_name(tag)), - QMessageBox.Ok | QMessageBox.Cancel, # type: ignore ) + message_box.addButton(QMessageBox.Ok).setText(Translations["generic.remove"]) + message_box.addButton(QMessageBox.Cancel).setText(Translations["generic.cancel"]) result = message_box.exec() diff --git a/src/tagstudio/qt/ts_qt.py b/src/tagstudio/qt/ts_qt.py index ab81b4e27..12d67a588 100644 --- a/src/tagstudio/qt/ts_qt.py +++ b/src/tagstudio/qt/ts_qt.py @@ -995,9 +995,9 @@ def delete_file_confirmation(self, count: int, filename: Path | None = None) -> msg.setStyleSheet("font-weight:normal;") msg.setTextFormat(Qt.TextFormat.RichText) msg.setWindowTitle( - Translations["trash.title.singular"] + Translations["trash.dialog.title.singular"] if count == 1 - else Translations["trash.title.plural"] + else Translations["trash.dialog.title.plural"] ) msg.setIcon(QMessageBox.Icon.Warning) if count <= 1: @@ -1022,8 +1022,10 @@ def delete_file_confirmation(self, count: int, filename: Path | None = None) -> f"{perm_warning}
" ) - yes_button: QPushButton = msg.addButton("&Yes", QMessageBox.ButtonRole.YesRole) - msg.addButton("&No", QMessageBox.ButtonRole.NoRole) + yes_button: QPushButton = msg.addButton( + Translations["generic.yes"], QMessageBox.ButtonRole.YesRole + ) + msg.addButton(Translations["generic.no"], QMessageBox.ButtonRole.NoRole) msg.setDefaultButton(yes_button) return msg.exec() From 3ef927bfecfc632f3c5871dd4377b51f2471e284 Mon Sep 17 00:00:00 2001 From: Bee Date: Fri, 20 Feb 2026 02:17:02 -0500 Subject: [PATCH 6/7] fix mypy type errors still using Standard Buttons. the main reason for switching is that it's a bit weird to work with Button Roles & that Button Roles aren't needed to do this --- src/tagstudio/qt/mixed/field_containers.py | 8 +++++--- src/tagstudio/qt/mixed/tag_database.py | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/tagstudio/qt/mixed/field_containers.py b/src/tagstudio/qt/mixed/field_containers.py index fe9bb66d2..89a8f2673 100644 --- a/src/tagstudio/qt/mixed/field_containers.py +++ b/src/tagstudio/qt/mixed/field_containers.py @@ -481,10 +481,12 @@ def remove_message_box(self, prompt: str, callback: Callable) -> None: remove_mb.setText(prompt) remove_mb.setWindowTitle(Translations["library.field.remove"]) remove_mb.setIcon(QMessageBox.Icon.Warning) - cancel_button = remove_mb.addButton(QMessageBox.Cancel) + cancel_button = remove_mb.addButton(QMessageBox.StandardButton.Cancel) cancel_button.setText(Translations["generic.cancel_alt"]) - remove_mb.addButton(QMessageBox.Ok).setText(Translations["generic.remove_alt"]) + remove_mb.addButton(QMessageBox.StandardButton.Ok).setText( + Translations["generic.remove_alt"] + ) remove_mb.setEscapeButton(cancel_button) result = remove_mb.exec() - if result == QMessageBox.Ok: + if result == QMessageBox.StandardButton.Ok: callback() diff --git a/src/tagstudio/qt/mixed/tag_database.py b/src/tagstudio/qt/mixed/tag_database.py index 66acfd7e6..10fde6e97 100644 --- a/src/tagstudio/qt/mixed/tag_database.py +++ b/src/tagstudio/qt/mixed/tag_database.py @@ -64,12 +64,14 @@ def delete_tag(self, tag: Tag): Translations["tag.remove"], Translations.format("tag.confirm_delete", tag_name=self.lib.tag_display_name(tag)), ) - message_box.addButton(QMessageBox.Ok).setText(Translations["generic.remove"]) - message_box.addButton(QMessageBox.Cancel).setText(Translations["generic.cancel"]) + message_box.addButton(QMessageBox.StandardButton.Ok).setText(Translations["generic.remove"]) + message_box.addButton(QMessageBox.StandardButton.Cancel).setText( + Translations["generic.cancel"] + ) result = message_box.exec() - if result != QMessageBox.Ok: # type: ignore + if result != QMessageBox.StandardButton.Ok: return self.lib.remove_tag(tag.id) From 784b89e1557d8d77637009a956392f7c9e62af20 Mon Sep 17 00:00:00 2001 From: Bee Date: Fri, 20 Feb 2026 03:06:01 -0500 Subject: [PATCH 7/7] use discard instead of ok discard should be better since it's closer to the actual action --- src/tagstudio/qt/mixed/field_containers.py | 4 ++-- src/tagstudio/qt/mixed/tag_database.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/tagstudio/qt/mixed/field_containers.py b/src/tagstudio/qt/mixed/field_containers.py index 89a8f2673..63721fab9 100644 --- a/src/tagstudio/qt/mixed/field_containers.py +++ b/src/tagstudio/qt/mixed/field_containers.py @@ -483,10 +483,10 @@ def remove_message_box(self, prompt: str, callback: Callable) -> None: remove_mb.setIcon(QMessageBox.Icon.Warning) cancel_button = remove_mb.addButton(QMessageBox.StandardButton.Cancel) cancel_button.setText(Translations["generic.cancel_alt"]) - remove_mb.addButton(QMessageBox.StandardButton.Ok).setText( + remove_mb.addButton(QMessageBox.StandardButton.Discard).setText( Translations["generic.remove_alt"] ) remove_mb.setEscapeButton(cancel_button) result = remove_mb.exec() - if result == QMessageBox.StandardButton.Ok: + if result == QMessageBox.StandardButton.Discard: callback() diff --git a/src/tagstudio/qt/mixed/tag_database.py b/src/tagstudio/qt/mixed/tag_database.py index 10fde6e97..6d94cd34c 100644 --- a/src/tagstudio/qt/mixed/tag_database.py +++ b/src/tagstudio/qt/mixed/tag_database.py @@ -64,14 +64,16 @@ def delete_tag(self, tag: Tag): Translations["tag.remove"], Translations.format("tag.confirm_delete", tag_name=self.lib.tag_display_name(tag)), ) - message_box.addButton(QMessageBox.StandardButton.Ok).setText(Translations["generic.remove"]) + message_box.addButton(QMessageBox.StandardButton.Discard).setText( + Translations["generic.remove"] + ) message_box.addButton(QMessageBox.StandardButton.Cancel).setText( Translations["generic.cancel"] ) result = message_box.exec() - if result != QMessageBox.StandardButton.Ok: + if result != QMessageBox.StandardButton.Discard: return self.lib.remove_tag(tag.id)