Config Window 各設定項目を変数化し、ctk variableなど全てview.pyに移動。

vrct_gui以下ではconfig.pyを使わないように切り離した。
CTkScrollableDropdownを使うことをやめた。(grab_setと干渉するため)
This commit is contained in:
Sakamoto Shiina
2023-09-02 02:19:23 +09:00
parent 3affcc1ee6
commit 2ee8eca63b
12 changed files with 337 additions and 205 deletions

View File

@@ -2,6 +2,8 @@ from threading import Thread
from config import config from config import config
from model import model from model import model
from view import view from view import view
from utils import get_key_by_value
from languages import selectable_languages
# func transcription send message # func transcription send message
def sendMicMessage(message): def sendMicMessage(message):
@@ -244,6 +246,8 @@ def callbackSetFontFamily(value):
def callbackSetUiLanguage(value): def callbackSetUiLanguage(value):
print("callbackSetUiLanguage", value) print("callbackSetUiLanguage", value)
value = get_key_by_value(selectable_languages, value)
print("callbackSetUiLanguage__after_get_key_by_value", value)
config.UI_LANGUAGE = value config.UI_LANGUAGE = value
# Translation Tab # Translation Tab

186
view.py
View File

@@ -1,6 +1,8 @@
from types import SimpleNamespace from types import SimpleNamespace
from tkinter import font as tk_font
from languages import selectable_languages
from customtkinter import StringVar, END as CTK_END, get_appearance_mode from customtkinter import StringVar, IntVar, BooleanVar, END as CTK_END, get_appearance_mode
from vrct_gui.ui_managers import ColorThemeManager, ImageFilenameManager, UiScalingManager from vrct_gui.ui_managers import ColorThemeManager, ImageFilenameManager, UiScalingManager
from vrct_gui import vrct_gui from vrct_gui import vrct_gui
@@ -34,6 +36,170 @@ class View():
**common_args **common_args
) )
self.view_variable = SimpleNamespace(
VAR_LABEL_TRANSPARENCY=StringVar(value="Transparency"),
VAR_DESC_TRANSPARENCY=StringVar(value="Change the window's transparency. 50% to 100%. (Default: 100%)"),
SLIDER_RANGE_TRANSPARENCY=(50, 100),
CALLBACK_SET_TRANSPARENCY=None,
VAR_TRANSPARENCY=IntVar(value=config.TRANSPARENCY),
VAR_LABEL_APPEARANCE_THEME=StringVar(value="Theme"),
VAR_DESC_APPEARANCE_THEME=StringVar(value="Change the color theme from \"Light\" and \"Dark\". If you select \"System\", It will adjust based on your Windows theme. (Default: System)"),
LIST_APPEARANCE_THEME=["Light", "Dark", "System"],
CALLBACK_SET_APPEARANCE_THEME=None,
VAR_APPEARANCE_THEME=StringVar(value=config.APPEARANCE_THEME),
VAR_LABEL_UI_SCALING=StringVar(value="UI Size"),
VAR_DESC_UI_SCALING=StringVar(value="(Default: 100%)"),
LIST_UI_SCALING=["80%", "90%", "100%", "110%", "120%"],
CALLBACK_SET_UI_SCALING=None,
VAR_UI_SCALING=StringVar(value=config.UI_SCALING),
VAR_LABEL_FONT_FAMILY=StringVar(value="Font Family"),
VAR_DESC_FONT_FAMILY=StringVar(value="(Default: Yu Gothic UI)"),
LIST_FONT_FAMILY=list(tk_font.families()),
CALLBACK_SET_FONT_FAMILY=None,
VAR_FONT_FAMILY=StringVar(value=config.FONT_FAMILY),
VAR_LABEL_UI_LANGUAGE=StringVar(value="UI Language"),
VAR_DESC_UI_LANGUAGE=StringVar(value="(Default: English)"),
LIST_UI_LANGUAGE=list(selectable_languages.values()),
CALLBACK_SET_UI_LANGUAGE=None,
VAR_UI_LANGUAGE=StringVar(value=selectable_languages[config.UI_LANGUAGE]),
VAR_LABEL_DEEPL_AUTH_KEY=StringVar(value="DeepL Auth Key"),
VAR_DESC_DEEPL_AUTH_KEY=None,
# VAR_DESC_DEEPL_AUTH_KEY=StringVar(value=""),
CALLBACK_SET_DEEPL_AUTH_KEY=None,
VAR_DEEPL_AUTH_KEY=StringVar(value=config.AUTH_KEYS["DeepL(auth)"]),
VAR_LABEL_MIC_HOST=StringVar(value="Mic Host"),
VAR_DESC_MIC_HOST=StringVar(value="Select the mic host. (Default: ?)"),
LIST_MIC_HOST=[], # model.getListInputHost(),
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(),
CALLBACK_SET_MIC_DEVICE=None,
VAR_MIC_DEVICE=StringVar(value=config.CHOICE_MIC_DEVICE),
VAR_LABEL_MIC_ENERGY_THRESHOLD=StringVar(value="Mic Energy Threshold"),
VAR_DESC_MIC_ENERGY_THRESHOLD=StringVar(value="Slider to modify the threshold for activating voice input.\nPress the microphone button to start input and speak something, so you can adjust it while monitoring the actual volume. 0 to 2000 (Default: 300)"),
SLIDER_RANGE_MIC_ENERGY_THRESHOLD=(0, config.MAX_MIC_ENERGY_THRESHOLD),
CALLBACK_CHECK_MIC_THRESHOLD=None,
VAR_MIC_ENERGY_THRESHOLD=IntVar(value=config.INPUT_MIC_ENERGY_THRESHOLD),
VAR_LABEL_MIC_DYNAMIC_ENERGY_THRESHOLD=StringVar(value="Mic Dynamic Energy Threshold"),
VAR_DESC_MIC_DYNAMIC_ENERGY_THRESHOLD=StringVar(value="When this feature is selected, it will automatically adjust in a way that works well, based on the set Mic Energy Threshold."),
CALLBACK_SET_MIC_DYNAMIC_ENERGY_THRESHOLD=None,
VAR_MIC_DYNAMIC_ENERGY_THRESHOLD=BooleanVar(value=config.INPUT_MIC_DYNAMIC_ENERGY_THRESHOLD),
VAR_LABEL_MIC_RECORD_TIMEOUT=StringVar(value="Mic Record Timeout"),
VAR_DESC_MIC_RECORD_TIMEOUT=StringVar(value="(Default: 3)"),
CALLBACK_SET_MIC_RECORD_TIMEOUT=None,
VAR_MIC_RECORD_TIMEOUT=IntVar(value=config.INPUT_MIC_RECORD_TIMEOUT),
VAR_LABEL_MIC_PHRASE_TIMEOUT=StringVar(value="Mic Phrase Timeout"),
VAR_DESC_MIC_PHRASE_TIMEOUT=StringVar(value="(Default: 3)"),
CALLBACK_SET_MIC_PHRASE_TIMEOUT=None,
VAR_MIC_PHRASE_TIMEOUT=IntVar(value=config.INPUT_MIC_PHRASE_TIMEOUT),
VAR_LABEL_MIC_MAX_PHRASES=StringVar(value="Mic Max Phrases"),
VAR_DESC_MIC_MAX_PHRASES=StringVar(value="It will stop recording and send the recordings when the set count of phrase(s) is reached. (Default: 10)"),
CALLBACK_SET_MIC_MAX_PHRASES=None,
VAR_MIC_MAX_PHRASES=IntVar(value=config.INPUT_MIC_MAX_PHRASES),
VAR_LABEL_MIC_WORD_FILTER=StringVar(value="Mic Word Filter"),
VAR_DESC_MIC_WORD_FILTER=StringVar(value="It will not send the sentence if the word(s) included in the set list of words.\nHow to set: e.g. AAA,BBB,CCC"),
CALLBACK_SET_MIC_WORD_FILTER=None,
VAR_MIC_WORD_FILTER=StringVar(value=",".join(config.INPUT_MIC_WORD_FILTER) if len(config.INPUT_MIC_WORD_FILTER) > 0 else ""),
VAR_LABEL_SPEAKER_DEVICE=StringVar(value="Speaker Device"),
VAR_DESC_SPEAKER_DEVICE=StringVar(value="Select the speaker devise. (Default: ?)"),
LIST_SPEAKER_DEVICE=[], # model.getListOutputDevice(),
CALLBACK_SET_SPEAKER_DEVICE=None,
VAR_SPEAKER_DEVICE=StringVar(value=config.CHOICE_SPEAKER_DEVICE),
VAR_LABEL_SPEAKER_ENERGY_THRESHOLD=StringVar(value="Mic Energy Threshold"),
VAR_DESC_SPEAKER_ENERGY_THRESHOLD=StringVar(value="Slider to modify the threshold for activating voice input.\nPress the headphones mark button to start input and speak something, so you can adjust it while monitoring the actual volume. 0 to 4000 (Default: 300)"),
SLIDER_RANGE_SPEAKER_ENERGY_THRESHOLD=(0, config.MAX_SPEAKER_ENERGY_THRESHOLD),
CALLBACK_CHECK_SPEAKER_THRESHOLD=None,
VAR_SPEAKER_ENERGY_THRESHOLD=IntVar(value=config.INPUT_SPEAKER_ENERGY_THRESHOLD),
VAR_LABEL_SPEAKER_DYNAMIC_ENERGY_THRESHOLD=StringVar(value="Speaker Dynamic Energy Threshold"),
VAR_DESC_SPEAKER_DYNAMIC_ENERGY_THRESHOLD=StringVar(value="When this feature is selected, it will automatically adjust in a way that works well, based on the set Speaker Energy Threshold."),
CALLBACK_SET_SPEAKER_DYNAMIC_ENERGY_THRESHOLD=None,
VAR_SPEAKER_DYNAMIC_ENERGY_THRESHOLD=BooleanVar(value=config.INPUT_SPEAKER_DYNAMIC_ENERGY_THRESHOLD),
VAR_LABEL_SPEAKER_RECORD_TIMEOUT=StringVar(value="Speaker Record Timeout"),
VAR_DESC_SPEAKER_RECORD_TIMEOUT=StringVar(value="(Default: 3)"),
CALLBACK_SET_SPEAKER_RECORD_TIMEOUT=None,
VAR_SPEAKER_RECORD_TIMEOUT=IntVar(value=config.INPUT_SPEAKER_RECORD_TIMEOUT),
VAR_LABEL_SPEAKER_PHRASE_TIMEOUT=StringVar(value="Speaker Phrase Timeout"),
VAR_DESC_SPEAKER_PHRASE_TIMEOUT=StringVar(value="It will stop recording and receive the recordings when the set second(s) is reached. (Default: 3)"),
CALLBACK_SET_SPEAKER_PHRASE_TIMEOUT=None,
VAR_SPEAKER_PHRASE_TIMEOUT=IntVar(value=config.INPUT_SPEAKER_PHRASE_TIMEOUT),
VAR_LABEL_SPEAKER_MAX_PHRASES=StringVar(value="Speaker Max Phrases"),
VAR_DESC_SPEAKER_MAX_PHRASES=StringVar(value="It will stop recording and receive the recordings when the set count of phrase(s) is reached. (Default: 10)"),
CALLBACK_SET_SPEAKER_MAX_PHRASES=None,
VAR_SPEAKER_MAX_PHRASES=IntVar(value=config.INPUT_SPEAKER_MAX_PHRASES),
VAR_LABEL_ENABLE_AUTO_CLEAR_MESSAGE_BOX=StringVar(value="Auto Clear The Message Box"),
VAR_DESC_ENABLE_AUTO_CLEAR_MESSAGE_BOX=StringVar(value="Clear the message box after sending your message."),
CALLBACK_SET_ENABLE_AUTO_CLEAR_MESSAGE_BOX=None,
VAR_ENABLE_AUTO_CLEAR_MESSAGE_BOX=BooleanVar(value=config.ENABLE_AUTO_CLEAR_MESSAGE_BOX),
VAR_LABEL_ENABLE_NOTICE_XSOVERLAY=StringVar(value="Notification XSOverlay (VR Only)"),
VAR_DESC_ENABLE_NOTICE_XSOVERLAY=StringVar(value="Notify received messages by using XSOverlay's notification feature."),
CALLBACK_SET_ENABLE_NOTICE_XSOVERLAY=None,
VAR_ENABLE_NOTICE_XSOVERLAY=BooleanVar(value=config.ENABLE_NOTICE_XSOVERLAY),
VAR_LABEL_MESSAGE_FORMAT=StringVar(value="Message Format"),
VAR_DESC_MESSAGE_FORMAT=StringVar(value="You can change the decoration of the message you want to send. (Default: \"[message]([translation])\" )"),
CALLBACK_SET_MESSAGE_FORMAT=None,
VAR_MESSAGE_FORMAT=StringVar(value=config.MESSAGE_FORMAT),
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_LABEL_OSC_PORT=StringVar(value="OSC Port"),
VAR_DESC_OSC_PORT=StringVar(value="(Default: 9000)"),
CALLBACK_SET_OSC_PORT=None,
VAR_OSC_PORT=IntVar(value=config.OSC_PORT),
)
def register(self, sidebar_features, language_presets, entry_message_box_commands, config_window): def register(self, sidebar_features, language_presets, entry_message_box_commands, config_window):
@@ -72,9 +238,23 @@ class View():
# Appearance Tab # Appearance Tab
vrct_gui.config_window.CALLBACK_SET_TRANSPARENCY = config_window["callback_set_transparency"] 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_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_UI_SCALING = config_window["callback_set_ui_scaling"]
vrct_gui.config_window.CALLBACK_SET_FONT_FAMILY = config_window["callback_set_font_family"]
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_UI_LANGUAGE = config_window["callback_set_ui_language"] vrct_gui.config_window.CALLBACK_SET_UI_LANGUAGE = config_window["callback_set_ui_language"]
@@ -216,7 +396,7 @@ class View():
def createGUI(self): def createGUI(self):
vrct_gui.createGUI(settings=self.settings) vrct_gui.createGUI(settings=self.settings, view_variable=self.view_variable)
def startMainLoop(self): def startMainLoop(self):
vrct_gui.startMainLoop() vrct_gui.startMainLoop()

View File

@@ -4,7 +4,7 @@ from .widgets import createConfigWindowTitle, createSideMenuAndSettingsBoxContai
from customtkinter import CTkToplevel from customtkinter import CTkToplevel
class ConfigWindow(CTkToplevel): class ConfigWindow(CTkToplevel):
def __init__(self, vrct_gui, settings): def __init__(self, vrct_gui, settings, view_variable):
super().__init__() super().__init__()
self.withdraw() self.withdraw()
@@ -18,47 +18,7 @@ class ConfigWindow(CTkToplevel):
self.protocol("WM_DELETE_WINDOW", vrct_gui.closeConfigWindow) self.protocol("WM_DELETE_WINDOW", vrct_gui.closeConfigWindow)
self.settings = settings self.settings = settings
self.view_variable = view_variable
# Appearance Tab
self.CALLBACK_SET_TRANSPARENCY = None
self.CALLBACK_SET_APPEARANCE = None
self.CALLBACK_SET_UI_SCALING = None
self.CALLBACK_SET_FONT_FAMILY = None
self.CALLBACK_SET_UI_LANGUAGE = None
# Translation Tab
self.CALLBACK_SET_DEEPL_AUTHKEY = None
# Transcription Tab (Mic)
self.CALLBACK_SET_MIC_HOST = None
self.CALLBACK_SET_MIC_DEVICE = None
self.CALLBACK_SET_MIC_ENERGY_THRESHOLD = None
self.CALLBACK_SET_MIC_DYNAMIC_ENERGY_THRESHOLD = None
self.CALLBACK_CHECK_MIC_THRESHOLD = None
self.CALLBACK_SET_MIC_RECORD_TIMEOUT = None
self.CALLBACK_SET_MIC_PHRASE_TIMEOUT = None
self.CALLBACK_SET_MIC_MAX_PHRASES = None
self.CALLBACK_SET_MIC_WORD_FILTER = None
# Transcription Tab (Speaker)
self.CALLBACK_SET_SPEAKER_DEVICE = None
self.CALLBACK_SET_SPEAKER_ENERGY_THRESHOLD = None
self.CALLBACK_SET_SPEAKER_DYNAMIC_ENERGY_THRESHOLD = None
self.CALLBACK_CHECK_SPEAKER_THRESHOLD = None
self.CALLBACK_SET_SPEAKER_RECORD_TIMEOUT = None
self.CALLBACK_SET_SPEAKER_PHRASE_TIMEOUT = None
self.CALLBACK_SET_SPEAKER_MAX_PHRASES = None
# Others Tab
self.CALLBACK_SET_ENABLE_AUTO_CLEAR_MESSAGE_BOX = None
self.CALLBACK_SET_ENABLE_NOTICE_XSOVERLAY = None
self.CALLBACK_SET_MESSAGE_FORMAT = None
# Advanced Settings Tab
self.CALLBACK_SET_OSC_IP_ADDRESS = None
self.CALLBACK_SET_OSC_PORT = None
createConfigWindowTitle(config_window=self, settings=settings) createConfigWindowTitle(config_window=self, settings=settings)

View File

@@ -1,4 +1,4 @@
from customtkinter import CTkOptionMenu, CTkFont, CTkFrame, CTkLabel, CTkRadioButton, CTkEntry, CTkSlider, CTkSwitch, CTkCheckBox, CTkProgressBar, END as CTK_END from customtkinter import CTkOptionMenu, CTkFont, CTkFrame, CTkLabel, CTkRadioButton, CTkEntry, CTkSlider, CTkSwitch, CTkCheckBox, CTkProgressBar, END as CTK_END, StringVar, IntVar
from ctk_scrollable_dropdown import CTkScrollableDropdown from ctk_scrollable_dropdown import CTkScrollableDropdown
from vrct_gui.ui_utils import createButtonWithImage from vrct_gui.ui_utils import createButtonWithImage
@@ -23,22 +23,22 @@ class _SettingBoxGenerator():
setting_box_frame_wrapper.grid_columnconfigure((0,1), weight=1, minsize=int(self.uism.SB__MAIN_WIDTH / 2)) setting_box_frame_wrapper.grid_columnconfigure((0,1), weight=1, minsize=int(self.uism.SB__MAIN_WIDTH / 2))
return setting_box_frame_wrapper return setting_box_frame_wrapper
def _createSettingBoxFrame(self, parent_widget, label_text, desc_text): def _createSettingBoxFrame(self, parent_widget, for_var_label_text, for_var_desc_text):
setting_box_frame = CTkFrame(parent_widget, corner_radius=0, fg_color=self.ctm.SB__BG_COLOR, width=0, height=0) setting_box_frame = CTkFrame(parent_widget, corner_radius=0, fg_color=self.ctm.SB__BG_COLOR, width=0, height=0)
setting_box_frame_wrapper = self._createSettingBoxFrameWrapper(setting_box_frame) setting_box_frame_wrapper = self._createSettingBoxFrameWrapper(setting_box_frame)
self._setSettingBoxLabels(setting_box_frame_wrapper, label_text, desc_text) self._setSettingBoxLabels(setting_box_frame_wrapper, for_var_label_text, for_var_desc_text)
# "pady=(0,1)" is for bottom padding. It can be removed(override) when you do like "self.attr_name.grid(row=row, pady=0)" # "pady=(0,1)" is for bottom padding. It can be removed(override) when you do like "self.attr_name.grid(row=row, pady=0)"
setting_box_frame.grid(column=0, padx=0, pady=(0,1), sticky="ew") setting_box_frame.grid(column=0, padx=0, pady=(0,1), sticky="ew")
return (setting_box_frame, setting_box_frame_wrapper) return (setting_box_frame, setting_box_frame_wrapper)
def _setSettingBoxLabels(self, setting_box_frame, label_text, desc_text=False): def _setSettingBoxLabels(self, setting_box_frame, for_var_label_text, for_var_desc_text=None):
setting_box_labels_frame = CTkFrame(setting_box_frame, corner_radius=0, fg_color=self.ctm.SB__BG_COLOR, width=0, height=0) setting_box_labels_frame = CTkFrame(setting_box_frame, corner_radius=0, fg_color=self.ctm.SB__BG_COLOR, width=0, height=0)
setting_box_label = CTkLabel( setting_box_label = CTkLabel(
setting_box_labels_frame, setting_box_labels_frame,
text=label_text, textvariable=for_var_label_text,
anchor="w", anchor="w",
# height=0, # height=0,
font=CTkFont(family=self.FONT_FAMILY, size=self.uism.SB__LABEL_FONT_SIZE, weight="normal"), font=CTkFont(family=self.FONT_FAMILY, size=self.uism.SB__LABEL_FONT_SIZE, weight="normal"),
@@ -46,12 +46,12 @@ class _SettingBoxGenerator():
) )
setting_box_label.grid(row=0, column=0, padx=0, pady=0, sticky="ew") setting_box_label.grid(row=0, column=0, padx=0, pady=0, sticky="ew")
if desc_text == False or self.IS_CONFIG_WINDOW_COMPACT_MODE is True: if for_var_desc_text == None or self.IS_CONFIG_WINDOW_COMPACT_MODE is True:
pass pass
else: else:
self.setting_box_desc = CTkLabel( self.setting_box_desc = CTkLabel(
setting_box_labels_frame, setting_box_labels_frame,
text=desc_text, textvariable=for_var_desc_text,
anchor="w", anchor="w",
justify="left", justify="left",
# height=0, # height=0,
@@ -65,8 +65,8 @@ class _SettingBoxGenerator():
def createSettingBoxDropdownMenu(self, parent_widget, label_text, desc_text, optionmenu_attr_name, dropdown_menu_attr_name, dropdown_menu_values, command, variable): def createSettingBoxDropdownMenu(self, parent_widget, for_var_label_text, for_var_desc_text, optionmenu_attr_name, command, variable=None, dropdown_menu_attr_name=None, dropdown_menu_values=None):
(setting_box_frame, setting_box_frame_wrapper) = self._createSettingBoxFrame(parent_widget, label_text, desc_text) (setting_box_frame, setting_box_frame_wrapper) = self._createSettingBoxFrame(parent_widget, for_var_label_text, for_var_desc_text)
setting_box_dropdown_menu_frame = CTkFrame(setting_box_frame_wrapper, corner_radius=0, width=0, height=0, fg_color=self.ctm.SB__BG_COLOR) setting_box_dropdown_menu_frame = CTkFrame(setting_box_frame_wrapper, corner_radius=0, width=0, height=0, fg_color=self.ctm.SB__BG_COLOR)
setting_box_dropdown_menu_frame.grid(row=0, column=1, padx=0, sticky="e") setting_box_dropdown_menu_frame.grid(row=0, column=1, padx=0, sticky="e")
@@ -74,7 +74,6 @@ class _SettingBoxGenerator():
self.createOption_DropdownMenu( self.createOption_DropdownMenu(
setting_box_dropdown_menu_frame=setting_box_dropdown_menu_frame, setting_box_dropdown_menu_frame=setting_box_dropdown_menu_frame,
optionmenu_attr_name=optionmenu_attr_name, optionmenu_attr_name=optionmenu_attr_name,
dropdown_menu_attr_name=dropdown_menu_attr_name,
dropdown_menu_values=dropdown_menu_values, dropdown_menu_values=dropdown_menu_values,
command=command, command=command,
variable=variable, variable=variable,
@@ -85,8 +84,8 @@ class _SettingBoxGenerator():
def createSettingBoxSwitch(self, parent_widget, label_text, desc_text, switch_attr_name, is_checked, command): def createSettingBoxSwitch(self, parent_widget, for_var_label_text, for_var_desc_text, switch_attr_name, is_checked, command):
(setting_box_frame, setting_box_frame_wrapper) = self._createSettingBoxFrame(parent_widget, label_text, desc_text) (setting_box_frame, setting_box_frame_wrapper) = self._createSettingBoxFrame(parent_widget, for_var_label_text, for_var_desc_text)
setting_box_switch_frame = CTkFrame(setting_box_frame_wrapper, corner_radius=0, width=0, height=0, fg_color=self.ctm.SB__BG_COLOR) setting_box_switch_frame = CTkFrame(setting_box_frame_wrapper, corner_radius=0, width=0, height=0, fg_color=self.ctm.SB__BG_COLOR)
setting_box_switch_frame.grid(row=0, column=1, padx=0, sticky="e") setting_box_switch_frame.grid(row=0, column=1, padx=0, sticky="e")
@@ -117,8 +116,8 @@ class _SettingBoxGenerator():
def createSettingBoxCheckbox(self, parent_widget, label_text, desc_text, checkbox_attr_name, is_checked, command): def createSettingBoxCheckbox(self, parent_widget, for_var_label_text, for_var_desc_text, checkbox_attr_name, variable, command):
(setting_box_frame, setting_box_frame_wrapper) = self._createSettingBoxFrame(parent_widget, label_text, desc_text) (setting_box_frame, setting_box_frame_wrapper) = self._createSettingBoxFrame(parent_widget, for_var_label_text, for_var_desc_text)
setting_box_checkbox_frame = CTkFrame(setting_box_frame_wrapper, corner_radius=0, width=0, height=0, fg_color=self.ctm.SB__BG_COLOR) setting_box_checkbox_frame = CTkFrame(setting_box_frame_wrapper, corner_radius=0, width=0, height=0, fg_color=self.ctm.SB__BG_COLOR)
setting_box_checkbox_frame.grid(row=0, column=1, padx=0, sticky="e") setting_box_checkbox_frame.grid(row=0, column=1, padx=0, sticky="e")
@@ -131,6 +130,7 @@ class _SettingBoxGenerator():
checkbox_height=self.uism.SB__CHECKBOX_SIZE, checkbox_height=self.uism.SB__CHECKBOX_SIZE,
onvalue=True, onvalue=True,
offvalue=False, offvalue=False,
variable=variable,
command=command, command=command,
corner_radius=self.uism.SB__CHECKBOX_CORNER_RADIUS, corner_radius=self.uism.SB__CHECKBOX_CORNER_RADIUS,
border_width=self.uism.SB__CHECKBOX_BORDER_WIDTH, border_width=self.uism.SB__CHECKBOX_BORDER_WIDTH,
@@ -144,7 +144,7 @@ class _SettingBoxGenerator():
) )
setattr(self.config_window, checkbox_attr_name, checkbox_widget) setattr(self.config_window, checkbox_attr_name, checkbox_widget)
checkbox_widget.select() if is_checked else checkbox_widget.deselect() # checkbox_widget.select() if is_checked else checkbox_widget.deselect()
checkbox_widget.grid(row=0, column=0) checkbox_widget.grid(row=0, column=0)
@@ -155,8 +155,8 @@ class _SettingBoxGenerator():
def createSettingBoxSlider(self, parent_widget, label_text, desc_text, slider_attr_name, slider_range, command, variable, slider_number_of_steps: Union[int, None] = None): def createSettingBoxSlider(self, parent_widget, for_var_label_text, for_var_desc_text, slider_attr_name, slider_range, command, variable, slider_number_of_steps: Union[int, None] = None):
(setting_box_frame, setting_box_frame_wrapper) = self._createSettingBoxFrame(parent_widget, label_text, desc_text) (setting_box_frame, setting_box_frame_wrapper) = self._createSettingBoxFrame(parent_widget, for_var_label_text, for_var_desc_text)
setting_box_slider_frame = CTkFrame(setting_box_frame_wrapper, corner_radius=0, width=0, height=0, fg_color=self.ctm.SB__BG_COLOR) setting_box_slider_frame = CTkFrame(setting_box_frame_wrapper, corner_radius=0, width=0, height=0, fg_color=self.ctm.SB__BG_COLOR)
setting_box_slider_frame.grid(row=0, column=1, padx=0, sticky="e") setting_box_slider_frame.grid(row=0, column=1, padx=0, sticky="e")
@@ -181,18 +181,20 @@ class _SettingBoxGenerator():
def createSettingBoxProgressbarXSlider(self, def createSettingBoxProgressbarXSlider(self,
parent_widget, label_text, desc_text, command, parent_widget, for_var_label_text, for_var_desc_text, command,
entry_attr_name, entry_attr_name,
slider_attr_name, slider_range, slider_number_of_steps, slider_attr_name, slider_range,
progressbar_attr_name, progressbar_attr_name,
passive_button_attr_name, passive_button_command, passive_button_attr_name, passive_button_command,
active_button_attr_name, active_button_command, active_button_attr_name, active_button_command,
button_image_filename, button_image_filename,
variable, variable,
slider_number_of_steps: Union[int, None] = None,
): ):
(setting_box_frame, setting_box_frame_wrapper) = self._createSettingBoxFrame(parent_widget, label_text, desc_text) (setting_box_frame, setting_box_frame_wrapper) = self._createSettingBoxFrame(parent_widget, for_var_label_text, for_var_desc_text)
setting_box_progressbar_x_slider_frame = CTkFrame(setting_box_frame_wrapper, corner_radius=0, width=0, height=0, fg_color=self.ctm.SB__BG_COLOR) setting_box_progressbar_x_slider_frame = CTkFrame(setting_box_frame_wrapper, corner_radius=0, width=0, height=0, fg_color=self.ctm.SB__BG_COLOR)
setting_box_progressbar_x_slider_frame.grid(row=0, column=1, padx=0, sticky="e") setting_box_progressbar_x_slider_frame.grid(row=0, column=1, padx=0, sticky="e")
@@ -288,8 +290,8 @@ class _SettingBoxGenerator():
def createSettingBoxEntry(self, parent_widget, label_text, desc_text, entry_attr_name, entry_width, entry_bind__Any_KeyRelease, entry_textvariable): def createSettingBoxEntry(self, parent_widget, for_var_label_text, for_var_desc_text, entry_attr_name, entry_width, entry_bind__Any_KeyRelease, entry_textvariable):
(setting_box_frame, setting_box_frame_wrapper) = self._createSettingBoxFrame(parent_widget, label_text, desc_text) (setting_box_frame, setting_box_frame_wrapper) = self._createSettingBoxFrame(parent_widget, for_var_label_text, for_var_desc_text)
setting_box_entry_frame = CTkFrame(setting_box_frame_wrapper, corner_radius=0, width=0, height=0, fg_color=self.ctm.SB__BG_COLOR) setting_box_entry_frame = CTkFrame(setting_box_frame_wrapper, corner_radius=0, width=0, height=0, fg_color=self.ctm.SB__BG_COLOR)
setting_box_entry_frame.grid(row=0, column=1, padx=0, sticky="e") setting_box_entry_frame.grid(row=0, column=1, padx=0, sticky="e")
@@ -414,50 +416,54 @@ class _SettingBoxGenerator():
def createOption_DropdownMenu(self, setting_box_dropdown_menu_frame, optionmenu_attr_name, dropdown_menu_attr_name, dropdown_menu_values, command, variable): def createOption_DropdownMenu(self, setting_box_dropdown_menu_frame, optionmenu_attr_name, command, variable, dropdown_menu_values):
# set the value to the option menu's variable automatically
# def adjustedCommand(selected_value):
# option_menu_widget.set(selected_value)
# command(selected_value)
option_menu_widget = CTkOptionMenu( option_menu_widget = CTkOptionMenu(
setting_box_dropdown_menu_frame, setting_box_dropdown_menu_frame,
height=self.uism.SB__OPTIONMENU_HEIGHT, height=self.uism.SB__OPTIONMENU_HEIGHT,
width=self.uism.SB__OPTIONMENU_WIDTH, width=self.uism.SB__OPTIONMENU_WIDTH,
values=dropdown_menu_values,
button_color=self.ctm.SB__OPTIONMENU_BG_COLOR, button_color=self.ctm.SB__OPTIONMENU_BG_COLOR,
button_hover_color=self.ctm.SB__OPTIONMENU_HOVERED_BG_COLOR, button_hover_color=self.ctm.SB__OPTIONMENU_HOVERED_BG_COLOR,
fg_color=self.ctm.SB__OPTIONMENU_BG_COLOR, fg_color=self.ctm.SB__OPTIONMENU_BG_COLOR,
font=CTkFont(family=self.FONT_FAMILY, size=self.uism.SB__OPTION_MENU_FONT_SIZE, weight="normal"), font=CTkFont(family=self.FONT_FAMILY, size=self.uism.SB__OPTION_MENU_FONT_SIZE, weight="normal"),
variable=variable, variable=variable,
command=command,
anchor="w", anchor="w",
) )
option_menu_widget.grid(row=0, column=0, sticky="e") option_menu_widget.grid(row=0, column=0, sticky="e")
setattr(self.config_window, optionmenu_attr_name, option_menu_widget) setattr(self.config_window, optionmenu_attr_name, option_menu_widget)
# set the value to the option menu's variable automatically # option_menu_widget.configure(command=adjustedCommand)
def adjustedCommand(selected_value):
option_menu_widget.set(selected_value)
command(selected_value)
dropdown_menu_widget = CTkScrollableDropdown( # dropdown_menu_widget = CTkScrollableDropdown(
option_menu_widget, # option_menu_widget,
values=dropdown_menu_values, # justify="left",
justify="left", # width=self.uism.SB__DROPDOWN_MENU_WIDTH,
width=self.uism.SB__DROPDOWN_MENU_WIDTH, # min_show_button_num=6,
min_show_button_num=6, # button_pady=0,
button_pady=0, # frame_corner_radius=self.uism.SB__DROPDOWN_MENU_FRAME_CORNER_RADIUS,
frame_corner_radius=self.uism.SB__DROPDOWN_MENU_FRAME_CORNER_RADIUS, # max_button_height=self.uism.SB__DROPDOWN_MENU_MAX_BUTTON_HEIGHT,
max_button_height=self.uism.SB__DROPDOWN_MENU_MAX_BUTTON_HEIGHT, # max_height=self.uism.SB__DROPDOWN_MENU_FRAME_MAX_HEIGHT,
max_height=self.uism.SB__DROPDOWN_MENU_FRAME_MAX_HEIGHT, # font=CTkFont(family=self.FONT_FAMILY, size=self.uism.SB__OPTION_MENU_FONT_SIZE, weight="normal"),
font=CTkFont(family=self.FONT_FAMILY, size=self.uism.SB__OPTION_MENU_FONT_SIZE, weight="normal"), # command=adjustedCommand,
command=adjustedCommand, # )
)
# dropdown_menu_widget.bind( # dropdown_menu_widget.bind(
# "<Leave>", # "<Leave>",
# lambda e: dropdown_menu_widget._withdraw() if not str(e.widget).startswith(str(dropdown_menu_widget.frame._parent_frame)) else None, # lambda e: dropdown_menu_widget._withdraw() if not str(e.widget).startswith(str(dropdown_menu_widget.frame._parent_frame)) else None,
# ) # )
dropdown_menu_widget.bind( # dropdown_menu_widget.bind(
"<Enter>", # "<Enter>",
lambda e: print(e), # lambda e: print(e),
) # )
setattr(self.config_window, dropdown_menu_attr_name, dropdown_menu_widget) # setattr(self.config_window, dropdown_menu_attr_name, dropdown_menu_widget)
return option_menu_widget return option_menu_widget

View File

@@ -20,12 +20,12 @@ def createSettingBox_AdvancedSettings(setting_box_wrapper, config_window, settin
row=0 row=0
config_window.sb__ip_address = createSettingBoxEntry( config_window.sb__ip_address = createSettingBoxEntry(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="OSC IP Address", for_var_label_text=config_window.view_variable.VAR_LABEL_OSC_IP_ADDRESS,
desc_text="(Default: 127.0.0.1)", for_var_desc_text=config_window.view_variable.VAR_DESC_OSC_IP_ADDRESS,
entry_attr_name="sb__entry_ip_address", entry_attr_name="sb__entry_ip_address",
entry_width=settings.uism.SB__ENTRY_WIDTH_150, entry_width=settings.uism.SB__ENTRY_WIDTH_150,
entry_bind__Any_KeyRelease=lambda value: entry_ip_address_callback(value), entry_bind__Any_KeyRelease=lambda value: entry_ip_address_callback(value),
entry_textvariable=StringVar(value=config.OSC_IP_ADDRESS), entry_textvariable=config_window.view_variable.VAR_OSC_IP_ADDRESS,
) )
config_window.sb__ip_address.grid(row=row) config_window.sb__ip_address.grid(row=row)
row+=1 row+=1
@@ -33,12 +33,12 @@ def createSettingBox_AdvancedSettings(setting_box_wrapper, config_window, settin
config_window.sb__port = createSettingBoxEntry( config_window.sb__port = createSettingBoxEntry(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="OSC Port", for_var_label_text=config_window.view_variable.VAR_LABEL_OSC_PORT,
desc_text="(Default: 9000)", for_var_desc_text=config_window.view_variable.VAR_DESC_OSC_PORT,
entry_attr_name="sb__entry_port", entry_attr_name="sb__entry_port",
entry_width=settings.uism.SB__ENTRY_WIDTH_150, entry_width=settings.uism.SB__ENTRY_WIDTH_150,
entry_bind__Any_KeyRelease=lambda value: entry_port_callback(value), entry_bind__Any_KeyRelease=lambda value: entry_port_callback(value),
entry_textvariable=IntVar(value=config.OSC_PORT), entry_textvariable=config_window.view_variable.VAR_OSC_PORT,
) )
config_window.sb__port.grid(row=row) config_window.sb__port.grid(row=row)
row+=1 row+=1

View File

@@ -1,7 +1,4 @@
from customtkinter import StringVar, IntVar from utils import callFunctionIfCallable
from tkinter import font as tk_font
from languages import selectable_languages
from utils import get_key_by_value, callFunctionIfCallable
from .._SettingBoxGenerator import _SettingBoxGenerator from .._SettingBoxGenerator import _SettingBoxGenerator
@@ -24,22 +21,21 @@ def createSettingBox_Appearance(setting_box_wrapper, config_window, settings):
callFunctionIfCallable(config_window.CALLBACK_SET_UI_SCALING, value) callFunctionIfCallable(config_window.CALLBACK_SET_UI_SCALING, value)
def optionmenu_font_family_callback(value): def optionmenu_font_family_callback(value):
callFunctionIfCallable(config_window.CALLBACK_SET_FONT_FAMILY, value) callFunctionIfCallable(config_window.view_variable.CALLBACK_SET_FONT_FAMILY, value)
def optionmenu_ui_language_callback(value): def optionmenu_ui_language_callback(value):
value = get_key_by_value(selectable_languages, value)
callFunctionIfCallable(config_window.CALLBACK_SET_UI_LANGUAGE, value) callFunctionIfCallable(config_window.CALLBACK_SET_UI_LANGUAGE, value)
row=0 row=0
config_window.sb__transparency = createSettingBoxSlider( config_window.sb__transparency = createSettingBoxSlider(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="Transparency", for_var_label_text=config_window.view_variable.VAR_LABEL_TRANSPARENCY,
desc_text="Change the window's transparency. 50% to 100%. (Default: 100%)", for_var_desc_text=config_window.view_variable.VAR_DESC_TRANSPARENCY,
slider_attr_name="sb__transparency_slider", slider_attr_name="sb__transparency_slider",
slider_range=(50, 100), slider_range=config_window.view_variable.SLIDER_RANGE_TRANSPARENCY,
command=lambda value: slider_transparency_callback(value), command=lambda value: slider_transparency_callback(value),
variable=IntVar(value=config.TRANSPARENCY), variable=config_window.view_variable.VAR_TRANSPARENCY,
) )
config_window.sb__transparency.grid(row=row) config_window.sb__transparency.grid(row=row)
row+=1 row+=1
@@ -47,58 +43,55 @@ def createSettingBox_Appearance(setting_box_wrapper, config_window, settings):
config_window.sb__appearance_theme = createSettingBoxDropdownMenu( config_window.sb__appearance_theme = createSettingBoxDropdownMenu(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="Theme", for_var_label_text=config_window.view_variable.VAR_LABEL_APPEARANCE_THEME,
desc_text="Change the color theme from \"Light\" and \"Dark\". If you select \"System\", It will adjust based on your Windows theme. (Default: System)", for_var_desc_text=config_window.view_variable.VAR_DESC_APPEARANCE_THEME,
optionmenu_attr_name="sb__optionmenu_appearance_theme", optionmenu_attr_name="sb__optionmenu_appearance_theme",
dropdown_menu_attr_name="sb__dropdown_appearance_theme", dropdown_menu_attr_name="sb__dropdown_appearance_theme",
dropdown_menu_values=["Light", "Dark", "System"], dropdown_menu_values=config_window.view_variable.LIST_APPEARANCE_THEME,
command=lambda value: optionmenu_appearance_theme_callback(value), command=lambda value: optionmenu_appearance_theme_callback(value),
variable=StringVar(value=config.APPEARANCE_THEME) variable=config_window.view_variable.VAR_APPEARANCE_THEME,
) )
config_window.sb__appearance_theme.grid(row=row) config_window.sb__appearance_theme.grid(row=row)
row+=1 row+=1
config_window.sb__ui_scaling = createSettingBoxDropdownMenu( config_window.sb__ui_scaling = createSettingBoxDropdownMenu(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="UI Size", for_var_label_text=config_window.view_variable.VAR_LABEL_UI_SCALING,
desc_text="(Default: 100%)", for_var_desc_text=config_window.view_variable.VAR_DESC_UI_SCALING,
optionmenu_attr_name="sb__optionmenu_ui_scaling", optionmenu_attr_name="sb__optionmenu_ui_scaling",
dropdown_menu_attr_name="sb__dropdown_ui_scaling", dropdown_menu_attr_name="sb__dropdown_ui_scaling",
dropdown_menu_values=["80%", "90%", "100%", "110%", "120%"], dropdown_menu_values=config_window.view_variable.LIST_UI_SCALING,
command=lambda value: optionmenu_ui_scaling_callback(value), command=lambda value: optionmenu_ui_scaling_callback(value),
variable=StringVar(value=config.UI_SCALING) variable=config_window.view_variable.VAR_UI_SCALING,
) )
config_window.sb__ui_scaling.grid(row=row) config_window.sb__ui_scaling.grid(row=row)
row+=1 row+=1
# font_families = list(tk_font.families())
config_window.sb__font_family = createSettingBoxDropdownMenu( config_window.sb__font_family = createSettingBoxDropdownMenu(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="Font Family", for_var_label_text=config_window.view_variable.VAR_LABEL_FONT_FAMILY,
desc_text="(Default: Yu Gothic UI)", for_var_desc_text=config_window.view_variable.VAR_DESC_FONT_FAMILY,
optionmenu_attr_name="sb__optionmenu_font_family", optionmenu_attr_name="sb__optionmenu_font_family",
dropdown_menu_attr_name="sb__dropdown_font_family", dropdown_menu_values=config_window.view_variable.LIST_FONT_FAMILY,
dropdown_menu_values=["Font A", "Font B"],
# dropdown_menu_values=font_families,
command=lambda value: optionmenu_font_family_callback(value), command=lambda value: optionmenu_font_family_callback(value),
variable=StringVar(value=config.FONT_FAMILY) variable=config_window.view_variable.VAR_FONT_FAMILY,
) )
config_window.sb__font_family.grid(row=row) config_window.sb__font_family.grid(row=row)
row+=1 row+=1
selectable_languages_values = list(selectable_languages.values())
config_window.sb__ui_language = createSettingBoxDropdownMenu( config_window.sb__ui_language = createSettingBoxDropdownMenu(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="UI Language", for_var_label_text=config_window.view_variable.VAR_LABEL_UI_LANGUAGE,
desc_text="(Default: English)", for_var_desc_text=config_window.view_variable.VAR_DESC_UI_LANGUAGE,
optionmenu_attr_name="sb__optionmenu_ui_language", optionmenu_attr_name="sb__optionmenu_ui_language",
dropdown_menu_attr_name="sb__dropdown_ui_language", dropdown_menu_attr_name="sb__dropdown_ui_language",
dropdown_menu_values=selectable_languages_values, dropdown_menu_values=config_window.view_variable.LIST_UI_LANGUAGE,
command=lambda value: optionmenu_ui_language_callback(value), command=lambda value: optionmenu_ui_language_callback(value),
variable=StringVar(value=selectable_languages[config.UI_LANGUAGE]), variable=config_window.view_variable.VAR_UI_LANGUAGE,
) )
config_window.sb__ui_language.grid(row=row) config_window.sb__ui_language.grid(row=row)
row+=1 row+=1

View File

@@ -26,11 +26,11 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings):
row=0 row=0
config_window.sb__auto_clear_message_box = 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", for_var_label_text=config_window.view_variable.VAR_LABEL_ENABLE_AUTO_CLEAR_MESSAGE_BOX,
desc_text="Clear the message box after sending your message.", for_var_desc_text=config_window.view_variable.VAR_DESC_ENABLE_AUTO_CLEAR_MESSAGE_BOX,
checkbox_attr_name="sb__checkbox_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), command=lambda: checkbox_auto_clear_message_box_callback(config_window.sb__checkbox_auto_clear_message_box),
is_checked=False variable=config_window.view_variable.VAR_ENABLE_AUTO_CLEAR_MESSAGE_BOX,
) )
config_window.sb__auto_clear_message_box.grid(row=row) config_window.sb__auto_clear_message_box.grid(row=row)
row+=1 row+=1
@@ -38,11 +38,11 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings):
config_window.sb__notice_xsoverlay = createSettingBoxCheckbox( config_window.sb__notice_xsoverlay = createSettingBoxCheckbox(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="Notification XSOverlay (VR Only)", for_var_label_text=config_window.view_variable.VAR_LABEL_ENABLE_NOTICE_XSOVERLAY,
desc_text="Notify received messages by using XSOverlay's notification feature.", for_var_desc_text=config_window.view_variable.VAR_DESC_ENABLE_NOTICE_XSOVERLAY,
checkbox_attr_name="sb__checkbox_notice_xsoverlay", checkbox_attr_name="sb__checkbox_notice_xsoverlay",
command=lambda: checkbox_notice_xsoverlay_callback(config_window.sb__checkbox_notice_xsoverlay), command=lambda: checkbox_notice_xsoverlay_callback(config_window.sb__checkbox_notice_xsoverlay),
is_checked=False variable=config_window.view_variable.VAR_ENABLE_NOTICE_XSOVERLAY,
) )
config_window.sb__notice_xsoverlay.grid(row=row) config_window.sb__notice_xsoverlay.grid(row=row)
row+=1 row+=1
@@ -50,12 +50,12 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings):
config_window.sb__message_format = createSettingBoxEntry( config_window.sb__message_format = createSettingBoxEntry(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="Message Format", for_var_label_text=config_window.view_variable.VAR_LABEL_MESSAGE_FORMAT,
desc_text="You can change the decoration of the message you want to send. (Default: \"[message]([translation])\" )", for_var_desc_text=config_window.view_variable.VAR_DESC_MESSAGE_FORMAT,
entry_attr_name="sb__entry_message_format", entry_attr_name="sb__entry_message_format",
entry_width=settings.uism.SB__ENTRY_WIDTH_250, entry_width=settings.uism.SB__ENTRY_WIDTH_250,
entry_bind__Any_KeyRelease=lambda value: entry_message_format_callback(value), entry_bind__Any_KeyRelease=lambda value: entry_message_format_callback(value),
entry_textvariable=StringVar(value=config.MESSAGE_FORMAT), entry_textvariable=config_window.view_variable.VAR_MESSAGE_FORMAT,
) )
config_window.sb__message_format.grid(row=row) config_window.sb__message_format.grid(row=row)
row+=1 row+=1

View File

@@ -6,7 +6,6 @@ from utils import callFunctionIfCallable
from .._SettingBoxGenerator import _SettingBoxGenerator from .._SettingBoxGenerator import _SettingBoxGenerator
from config import config
def createSettingBox_Mic(setting_box_wrapper, config_window, settings): def createSettingBox_Mic(setting_box_wrapper, config_window, settings):
sbg = _SettingBoxGenerator(config_window, settings) sbg = _SettingBoxGenerator(config_window, settings)
@@ -69,28 +68,25 @@ def createSettingBox_Mic(setting_box_wrapper, config_window, settings):
# Mic Host と Mic Device は一つの項目として引っ付ける予定 # Mic Host と Mic Device は一つの項目として引っ付ける予定
config_window.sb__mic_host = createSettingBoxDropdownMenu( config_window.sb__mic_host = createSettingBoxDropdownMenu(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="Mic Host", for_var_label_text=config_window.view_variable.VAR_LABEL_MIC_HOST,
desc_text="Select the mic host. (Default: ?)", for_var_desc_text=config_window.view_variable.VAR_DESC_MIC_HOST,
optionmenu_attr_name="sb__optionmenu_mic_host", optionmenu_attr_name="sb__optionmenu_mic_host",
dropdown_menu_attr_name="sb__dropdown_mic_host", dropdown_menu_values=config_window.view_variable.LIST_MIC_HOST,
# dropdown_menu_values=model.getListInputHost(),
dropdown_menu_values=["host1", "host2", "host3"],
command=lambda value: optionmenu_mic_host_callback(value), command=lambda value: optionmenu_mic_host_callback(value),
variable=StringVar(value=config.CHOICE_MIC_HOST) variable=config_window.view_variable.VAR_MIC_HOST,
) )
config_window.sb__mic_host.grid(row=row) config_window.sb__mic_host.grid(row=row)
row+=1 row+=1
config_window.sb__mic_device = createSettingBoxDropdownMenu( config_window.sb__mic_device = createSettingBoxDropdownMenu(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="Mic Device", for_var_label_text=config_window.view_variable.VAR_LABEL_MIC_DEVICE,
desc_text="Select the mic devise. (Default: ?)", for_var_desc_text=config_window.view_variable.VAR_DESC_MIC_DEVICE,
optionmenu_attr_name="sb__optionmenu_mic_device", optionmenu_attr_name="sb__optionmenu_mic_device",
dropdown_menu_attr_name="sb__dropdown_mic_device", dropdown_menu_attr_name="sb__dropdown_mic_device",
# dropdown_menu_values=model.getListInputDevice(), dropdown_menu_values=config_window.view_variable.LIST_MIC_DEVICE,
dropdown_menu_values=["device1", "device2", "device3"],
command=lambda value: optionmenu_input_mic_device_callback(value), command=lambda value: optionmenu_input_mic_device_callback(value),
variable=StringVar(value=config.CHOICE_MIC_DEVICE) variable=config_window.view_variable.VAR_MIC_DEVICE,
) )
config_window.sb__mic_device.grid(row=row) config_window.sb__mic_device.grid(row=row)
row+=1 row+=1
@@ -98,16 +94,15 @@ def createSettingBox_Mic(setting_box_wrapper, config_window, settings):
config_window.sb__mic_energy_threshold = createSettingBoxProgressbarXSlider( config_window.sb__mic_energy_threshold = createSettingBoxProgressbarXSlider(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="Mic Energy Threshold", for_var_label_text=config_window.view_variable.VAR_LABEL_MIC_ENERGY_THRESHOLD,
desc_text="Slider to modify the threshold for activating voice input.\nPress the microphone button to start input and speak something, so you can adjust it while monitoring the actual volume. 0 to 2000 (Default: 300)", for_var_desc_text=config_window.view_variable.VAR_DESC_MIC_ENERGY_THRESHOLD,
command=slider_input_mic_energy_threshold_callback, command=slider_input_mic_energy_threshold_callback,
variable=IntVar(value=config.INPUT_MIC_ENERGY_THRESHOLD), variable=config_window.view_variable.VAR_MIC_ENERGY_THRESHOLD,
entry_attr_name="sb__progressbar_x_slider__entry_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_attr_name="progressbar_x_slider__slider_mic_energy_threshold",
slider_range=(0, config.MAX_MIC_ENERGY_THRESHOLD), slider_range=config_window.view_variable.SLIDER_RANGE_MIC_ENERGY_THRESHOLD,
slider_number_of_steps=config.MAX_MIC_ENERGY_THRESHOLD,
progressbar_attr_name="sb__progressbar_x_slider__progressbar_mic_energy_threshold", progressbar_attr_name="sb__progressbar_x_slider__progressbar_mic_energy_threshold",
@@ -133,11 +128,11 @@ def createSettingBox_Mic(setting_box_wrapper, config_window, settings):
# Mic Dynamic Energy Thresholdも上に引っ付ける予定 # Mic Dynamic Energy Thresholdも上に引っ付ける予定
config_window.sb__mic_dynamic_energy_threshold = createSettingBoxCheckbox( config_window.sb__mic_dynamic_energy_threshold = createSettingBoxCheckbox(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="Mic Dynamic Energy Threshold", for_var_label_text=config_window.view_variable.VAR_LABEL_MIC_DYNAMIC_ENERGY_THRESHOLD,
desc_text="When this feature is selected, it will automatically adjust in a way that works well, based on the set Mic Energy Threshold.", for_var_desc_text=config_window.view_variable.VAR_DESC_MIC_DYNAMIC_ENERGY_THRESHOLD,
checkbox_attr_name="sb__checkbox_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), command=lambda: checkbox_input_mic_dynamic_energy_threshold_callback(config_window.sb__checkbox_mic_dynamic_energy_threshold),
is_checked=False variable=config_window.view_variable.VAR_MIC_DYNAMIC_ENERGY_THRESHOLD
) )
config_window.sb__mic_dynamic_energy_threshold.grid(row=row) config_window.sb__mic_dynamic_energy_threshold.grid(row=row)
row+=1 row+=1
@@ -146,55 +141,50 @@ def createSettingBox_Mic(setting_box_wrapper, config_window, settings):
# 以下3つも一つの項目にまとめるかもしれない # 以下3つも一つの項目にまとめるかもしれない
config_window.sb__mic_record_timeout = createSettingBoxEntry( config_window.sb__mic_record_timeout = createSettingBoxEntry(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="Mic Record Timeout", for_var_label_text=config_window.view_variable.VAR_LABEL_MIC_RECORD_TIMEOUT,
desc_text="(Default: 3)", for_var_desc_text=config_window.view_variable.VAR_DESC_MIC_RECORD_TIMEOUT,
entry_attr_name="sb__entry_mic_record_timeout", entry_attr_name="sb__entry_mic_record_timeout",
entry_width=settings.uism.SB__ENTRY_WIDTH_100, entry_width=settings.uism.SB__ENTRY_WIDTH_100,
entry_bind__Any_KeyRelease=lambda value: entry_input_mic_record_timeout_callback(value), entry_bind__Any_KeyRelease=lambda value: entry_input_mic_record_timeout_callback(value),
entry_textvariable=IntVar(value=config.INPUT_MIC_RECORD_TIMEOUT), entry_textvariable=config_window.view_variable.VAR_MIC_RECORD_TIMEOUT,
) )
config_window.sb__mic_record_timeout.grid(row=row) config_window.sb__mic_record_timeout.grid(row=row)
row+=1 row+=1
config_window.sb__mic_phrase_timeout = createSettingBoxEntry( config_window.sb__mic_phrase_timeout = createSettingBoxEntry(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="Mic Phrase Timeout", for_var_label_text=config_window.view_variable.VAR_LABEL_MIC_PHRASE_TIMEOUT,
desc_text="It will stop recording and send the recordings when the set second(s) is reached. (Default: 3)", for_var_desc_text=config_window.view_variable.VAR_DESC_MIC_PHRASE_TIMEOUT,
entry_attr_name="sb__entry_mic_phrase_timeout", entry_attr_name="sb__entry_mic_phrase_timeout",
entry_width=settings.uism.SB__ENTRY_WIDTH_100, entry_width=settings.uism.SB__ENTRY_WIDTH_100,
entry_bind__Any_KeyRelease=lambda value: entry_input_mic_phrase_timeout_callback(value), entry_bind__Any_KeyRelease=lambda value: entry_input_mic_phrase_timeout_callback(value),
entry_textvariable=IntVar(value=config.INPUT_MIC_PHRASE_TIMEOUT), entry_textvariable=config_window.view_variable.VAR_MIC_PHRASE_TIMEOUT,
) )
config_window.sb__mic_phrase_timeout.grid(row=row) config_window.sb__mic_phrase_timeout.grid(row=row)
row+=1 row+=1
config_window.sb__mic_max_phrases = createSettingBoxEntry( config_window.sb__mic_max_phrases = createSettingBoxEntry(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="Mic Max Phrases", for_var_label_text=config_window.view_variable.VAR_LABEL_MIC_MAX_PHRASES,
desc_text="It will stop recording and send the recordings when the set count of phrase(s) is reached. (Default: 10)", for_var_desc_text=config_window.view_variable.VAR_DESC_MIC_MAX_PHRASES,
entry_attr_name="sb__entry_mic_max_phrases", entry_attr_name="sb__entry_mic_max_phrases",
entry_width=settings.uism.SB__ENTRY_WIDTH_100, entry_width=settings.uism.SB__ENTRY_WIDTH_100,
entry_bind__Any_KeyRelease=lambda value: entry_input_mic_max_phrases_callback(value), entry_bind__Any_KeyRelease=lambda value: entry_input_mic_max_phrases_callback(value),
entry_textvariable=IntVar(value=config.INPUT_MIC_MAX_PHRASES), entry_textvariable=config_window.view_variable.VAR_MIC_MAX_PHRASES,
) )
config_window.sb__mic_max_phrases.grid(row=row) config_window.sb__mic_max_phrases.grid(row=row)
row+=1 row+=1
# __________ # # __________
if len(config.INPUT_MIC_WORD_FILTER) > 0:
entry_textvariable=StringVar(value=",".join(config.INPUT_MIC_WORD_FILTER))
else:
entry_textvariable=None
config_window.sb__mic_word_filter = createSettingBoxEntry( config_window.sb__mic_word_filter = createSettingBoxEntry(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="Mic Word Filter", for_var_label_text=config_window.view_variable.VAR_LABEL_MIC_WORD_FILTER,
desc_text="It will not send the sentence if the word(s) included in the set list of words.\nHow to set: e.g. AAA,BBB,CCC", for_var_desc_text=config_window.view_variable.VAR_DESC_MIC_WORD_FILTER,
entry_attr_name="sb__entry_mic_word_filter", entry_attr_name="sb__entry_mic_word_filter",
entry_width=settings.uism.SB__ENTRY_WIDTH_100, entry_width=settings.uism.SB__ENTRY_WIDTH_300,
entry_bind__Any_KeyRelease=lambda value: entry_input_mic_word_filters_callback(value), entry_bind__Any_KeyRelease=lambda value: entry_input_mic_word_filters_callback(value),
entry_textvariable=entry_textvariable, entry_textvariable=config_window.view_variable.VAR_MIC_WORD_FILTER,
) )
config_window.sb__mic_word_filter.grid(row=row) config_window.sb__mic_word_filter.grid(row=row)
row+=1 row+=1

View File

@@ -63,14 +63,13 @@ def createSettingBox_Speaker(setting_box_wrapper, config_window, settings):
row=0 row=0
config_window.sb__speaker_device = createSettingBoxDropdownMenu( config_window.sb__speaker_device = createSettingBoxDropdownMenu(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="Speaker Device", for_var_label_text=config_window.view_variable.VAR_LABEL_SPEAKER_DEVICE,
desc_text="Select the speaker devise. (Default: ?)", for_var_desc_text=config_window.view_variable.VAR_DESC_SPEAKER_DEVICE,
optionmenu_attr_name="sb__optionmenu_speaker_device", optionmenu_attr_name="sb__optionmenu_speaker_device",
dropdown_menu_attr_name="sb__dropdown_speaker_device", dropdown_menu_attr_name="sb__dropdown_speaker_device",
# dropdown_menu_values=model.getListOutputDevice(), dropdown_menu_values=config_window.view_variable.LIST_SPEAKER_DEVICE,
dropdown_menu_values=["device1", "device2", "device3"],
command=lambda value: optionmenu_input_speaker_device_callback(value), command=lambda value: optionmenu_input_speaker_device_callback(value),
variable=StringVar(value=config.CHOICE_SPEAKER_DEVICE) variable=config_window.view_variable.VAR_SPEAKER_DEVICE,
) )
config_window.sb__speaker_device.grid(row=row) config_window.sb__speaker_device.grid(row=row)
row+=1 row+=1
@@ -78,16 +77,15 @@ def createSettingBox_Speaker(setting_box_wrapper, config_window, settings):
config_window.sb__speaker_energy_threshold = createSettingBoxProgressbarXSlider( config_window.sb__speaker_energy_threshold = createSettingBoxProgressbarXSlider(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="Speaker Energy Threshold", for_var_label_text=config_window.view_variable.VAR_LABEL_SPEAKER_ENERGY_THRESHOLD,
desc_text="Slider to modify the threshold for activating voice input.\nPress the headphones mark button to start input and speak something, so you can adjust it while monitoring the actual volume. 0 to 4000 (Default: 300)", for_var_desc_text=config_window.view_variable.VAR_DESC_SPEAKER_ENERGY_THRESHOLD,
command=slider_input_speaker_energy_threshold_callback, command=slider_input_speaker_energy_threshold_callback,
variable=IntVar(value=config.INPUT_SPEAKER_ENERGY_THRESHOLD), variable=config_window.view_variable.VAR_SPEAKER_ENERGY_THRESHOLD,
entry_attr_name="sb__progressbar_x_slider__entry_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_attr_name="progressbar_x_slider__slider_speaker_energy_threshold",
slider_range=(0, config.MAX_SPEAKER_ENERGY_THRESHOLD), slider_range=config_window.view_variable.SLIDER_RANGE_SPEAKER_ENERGY_THRESHOLD,
slider_number_of_steps=config.MAX_SPEAKER_ENERGY_THRESHOLD,
progressbar_attr_name="sb__progressbar_x_slider__progressbar_speaker_energy_threshold", progressbar_attr_name="sb__progressbar_x_slider__progressbar_speaker_energy_threshold",
@@ -113,11 +111,11 @@ def createSettingBox_Speaker(setting_box_wrapper, config_window, settings):
# Speaker Dynamic Energy Thresholdも上に引っ付ける予定 # Speaker Dynamic Energy Thresholdも上に引っ付ける予定
config_window.sb__speaker_dynamic_energy_threshold = createSettingBoxCheckbox( config_window.sb__speaker_dynamic_energy_threshold = createSettingBoxCheckbox(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="Speaker Dynamic Energy Threshold", for_var_label_text=config_window.view_variable.VAR_LABEL_SPEAKER_DYNAMIC_ENERGY_THRESHOLD,
desc_text="When this feature is selected, it will automatically adjust in a way that works well, based on the set Speaker Energy Threshold.", for_var_desc_text=config_window.view_variable.VAR_DESC_SPEAKER_DYNAMIC_ENERGY_THRESHOLD,
checkbox_attr_name="sb__checkbox_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), command=lambda: checkbox_input_speaker_dynamic_energy_threshold_callback(config_window.sb__checkbox_speaker_dynamic_energy_threshold),
is_checked=False variable=config_window.view_variable.VAR_MIC_DYNAMIC_ENERGY_THRESHOLD,
) )
config_window.sb__speaker_dynamic_energy_threshold.grid(row=row) config_window.sb__speaker_dynamic_energy_threshold.grid(row=row)
row+=1 row+=1
@@ -126,36 +124,36 @@ def createSettingBox_Speaker(setting_box_wrapper, config_window, settings):
# 以下3つも一つの項目にまとめるかもしれない # 以下3つも一つの項目にまとめるかもしれない
config_window.sb__speaker_record_timeout = createSettingBoxEntry( config_window.sb__speaker_record_timeout = createSettingBoxEntry(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="Speaker Record Timeout", for_var_label_text=config_window.view_variable.VAR_LABEL_SPEAKER_RECORD_TIMEOUT,
desc_text="(Default: 3)", for_var_desc_text=config_window.view_variable.VAR_DESC_SPEAKER_RECORD_TIMEOUT,
entry_attr_name="sb__entry_speaker_record_timeout", entry_attr_name="sb__entry_speaker_record_timeout",
entry_width=settings.uism.SB__ENTRY_WIDTH_100, entry_width=settings.uism.SB__ENTRY_WIDTH_100,
entry_bind__Any_KeyRelease=lambda value: entry_input_speaker_record_timeout_callback(value), entry_bind__Any_KeyRelease=lambda value: entry_input_speaker_record_timeout_callback(value),
entry_textvariable=IntVar(value=config.INPUT_SPEAKER_RECORD_TIMEOUT), entry_textvariable=config_window.view_variable.VAR_SPEAKER_RECORD_TIMEOUT,
) )
config_window.sb__speaker_record_timeout.grid(row=row) config_window.sb__speaker_record_timeout.grid(row=row)
row+=1 row+=1
config_window.sb__speaker_phrase_timeout = createSettingBoxEntry( config_window.sb__speaker_phrase_timeout = createSettingBoxEntry(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="Speaker Phrase Timeout", for_var_label_text=config_window.view_variable.VAR_LABEL_SPEAKER_PHRASE_TIMEOUT,
desc_text="It will stop recording and receive the recordings when the set second(s) is reached. (Default: 3)", for_var_desc_text=config_window.view_variable.VAR_DESC_SPEAKER_PHRASE_TIMEOUT,
entry_attr_name="sb__entry_speaker_phrase_timeout", entry_attr_name="sb__entry_speaker_phrase_timeout",
entry_width=settings.uism.SB__ENTRY_WIDTH_100, entry_width=settings.uism.SB__ENTRY_WIDTH_100,
entry_bind__Any_KeyRelease=lambda value: entry_input_speaker_phrase_timeout_callback(value), entry_bind__Any_KeyRelease=lambda value: entry_input_speaker_phrase_timeout_callback(value),
entry_textvariable=IntVar(value=config.INPUT_SPEAKER_PHRASE_TIMEOUT), entry_textvariable=config_window.view_variable.VAR_SPEAKER_PHRASE_TIMEOUT,
) )
config_window.sb__speaker_phrase_timeout.grid(row=row) config_window.sb__speaker_phrase_timeout.grid(row=row)
row+=1 row+=1
config_window.sb__speaker_max_phrases = createSettingBoxEntry( config_window.sb__speaker_max_phrases = createSettingBoxEntry(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="Speaker Max Phrases", for_var_label_text=config_window.view_variable.VAR_LABEL_SPEAKER_MAX_PHRASES,
desc_text="It will stop recording and receive the recordings when the set count of phrase(s) is reached. (Default: 10)", for_var_desc_text=config_window.view_variable.VAR_DESC_SPEAKER_MAX_PHRASES,
entry_attr_name="sb__entry_speaker_max_phrases", entry_attr_name="sb__entry_speaker_max_phrases",
entry_width=settings.uism.SB__ENTRY_WIDTH_100, entry_width=settings.uism.SB__ENTRY_WIDTH_100,
entry_bind__Any_KeyRelease=lambda value: entry_input_speaker_max_phrases_callback(value), entry_bind__Any_KeyRelease=lambda value: entry_input_speaker_max_phrases_callback(value),
entry_textvariable=IntVar(value=config.INPUT_SPEAKER_MAX_PHRASES), entry_textvariable=config_window.view_variable.VAR_SPEAKER_MAX_PHRASES,
) )
config_window.sb__speaker_max_phrases.grid(row=row) config_window.sb__speaker_max_phrases.grid(row=row)
row+=1 row+=1

View File

@@ -18,12 +18,12 @@ def createSettingBox_Translation(setting_box_wrapper, config_window, settings):
row=0 row=0
config_window.sb__deepl_authkey = createSettingBoxEntry( config_window.sb__deepl_authkey = createSettingBoxEntry(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
label_text="DeepL Auth Key", for_var_label_text=config_window.view_variable.VAR_LABEL_DEEPL_AUTH_KEY,
desc_text="", for_var_desc_text=config_window.view_variable.VAR_DESC_DEEPL_AUTH_KEY,
entry_attr_name="sb__deepl_authkey", entry_attr_name="sb__deepl_authkey",
entry_width=settings.uism.SB__ENTRY_WIDTH_300, entry_width=settings.uism.SB__ENTRY_WIDTH_300,
entry_bind__Any_KeyRelease=lambda value: deepl_authkey_callback(value), entry_bind__Any_KeyRelease=lambda value: deepl_authkey_callback(value),
entry_textvariable=StringVar(value=config.AUTH_KEYS["DeepL(auth)"]), entry_textvariable=config_window.view_variable.VAR_DEEPL_AUTH_KEY,
) )
config_window.sb__deepl_authkey.grid(row=row) config_window.sb__deepl_authkey.grid(row=row)
row+=1 row+=1

View File

@@ -5,7 +5,7 @@ from customtkinter import CTkFrame
from ..ui_utils import createButtonWithImage, getImagePath from ..ui_utils import createButtonWithImage, getImagePath
def createMainWindowWidgets(vrct_gui, settings): def createMainWindowWidgets(vrct_gui, settings, view_variable):
vrct_gui.protocol("WM_DELETE_WINDOW", vrct_gui.quitVRCT) vrct_gui.protocol("WM_DELETE_WINDOW", vrct_gui.quitVRCT)
# self.IS_DEVELOPER_MODE = False # self.IS_DEVELOPER_MODE = False

View File

@@ -16,7 +16,7 @@ from .ui_utils import _setDefaultActiveTab
class VRCT_GUI(CTk): class VRCT_GUI(CTk):
def __init__(self): def __init__(self):
super().__init__() super().__init__()
self.settings = SimpleNamespace() # self.settings = SimpleNamespace()
self.YOUR_LANGUAGE = "Japanese\n(Japan)" self.YOUR_LANGUAGE = "Japanese\n(Japan)"
self.TARGET_LANGUAGE = "English\n(United States)" self.TARGET_LANGUAGE = "English\n(United States)"
@@ -29,11 +29,12 @@ class VRCT_GUI(CTk):
self.CALLBACK_SELECTED_TAB_NO_3 = None self.CALLBACK_SELECTED_TAB_NO_3 = None
def createGUI(self, settings): def createGUI(self, settings, view_variable):
self.settings = settings self.settings = settings
self.view_variable = view_variable
createMainWindowWidgets(vrct_gui=self, settings=self.settings.main) createMainWindowWidgets(vrct_gui=self, settings=self.settings.main, view_variable=self.view_variable)
self.config_window = ConfigWindow(vrct_gui=self, settings=self.settings.config_window) self.config_window = ConfigWindow(vrct_gui=self, settings=self.settings.config_window, view_variable=self.view_variable)
# self.information_window = ToplevelWindowInformation(self) # self.information_window = ToplevelWindowInformation(self)
def startMainLoop(self): def startMainLoop(self):