From c819b956b4aa75b32c894025ca208f358cb9bd01 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Mon, 4 Sep 2023 14:48:25 +0900 Subject: [PATCH 1/5] index on view: 6b4d782 Merge branch 'remove_modules' into UI_2.0 From 90668b1e7aa8beef6a8cd4ee236d35800082e0c3 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Mon, 4 Sep 2023 18:17:01 +0900 Subject: [PATCH 2/5] =?UTF-8?q?[Add]=20view.py=E3=81=AB=E3=80=81=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A=E9=A0=85=E7=9B=AE=20mic=5Fhost=20mic=5Fdevice=20speak?= =?UTF-8?q?er=5Fdevice=E3=81=AE=E6=9B=B4=E6=96=B0=E3=80=81=E3=82=BB?= =?UTF-8?q?=E3=83=83=E3=83=88=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E3=80=82=20model.py=E3=81=A7=E5=AE=9F=E9=9A=9B=E3=81=ABdevice?= =?UTF-8?q?=E3=81=AA=E3=81=A9=E3=82=92=E5=8F=96=E5=BE=97=E3=81=99=E3=82=8B?= =?UTF-8?q?=E9=96=A2=E6=95=B0=E3=82=82=E5=85=A5=E3=82=8C=E8=BE=BC=E3=81=BF?= =?UTF-8?q?(=E5=85=83=E3=80=85=E3=81=82=E3=81=A3=E3=81=9F=E3=82=82?= =?UTF-8?q?=E3=81=AE=E3=82=92=E7=A7=BB=E6=A4=8D)=E3=81=97=E3=81=9F?= =?UTF-8?q?=E3=81=AE=E3=81=A7=E3=80=81=E8=A8=AD=E5=AE=9A=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E4=B8=8A=E3=81=A7=E8=A6=8B=E3=81=9F=E7=9B=AE=E3=81=A0=E3=81=91?= =?UTF-8?q?=E3=81=AF=E5=AE=9F=E9=9A=9B=E3=81=AE=E5=80=A4=E3=81=A7=E5=8B=95?= =?UTF-8?q?=E3=81=8F=E3=82=88=E3=81=86=E3=81=AB=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 9 +++++++-- view.py | 34 ++++++++++++++++++++++++++-------- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/main.py b/main.py index 149ed4e0..4a36015e 100644 --- a/main.py +++ b/main.py @@ -247,6 +247,10 @@ def callbackSetDeeplAuthkey(value): def callbackSetMicHost(value): print("callbackSetMicHost", value) config.CHOICE_MIC_HOST = value + config.CHOICE_MIC_DEVICE = model.getInputDefaultDevice() + + view.updateSelected_MicDevice(config.CHOICE_MIC_DEVICE) + view.updateList_MicDevice(model.getListInputDevice()) def callbackSetMicDevice(value): print("callbackSetMicDevice", value) @@ -415,9 +419,9 @@ view.register( # Transcription Tab (Mic) "callback_set_mic_host": callbackSetMicHost, - "list_mic_host": ["list_mic_host"], + "list_mic_host": model.getListInputHost(), "callback_set_mic_device": callbackSetMicDevice, - "list_mic_device": ["list_mic_device"], + "list_mic_device": model.getListInputDevice(), "callback_set_mic_energy_threshold": callbackSetMicEnergyThreshold, "callback_set_mic_dynamic_energy_threshold": callbackSetMicDynamicEnergyThreshold, "callback_check_mic_threshold": callbackCheckMicThreshold, @@ -428,6 +432,7 @@ view.register( # Transcription Tab (Speaker) "callback_set_speaker_device": callbackSetSpeakerDevice, + "list_speaker_device": model.getListOutputDevice(), "callback_set_speaker_energy_threshold": callbackSetSpeakerEnergyThreshold, "callback_set_speaker_dynamic_energy_threshold": callbackSetSpeakerDynamicEnergyThreshold, "callback_check_speaker_threshold": callbackCheckSpeakerThreshold, diff --git a/view.py b/view.py index 26d7adbe..6d625a2e 100644 --- a/view.py +++ b/view.py @@ -105,13 +105,13 @@ class View(): # Transcription Tab (Mic) VAR_LABEL_MIC_HOST=StringVar(value="Mic Host"), VAR_DESC_MIC_HOST=StringVar(value="Select the mic host. (Default: ?)"), - LIST_MIC_HOST=[], # model.getListInputHost(), + LIST_MIC_HOST=[], CALLBACK_SET_MIC_HOST=None, VAR_MIC_HOST=StringVar(value=config.CHOICE_MIC_HOST), VAR_LABEL_MIC_DEVICE=StringVar(value="Mic Device"), VAR_DESC_MIC_DEVICE=StringVar(value="Select the mic devise. (Default: ?)"), - LIST_MIC_DEVICE=[], # model.getListInputDevice(), + LIST_MIC_DEVICE=[], CALLBACK_SET_MIC_DEVICE=None, VAR_MIC_DEVICE=StringVar(value=config.CHOICE_MIC_DEVICE), @@ -150,7 +150,7 @@ class View(): # Transcription Tab (Speaker) VAR_LABEL_SPEAKER_DEVICE=StringVar(value="Speaker Device"), VAR_DESC_SPEAKER_DEVICE=StringVar(value="Select the speaker devise. (Default: ?)"), - LIST_SPEAKER_DEVICE=[], # model.getListOutputDevice(), + LIST_SPEAKER_DEVICE=[], CALLBACK_SET_SPEAKER_DEVICE=None, VAR_SPEAKER_DEVICE=StringVar(value=config.CHOICE_SPEAKER_DEVICE), @@ -276,11 +276,11 @@ class View(): # Transcription Tab (Mic) vrct_gui.config_window.CALLBACK_SET_MIC_HOST = config_window["callback_set_mic_host"] - # vrct_gui.config_window.LIST_MIC_HOST = config_window["list_mic_host"] - self.updateList_MicHost(vrct_gui.config_window.LIST_MIC_HOST) + self.updateList_MicHost(config_window["list_mic_host"]) vrct_gui.config_window.CALLBACK_SET_MIC_DEVICE = config_window["callback_set_mic_device"] - vrct_gui.config_window.LIST_MIC_DEVISE = config_window["list_mic_device"] + self.updateList_MicDevice(config_window["list_mic_device"]) + vrct_gui.config_window.CALLBACK_SET_MIC_ENERGY_THRESHOLD = config_window["callback_set_mic_energy_threshold"] vrct_gui.config_window.CALLBACK_SET_MIC_DYNAMIC_ENERGY_THRESHOLD = config_window["callback_set_mic_dynamic_energy_threshold"] @@ -292,6 +292,8 @@ class View(): # Transcription Tab (Speaker) vrct_gui.config_window.CALLBACK_SET_SPEAKER_DEVICE = config_window["callback_set_speaker_device"] + self.updateList_SpeakerDevice(config_window["list_speaker_device"]) + vrct_gui.config_window.CALLBACK_SET_SPEAKER_ENERGY_THRESHOLD = config_window["callback_set_speaker_energy_threshold"] vrct_gui.config_window.CALLBACK_SET_SPEAKER_DYNAMIC_ENERGY_THRESHOLD = config_window["callback_set_speaker_dynamic_energy_threshold"] vrct_gui.config_window.CALLBACK_CHECK_SPEAKER_THRESHOLD = config_window["callback_check_speaker_threshold"] @@ -422,8 +424,24 @@ class View(): vrct_gui.config_window.reloadConfigWindowSettingBoxContainer() - def updateList_MicHost(self, list__mic_host): - vrct_gui.config_window.LIST_MIC_HOST = list__mic_host + def updateList_MicHost(self, new_mic_host_list:list): + vrct_gui.config_window.LIST_MIC_HOST = new_mic_host_list + vrct_gui.config_window.sb__optionmenu_mic_host.configure(values=new_mic_host_list) + def updateSelected_MicHost(self, selected_mic_host_name:str): + vrct_gui.config_window.VAR_MIC_HOST.set(selected_mic_host_name) + + def updateList_MicDevice(self, new_mic_device_list): + vrct_gui.config_window.LIST_MIC_DEVICE = new_mic_device_list + vrct_gui.config_window.sb__optionmenu_mic_device.configure(values=new_mic_device_list) + + def updateSelected_MicDevice(self, default_selected_mic_device_name:str): + self.view_variable.VAR_MIC_DEVICE.set(default_selected_mic_device_name) + + + + def updateList_SpeakerDevice(self, new_speaker_device_list): + vrct_gui.config_window.LIST_SPEAKER_DEVICE = new_speaker_device_list + vrct_gui.config_window.sb__optionmenu_speaker_device.configure(values=new_speaker_device_list) view = View() \ No newline at end of file From fb22ffa31ea70c9fea4b3dd042dccb6b0e483811 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Mon, 4 Sep 2023 18:29:04 +0900 Subject: [PATCH 3/5] =?UTF-8?q?[bugfix]=20Config=20Window=20Font=20Family?= =?UTF-8?q?=20CALLBACK=E9=96=A2=E6=95=B0=E7=99=BB=E9=8C=B2=E3=81=AE?= =?UTF-8?q?=E3=81=97=E5=BF=98=E3=82=8C(=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E7=94=A8=E3=81=AB=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88=E3=82=A2?= =?UTF-8?q?=E3=82=A6=E3=83=88=E3=81=97=E3=81=9F=E3=81=BE=E3=81=BE=E3=81=A0?= =?UTF-8?q?=E3=81=A3=E3=81=9F)=E3=81=A8=E3=80=81=E5=AE=9F=E9=9A=9B?= =?UTF-8?q?=E3=81=AB=E3=83=95=E3=82=A9=E3=83=B3=E3=83=88=E9=81=B8=E6=8A=9E?= =?UTF-8?q?=E6=99=82=E3=81=AB=E6=AD=A3=E3=81=97=E3=81=8F=E9=96=A2=E6=95=B0?= =?UTF-8?q?=E3=81=8C=E5=8B=95=E3=81=84=E3=81=A6=E3=81=84=E3=81=AA=E3=81=8B?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- view.py | 18 +----------------- .../createSettingBox_Appearance.py | 2 +- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/view.py b/view.py index 6d625a2e..25d75690 100644 --- a/view.py +++ b/view.py @@ -249,25 +249,10 @@ class View(): # Appearance Tab vrct_gui.config_window.CALLBACK_SET_TRANSPARENCY = config_window["callback_set_transparency"] - # vrct_gui.config_window.sb__transparency_slider.configure(variable=IntVar(value=config.TRANSPARENCY)) vrct_gui.config_window.CALLBACK_SET_APPEARANCE = config_window["callback_set_appearance"] vrct_gui.config_window.CALLBACK_SET_UI_SCALING = config_window["callback_set_ui_scaling"] - - self.view_variable.CALLBACK_SET_FONT_FAMILY = config_window["callback_set_font_family"] - - - - # vrct_gui.config_window.sb__optionmenu_font_family.configure(values=self.view_variable.LIST_FONT_FAMILY) - - # self.view_variable.VAR_FONT_FAMILY = StringVar(value=config.FONT_FAMILY) - # vrct_gui.config_window.sb__optionmenu_font_family.configure(variable=self.view_variable.VAR_FONT_FAMILY) - - - - # vrct_gui.config_window.sb__optionmenu_font_family.configure(variable=StringVar(value=config.FONT_FAMILY)) - # vrct_gui.config_window.sb__optionmenu_font_family.configure(values=["test", "from", "view.py"]) - + vrct_gui.config_window.CALLBACK_SET_FONT_FAMILY = config_window["callback_set_font_family"] vrct_gui.config_window.CALLBACK_SET_UI_LANGUAGE = config_window["callback_set_ui_language"] @@ -281,7 +266,6 @@ class View(): vrct_gui.config_window.CALLBACK_SET_MIC_DEVICE = config_window["callback_set_mic_device"] self.updateList_MicDevice(config_window["list_mic_device"]) - vrct_gui.config_window.CALLBACK_SET_MIC_ENERGY_THRESHOLD = config_window["callback_set_mic_energy_threshold"] vrct_gui.config_window.CALLBACK_SET_MIC_DYNAMIC_ENERGY_THRESHOLD = config_window["callback_set_mic_dynamic_energy_threshold"] vrct_gui.config_window.CALLBACK_CHECK_MIC_THRESHOLD = config_window["callback_check_mic_threshold"] 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 800288a2..211f7bf3 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 @@ -19,7 +19,7 @@ def createSettingBox_Appearance(setting_box_wrapper, config_window, settings): callFunctionIfCallable(config_window.CALLBACK_SET_UI_SCALING, value) def optionmenu_font_family_callback(value): - callFunctionIfCallable(config_window.view_variable.CALLBACK_SET_FONT_FAMILY, value) + callFunctionIfCallable(config_window.CALLBACK_SET_FONT_FAMILY, value) def optionmenu_ui_language_callback(value): callFunctionIfCallable(config_window.CALLBACK_SET_UI_LANGUAGE, value) From 69fae94707e1d8e42c1dc0f614a5058349164f45 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Mon, 4 Sep 2023 22:48:24 +0900 Subject: [PATCH 4/5] =?UTF-8?q?[bugifx]=20Config=20Window:=20view=5Fvariab?= =?UTF-8?q?le(view.py=E5=A4=89=E6=95=B0)=E3=81=AE=E5=8F=82=E7=85=A7?= =?UTF-8?q?=E3=81=AE=E4=BB=95=E6=96=B9=E3=81=8C=E3=81=8A=E3=81=8B=E3=81=97?= =?UTF-8?q?=E3=81=8F=E3=80=81=E6=84=8F=E5=9B=B3=E3=81=97=E3=81=9F=E5=80=A4?= =?UTF-8?q?=E3=81=AE=E4=BF=9D=E5=AD=98=E3=81=A8=E5=8F=82=E7=85=A7=E3=81=8C?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA=E3=81=8B=E3=81=A3?= =?UTF-8?q?=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- view.py | 76 +++++++++---------- vrct_gui/config_window/ConfigWindow.py | 15 ++-- .../_createSettingBoxCompactModeButton.py | 10 +-- .../createSettingBoxTopBar.py | 4 +- .../_createSettingBoxContainer.py | 9 ++- .../createSideMenuAndSettingsBoxContainers.py | 4 +- .../createSettingBox_AdvancedSettings.py | 18 ++--- .../createSettingBox_Appearance.py | 52 ++++++------- .../createSettingBox_Others.py | 26 +++---- .../createSettingBox_Mic.py | 73 +++++++++--------- .../createSettingBox_Speaker.py | 54 ++++++------- .../createSettingBox_Translation.py | 10 +-- 12 files changed, 179 insertions(+), 172 deletions(-) diff --git a/view.py b/view.py index 25d75690..37b362ad 100644 --- a/view.py +++ b/view.py @@ -216,10 +216,10 @@ class View(): self.view_variable.CALLBACK_TOGGLE_MAIN_WINDOW_SIDEBAR_COMPACT_MODE = self._toggleMainWindowSidebarCompactMode - vrct_gui.CALLBACK_TOGGLE_TRANSLATION = sidebar_features["callback_toggle_translation"] - vrct_gui.CALLBACK_TOGGLE_TRANSCRIPTION_SEND = sidebar_features["callback_toggle_transcription_send"] - vrct_gui.CALLBACK_TOGGLE_TRANSCRIPTION_RECEIVE = sidebar_features["callback_toggle_transcription_receive"] - vrct_gui.CALLBACK_TOGGLE_FOREGROUND = sidebar_features["callback_toggle_foreground"] + self.view_variable.CALLBACK_TOGGLE_TRANSLATION = sidebar_features["callback_toggle_translation"] + self.view_variable.CALLBACK_TOGGLE_TRANSCRIPTION_SEND = sidebar_features["callback_toggle_transcription_send"] + self.view_variable.CALLBACK_TOGGLE_TRANSCRIPTION_RECEIVE = sidebar_features["callback_toggle_transcription_receive"] + self.view_variable.CALLBACK_TOGGLE_FOREGROUND = sidebar_features["callback_toggle_foreground"] vrct_gui.sls__optionmenu_your_language.configure(values=language_presets["values"]) @@ -229,7 +229,7 @@ class View(): vrct_gui.sls__optionmenu_target_language.configure(command=language_presets["callback_target_language"]) vrct_gui.sls__optionmenu_target_language.configure(variable=StringVar(value=config.SELECTED_TAB_TARGET_LANGUAGES[config.SELECTED_TAB_NO])) - vrct_gui.CALLBACK_SELECTED_LANGUAGE_PRESET_TAB = language_presets["callback_selected_language_preset_tab"] + self.view_variable.CALLBACK_SELECTED_LANGUAGE_PRESET_TAB = language_presets["callback_selected_language_preset_tab"] vrct_gui.setDefaultActiveLanguagePresetTab(tab_no=config.SELECTED_TAB_NO) @@ -243,56 +243,56 @@ class View(): # Config Window # Compact Mode Switch - vrct_gui.config_window.CALLBACK_ENABLE_CONFIG_WINDOW_COMPACT_MODE = config_window["callback_disable_config_window_compact_mode"] - vrct_gui.config_window.CALLBACK_DISABLE_CONFIG_WINDOW_COMPACT_MODE = config_window["callback_enable_config_window_compact_mode"] + self.view_variable.CALLBACK_ENABLE_CONFIG_WINDOW_COMPACT_MODE = config_window["callback_disable_config_window_compact_mode"] + self.view_variable.CALLBACK_DISABLE_CONFIG_WINDOW_COMPACT_MODE = config_window["callback_enable_config_window_compact_mode"] # Appearance Tab - vrct_gui.config_window.CALLBACK_SET_TRANSPARENCY = config_window["callback_set_transparency"] + self.view_variable.CALLBACK_SET_TRANSPARENCY = config_window["callback_set_transparency"] - vrct_gui.config_window.CALLBACK_SET_APPEARANCE = config_window["callback_set_appearance"] - vrct_gui.config_window.CALLBACK_SET_UI_SCALING = config_window["callback_set_ui_scaling"] - vrct_gui.config_window.CALLBACK_SET_FONT_FAMILY = config_window["callback_set_font_family"] - vrct_gui.config_window.CALLBACK_SET_UI_LANGUAGE = config_window["callback_set_ui_language"] + self.view_variable.CALLBACK_SET_APPEARANCE = config_window["callback_set_appearance"] + self.view_variable.CALLBACK_SET_UI_SCALING = config_window["callback_set_ui_scaling"] + self.view_variable.CALLBACK_SET_FONT_FAMILY = config_window["callback_set_font_family"] + self.view_variable.CALLBACK_SET_UI_LANGUAGE = config_window["callback_set_ui_language"] # Translation Tab - vrct_gui.config_window.CALLBACK_SET_DEEPL_AUTHKEY = config_window["callback_set_deepl_authkey"] + self.view_variable.CALLBACK_SET_DEEPL_AUTHKEY = config_window["callback_set_deepl_authkey"] # Transcription Tab (Mic) - vrct_gui.config_window.CALLBACK_SET_MIC_HOST = config_window["callback_set_mic_host"] + self.view_variable.CALLBACK_SET_MIC_HOST = config_window["callback_set_mic_host"] self.updateList_MicHost(config_window["list_mic_host"]) - vrct_gui.config_window.CALLBACK_SET_MIC_DEVICE = config_window["callback_set_mic_device"] + self.view_variable.CALLBACK_SET_MIC_DEVICE = config_window["callback_set_mic_device"] self.updateList_MicDevice(config_window["list_mic_device"]) - vrct_gui.config_window.CALLBACK_SET_MIC_ENERGY_THRESHOLD = config_window["callback_set_mic_energy_threshold"] - vrct_gui.config_window.CALLBACK_SET_MIC_DYNAMIC_ENERGY_THRESHOLD = config_window["callback_set_mic_dynamic_energy_threshold"] - vrct_gui.config_window.CALLBACK_CHECK_MIC_THRESHOLD = config_window["callback_check_mic_threshold"] - vrct_gui.config_window.CALLBACK_SET_MIC_RECORD_TIMEOUT = config_window["callback_set_mic_record_timeout"] - vrct_gui.config_window.CALLBACK_SET_MIC_PHRASE_TIMEOUT = config_window["callback_set_mic_phrase_timeout"] - vrct_gui.config_window.CALLBACK_SET_MIC_MAX_PHRASES = config_window["callback_set_mic_max_phrases"] - vrct_gui.config_window.CALLBACK_SET_MIC_WORD_FILTER = config_window["callback_set_mic_word_filter"] + self.view_variable.CALLBACK_SET_MIC_ENERGY_THRESHOLD = config_window["callback_set_mic_energy_threshold"] + self.view_variable.CALLBACK_SET_MIC_DYNAMIC_ENERGY_THRESHOLD = config_window["callback_set_mic_dynamic_energy_threshold"] + self.view_variable.CALLBACK_CHECK_MIC_THRESHOLD = config_window["callback_check_mic_threshold"] + self.view_variable.CALLBACK_SET_MIC_RECORD_TIMEOUT = config_window["callback_set_mic_record_timeout"] + self.view_variable.CALLBACK_SET_MIC_PHRASE_TIMEOUT = config_window["callback_set_mic_phrase_timeout"] + self.view_variable.CALLBACK_SET_MIC_MAX_PHRASES = config_window["callback_set_mic_max_phrases"] + self.view_variable.CALLBACK_SET_MIC_WORD_FILTER = config_window["callback_set_mic_word_filter"] # Transcription Tab (Speaker) - vrct_gui.config_window.CALLBACK_SET_SPEAKER_DEVICE = config_window["callback_set_speaker_device"] + self.view_variable.CALLBACK_SET_SPEAKER_DEVICE = config_window["callback_set_speaker_device"] self.updateList_SpeakerDevice(config_window["list_speaker_device"]) - vrct_gui.config_window.CALLBACK_SET_SPEAKER_ENERGY_THRESHOLD = config_window["callback_set_speaker_energy_threshold"] - vrct_gui.config_window.CALLBACK_SET_SPEAKER_DYNAMIC_ENERGY_THRESHOLD = config_window["callback_set_speaker_dynamic_energy_threshold"] - vrct_gui.config_window.CALLBACK_CHECK_SPEAKER_THRESHOLD = config_window["callback_check_speaker_threshold"] - vrct_gui.config_window.CALLBACK_SET_SPEAKER_RECORD_TIMEOUT = config_window["callback_set_speaker_record_timeout"] - vrct_gui.config_window.CALLBACK_SET_SPEAKER_PHRASE_TIMEOUT = config_window["callback_set_speaker_phrase_timeout"] - vrct_gui.config_window.CALLBACK_SET_SPEAKER_MAX_PHRASES = config_window["callback_set_speaker_max_phrases"] + self.view_variable.CALLBACK_SET_SPEAKER_ENERGY_THRESHOLD = config_window["callback_set_speaker_energy_threshold"] + self.view_variable.CALLBACK_SET_SPEAKER_DYNAMIC_ENERGY_THRESHOLD = config_window["callback_set_speaker_dynamic_energy_threshold"] + self.view_variable.CALLBACK_CHECK_SPEAKER_THRESHOLD = config_window["callback_check_speaker_threshold"] + self.view_variable.CALLBACK_SET_SPEAKER_RECORD_TIMEOUT = config_window["callback_set_speaker_record_timeout"] + self.view_variable.CALLBACK_SET_SPEAKER_PHRASE_TIMEOUT = config_window["callback_set_speaker_phrase_timeout"] + self.view_variable.CALLBACK_SET_SPEAKER_MAX_PHRASES = config_window["callback_set_speaker_max_phrases"] # Others Tab - 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"] + self.view_variable.CALLBACK_SET_ENABLE_AUTO_CLEAR_MESSAGE_BOX = config_window["callback_set_enable_auto_clear_chatbox"] + self.view_variable.CALLBACK_SET_ENABLE_NOTICE_XSOVERLAY = config_window["callback_set_enable_notice_xsoverlay"] + self.view_variable.CALLBACK_SET_MESSAGE_FORMAT = config_window["callback_set_message_format"] # Advanced Settings Tab - vrct_gui.config_window.CALLBACK_SET_OSC_IP_ADDRESS = config_window["callback_set_osc_ip_address"] - vrct_gui.config_window.CALLBACK_SET_OSC_PORT = config_window["callback_set_osc_port"] + self.view_variable.CALLBACK_SET_OSC_IP_ADDRESS = config_window["callback_set_osc_ip_address"] + self.view_variable.CALLBACK_SET_OSC_PORT = config_window["callback_set_osc_port"] @@ -409,14 +409,14 @@ class View(): def updateList_MicHost(self, new_mic_host_list:list): - vrct_gui.config_window.LIST_MIC_HOST = new_mic_host_list + self.view_variable.LIST_MIC_HOST = new_mic_host_list vrct_gui.config_window.sb__optionmenu_mic_host.configure(values=new_mic_host_list) def updateSelected_MicHost(self, selected_mic_host_name:str): - vrct_gui.config_window.VAR_MIC_HOST.set(selected_mic_host_name) + self.view_variable.VAR_MIC_HOST.set(selected_mic_host_name) def updateList_MicDevice(self, new_mic_device_list): - vrct_gui.config_window.LIST_MIC_DEVICE = new_mic_device_list + self.view_variable.LIST_MIC_DEVICE = new_mic_device_list vrct_gui.config_window.sb__optionmenu_mic_device.configure(values=new_mic_device_list) def updateSelected_MicDevice(self, default_selected_mic_device_name:str): @@ -425,7 +425,7 @@ class View(): def updateList_SpeakerDevice(self, new_speaker_device_list): - vrct_gui.config_window.LIST_SPEAKER_DEVICE = new_speaker_device_list + self.view_variable.LIST_SPEAKER_DEVICE = new_speaker_device_list vrct_gui.config_window.sb__optionmenu_speaker_device.configure(values=new_speaker_device_list) view = View() \ No newline at end of file diff --git a/vrct_gui/config_window/ConfigWindow.py b/vrct_gui/config_window/ConfigWindow.py index c2c87c1c..8ca90445 100644 --- a/vrct_gui/config_window/ConfigWindow.py +++ b/vrct_gui/config_window/ConfigWindow.py @@ -18,19 +18,18 @@ class ConfigWindow(CTkToplevel): self.protocol("WM_DELETE_WINDOW", vrct_gui.closeConfigWindow) self.settings = settings - self.view_variable = view_variable + self._view_variable = view_variable + + createConfigWindowTitle(config_window=self, settings=self.settings) + + createSettingBoxTopBar(config_window=self, settings=self.settings, view_variable=self._view_variable) - createConfigWindowTitle(config_window=self, settings=settings) - - createSettingBoxTopBar(config_window=self, settings=settings) - - - createSideMenuAndSettingsBoxContainers(config_window=self, settings=settings) + createSideMenuAndSettingsBoxContainers(config_window=self, settings=self.settings, view_variable=self._view_variable) def reloadConfigWindowSettingBoxContainer(self): self.main_bg_container.destroy() - createSideMenuAndSettingsBoxContainers(config_window=self, settings=self.settings) \ No newline at end of file + createSideMenuAndSettingsBoxContainers(config_window=self, settings=self.settings, view_variable=self._view_variable) \ No newline at end of file diff --git a/vrct_gui/config_window/widgets/createSettingBoxTopBar/_createSettingBoxCompactModeButton.py b/vrct_gui/config_window/widgets/createSettingBoxTopBar/_createSettingBoxCompactModeButton.py index 0d9e21ed..7ffc533f 100644 --- a/vrct_gui/config_window/widgets/createSettingBoxTopBar/_createSettingBoxCompactModeButton.py +++ b/vrct_gui/config_window/widgets/createSettingBoxTopBar/_createSettingBoxCompactModeButton.py @@ -1,15 +1,15 @@ from customtkinter import CTkFont, CTkFrame, CTkLabel, CTkSwitch -def _createSettingBoxCompactModeButton(parent_widget, config_window, settings): +def _createSettingBoxCompactModeButton(parent_widget, config_window, settings, view_variable): def switchConfigWindowCompactMode(): print(config_window.setting_box_compact_mode_switch_box.get()) if config_window.setting_box_compact_mode_switch_box.get() is True: - if callable(config_window.CALLBACK_ENABLE_CONFIG_WINDOW_COMPACT_MODE) is True: - config_window.CALLBACK_ENABLE_CONFIG_WINDOW_COMPACT_MODE() + if callable(view_variable.CALLBACK_ENABLE_CONFIG_WINDOW_COMPACT_MODE) is True: + view_variable.CALLBACK_ENABLE_CONFIG_WINDOW_COMPACT_MODE() else: - if callable(config_window.CALLBACK_DISABLE_CONFIG_WINDOW_COMPACT_MODE) is True: - config_window.CALLBACK_DISABLE_CONFIG_WINDOW_COMPACT_MODE() + if callable(view_variable.CALLBACK_DISABLE_CONFIG_WINDOW_COMPACT_MODE) is True: + view_variable.CALLBACK_DISABLE_CONFIG_WINDOW_COMPACT_MODE() diff --git a/vrct_gui/config_window/widgets/createSettingBoxTopBar/createSettingBoxTopBar.py b/vrct_gui/config_window/widgets/createSettingBoxTopBar/createSettingBoxTopBar.py index a42d43f9..8ec955d6 100644 --- a/vrct_gui/config_window/widgets/createSettingBoxTopBar/createSettingBoxTopBar.py +++ b/vrct_gui/config_window/widgets/createSettingBoxTopBar/createSettingBoxTopBar.py @@ -3,7 +3,7 @@ from customtkinter import CTkFont, CTkFrame, CTkLabel from ._createSettingBoxTitle import _createSettingBoxTitle from ._createSettingBoxCompactModeButton import _createSettingBoxCompactModeButton -def createSettingBoxTopBar(config_window, settings): +def createSettingBoxTopBar(config_window, settings, view_variable): config_window.grid_columnconfigure(1, weight=1) config_window.setting_box_top_bar = CTkFrame(config_window, corner_radius=0, fg_color=settings.ctm.TOP_BAR_BG_COLOR, width=0, height=0) @@ -12,4 +12,4 @@ def createSettingBoxTopBar(config_window, settings): _createSettingBoxTitle(parent_widget=config_window.setting_box_top_bar, config_window=config_window, settings=settings) - _createSettingBoxCompactModeButton(parent_widget=config_window.setting_box_top_bar, config_window=config_window, settings=settings) \ No newline at end of file + _createSettingBoxCompactModeButton(parent_widget=config_window.setting_box_top_bar, config_window=config_window, settings=settings, view_variable=view_variable) \ No newline at end of file diff --git a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/_createSettingBoxContainer.py b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/_createSettingBoxContainer.py index dd01d49c..62e8088d 100644 --- a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/_createSettingBoxContainer.py +++ b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/_createSettingBoxContainer.py @@ -1,7 +1,7 @@ from customtkinter import CTkFont, CTkFrame, CTkLabel -def _createSettingBoxContainer(config_window, settings, setting_box_container_settings): +def _createSettingBoxContainer(config_window, settings, view_variable, setting_box_container_settings): def createSectionTitle(container_widget, section_title): @@ -56,5 +56,10 @@ def _createSettingBoxContainer(config_window, settings, setting_box_container_se setting_box_and_section_title_wrapper.grid(row=setting_box_row, column=0, sticky="ew", padx=0, pady=(SB__TOP_PADY, SB__BOTTOM_PADY)) if setting_box_setting["setting_box"] is not None: - setting_box_setting["setting_box"](setting_box_wrapper=setting_box_wrapper, config_window=config_window, settings=settings) + setting_box_setting["setting_box"]( + setting_box_wrapper=setting_box_wrapper, + config_window=config_window, + settings=settings, + view_variable=view_variable, + ) diff --git a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/createSideMenuAndSettingsBoxContainers.py b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/createSideMenuAndSettingsBoxContainers.py index 2c47507f..32c1156e 100644 --- a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/createSideMenuAndSettingsBoxContainers.py +++ b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/createSideMenuAndSettingsBoxContainers.py @@ -13,7 +13,7 @@ from .setting_box_containers.setting_box_advanced_settings import createSettingB from .setting_box_containers.setting_box_translation import createSettingBox_Translation -def createSideMenuAndSettingsBoxContainers(config_window, settings): +def createSideMenuAndSettingsBoxContainers(config_window, settings, view_variable): # Main container config_window.main_bg_container = CTkFrame(config_window, corner_radius=0, fg_color=settings.ctm.MAIN_BG_COLOR, width=0, height=0) @@ -119,6 +119,7 @@ def createSideMenuAndSettingsBoxContainers(config_window, settings): _addConfigSideMenuItem( config_window=config_window, settings=settings, + # view_variable=view_variable, side_menu_settings=sm_and_sbc_setting, side_menu_row=side_menu_row, all_side_menu_tab_attr_name=all_side_menu_tab_attr_name, @@ -129,6 +130,7 @@ def createSideMenuAndSettingsBoxContainers(config_window, settings): _createSettingBoxContainer( config_window=config_window, settings=settings, + view_variable=view_variable, setting_box_container_settings=sm_and_sbc_setting["setting_box_container_settings"], ) 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 41c57907..c66d1e86 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 @@ -2,26 +2,26 @@ from utils import callFunctionIfCallable from .._SettingBoxGenerator import _SettingBoxGenerator -def createSettingBox_AdvancedSettings(setting_box_wrapper, config_window, settings): +def createSettingBox_AdvancedSettings(setting_box_wrapper, config_window, settings, view_variable): sbg = _SettingBoxGenerator(config_window, settings) createSettingBoxEntry = sbg.createSettingBoxEntry def entry_ip_address_callback(value): - callFunctionIfCallable(config_window.CALLBACK_SET_OSC_IP_ADDRESS, value) + callFunctionIfCallable(view_variable.CALLBACK_SET_OSC_IP_ADDRESS, value) def entry_port_callback(value): - callFunctionIfCallable(config_window.CALLBACK_SET_OSC_PORT, value) + callFunctionIfCallable(view_variable.CALLBACK_SET_OSC_PORT, value) row=0 config_window.sb__ip_address = createSettingBoxEntry( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_OSC_IP_ADDRESS, - for_var_desc_text=config_window.view_variable.VAR_DESC_OSC_IP_ADDRESS, + for_var_label_text=view_variable.VAR_LABEL_OSC_IP_ADDRESS, + for_var_desc_text=view_variable.VAR_DESC_OSC_IP_ADDRESS, entry_attr_name="sb__entry_ip_address", entry_width=settings.uism.SB__ENTRY_WIDTH_150, entry_bind__Any_KeyRelease=lambda value: entry_ip_address_callback(value), - entry_textvariable=config_window.view_variable.VAR_OSC_IP_ADDRESS, + entry_textvariable=view_variable.VAR_OSC_IP_ADDRESS, ) config_window.sb__ip_address.grid(row=row) row+=1 @@ -29,12 +29,12 @@ def createSettingBox_AdvancedSettings(setting_box_wrapper, config_window, settin config_window.sb__port = createSettingBoxEntry( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_OSC_PORT, - for_var_desc_text=config_window.view_variable.VAR_DESC_OSC_PORT, + for_var_label_text=view_variable.VAR_LABEL_OSC_PORT, + for_var_desc_text=view_variable.VAR_DESC_OSC_PORT, entry_attr_name="sb__entry_port", entry_width=settings.uism.SB__ENTRY_WIDTH_150, entry_bind__Any_KeyRelease=lambda value: entry_port_callback(value), - entry_textvariable=config_window.view_variable.VAR_OSC_PORT, + entry_textvariable=view_variable.VAR_OSC_PORT, ) config_window.sb__port.grid(row=row) row+=1 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 211f7bf3..80ace904 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 @@ -2,7 +2,7 @@ from utils import callFunctionIfCallable from .._SettingBoxGenerator import _SettingBoxGenerator -def createSettingBox_Appearance(setting_box_wrapper, config_window, settings): +def createSettingBox_Appearance(setting_box_wrapper, config_window, settings, view_variable): sbg = _SettingBoxGenerator(config_window, settings) createSettingBoxDropdownMenu = sbg.createSettingBoxDropdownMenu createSettingBoxSlider = sbg.createSettingBoxSlider @@ -10,30 +10,30 @@ def createSettingBox_Appearance(setting_box_wrapper, config_window, settings): # 関数名は変えるかもしれない。 # テーマ変更、フォント変更時、 Widget再生成か再起動かは検討中 def slider_transparency_callback(value): - callFunctionIfCallable(config_window.CALLBACK_SET_TRANSPARENCY, value) + callFunctionIfCallable(view_variable.CALLBACK_SET_TRANSPARENCY, value) def optionmenu_appearance_theme_callback(value): - callFunctionIfCallable(config_window.CALLBACK_SET_APPEARANCE, value) + callFunctionIfCallable(view_variable.CALLBACK_SET_APPEARANCE, value) def optionmenu_ui_scaling_callback(value): - callFunctionIfCallable(config_window.CALLBACK_SET_UI_SCALING, value) + callFunctionIfCallable(view_variable.CALLBACK_SET_UI_SCALING, value) def optionmenu_font_family_callback(value): - callFunctionIfCallable(config_window.CALLBACK_SET_FONT_FAMILY, value) + callFunctionIfCallable(view_variable.CALLBACK_SET_FONT_FAMILY, value) def optionmenu_ui_language_callback(value): - callFunctionIfCallable(config_window.CALLBACK_SET_UI_LANGUAGE, value) + callFunctionIfCallable(view_variable.CALLBACK_SET_UI_LANGUAGE, value) row=0 config_window.sb__transparency = createSettingBoxSlider( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_TRANSPARENCY, - for_var_desc_text=config_window.view_variable.VAR_DESC_TRANSPARENCY, + for_var_label_text=view_variable.VAR_LABEL_TRANSPARENCY, + for_var_desc_text=view_variable.VAR_DESC_TRANSPARENCY, slider_attr_name="sb__transparency_slider", - slider_range=config_window.view_variable.SLIDER_RANGE_TRANSPARENCY, + slider_range=view_variable.SLIDER_RANGE_TRANSPARENCY, command=lambda value: slider_transparency_callback(value), - variable=config_window.view_variable.VAR_TRANSPARENCY, + variable=view_variable.VAR_TRANSPARENCY, ) config_window.sb__transparency.grid(row=row) row+=1 @@ -41,13 +41,13 @@ def createSettingBox_Appearance(setting_box_wrapper, config_window, settings): config_window.sb__appearance_theme = createSettingBoxDropdownMenu( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_APPEARANCE_THEME, - for_var_desc_text=config_window.view_variable.VAR_DESC_APPEARANCE_THEME, + for_var_label_text=view_variable.VAR_LABEL_APPEARANCE_THEME, + for_var_desc_text=view_variable.VAR_DESC_APPEARANCE_THEME, optionmenu_attr_name="sb__optionmenu_appearance_theme", dropdown_menu_attr_name="sb__dropdown_appearance_theme", - dropdown_menu_values=config_window.view_variable.LIST_APPEARANCE_THEME, + dropdown_menu_values=view_variable.LIST_APPEARANCE_THEME, command=lambda value: optionmenu_appearance_theme_callback(value), - variable=config_window.view_variable.VAR_APPEARANCE_THEME, + variable=view_variable.VAR_APPEARANCE_THEME, ) config_window.sb__appearance_theme.grid(row=row) row+=1 @@ -56,13 +56,13 @@ def createSettingBox_Appearance(setting_box_wrapper, config_window, settings): config_window.sb__ui_scaling = createSettingBoxDropdownMenu( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_UI_SCALING, - for_var_desc_text=config_window.view_variable.VAR_DESC_UI_SCALING, + for_var_label_text=view_variable.VAR_LABEL_UI_SCALING, + for_var_desc_text=view_variable.VAR_DESC_UI_SCALING, optionmenu_attr_name="sb__optionmenu_ui_scaling", dropdown_menu_attr_name="sb__dropdown_ui_scaling", - dropdown_menu_values=config_window.view_variable.LIST_UI_SCALING, + dropdown_menu_values=view_variable.LIST_UI_SCALING, command=lambda value: optionmenu_ui_scaling_callback(value), - variable=config_window.view_variable.VAR_UI_SCALING, + variable=view_variable.VAR_UI_SCALING, ) config_window.sb__ui_scaling.grid(row=row) row+=1 @@ -70,12 +70,12 @@ def createSettingBox_Appearance(setting_box_wrapper, config_window, settings): config_window.sb__font_family = createSettingBoxDropdownMenu( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_FONT_FAMILY, - for_var_desc_text=config_window.view_variable.VAR_DESC_FONT_FAMILY, + for_var_label_text=view_variable.VAR_LABEL_FONT_FAMILY, + for_var_desc_text=view_variable.VAR_DESC_FONT_FAMILY, optionmenu_attr_name="sb__optionmenu_font_family", - dropdown_menu_values=config_window.view_variable.LIST_FONT_FAMILY, + dropdown_menu_values=view_variable.LIST_FONT_FAMILY, command=lambda value: optionmenu_font_family_callback(value), - variable=config_window.view_variable.VAR_FONT_FAMILY, + variable=view_variable.VAR_FONT_FAMILY, ) config_window.sb__font_family.grid(row=row) row+=1 @@ -83,13 +83,13 @@ def createSettingBox_Appearance(setting_box_wrapper, config_window, settings): config_window.sb__ui_language = createSettingBoxDropdownMenu( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_UI_LANGUAGE, - for_var_desc_text=config_window.view_variable.VAR_DESC_UI_LANGUAGE, + for_var_label_text=view_variable.VAR_LABEL_UI_LANGUAGE, + for_var_desc_text=view_variable.VAR_DESC_UI_LANGUAGE, optionmenu_attr_name="sb__optionmenu_ui_language", dropdown_menu_attr_name="sb__dropdown_ui_language", - dropdown_menu_values=config_window.view_variable.LIST_UI_LANGUAGE, + dropdown_menu_values=view_variable.LIST_UI_LANGUAGE, command=lambda value: optionmenu_ui_language_callback(value), - variable=config_window.view_variable.VAR_UI_LANGUAGE, + variable=view_variable.VAR_UI_LANGUAGE, ) config_window.sb__ui_language.grid(row=row) row+=1 \ No newline at end of file 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 b3c2b81e..dd730e92 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 @@ -2,7 +2,7 @@ from utils import callFunctionIfCallable from .._SettingBoxGenerator import _SettingBoxGenerator -def createSettingBox_Others(setting_box_wrapper, config_window, settings): +def createSettingBox_Others(setting_box_wrapper, config_window, settings, view_variable): sbg = _SettingBoxGenerator(config_window, settings) createSettingBoxCheckbox = sbg.createSettingBoxCheckbox createSettingBoxEntry = sbg.createSettingBoxEntry @@ -10,23 +10,23 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings): # 元 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()) + callFunctionIfCallable(view_variable.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()) + callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_NOTICE_XSOVERLAY, checkbox_box_widget.get()) def entry_message_format_callback(value): - callFunctionIfCallable(config_window.CALLBACK_SET_ENABLE_NOTICE_XSOVERLAY, value) + callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_NOTICE_XSOVERLAY, value) row=0 config_window.sb__auto_clear_message_box = createSettingBoxCheckbox( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_ENABLE_AUTO_CLEAR_MESSAGE_BOX, - for_var_desc_text=config_window.view_variable.VAR_DESC_ENABLE_AUTO_CLEAR_MESSAGE_BOX, + for_var_label_text=view_variable.VAR_LABEL_ENABLE_AUTO_CLEAR_MESSAGE_BOX, + for_var_desc_text=view_variable.VAR_DESC_ENABLE_AUTO_CLEAR_MESSAGE_BOX, 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), - variable=config_window.view_variable.VAR_ENABLE_AUTO_CLEAR_MESSAGE_BOX, + variable=view_variable.VAR_ENABLE_AUTO_CLEAR_MESSAGE_BOX, ) config_window.sb__auto_clear_message_box.grid(row=row) row+=1 @@ -34,11 +34,11 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings): config_window.sb__notice_xsoverlay = createSettingBoxCheckbox( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_ENABLE_NOTICE_XSOVERLAY, - for_var_desc_text=config_window.view_variable.VAR_DESC_ENABLE_NOTICE_XSOVERLAY, + for_var_label_text=view_variable.VAR_LABEL_ENABLE_NOTICE_XSOVERLAY, + for_var_desc_text=view_variable.VAR_DESC_ENABLE_NOTICE_XSOVERLAY, checkbox_attr_name="sb__checkbox_notice_xsoverlay", command=lambda: checkbox_notice_xsoverlay_callback(config_window.sb__checkbox_notice_xsoverlay), - variable=config_window.view_variable.VAR_ENABLE_NOTICE_XSOVERLAY, + variable=view_variable.VAR_ENABLE_NOTICE_XSOVERLAY, ) config_window.sb__notice_xsoverlay.grid(row=row) row+=1 @@ -46,12 +46,12 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings): config_window.sb__message_format = createSettingBoxEntry( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_MESSAGE_FORMAT, - for_var_desc_text=config_window.view_variable.VAR_DESC_MESSAGE_FORMAT, + for_var_label_text=view_variable.VAR_LABEL_MESSAGE_FORMAT, + for_var_desc_text=view_variable.VAR_DESC_MESSAGE_FORMAT, entry_attr_name="sb__entry_message_format", entry_width=settings.uism.SB__ENTRY_WIDTH_250, entry_bind__Any_KeyRelease=lambda value: entry_message_format_callback(value), - entry_textvariable=config_window.view_variable.VAR_MESSAGE_FORMAT, + entry_textvariable=view_variable.VAR_MESSAGE_FORMAT, ) config_window.sb__message_format.grid(row=row) row+=1 \ No newline at end of file diff --git a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_transcription/createSettingBox_Mic.py b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_transcription/createSettingBox_Mic.py index 583d192f..3a53b3c0 100644 --- a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_transcription/createSettingBox_Mic.py +++ b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_transcription/createSettingBox_Mic.py @@ -4,7 +4,7 @@ from utils import callFunctionIfCallable from .._SettingBoxGenerator import _SettingBoxGenerator -def createSettingBox_Mic(setting_box_wrapper, config_window, settings): +def createSettingBox_Mic(setting_box_wrapper, config_window, settings, view_variable): sbg = _SettingBoxGenerator(config_window, settings) createSettingBoxDropdownMenu = sbg.createSettingBoxDropdownMenu createSettingBoxCheckbox = sbg.createSettingBoxCheckbox @@ -36,54 +36,55 @@ def createSettingBox_Mic(setting_box_wrapper, config_window, settings): passive_button_wrapper_widget.grid() def optionmenu_mic_host_callback(value): - callFunctionIfCallable(config_window.CALLBACK_SET_MIC_HOST, value) + callFunctionIfCallable(view_variable.CALLBACK_SET_MIC_HOST, value) def optionmenu_input_mic_device_callback(value): - callFunctionIfCallable(config_window.CALLBACK_SET_MIC_DEVICE, value) + callFunctionIfCallable(view_variable.CALLBACK_SET_MIC_DEVICE, value) def slider_input_mic_energy_threshold_callback(value): - callFunctionIfCallable(config_window.CALLBACK_SET_MIC_ENERGY_THRESHOLD, value) + callFunctionIfCallable(view_variable.CALLBACK_SET_MIC_ENERGY_THRESHOLD, value) def checkbox_input_mic_dynamic_energy_threshold_callback(checkbox_box_widget): - callFunctionIfCallable(config_window.CALLBACK_SET_MIC_DYNAMIC_ENERGY_THRESHOLD, checkbox_box_widget.get()) + callFunctionIfCallable(view_variable.CALLBACK_SET_MIC_DYNAMIC_ENERGY_THRESHOLD, checkbox_box_widget.get()) def entry_input_mic_record_timeout_callback(value): - callFunctionIfCallable(config_window.CALLBACK_SET_MIC_RECORD_TIMEOUT, value) + callFunctionIfCallable(view_variable.CALLBACK_SET_MIC_RECORD_TIMEOUT, value) def entry_input_mic_phrase_timeout_callback(value): - callFunctionIfCallable(config_window.CALLBACK_SET_MIC_PHRASE_TIMEOUT, value) + callFunctionIfCallable(view_variable.CALLBACK_SET_MIC_PHRASE_TIMEOUT, value) def entry_input_mic_max_phrases_callback(value): - callFunctionIfCallable(config_window.CALLBACK_SET_MIC_MAX_PHRASES, value) + callFunctionIfCallable(view_variable.CALLBACK_SET_MIC_MAX_PHRASES, value) def entry_input_mic_word_filters_callback(value): - callFunctionIfCallable(config_window.CALLBACK_SET_MIC_WORD_FILTER, value) + callFunctionIfCallable(view_variable.CALLBACK_SET_MIC_WORD_FILTER, value) row=0 # Mic Host と Mic Device は一つの項目として引っ付ける予定 config_window.sb__mic_host = createSettingBoxDropdownMenu( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_MIC_HOST, - for_var_desc_text=config_window.view_variable.VAR_DESC_MIC_HOST, + for_var_label_text=view_variable.VAR_LABEL_MIC_HOST, + for_var_desc_text=view_variable.VAR_DESC_MIC_HOST, optionmenu_attr_name="sb__optionmenu_mic_host", - dropdown_menu_values=config_window.view_variable.LIST_MIC_HOST, + dropdown_menu_attr_name="sb__dropdown_mic_host", + dropdown_menu_values=view_variable.LIST_MIC_HOST, command=lambda value: optionmenu_mic_host_callback(value), - variable=config_window.view_variable.VAR_MIC_HOST, + variable=view_variable.VAR_MIC_HOST, ) config_window.sb__mic_host.grid(row=row) row+=1 config_window.sb__mic_device = createSettingBoxDropdownMenu( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_MIC_DEVICE, - for_var_desc_text=config_window.view_variable.VAR_DESC_MIC_DEVICE, + for_var_label_text=view_variable.VAR_LABEL_MIC_DEVICE, + for_var_desc_text=view_variable.VAR_DESC_MIC_DEVICE, optionmenu_attr_name="sb__optionmenu_mic_device", dropdown_menu_attr_name="sb__dropdown_mic_device", - dropdown_menu_values=config_window.view_variable.LIST_MIC_DEVICE, + dropdown_menu_values=view_variable.LIST_MIC_DEVICE, command=lambda value: optionmenu_input_mic_device_callback(value), - variable=config_window.view_variable.VAR_MIC_DEVICE, + variable=view_variable.VAR_MIC_DEVICE, ) config_window.sb__mic_device.grid(row=row) row+=1 @@ -91,15 +92,15 @@ def createSettingBox_Mic(setting_box_wrapper, config_window, settings): config_window.sb__mic_energy_threshold = createSettingBoxProgressbarXSlider( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_MIC_ENERGY_THRESHOLD, - for_var_desc_text=config_window.view_variable.VAR_DESC_MIC_ENERGY_THRESHOLD, + for_var_label_text=view_variable.VAR_LABEL_MIC_ENERGY_THRESHOLD, + for_var_desc_text=view_variable.VAR_DESC_MIC_ENERGY_THRESHOLD, command=slider_input_mic_energy_threshold_callback, - variable=config_window.view_variable.VAR_MIC_ENERGY_THRESHOLD, + variable=view_variable.VAR_MIC_ENERGY_THRESHOLD, entry_attr_name="sb__progressbar_x_slider__entry_mic_energy_threshold", slider_attr_name="progressbar_x_slider__slider_mic_energy_threshold", - slider_range=config_window.view_variable.SLIDER_RANGE_MIC_ENERGY_THRESHOLD, + slider_range=view_variable.SLIDER_RANGE_MIC_ENERGY_THRESHOLD, progressbar_attr_name="sb__progressbar_x_slider__progressbar_mic_energy_threshold", @@ -125,11 +126,11 @@ def createSettingBox_Mic(setting_box_wrapper, config_window, settings): # Mic Dynamic Energy Thresholdも上に引っ付ける予定 config_window.sb__mic_dynamic_energy_threshold = createSettingBoxCheckbox( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_MIC_DYNAMIC_ENERGY_THRESHOLD, - for_var_desc_text=config_window.view_variable.VAR_DESC_MIC_DYNAMIC_ENERGY_THRESHOLD, + for_var_label_text=view_variable.VAR_LABEL_MIC_DYNAMIC_ENERGY_THRESHOLD, + for_var_desc_text=view_variable.VAR_DESC_MIC_DYNAMIC_ENERGY_THRESHOLD, checkbox_attr_name="sb__checkbox_mic_dynamic_energy_threshold", command=lambda: checkbox_input_mic_dynamic_energy_threshold_callback(config_window.sb__checkbox_mic_dynamic_energy_threshold), - variable=config_window.view_variable.VAR_MIC_DYNAMIC_ENERGY_THRESHOLD + variable=view_variable.VAR_MIC_DYNAMIC_ENERGY_THRESHOLD ) config_window.sb__mic_dynamic_energy_threshold.grid(row=row) row+=1 @@ -138,36 +139,36 @@ def createSettingBox_Mic(setting_box_wrapper, config_window, settings): # 以下3つも一つの項目にまとめるかもしれない config_window.sb__mic_record_timeout = createSettingBoxEntry( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_MIC_RECORD_TIMEOUT, - for_var_desc_text=config_window.view_variable.VAR_DESC_MIC_RECORD_TIMEOUT, + for_var_label_text=view_variable.VAR_LABEL_MIC_RECORD_TIMEOUT, + for_var_desc_text=view_variable.VAR_DESC_MIC_RECORD_TIMEOUT, entry_attr_name="sb__entry_mic_record_timeout", entry_width=settings.uism.SB__ENTRY_WIDTH_100, entry_bind__Any_KeyRelease=lambda value: entry_input_mic_record_timeout_callback(value), - entry_textvariable=config_window.view_variable.VAR_MIC_RECORD_TIMEOUT, + entry_textvariable=view_variable.VAR_MIC_RECORD_TIMEOUT, ) config_window.sb__mic_record_timeout.grid(row=row) row+=1 config_window.sb__mic_phrase_timeout = createSettingBoxEntry( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_MIC_PHRASE_TIMEOUT, - for_var_desc_text=config_window.view_variable.VAR_DESC_MIC_PHRASE_TIMEOUT, + for_var_label_text=view_variable.VAR_LABEL_MIC_PHRASE_TIMEOUT, + for_var_desc_text=view_variable.VAR_DESC_MIC_PHRASE_TIMEOUT, entry_attr_name="sb__entry_mic_phrase_timeout", entry_width=settings.uism.SB__ENTRY_WIDTH_100, entry_bind__Any_KeyRelease=lambda value: entry_input_mic_phrase_timeout_callback(value), - entry_textvariable=config_window.view_variable.VAR_MIC_PHRASE_TIMEOUT, + entry_textvariable=view_variable.VAR_MIC_PHRASE_TIMEOUT, ) config_window.sb__mic_phrase_timeout.grid(row=row) row+=1 config_window.sb__mic_max_phrases = createSettingBoxEntry( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_MIC_MAX_PHRASES, - for_var_desc_text=config_window.view_variable.VAR_DESC_MIC_MAX_PHRASES, + for_var_label_text=view_variable.VAR_LABEL_MIC_MAX_PHRASES, + for_var_desc_text=view_variable.VAR_DESC_MIC_MAX_PHRASES, entry_attr_name="sb__entry_mic_max_phrases", entry_width=settings.uism.SB__ENTRY_WIDTH_100, entry_bind__Any_KeyRelease=lambda value: entry_input_mic_max_phrases_callback(value), - entry_textvariable=config_window.view_variable.VAR_MIC_MAX_PHRASES, + entry_textvariable=view_variable.VAR_MIC_MAX_PHRASES, ) config_window.sb__mic_max_phrases.grid(row=row) row+=1 @@ -176,12 +177,12 @@ def createSettingBox_Mic(setting_box_wrapper, config_window, settings): config_window.sb__mic_word_filter = createSettingBoxEntry( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_MIC_WORD_FILTER, - for_var_desc_text=config_window.view_variable.VAR_DESC_MIC_WORD_FILTER, + for_var_label_text=view_variable.VAR_LABEL_MIC_WORD_FILTER, + for_var_desc_text=view_variable.VAR_DESC_MIC_WORD_FILTER, entry_attr_name="sb__entry_mic_word_filter", entry_width=settings.uism.SB__ENTRY_WIDTH_300, entry_bind__Any_KeyRelease=lambda value: entry_input_mic_word_filters_callback(value), - entry_textvariable=config_window.view_variable.VAR_MIC_WORD_FILTER, + entry_textvariable=view_variable.VAR_MIC_WORD_FILTER, ) config_window.sb__mic_word_filter.grid(row=row) row+=1 \ No newline at end of file diff --git a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_transcription/createSettingBox_Speaker.py b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_transcription/createSettingBox_Speaker.py index 236e4c58..a27a7f5c 100644 --- a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_transcription/createSettingBox_Speaker.py +++ b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_transcription/createSettingBox_Speaker.py @@ -4,7 +4,7 @@ from utils import callFunctionIfCallable from .._SettingBoxGenerator import _SettingBoxGenerator -def createSettingBox_Speaker(setting_box_wrapper, config_window, settings): +def createSettingBox_Speaker(setting_box_wrapper, config_window, settings, view_variable): sbg = _SettingBoxGenerator(config_window, settings) createSettingBoxDropdownMenu = sbg.createSettingBoxDropdownMenu createSettingBoxCheckbox = sbg.createSettingBoxCheckbox @@ -36,36 +36,36 @@ def createSettingBox_Speaker(setting_box_wrapper, config_window, settings): passive_button_wrapper_widget.grid() def optionmenu_input_speaker_device_callback(value): - callFunctionIfCallable(config_window.CALLBACK_SET_SPEAKER_DEVICE, value) + callFunctionIfCallable(view_variable.CALLBACK_SET_SPEAKER_DEVICE, value) def slider_input_speaker_energy_threshold_callback(value): - callFunctionIfCallable(config_window.CALLBACK_SET_SPEAKER_ENERGY_THRESHOLD, value) + callFunctionIfCallable(view_variable.CALLBACK_SET_SPEAKER_ENERGY_THRESHOLD, value) def checkbox_input_speaker_dynamic_energy_threshold_callback(checkbox_box_widget): - callFunctionIfCallable(config_window.CALLBACK_SET_SPEAKER_DYNAMIC_ENERGY_THRESHOLD, checkbox_box_widget.get()) + callFunctionIfCallable(view_variable.CALLBACK_SET_SPEAKER_DYNAMIC_ENERGY_THRESHOLD, checkbox_box_widget.get()) def entry_input_speaker_record_timeout_callback(value): - callFunctionIfCallable(config_window.CALLBACK_SET_SPEAKER_RECORD_TIMEOUT, value) + callFunctionIfCallable(view_variable.CALLBACK_SET_SPEAKER_RECORD_TIMEOUT, value) def entry_input_speaker_phrase_timeout_callback(value): - callFunctionIfCallable(config_window.CALLBACK_SET_SPEAKER_PHRASE_TIMEOUT, value) + callFunctionIfCallable(view_variable.CALLBACK_SET_SPEAKER_PHRASE_TIMEOUT, value) def entry_input_speaker_max_phrases_callback(value): - callFunctionIfCallable(config_window.CALLBACK_SET_SPEAKER_MAX_PHRASES, value) + callFunctionIfCallable(view_variable.CALLBACK_SET_SPEAKER_MAX_PHRASES, value) row=0 config_window.sb__speaker_device = createSettingBoxDropdownMenu( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_SPEAKER_DEVICE, - for_var_desc_text=config_window.view_variable.VAR_DESC_SPEAKER_DEVICE, + for_var_label_text=view_variable.VAR_LABEL_SPEAKER_DEVICE, + for_var_desc_text=view_variable.VAR_DESC_SPEAKER_DEVICE, optionmenu_attr_name="sb__optionmenu_speaker_device", dropdown_menu_attr_name="sb__dropdown_speaker_device", - dropdown_menu_values=config_window.view_variable.LIST_SPEAKER_DEVICE, + dropdown_menu_values=view_variable.LIST_SPEAKER_DEVICE, command=lambda value: optionmenu_input_speaker_device_callback(value), - variable=config_window.view_variable.VAR_SPEAKER_DEVICE, + variable=view_variable.VAR_SPEAKER_DEVICE, ) config_window.sb__speaker_device.grid(row=row) row+=1 @@ -73,15 +73,15 @@ def createSettingBox_Speaker(setting_box_wrapper, config_window, settings): config_window.sb__speaker_energy_threshold = createSettingBoxProgressbarXSlider( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_SPEAKER_ENERGY_THRESHOLD, - for_var_desc_text=config_window.view_variable.VAR_DESC_SPEAKER_ENERGY_THRESHOLD, + for_var_label_text=view_variable.VAR_LABEL_SPEAKER_ENERGY_THRESHOLD, + for_var_desc_text=view_variable.VAR_DESC_SPEAKER_ENERGY_THRESHOLD, command=slider_input_speaker_energy_threshold_callback, - variable=config_window.view_variable.VAR_SPEAKER_ENERGY_THRESHOLD, + variable=view_variable.VAR_SPEAKER_ENERGY_THRESHOLD, entry_attr_name="sb__progressbar_x_slider__entry_speaker_energy_threshold", slider_attr_name="progressbar_x_slider__slider_speaker_energy_threshold", - slider_range=config_window.view_variable.SLIDER_RANGE_SPEAKER_ENERGY_THRESHOLD, + slider_range=view_variable.SLIDER_RANGE_SPEAKER_ENERGY_THRESHOLD, progressbar_attr_name="sb__progressbar_x_slider__progressbar_speaker_energy_threshold", @@ -107,11 +107,11 @@ def createSettingBox_Speaker(setting_box_wrapper, config_window, settings): # Speaker Dynamic Energy Thresholdも上に引っ付ける予定 config_window.sb__speaker_dynamic_energy_threshold = createSettingBoxCheckbox( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_SPEAKER_DYNAMIC_ENERGY_THRESHOLD, - for_var_desc_text=config_window.view_variable.VAR_DESC_SPEAKER_DYNAMIC_ENERGY_THRESHOLD, + for_var_label_text=view_variable.VAR_LABEL_SPEAKER_DYNAMIC_ENERGY_THRESHOLD, + for_var_desc_text=view_variable.VAR_DESC_SPEAKER_DYNAMIC_ENERGY_THRESHOLD, checkbox_attr_name="sb__checkbox_speaker_dynamic_energy_threshold", command=lambda: checkbox_input_speaker_dynamic_energy_threshold_callback(config_window.sb__checkbox_speaker_dynamic_energy_threshold), - variable=config_window.view_variable.VAR_MIC_DYNAMIC_ENERGY_THRESHOLD, + variable=view_variable.VAR_MIC_DYNAMIC_ENERGY_THRESHOLD, ) config_window.sb__speaker_dynamic_energy_threshold.grid(row=row) row+=1 @@ -120,36 +120,36 @@ def createSettingBox_Speaker(setting_box_wrapper, config_window, settings): # 以下3つも一つの項目にまとめるかもしれない config_window.sb__speaker_record_timeout = createSettingBoxEntry( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_SPEAKER_RECORD_TIMEOUT, - for_var_desc_text=config_window.view_variable.VAR_DESC_SPEAKER_RECORD_TIMEOUT, + for_var_label_text=view_variable.VAR_LABEL_SPEAKER_RECORD_TIMEOUT, + for_var_desc_text=view_variable.VAR_DESC_SPEAKER_RECORD_TIMEOUT, entry_attr_name="sb__entry_speaker_record_timeout", entry_width=settings.uism.SB__ENTRY_WIDTH_100, entry_bind__Any_KeyRelease=lambda value: entry_input_speaker_record_timeout_callback(value), - entry_textvariable=config_window.view_variable.VAR_SPEAKER_RECORD_TIMEOUT, + entry_textvariable=view_variable.VAR_SPEAKER_RECORD_TIMEOUT, ) config_window.sb__speaker_record_timeout.grid(row=row) row+=1 config_window.sb__speaker_phrase_timeout = createSettingBoxEntry( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_SPEAKER_PHRASE_TIMEOUT, - for_var_desc_text=config_window.view_variable.VAR_DESC_SPEAKER_PHRASE_TIMEOUT, + for_var_label_text=view_variable.VAR_LABEL_SPEAKER_PHRASE_TIMEOUT, + for_var_desc_text=view_variable.VAR_DESC_SPEAKER_PHRASE_TIMEOUT, entry_attr_name="sb__entry_speaker_phrase_timeout", entry_width=settings.uism.SB__ENTRY_WIDTH_100, entry_bind__Any_KeyRelease=lambda value: entry_input_speaker_phrase_timeout_callback(value), - entry_textvariable=config_window.view_variable.VAR_SPEAKER_PHRASE_TIMEOUT, + entry_textvariable=view_variable.VAR_SPEAKER_PHRASE_TIMEOUT, ) config_window.sb__speaker_phrase_timeout.grid(row=row) row+=1 config_window.sb__speaker_max_phrases = createSettingBoxEntry( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_SPEAKER_MAX_PHRASES, - for_var_desc_text=config_window.view_variable.VAR_DESC_SPEAKER_MAX_PHRASES, + for_var_label_text=view_variable.VAR_LABEL_SPEAKER_MAX_PHRASES, + for_var_desc_text=view_variable.VAR_DESC_SPEAKER_MAX_PHRASES, entry_attr_name="sb__entry_speaker_max_phrases", entry_width=settings.uism.SB__ENTRY_WIDTH_100, entry_bind__Any_KeyRelease=lambda value: entry_input_speaker_max_phrases_callback(value), - entry_textvariable=config_window.view_variable.VAR_SPEAKER_MAX_PHRASES, + entry_textvariable=view_variable.VAR_SPEAKER_MAX_PHRASES, ) config_window.sb__speaker_max_phrases.grid(row=row) row+=1 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 1bdaa8b0..7096bbc2 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 @@ -2,24 +2,24 @@ from utils import callFunctionIfCallable from .._SettingBoxGenerator import _SettingBoxGenerator -def createSettingBox_Translation(setting_box_wrapper, config_window, settings): +def createSettingBox_Translation(setting_box_wrapper, config_window, settings, view_variable): sbg = _SettingBoxGenerator(config_window, settings) createSettingBoxEntry = sbg.createSettingBoxEntry def deepl_authkey_callback(value): - callFunctionIfCallable(config_window.CALLBACK_SET_DEEPL_AUTHKEY, value) + callFunctionIfCallable(view_variable.CALLBACK_SET_DEEPL_AUTHKEY, value) row=0 config_window.sb__deepl_authkey = createSettingBoxEntry( parent_widget=setting_box_wrapper, - for_var_label_text=config_window.view_variable.VAR_LABEL_DEEPL_AUTH_KEY, - for_var_desc_text=config_window.view_variable.VAR_DESC_DEEPL_AUTH_KEY, + for_var_label_text=view_variable.VAR_LABEL_DEEPL_AUTH_KEY, + for_var_desc_text=view_variable.VAR_DESC_DEEPL_AUTH_KEY, entry_attr_name="sb__deepl_authkey", entry_width=settings.uism.SB__ENTRY_WIDTH_300, entry_bind__Any_KeyRelease=lambda value: deepl_authkey_callback(value), - entry_textvariable=config_window.view_variable.VAR_DEEPL_AUTH_KEY, + entry_textvariable=view_variable.VAR_DEEPL_AUTH_KEY, ) config_window.sb__deepl_authkey.grid(row=row) row+=1 \ No newline at end of file From ca669f9fec280e60db6e5a6b9ce50e0ac63801e3 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Mon, 4 Sep 2023 23:08:28 +0900 Subject: [PATCH 5/5] =?UTF-8?q?[bugfix]=20view.py=20OSC=5FIP=5FADDRESS?= =?UTF-8?q?=E3=81=AB=E5=85=A5=E3=82=8C=E3=82=8BTkinter=E5=A4=89=E6=95=B0?= =?UTF-8?q?=E3=81=AE=E5=9E=8B=E6=8C=87=E5=AE=9A=E3=83=9F=E3=82=B9=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20int=E5=9E=8B=E3=81=8B=E3=82=89str=E5=9E=8B=E3=81=AB?= =?UTF-8?q?=E3=80=82=20=E4=BB=8A=E3=81=BE=E3=81=A7=E3=81=AFint=E5=9E=8B?= =?UTF-8?q?=E3=81=A7=E6=8C=87=E5=AE=9A=E3=81=97=E3=81=A6=E3=81=84=E3=81=9F?= =?UTF-8?q?=E3=81=AE=E3=81=A7=E3=80=81127.0.0.1=E3=81=AA=E3=81=A9=E3=81=AF?= =?UTF-8?q?float=E3=81=A8=E3=81=97=E3=81=A6=E8=AA=8D=E8=AD=98=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=A6=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=8C=E3=81=A7?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 4 ++-- view.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 4a36015e..a83154f3 100644 --- a/main.py +++ b/main.py @@ -350,8 +350,8 @@ def callbackSetMessageFormat(value): # Advanced Settings Tab def callbackSetOscIpAddress(value): - print("callbackSetOscIpAddress", value) - config.OSC_IP_ADDRESS = value + print("callbackSetOscIpAddress", str(value)) + config.OSC_IP_ADDRESS = str(value) def callbackSetOscPort(value): print("callbackSetOscPort", int(value)) diff --git a/view.py b/view.py index 37b362ad..ccd98abd 100644 --- a/view.py +++ b/view.py @@ -202,7 +202,7 @@ class View(): VAR_LABEL_OSC_IP_ADDRESS=StringVar(value="OSC IP Address"), VAR_DESC_OSC_IP_ADDRESS=StringVar(value="(Default: 127.0.0.1)"), CALLBACK_SET_OSC_IP_ADDRESS=None, - VAR_OSC_IP_ADDRESS=IntVar(value=config.OSC_IP_ADDRESS), + VAR_OSC_IP_ADDRESS=StringVar(value=config.OSC_IP_ADDRESS), VAR_LABEL_OSC_PORT=StringVar(value="OSC Port"), VAR_DESC_OSC_PORT=StringVar(value="(Default: 9000)"),