Merge branch 'chore' into config_window

This commit is contained in:
Sakamoto Shiina
2023-09-01 03:37:27 +09:00
9 changed files with 21 additions and 32 deletions

View File

@@ -359,13 +359,13 @@ class Config:
saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value) saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value)
@property @property
def ENABLE_AUTO_CLEAR_CHATBOX(self): def ENABLE_AUTO_CLEAR_MESSAGE_BOX(self):
return self._ENABLE_AUTO_CLEAR_CHATBOX return self._ENABLE_AUTO_CLEAR_MESSAGE_BOX
@ENABLE_AUTO_CLEAR_CHATBOX.setter @ENABLE_AUTO_CLEAR_MESSAGE_BOX.setter
def ENABLE_AUTO_CLEAR_CHATBOX(self, value): def ENABLE_AUTO_CLEAR_MESSAGE_BOX(self, value):
if type(value) is bool: if type(value) is bool:
self._ENABLE_AUTO_CLEAR_CHATBOX = value self._ENABLE_AUTO_CLEAR_MESSAGE_BOX = value
saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value) saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value)
@property @property
@@ -493,7 +493,7 @@ class Config:
"Google(web)": None, "Google(web)": None,
} }
self._MESSAGE_FORMAT = "[message]([translation])" self._MESSAGE_FORMAT = "[message]([translation])"
self._ENABLE_AUTO_CLEAR_CHATBOX = False self._ENABLE_AUTO_CLEAR_MESSAGE_BOX = False
self._ENABLE_NOTICE_XSOVERLAY = False self._ENABLE_NOTICE_XSOVERLAY = False
self._ENABLE_OSC = False self._ENABLE_OSC = False
self._UPDATE_FLAG = False self._UPDATE_FLAG = False

10
main.py
View File

@@ -90,7 +90,7 @@ def sendChatMessage(message):
view.printToTextbox_SentMessage(message, translation) view.printToTextbox_SentMessage(message, translation)
# delete message in entry message box # delete message in entry message box
if config.ENABLE_AUTO_CLEAR_CHATBOX is True: if config.ENABLE_AUTO_CLEAR_MESSAGE_BOX is True:
view.clearMessageBox() view.clearMessageBox()
def messageBoxPressKeyEnter(e): def messageBoxPressKeyEnter(e):
@@ -344,9 +344,9 @@ def callbackSetSpeakerMaxPhrases(value):
# Others Tab # Others Tab
def callbackSetEnableAutoClearChatbox(value): def callbackSetEnableAutoClearMessageBox(value):
print("callbackSetEnableAutoClearChatbox", value) print("callbackSetEnableAutoClearMessageBox", value)
config.ENABLE_AUTO_CLEAR_CHATBOX = value config.ENABLE_AUTO_CLEAR_MESSAGE_BOX = value
def callbackSetEnableNoticeXsoverlay(value): def callbackSetEnableNoticeXsoverlay(value):
print("callbackSetEnableNoticeXsoverlay", value) print("callbackSetEnableNoticeXsoverlay", value)
@@ -446,7 +446,7 @@ view.register(
"callback_set_speaker_max_phrases": callbackSetSpeakerMaxPhrases, "callback_set_speaker_max_phrases": callbackSetSpeakerMaxPhrases,
# Others Tab # Others Tab
"callback_set_enable_auto_clear_chatbox": callbackSetEnableAutoClearChatbox, "callback_set_enable_auto_clear_chatbox": callbackSetEnableAutoClearMessageBox,
"callback_set_enable_notice_xsoverlay": callbackSetEnableNoticeXsoverlay, "callback_set_enable_notice_xsoverlay": callbackSetEnableNoticeXsoverlay,
"callback_set_message_format": callbackSetMessageFormat, "callback_set_message_format": callbackSetMessageFormat,

View File

@@ -102,7 +102,7 @@ class View():
vrct_gui.config_window.CALLBACK_SET_SPEAKER_MAX_PHRASES = config_window["callback_set_speaker_max_phrases"] vrct_gui.config_window.CALLBACK_SET_SPEAKER_MAX_PHRASES = config_window["callback_set_speaker_max_phrases"]
# Others Tab # Others Tab
vrct_gui.config_window.CALLBACK_SET_ENABLE_AUTO_CLEAR_CHATBOX = config_window["callback_set_enable_auto_clear_chatbox"] vrct_gui.config_window.CALLBACK_SET_ENABLE_AUTO_CLEAR_MESSAGE_BOX = config_window["callback_set_enable_auto_clear_chatbox"]
vrct_gui.config_window.CALLBACK_SET_ENABLE_NOTICE_XSOVERLAY = config_window["callback_set_enable_notice_xsoverlay"] vrct_gui.config_window.CALLBACK_SET_ENABLE_NOTICE_XSOVERLAY = config_window["callback_set_enable_notice_xsoverlay"]
vrct_gui.config_window.CALLBACK_SET_MESSAGE_FORMAT = config_window["callback_set_message_format"] vrct_gui.config_window.CALLBACK_SET_MESSAGE_FORMAT = config_window["callback_set_message_format"]

View File

@@ -51,7 +51,7 @@ class ConfigWindow(CTkToplevel):
self.CALLBACK_SET_SPEAKER_MAX_PHRASES = None self.CALLBACK_SET_SPEAKER_MAX_PHRASES = None
# Others Tab # Others Tab
self.CALLBACK_SET_ENABLE_AUTO_CLEAR_CHATBOX = None self.CALLBACK_SET_ENABLE_AUTO_CLEAR_MESSAGE_BOX = None
self.CALLBACK_SET_ENABLE_NOTICE_XSOVERLAY = None self.CALLBACK_SET_ENABLE_NOTICE_XSOVERLAY = None
self.CALLBACK_SET_MESSAGE_FORMAT = None self.CALLBACK_SET_MESSAGE_FORMAT = None

View File

@@ -19,7 +19,6 @@ def _createSettingBoxContainer(config_window, settings, setting_box_container_se
return setting_box_wrapper_section_title_frame return setting_box_wrapper_section_title_frame
# Common setting
# Setting box container # Setting box container
setting_box_container_widget = CTkFrame(config_window.main_setting_box_bg_wrapper, corner_radius=0, fg_color=settings.ctm.MAIN_BG_COLOR, width=0, height=0) setting_box_container_widget = CTkFrame(config_window.main_setting_box_bg_wrapper, corner_radius=0, fg_color=settings.ctm.MAIN_BG_COLOR, width=0, height=0)

View File

@@ -1,5 +1,3 @@
from time import sleep
from customtkinter import StringVar, IntVar from customtkinter import StringVar, IntVar
from utils import callFunctionIfCallable from utils import callFunctionIfCallable

View File

@@ -1,11 +1,8 @@
from time import sleep
from customtkinter import StringVar, IntVar from customtkinter import StringVar, IntVar
from tkinter import font as tk_font from tkinter import font as tk_font
from languages import selectable_languages from languages import selectable_languages
from utils import get_key_by_value, callFunctionIfCallable from utils import get_key_by_value, callFunctionIfCallable
from .._SettingBoxGenerator import _SettingBoxGenerator from .._SettingBoxGenerator import _SettingBoxGenerator
from config import config from config import config
@@ -16,7 +13,7 @@ def createSettingBox_Appearance(setting_box_wrapper, config_window, settings):
createSettingBoxSlider = sbg.createSettingBoxSlider createSettingBoxSlider = sbg.createSettingBoxSlider
# 関数名は変えるかもしれない。 # 関数名は変えるかもしれない。
# テーマ変更、フォント変更時、 Widget再生成か再起動かは検討中\ # テーマ変更、フォント変更時、 Widget再生成か再起動かは検討中
def slider_transparency_callback(value): def slider_transparency_callback(value):
callFunctionIfCallable(config_window.CALLBACK_SET_TRANSPARENCY, value) callFunctionIfCallable(config_window.CALLBACK_SET_TRANSPARENCY, value)
@@ -25,7 +22,6 @@ def createSettingBox_Appearance(setting_box_wrapper, config_window, settings):
def optionmenu_ui_scaling_callback(value): def optionmenu_ui_scaling_callback(value):
callFunctionIfCallable(config_window.CALLBACK_SET_UI_SCALING, value) callFunctionIfCallable(config_window.CALLBACK_SET_UI_SCALING, value)
# self.optionmenu_ui_scaling.set(choice)
def optionmenu_font_family_callback(value): def optionmenu_font_family_callback(value):
callFunctionIfCallable(config_window.CALLBACK_SET_FONT_FAMILY, value) callFunctionIfCallable(config_window.CALLBACK_SET_FONT_FAMILY, value)

View File

@@ -1,5 +1,3 @@
from time import sleep
from customtkinter import StringVar, IntVar from customtkinter import StringVar, IntVar
from utils import callFunctionIfCallable from utils import callFunctionIfCallable
@@ -14,9 +12,9 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings):
createSettingBoxEntry = sbg.createSettingBoxEntry createSettingBoxEntry = sbg.createSettingBoxEntry
# 関数名 chatbox から messagebox に変える予定 config.ENABLE_AUTO_CLEAR_CHATBOX も MESSAGEBOXに変えるかな。 # 元 checkbox_auto_clear_chatbox_callback
def checkbox_auto_clear_chatbox_callback(checkbox_box_widget): def checkbox_auto_clear_message_box_callback(checkbox_box_widget):
callFunctionIfCallable(config_window.CALLBACK_SET_ENABLE_AUTO_CLEAR_CHATBOX, checkbox_box_widget.get()) callFunctionIfCallable(config_window.CALLBACK_SET_ENABLE_AUTO_CLEAR_MESSAGE_BOX, checkbox_box_widget.get())
def checkbox_notice_xsoverlay_callback(checkbox_box_widget): def checkbox_notice_xsoverlay_callback(checkbox_box_widget):
callFunctionIfCallable(config_window.CALLBACK_SET_ENABLE_NOTICE_XSOVERLAY, checkbox_box_widget.get()) callFunctionIfCallable(config_window.CALLBACK_SET_ENABLE_NOTICE_XSOVERLAY, checkbox_box_widget.get())
@@ -26,15 +24,15 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings):
row=0 row=0
config_window.sb__auto_clear_chatbox = createSettingBoxCheckbox( config_window.sb__auto_clear_message_box = createSettingBoxCheckbox(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="Auto Clear The Message Box", label_text="Auto Clear The Message Box",
desc_text="Clear the message box after sending your message.", desc_text="Clear the message box after sending your message.",
checkbox_attr_name="sb__checkbox_auto_clear_chatbox", checkbox_attr_name="sb__checkbox_auto_clear_message_box",
command=lambda: checkbox_auto_clear_chatbox_callback(config_window.sb__checkbox_auto_clear_chatbox), command=lambda: checkbox_auto_clear_message_box_callback(config_window.sb__checkbox_auto_clear_message_box),
is_checked=False is_checked=False
) )
config_window.sb__auto_clear_chatbox.grid(row=row) config_window.sb__auto_clear_message_box.grid(row=row)
row+=1 row+=1

View File

@@ -1,5 +1,3 @@
from time import sleep
from customtkinter import StringVar, IntVar from customtkinter import StringVar, IntVar
from utils import callFunctionIfCallable from utils import callFunctionIfCallable