diff --git a/controller.py b/controller.py index a26e7c8e..421330a8 100644 --- a/controller.py +++ b/controller.py @@ -16,6 +16,9 @@ def callbackRestartSoftware(): def callbackFilepathLogs(): print("callbackFilepathLogs") +def callbackFilepathConfigFile(): + print("callbackFilepathConfigFile") + # func transcription send message def sendMicMessage(message): if len(message) > 0: @@ -704,6 +707,7 @@ def createMainWindow(): "callback_update_software": callbackUpdateSoftware, "callback_restart_software": callbackRestartSoftware, "callback_filepath_logs": callbackFilepathLogs, + "callback_filepath_config_file": callbackFilepathConfigFile, }, window_action_registers={ diff --git a/locales/en.yml b/locales/en.yml index 9bce45f3..887d3a92 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -193,4 +193,7 @@ config_window: label: OSC IP Address osc_port: - label: OSC Port \ No newline at end of file + label: OSC Port + + open_config_filepath: + label: Open Config File \ No newline at end of file diff --git a/locales/ja.yml b/locales/ja.yml index c0e9cc11..313c991f 100644 --- a/locales/ja.yml +++ b/locales/ja.yml @@ -192,4 +192,7 @@ config_window: label: OSC IP Address osc_port: - label: OSC Port \ No newline at end of file + label: OSC Port + + open_config_filepath: + label: 設定ファイルを開く \ No newline at end of file diff --git a/view.py b/view.py index 3979439c..f7250b9f 100644 --- a/view.py +++ b/view.py @@ -83,6 +83,7 @@ class View(): CALLBACK_RESTART_SOFTWARE=None, CALLBACK_UPDATE_SOFTWARE=None, CALLBACK_OPEN_FILEPATH_LOGS=None, + CALLBACK_OPEN_FILEPATH_CONFIG_FILE=None, CALLBACK_QUIT_VRCT=vrct_gui._quitVRCT, @@ -385,6 +386,9 @@ class View(): VAR_DESC_OSC_PORT=None, CALLBACK_SET_OSC_PORT=None, VAR_OSC_PORT=StringVar(value=config.OSC_PORT), + + VAR_LABEL_OPEN_CONFIG_FILEPATH=StringVar(value=i18n.t("config_window.open_config_filepath.label")), + VAR_DESC_OPEN_CONFIG_FILEPATH=None, ) @@ -402,6 +406,7 @@ class View(): self.view_variable.CALLBACK_UPDATE_SOFTWARE=common_registers.get("callback_update_software", None) self.view_variable.CALLBACK_RESTART_SOFTWARE=common_registers.get("callback_restart_software", None) self.view_variable.CALLBACK_OPEN_FILEPATH_LOGS=common_registers.get("callback_filepath_logs", None) + self.view_variable.CALLBACK_OPEN_FILEPATH_CONFIG_FILE=common_registers.get("callback_filepath_config_file", None) if window_action_registers is not None: diff --git a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/_SettingBoxGenerator.py b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/_SettingBoxGenerator.py index 28e99364..c08f95bc 100644 --- a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/_SettingBoxGenerator.py +++ b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/_SettingBoxGenerator.py @@ -740,6 +740,33 @@ class _SettingBoxGenerator(): + def createSettingBoxButtonWithImage( + self, + for_var_label_text, for_var_desc_text, + button_attr_name, + button_image, + button_command, + ): + + (setting_box_frame, setting_box_item_frame) = self._createSettingBoxFrame(button_attr_name, for_var_label_text, for_var_desc_text) + + + button_with_image_widget = createButtonWithImage( + parent_widget=setting_box_item_frame, + button_fg_color=self.settings.ctm.SB__ARROW_SWITCH_BUTTON_COLOR, + button_enter_color=self.settings.ctm.SB__ARROW_SWITCH_BUTTON_HOVERED_COLOR, + button_clicked_color=self.settings.ctm.SB__ARROW_SWITCH_BUTTON_CLICKED_COLOR, + button_image_file=button_image, + button_image_size=self.settings.uism.SB__ARROW_SWITCH_BUTTON_ICON_SIZE, + button_ipadxy=self.settings.uism.SB__ARROW_SWITCH_BUTTON_IPADXY, + button_command=button_command, + ) + button_with_image_widget.grid(row=1, column=SETTING_BOX_COLUMN, padx=self.settings.uism.SB__ARROW_SWITCH_LEFT_PADX, sticky="e") + + return setting_box_frame + + + def createSettingBoxArrowSwitch( self, 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 4c6ef337..bb305ecf 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 @@ -5,6 +5,7 @@ from .._SettingBoxGenerator import _SettingBoxGenerator def createSettingBox_AdvancedSettings(setting_box_wrapper, config_window, settings, view_variable): sbg = _SettingBoxGenerator(setting_box_wrapper, config_window, settings, view_variable) createSettingBoxEntry = sbg.createSettingBoxEntry + createSettingBoxButtonWithImage = sbg.createSettingBoxButtonWithImage def entry_ip_address_callback(value): @@ -13,6 +14,9 @@ def createSettingBox_AdvancedSettings(setting_box_wrapper, config_window, settin def entry_port_callback(value): callFunctionIfCallable(view_variable.CALLBACK_SET_OSC_PORT, value) + def open_config_filepath_callback(): + callFunctionIfCallable(view_variable.CALLBACK_OPEN_FILEPATH_CONFIG_FILE) + row=0 config_window.sb__ip_address = createSettingBoxEntry( for_var_label_text=view_variable.VAR_LABEL_OSC_IP_ADDRESS, @@ -34,5 +38,15 @@ def createSettingBox_AdvancedSettings(setting_box_wrapper, config_window, settin entry_bind__Any_KeyRelease=lambda value: entry_port_callback(value), entry_textvariable=view_variable.VAR_OSC_PORT, ) - config_window.sb__port.grid(row=row, pady=0) + config_window.sb__port.grid(row=row) row+=1 + + config_window.sb__open_config_filepath = createSettingBoxButtonWithImage( + for_var_label_text=view_variable.VAR_LABEL_OPEN_CONFIG_FILEPATH, + for_var_desc_text=view_variable.VAR_DESC_OPEN_CONFIG_FILEPATH, + button_attr_name="sb__button_open_config_filepath", + button_command=lambda _e: open_config_filepath_callback(), + button_image=settings.image_file.FOLDER_OPEN_ICON, + ) + config_window.sb__open_config_filepath.grid(row=row, pady=0) + row+=1 \ No newline at end of file