From 19b2cbb010efff8e6627f3577f2b3a036e550aab Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Fri, 1 Sep 2023 03:29:33 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A4=89=E6=95=B0=E5=90=8D=20=E9=96=A2?= =?UTF-8?q?=E6=95=B0=E5=90=8D=E5=A4=89=E6=9B=B4:=20chatbox=20->=20message?= =?UTF-8?q?=20box.=20=E3=83=A1=E3=82=A4=E3=83=B3=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E3=81=AE=E3=83=86=E3=82=AD=E3=82=B9=E3=83=88=E5=85=A5=E5=8A=9B?= =?UTF-8?q?=E6=AC=84=E3=81=AE=E4=BA=8B=E3=81=AFmessage=20box.=20chatbox?= =?UTF-8?q?=E3=81=AFvrc=E5=86=85=E3=81=AEchatbox=E3=82=82=E3=81=82?= =?UTF-8?q?=E3=82=8B=E3=81=AE=E3=81=A7=E5=91=BC=E3=81=B3=E6=96=B9=E3=82=92?= =?UTF-8?q?=E5=88=86=E3=81=91=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.py | 12 ++++++------ main.py | 10 +++++----- view.py | 2 +- vrct_gui/config_window/ConfigWindow.py | 2 +- .../setting_box_others/createSettingBox_Others.py | 14 +++++++------- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/config.py b/config.py index a66921a4..1e86fa4a 100644 --- a/config.py +++ b/config.py @@ -359,13 +359,13 @@ class Config: saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value) @property - def ENABLE_AUTO_CLEAR_CHATBOX(self): - return self._ENABLE_AUTO_CLEAR_CHATBOX + def ENABLE_AUTO_CLEAR_MESSAGE_BOX(self): + return self._ENABLE_AUTO_CLEAR_MESSAGE_BOX - @ENABLE_AUTO_CLEAR_CHATBOX.setter - def ENABLE_AUTO_CLEAR_CHATBOX(self, value): + @ENABLE_AUTO_CLEAR_MESSAGE_BOX.setter + def ENABLE_AUTO_CLEAR_MESSAGE_BOX(self, value): if type(value) is bool: - self._ENABLE_AUTO_CLEAR_CHATBOX = value + self._ENABLE_AUTO_CLEAR_MESSAGE_BOX = value saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value) @property @@ -493,7 +493,7 @@ class Config: "Google(web)": None, } self._MESSAGE_FORMAT = "[message]([translation])" - self._ENABLE_AUTO_CLEAR_CHATBOX = False + self._ENABLE_AUTO_CLEAR_MESSAGE_BOX = False self._ENABLE_NOTICE_XSOVERLAY = False self._ENABLE_OSC = False self._UPDATE_FLAG = False diff --git a/main.py b/main.py index 17eb02b8..c939d26b 100644 --- a/main.py +++ b/main.py @@ -90,7 +90,7 @@ def sendChatMessage(message): view.printToTextbox_SentMessage(message, translation) # delete message in entry message box - if config.ENABLE_AUTO_CLEAR_CHATBOX is True: + if config.ENABLE_AUTO_CLEAR_MESSAGE_BOX is True: view.clearMessageBox() def messageBoxPressKeyEnter(e): @@ -344,9 +344,9 @@ def callbackSetSpeakerMaxPhrases(value): # Others Tab -def callbackSetEnableAutoClearChatbox(value): - print("callbackSetEnableAutoClearChatbox", value) - config.ENABLE_AUTO_CLEAR_CHATBOX = value +def callbackSetEnableAutoClearMessageBox(value): + print("callbackSetEnableAutoClearMessageBox", value) + config.ENABLE_AUTO_CLEAR_MESSAGE_BOX = value def callbackSetEnableNoticeXsoverlay(value): print("callbackSetEnableNoticeXsoverlay", value) @@ -446,7 +446,7 @@ view.register( "callback_set_speaker_max_phrases": callbackSetSpeakerMaxPhrases, # Others Tab - "callback_set_enable_auto_clear_chatbox": callbackSetEnableAutoClearChatbox, + "callback_set_enable_auto_clear_chatbox": callbackSetEnableAutoClearMessageBox, "callback_set_enable_notice_xsoverlay": callbackSetEnableNoticeXsoverlay, "callback_set_message_format": callbackSetMessageFormat, diff --git a/view.py b/view.py index 56132574..975921f8 100644 --- a/view.py +++ b/view.py @@ -102,7 +102,7 @@ class View(): vrct_gui.config_window.CALLBACK_SET_SPEAKER_MAX_PHRASES = config_window["callback_set_speaker_max_phrases"] # Others Tab - vrct_gui.config_window.CALLBACK_SET_ENABLE_AUTO_CLEAR_CHATBOX = config_window["callback_set_enable_auto_clear_chatbox"] + vrct_gui.config_window.CALLBACK_SET_ENABLE_AUTO_CLEAR_MESSAGE_BOX = config_window["callback_set_enable_auto_clear_chatbox"] vrct_gui.config_window.CALLBACK_SET_ENABLE_NOTICE_XSOVERLAY = config_window["callback_set_enable_notice_xsoverlay"] vrct_gui.config_window.CALLBACK_SET_MESSAGE_FORMAT = config_window["callback_set_message_format"] diff --git a/vrct_gui/config_window/ConfigWindow.py b/vrct_gui/config_window/ConfigWindow.py index f561a370..25e03688 100644 --- a/vrct_gui/config_window/ConfigWindow.py +++ b/vrct_gui/config_window/ConfigWindow.py @@ -51,7 +51,7 @@ class ConfigWindow(CTkToplevel): self.CALLBACK_SET_SPEAKER_MAX_PHRASES = None # Others Tab - self.CALLBACK_SET_ENABLE_AUTO_CLEAR_CHATBOX = None + self.CALLBACK_SET_ENABLE_AUTO_CLEAR_MESSAGE_BOX = None self.CALLBACK_SET_ENABLE_NOTICE_XSOVERLAY = None self.CALLBACK_SET_MESSAGE_FORMAT = None diff --git a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_others/createSettingBox_Others.py b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_others/createSettingBox_Others.py index c5cb4fb2..b0d77325 100644 --- a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_others/createSettingBox_Others.py +++ b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_others/createSettingBox_Others.py @@ -14,9 +14,9 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings): createSettingBoxEntry = sbg.createSettingBoxEntry - # 関数名 chatbox から messagebox に変える予定 config.ENABLE_AUTO_CLEAR_CHATBOX も MESSAGEBOXに変えるかな。 - def checkbox_auto_clear_chatbox_callback(checkbox_box_widget): - callFunctionIfCallable(config_window.CALLBACK_SET_ENABLE_AUTO_CLEAR_CHATBOX, checkbox_box_widget.get()) + # 元 checkbox_auto_clear_chatbox_callback + def checkbox_auto_clear_message_box_callback(checkbox_box_widget): + callFunctionIfCallable(config_window.CALLBACK_SET_ENABLE_AUTO_CLEAR_MESSAGE_BOX, checkbox_box_widget.get()) def checkbox_notice_xsoverlay_callback(checkbox_box_widget): callFunctionIfCallable(config_window.CALLBACK_SET_ENABLE_NOTICE_XSOVERLAY, checkbox_box_widget.get()) @@ -26,15 +26,15 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings): row=0 - config_window.sb__auto_clear_chatbox = createSettingBoxCheckbox( + config_window.sb__auto_clear_message_box = createSettingBoxCheckbox( parent_widget=setting_box_wrapper, label_text="Auto Clear The Message Box", desc_text="Clear the message box after sending your message.", - checkbox_attr_name="sb__checkbox_auto_clear_chatbox", - command=lambda: checkbox_auto_clear_chatbox_callback(config_window.sb__checkbox_auto_clear_chatbox), + checkbox_attr_name="sb__checkbox_auto_clear_message_box", + command=lambda: checkbox_auto_clear_message_box_callback(config_window.sb__checkbox_auto_clear_message_box), is_checked=False ) - config_window.sb__auto_clear_chatbox.grid(row=row) + config_window.sb__auto_clear_message_box.grid(row=row) row+=1 From 55ee9e6325703eec43ff0c462f5a70f212f35d0f Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Fri, 1 Sep 2023 03:36:33 +0900 Subject: [PATCH 2/2] [Chore] remove the code that is no longer in use. --- .../_createSettingBoxContainer.py | 1 - .../createSettingBox_AdvancedSettings.py | 2 -- .../setting_box_appearance/createSettingBox_Appearance.py | 6 +----- .../setting_box_others/createSettingBox_Others.py | 2 -- .../setting_box_translation/createSettingBox_Translation.py | 2 -- 5 files changed, 1 insertion(+), 12 deletions(-) diff --git a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/_createSettingBoxContainer.py b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/_createSettingBoxContainer.py index a8219006..dd01d49c 100644 --- a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/_createSettingBoxContainer.py +++ b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/_createSettingBoxContainer.py @@ -19,7 +19,6 @@ def _createSettingBoxContainer(config_window, settings, setting_box_container_se return setting_box_wrapper_section_title_frame - # Common setting # Setting box container setting_box_container_widget = CTkFrame(config_window.main_setting_box_bg_wrapper, corner_radius=0, fg_color=settings.ctm.MAIN_BG_COLOR, width=0, height=0) diff --git a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_advanced_settings/createSettingBox_AdvancedSettings.py b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_advanced_settings/createSettingBox_AdvancedSettings.py index 32a01e06..10fdb6f8 100644 --- a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_advanced_settings/createSettingBox_AdvancedSettings.py +++ b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_advanced_settings/createSettingBox_AdvancedSettings.py @@ -1,5 +1,3 @@ -from time import sleep - from customtkinter import StringVar, IntVar from utils import callFunctionIfCallable diff --git a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_appearance/createSettingBox_Appearance.py b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_appearance/createSettingBox_Appearance.py index e8dda661..fc9567ba 100644 --- a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_appearance/createSettingBox_Appearance.py +++ b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_appearance/createSettingBox_Appearance.py @@ -1,11 +1,8 @@ -from time import sleep - from customtkinter import StringVar, IntVar from tkinter import font as tk_font from languages import selectable_languages from utils import get_key_by_value, callFunctionIfCallable - from .._SettingBoxGenerator import _SettingBoxGenerator from config import config @@ -16,7 +13,7 @@ def createSettingBox_Appearance(setting_box_wrapper, config_window, settings): createSettingBoxSlider = sbg.createSettingBoxSlider # 関数名は変えるかもしれない。 - # テーマ変更、フォント変更時、 Widget再生成か再起動かは検討中\ + # テーマ変更、フォント変更時、 Widget再生成か再起動かは検討中 def slider_transparency_callback(value): callFunctionIfCallable(config_window.CALLBACK_SET_TRANSPARENCY, value) @@ -25,7 +22,6 @@ def createSettingBox_Appearance(setting_box_wrapper, config_window, settings): def optionmenu_ui_scaling_callback(value): callFunctionIfCallable(config_window.CALLBACK_SET_UI_SCALING, value) - # self.optionmenu_ui_scaling.set(choice) def optionmenu_font_family_callback(value): callFunctionIfCallable(config_window.CALLBACK_SET_FONT_FAMILY, value) diff --git a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_others/createSettingBox_Others.py b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_others/createSettingBox_Others.py index b0d77325..7b5811c9 100644 --- a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_others/createSettingBox_Others.py +++ b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_others/createSettingBox_Others.py @@ -1,5 +1,3 @@ -from time import sleep - from customtkinter import StringVar, IntVar from utils import callFunctionIfCallable diff --git a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_translation/createSettingBox_Translation.py b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_translation/createSettingBox_Translation.py index 974e6f33..5c635edd 100644 --- a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_translation/createSettingBox_Translation.py +++ b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_translation/createSettingBox_Translation.py @@ -1,5 +1,3 @@ -from time import sleep - from customtkinter import StringVar, IntVar from utils import callFunctionIfCallable