[Update] Config Window: Auto Export Message Logs. add open file(logs) button.

This commit is contained in:
Sakamoto Shiina
2023-11-06 12:31:49 +09:00
parent d396a56721
commit 5d6902c196
6 changed files with 75 additions and 2 deletions

View File

@@ -13,6 +13,9 @@ def callbackUpdateSoftware():
def callbackRestartSoftware():
model.reStartSoftware()
def callbackFilepathLogs():
print("callbackFilepathLogs")
# func transcription send message
def sendMicMessage(message):
if len(message) > 0:
@@ -700,6 +703,7 @@ def createMainWindow():
common_registers={
"callback_update_software": callbackUpdateSoftware,
"callback_restart_software": callbackRestartSoftware,
"callback_filepath_logs": callbackFilepathLogs,
},
window_action_registers={

BIN
img/folder_open_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

View File

@@ -82,6 +82,7 @@ class View():
# Common
CALLBACK_RESTART_SOFTWARE=None,
CALLBACK_UPDATE_SOFTWARE=None,
CALLBACK_OPEN_FILEPATH_LOGS=None,
CALLBACK_QUIT_VRCT=vrct_gui._quitVRCT,
@@ -400,6 +401,7 @@ class View():
if common_registers is not None:
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)
if window_action_registers is not None:

View File

@@ -254,6 +254,67 @@ class _SettingBoxGenerator():
def createSettingBoxAutoExportMessageLogs(
self,
for_var_label_text, for_var_desc_text,
checkbox_attr_name,
checkbox_command,
button_command,
variable,
):
(setting_box_frame, setting_box_item_frame) = self._createSettingBoxFrame(checkbox_attr_name, for_var_label_text, for_var_desc_text)
all_wrapper = CTkFrame(setting_box_item_frame, corner_radius=0, fg_color=self.settings.ctm.SB__BG_COLOR, width=0, height=0)
all_wrapper.grid(row=1, column=0, sticky="ew")
all_wrapper.grid_columnconfigure(1, weight=1)
button_widget = createButtonWithImage(
parent_widget=all_wrapper,
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=self.settings.image_file.FOLDER_OPEN_ICON,
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_widget.grid(row=0, column=0, padx=0, sticky="w")
checkbox_widget = CTkCheckBox(
all_wrapper,
text=None,
width=0,
checkbox_width=self.settings.uism.SB__CHECKBOX_SIZE,
checkbox_height=self.settings.uism.SB__CHECKBOX_SIZE,
onvalue=True,
offvalue=False,
variable=variable,
command=checkbox_command,
corner_radius=self.settings.uism.SB__CHECKBOX_CORNER_RADIUS,
border_width=self.settings.uism.SB__CHECKBOX_BORDER_WIDTH,
border_color=self.settings.ctm.SB__CHECKBOX_BORDER_COLOR,
hover_color=self.settings.ctm.SB__CHECKBOX_HOVER_COLOR,
checkmark_color=self.settings.ctm.SB__CHECKBOX_CHECKMARK_COLOR,
fg_color=self.settings.ctm.SB__CHECKBOX_CHECKED_COLOR,
)
setattr(self.config_window, checkbox_attr_name, checkbox_widget)
checkbox_widget.grid(row=0, column=2, sticky="e")
return setting_box_frame
def createSettingBoxSlider(

View File

@@ -5,6 +5,7 @@ from .._SettingBoxGenerator import _SettingBoxGenerator
def createSettingBox_Others(setting_box_wrapper, config_window, settings, view_variable):
sbg = _SettingBoxGenerator(setting_box_wrapper, config_window, settings, view_variable)
createSettingBoxCheckbox = sbg.createSettingBoxCheckbox
createSettingBoxAutoExportMessageLogs = sbg.createSettingBoxAutoExportMessageLogs
createSettingBox_Labels = sbg.createSettingBox_Labels
createSettingBoxMessageFormatEntries = sbg.createSettingBoxMessageFormatEntries
@@ -19,6 +20,9 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings, view_v
def checkbox_auto_export_message_logs_callback(checkbox_box_widget):
callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_AUTO_EXPORT_MESSAGE_LOGS, checkbox_box_widget.get())
def button_auto_export_message_logs_callback():
callFunctionIfCallable(view_variable.CALLBACK_OPEN_FILEPATH_LOGS)
def checkbox_enable_send_message_to_vrc_callback(checkbox_box_widget):
callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_SEND_MESSAGE_TO_VRC, checkbox_box_widget.get())
@@ -53,11 +57,12 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings, view_v
row+=1
config_window.sb__auto_export_message_logs = createSettingBoxCheckbox(
config_window.sb__auto_export_message_logs = createSettingBoxAutoExportMessageLogs(
for_var_label_text=view_variable.VAR_LABEL_ENABLE_AUTO_EXPORT_MESSAGE_LOGS,
for_var_desc_text=view_variable.VAR_DESC_ENABLE_AUTO_EXPORT_MESSAGE_LOGS,
checkbox_attr_name="sb__checkbox_auto_export_message_logs",
command=lambda: checkbox_auto_export_message_logs_callback(config_window.sb__checkbox_auto_export_message_logs),
checkbox_command=lambda: checkbox_auto_export_message_logs_callback(config_window.sb__checkbox_auto_export_message_logs),
button_command=lambda _e: button_auto_export_message_logs_callback(),
variable=view_variable.VAR_ENABLE_AUTO_EXPORT_MESSAGE_LOGS,
)
config_window.sb__auto_export_message_logs.grid(row=row)

View File

@@ -306,6 +306,7 @@ def _darkTheme(base_color):
CANCEL_ICON = getImageFileFromUiUtils("cancel_icon.png"),
REDO_ICON = getImageFileFromUiUtils("redo_white.png"),
SWAP_ICON = getImageFileFromUiUtils("swap_icon.png"),
FOLDER_OPEN_ICON = getImageFileFromUiUtils("folder_open_icon.png"),
),
)