From 29c0dfdb2d88e8f473e27c7f1fe7ede6e5bd0feb Mon Sep 17 00:00:00 2001 From: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com> Date: Sun, 5 Jan 2025 23:40:41 -0800 Subject: [PATCH] feat(ui): use tag query as default new tag name --- tagstudio/src/qt/modals/tag_database.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tagstudio/src/qt/modals/tag_database.py b/tagstudio/src/qt/modals/tag_database.py index 560611d51..c2cdc8f0d 100644 --- a/tagstudio/src/qt/modals/tag_database.py +++ b/tagstudio/src/qt/modals/tag_database.py @@ -65,14 +65,14 @@ def __init__(self, library: Library): self.create_tag_button = QPushButton() Translations.translate_qobject(self.create_tag_button, "tag.create") - self.create_tag_button.clicked.connect(self.build_tag) + self.create_tag_button.clicked.connect(lambda: self.build_tag(self.search_field.text())) self.root_layout.addWidget(self.search_field) self.root_layout.addWidget(self.scroll_area) self.root_layout.addWidget(self.create_tag_button) self.update_tags() - def build_tag(self): + def build_tag(self, name: str): panel = BuildTagPanel(self.lib) self.modal = PanelModal( panel, @@ -80,6 +80,8 @@ def build_tag(self): ) Translations.translate_with_setter(self.modal.setTitle, "tag.new") Translations.translate_with_setter(self.modal.setWindowTitle, "tag.add") + if name.strip(): + panel.name_field.setText(name) self.modal.saved.connect( lambda: (