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] =?UTF-8?q?[bugifx]=20Config=20Window:=20view=5Fvariable(v?= =?UTF-8?q?iew.py=E5=A4=89=E6=95=B0)=E3=81=AE=E5=8F=82=E7=85=A7=E3=81=AE?= =?UTF-8?q?=E4=BB=95=E6=96=B9=E3=81=8C=E3=81=8A=E3=81=8B=E3=81=97=E3=81=8F?= =?UTF-8?q?=E3=80=81=E6=84=8F=E5=9B=B3=E3=81=97=E3=81=9F=E5=80=A4=E3=81=AE?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E3=81=A8=E5=8F=82=E7=85=A7=E3=81=8C=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F?= =?UTF-8?q?=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