Cancellable tasks
All checks were successful
Gitea/kapitanbooru-uploader/pipeline/head This commit looks good

This commit is contained in:
2025-02-28 18:57:55 +01:00
parent 5571e18102
commit 9f187afc22
5 changed files with 283 additions and 114 deletions

View File

@@ -180,9 +180,16 @@ class TagManager(tk.Frame):
"""
def __init__(
self, master, settings: Settings, tags_repo: TagsRepo, *args, **kwargs
self,
master,
settings: Settings,
tags_repo: TagsRepo,
tag_change_callback=None,
*args,
**kwargs,
):
super().__init__(master, *args, **kwargs)
self.tag_change_callback = tag_change_callback
self.tags_repo = tags_repo
self.settings = settings
self.manual_tags = [] # List to hold manually entered tags
@@ -234,6 +241,8 @@ class TagManager(tk.Frame):
self.tags_display.tag_bind(tag_name, "<Button-3>", self.open_tag_wiki_url)
self.tags_display.insert(tk.INSERT, " ")
self.tags_display.config(state=tk.DISABLED)
if self.tag_change_callback:
self.tag_change_callback()
def remove_tag(self, event):
"""Remove the clicked tag from the list and update the display."""