From 74892ed7265ee75dd536393958823f2e53c72aaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9-Abush=20Clause?= Date: Sun, 16 Feb 2025 20:52:12 +0100 Subject: [PATCH] refactor(gui): rename menu option and variable for file attachment --- basilisk/gui/main_frame.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/basilisk/gui/main_frame.py b/basilisk/gui/main_frame.py index 40a0b433..b137eb6a 100644 --- a/basilisk/gui/main_frame.py +++ b/basilisk/gui/main_frame.py @@ -142,15 +142,15 @@ def update_item_label_suffix(item: wx.MenuItem, suffix: str = "..."): wx.EVT_MENU, self.on_close_conversation, close_conversation_item ) conversation_menu.AppendSeparator() - add_image_files_item = conversation_menu.Append( + attach_files_item = conversation_menu.Append( wx.ID_ANY, - # Translators: A label for a menu item to add an image from a file - _("Add image from f&ile") + "...\tCtrl+I", + # Translators: A label for a menu item to attach files to a conversation + _("Attach f&iles") + "...\tCtrl+I", ) self.Bind( wx.EVT_MENU, - lambda e: self.on_add_image(e, False), - add_image_files_item, + lambda e: self.on_add_attachments(e, False), + attach_files_item, ) add_image_url = conversation_menu.Append( wx.ID_ANY, @@ -158,7 +158,9 @@ def update_item_label_suffix(item: wx.MenuItem, suffix: str = "..."): _("Add image from &URL") + "...\tCtrl+U", ) self.Bind( - wx.EVT_MENU, lambda e: self.on_add_image(e, True), add_image_url + wx.EVT_MENU, + lambda e: self.on_add_attachments(e, True), + add_image_url, ) transcribe_audio_microphone_item = conversation_menu.Append( wx.ID_ANY, _("Transcribe audio from microphone") + "...\tCtrl+R" @@ -638,11 +640,13 @@ def current_tab(self) -> ConversationTab: """ return self.tabs_panels[self.notebook.GetSelection()] - def on_add_image(self, event: wx.Event | None, from_url: bool = False): - """Add an image to the current conversation tab. + def on_add_attachments( + self, event: wx.Event | None, from_url: bool = False + ): + """Add an attachment to the current conversation tab. Args: - event: The event that triggered the image addition. Can be None. + event: The event that triggered the attachment addition. Can be None. from_url: If True, add an image from a URL. If False, add an image from a file. Defaults to False. """ current_tab = self.current_tab