Merge branch 'config_window' into UI_2.0
This commit is contained in:
@@ -4,7 +4,7 @@ from ....ui_utils import bindEnterAndLeaveColor, bindButtonPressColor, bindButto
|
||||
|
||||
|
||||
|
||||
def addConfigSideMenuItem(config_window, settings, side_menu_settings, side_menu_row, all_side_menu_tab_attr_name):
|
||||
def _addConfigSideMenuItem(config_window, settings, side_menu_settings, side_menu_row, all_side_menu_tab_attr_name):
|
||||
|
||||
|
||||
def switchActiveAndPassiveSettingBoxContainerTabsColor(target_active_widget):
|
||||
@@ -1,7 +1,7 @@
|
||||
from customtkinter import CTkFont, CTkFrame, CTkLabel
|
||||
|
||||
|
||||
def createSettingBoxContainer(config_window, settings, setting_box_container_settings):
|
||||
def _createSettingBoxContainer(config_window, settings, setting_box_container_settings):
|
||||
|
||||
|
||||
def createSectionTitle(container_widget, section_title):
|
||||
@@ -2,11 +2,15 @@ from customtkinter import CTkFrame, CTkScrollableFrame
|
||||
|
||||
from ....ui_utils import setDefaultActiveTab
|
||||
|
||||
from .addConfigSideMenuItem import addConfigSideMenuItem
|
||||
from .createSettingBoxContainer import createSettingBoxContainer
|
||||
from ._addConfigSideMenuItem import _addConfigSideMenuItem
|
||||
from ._createSettingBoxContainer import _createSettingBoxContainer
|
||||
|
||||
|
||||
from .setting_box_containers import createSettingBox_Appearance, createSettingBox_Mic, createSettingBox_Speaker, createSettingBox_Others, createSettingBox_AdvancedSettings
|
||||
from .setting_box_containers.setting_box_appearance import createSettingBox_Appearance
|
||||
from .setting_box_containers.setting_box_transcription import createSettingBox_Mic, createSettingBox_Speaker
|
||||
from .setting_box_containers.setting_box_others import createSettingBox_Others
|
||||
from .setting_box_containers.setting_box_advanced_settings import createSettingBox_AdvancedSettings
|
||||
from .setting_box_containers.setting_box_translation import createSettingBox_Translation
|
||||
|
||||
|
||||
def createSideMenuAndSettingsBoxContainers(config_window, settings):
|
||||
@@ -55,6 +59,7 @@ def createSideMenuAndSettingsBoxContainers(config_window, settings):
|
||||
{ "section_title": None, "setting_box": createSettingBox_Appearance },
|
||||
]
|
||||
},
|
||||
"activate_by_default": True,
|
||||
},
|
||||
{
|
||||
"side_menu_tab_attr_name": "side_menu_tab_translation",
|
||||
@@ -64,7 +69,7 @@ def createSideMenuAndSettingsBoxContainers(config_window, settings):
|
||||
"setting_box_container_settings": {
|
||||
"setting_box_container_attr_name": "setting_box_container_translation",
|
||||
"setting_boxes": [
|
||||
{ "section_title": None, "setting_box": None },
|
||||
{ "section_title": None, "setting_box": createSettingBox_Translation },
|
||||
]
|
||||
},
|
||||
},
|
||||
@@ -104,7 +109,6 @@ def createSideMenuAndSettingsBoxContainers(config_window, settings):
|
||||
{ "section_title": None, "setting_box": createSettingBox_AdvancedSettings },
|
||||
]
|
||||
},
|
||||
"activate_by_default": True,
|
||||
},
|
||||
]
|
||||
|
||||
@@ -112,7 +116,7 @@ def createSideMenuAndSettingsBoxContainers(config_window, settings):
|
||||
|
||||
side_menu_row=0
|
||||
for sm_and_sbc_setting in side_menu_and_setting_box_containers_settings:
|
||||
addConfigSideMenuItem(
|
||||
_addConfigSideMenuItem(
|
||||
config_window=config_window,
|
||||
settings=settings,
|
||||
side_menu_settings=sm_and_sbc_setting,
|
||||
@@ -122,7 +126,7 @@ def createSideMenuAndSettingsBoxContainers(config_window, settings):
|
||||
side_menu_row+=1
|
||||
|
||||
|
||||
createSettingBoxContainer(
|
||||
_createSettingBoxContainer(
|
||||
config_window=config_window,
|
||||
settings=settings,
|
||||
setting_box_container_settings=sm_and_sbc_setting["setting_box_container_settings"],
|
||||
@@ -143,6 +147,4 @@ def createSideMenuAndSettingsBoxContainers(config_window, settings):
|
||||
|
||||
# Set default active setting box container
|
||||
config_window.current_active_setting_box_container = getattr(config_window, sm_and_sbc_setting["setting_box_container_settings"]["setting_box_container_attr_name"])
|
||||
config_window.current_active_setting_box_container.grid()
|
||||
|
||||
|
||||
config_window.current_active_setting_box_container.grid()
|
||||
@@ -6,7 +6,7 @@ from vrct_gui.ui_utils import createButtonWithImage
|
||||
from typing import Union
|
||||
|
||||
|
||||
class SettingBoxGenerator():
|
||||
class _SettingBoxGenerator():
|
||||
def __init__(self, config_window, settings):
|
||||
|
||||
self.IS_CONFIG_WINDOW_COMPACT_MODE = settings.IS_CONFIG_WINDOW_COMPACT_MODE
|
||||
@@ -1,4 +0,0 @@
|
||||
from .setting_box_appearance import createSettingBox_Appearance
|
||||
from .setting_box_transcription import createSettingBox_Mic, createSettingBox_Speaker
|
||||
from .setting_box_others import createSettingBox_Others
|
||||
from .setting_box_advanced_settings import createSettingBox_AdvancedSettings
|
||||
@@ -3,15 +3,12 @@ from time import sleep
|
||||
from customtkinter import StringVar, IntVar
|
||||
|
||||
|
||||
from ..SettingBoxGenerator import SettingBoxGenerator
|
||||
from .._SettingBoxGenerator import _SettingBoxGenerator
|
||||
|
||||
from config import config
|
||||
|
||||
def createSettingBox_AdvancedSettings(setting_box_wrapper, config_window, settings):
|
||||
|
||||
|
||||
sbg = SettingBoxGenerator(config_window, settings)
|
||||
|
||||
sbg = _SettingBoxGenerator(config_window, settings)
|
||||
createSettingBoxEntry = sbg.createSettingBoxEntry
|
||||
|
||||
|
||||
|
||||
@@ -6,15 +6,12 @@ from languages import selectable_languages
|
||||
from utils import get_key_by_value
|
||||
|
||||
|
||||
from ..SettingBoxGenerator import SettingBoxGenerator
|
||||
from .._SettingBoxGenerator import _SettingBoxGenerator
|
||||
|
||||
from config import config
|
||||
|
||||
def createSettingBox_Appearance(setting_box_wrapper, config_window, settings):
|
||||
|
||||
|
||||
sbg = SettingBoxGenerator(config_window, settings)
|
||||
|
||||
sbg = _SettingBoxGenerator(config_window, settings)
|
||||
createSettingBoxDropdownMenu = sbg.createSettingBoxDropdownMenu
|
||||
createSettingBoxSlider = sbg.createSettingBoxSlider
|
||||
|
||||
|
||||
@@ -3,15 +3,12 @@ from time import sleep
|
||||
from customtkinter import StringVar, IntVar
|
||||
|
||||
|
||||
from ..SettingBoxGenerator import SettingBoxGenerator
|
||||
from .._SettingBoxGenerator import _SettingBoxGenerator
|
||||
|
||||
from config import config
|
||||
|
||||
def createSettingBox_Others(setting_box_wrapper, config_window, settings):
|
||||
|
||||
|
||||
sbg = SettingBoxGenerator(config_window, settings)
|
||||
|
||||
sbg = _SettingBoxGenerator(config_window, settings)
|
||||
createSettingBoxCheckbox = sbg.createSettingBoxCheckbox
|
||||
createSettingBoxEntry = sbg.createSettingBoxEntry
|
||||
|
||||
|
||||
@@ -3,15 +3,12 @@ from time import sleep
|
||||
from customtkinter import StringVar, IntVar
|
||||
|
||||
|
||||
from ..SettingBoxGenerator import SettingBoxGenerator
|
||||
from .._SettingBoxGenerator import _SettingBoxGenerator
|
||||
|
||||
from config import config
|
||||
|
||||
def createSettingBox_Mic(setting_box_wrapper, config_window, settings):
|
||||
|
||||
|
||||
sbg = SettingBoxGenerator(config_window, settings)
|
||||
|
||||
sbg = _SettingBoxGenerator(config_window, settings)
|
||||
createSettingBoxDropdownMenu = sbg.createSettingBoxDropdownMenu
|
||||
createSettingBoxCheckbox = sbg.createSettingBoxCheckbox
|
||||
createSettingBoxProgressbarXSlider = sbg.createSettingBoxProgressbarXSlider
|
||||
|
||||
@@ -3,15 +3,12 @@ from time import sleep
|
||||
from customtkinter import StringVar, IntVar
|
||||
|
||||
|
||||
from ..SettingBoxGenerator import SettingBoxGenerator
|
||||
from .._SettingBoxGenerator import _SettingBoxGenerator
|
||||
|
||||
from config import config
|
||||
|
||||
def createSettingBox_Speaker(setting_box_wrapper, config_window, settings):
|
||||
|
||||
|
||||
sbg = SettingBoxGenerator(config_window, settings)
|
||||
|
||||
sbg = _SettingBoxGenerator(config_window, settings)
|
||||
createSettingBoxDropdownMenu = sbg.createSettingBoxDropdownMenu
|
||||
createSettingBoxCheckbox = sbg.createSettingBoxCheckbox
|
||||
createSettingBoxProgressbarXSlider = sbg.createSettingBoxProgressbarXSlider
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
from .createSettingBox_Translation import createSettingBox_Translation
|
||||
@@ -0,0 +1,37 @@
|
||||
from time import sleep
|
||||
|
||||
from customtkinter import StringVar, IntVar
|
||||
|
||||
|
||||
from .._SettingBoxGenerator import _SettingBoxGenerator
|
||||
|
||||
from config import config
|
||||
|
||||
def createSettingBox_Translation(setting_box_wrapper, config_window, settings):
|
||||
sbg = _SettingBoxGenerator(config_window, settings)
|
||||
createSettingBoxEntry = sbg.createSettingBoxEntry
|
||||
|
||||
|
||||
def deepl_authkey_callback(value):
|
||||
print(str(value))
|
||||
# config.AUTH_KEYS["DeepL(auth)"] = str(value)
|
||||
# if len(value) > 0:
|
||||
# if model.authenticationTranslator(choice_translator="DeepL(auth)", auth_key=value) is True:
|
||||
# print_textbox(self.parent.textbox_message_log, "Auth key update completed", "INFO")
|
||||
# print_textbox(self.parent.textbox_message_system_log, "Auth key update completed", "INFO")
|
||||
# else:
|
||||
# pass
|
||||
|
||||
|
||||
row=0
|
||||
config_window.sb__deepl_authkey = createSettingBoxEntry(
|
||||
parent_widget=setting_box_wrapper,
|
||||
label_text="DeepL Auth Key",
|
||||
desc_text="",
|
||||
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=StringVar(value=config.AUTH_KEYS["DeepL(auth)"]),
|
||||
)
|
||||
config_window.sb__deepl_authkey.grid(row=row)
|
||||
row+=1
|
||||
Reference in New Issue
Block a user