11import copy
2+ from pathlib import Path
3+ from typing import Any
24
35from PySide6 .QtWidgets import (
46 QCheckBox ,
79 QLabel ,
810 QVBoxLayout ,
911)
10- from src .core .settings import TSSettings
12+ from src .core .settings import TSSettings
1113from src .qt .widgets .panel import PanelWidget
12- from typing import Any
1314
1415
1516class SettingsModal (PanelWidget ):
@@ -19,20 +20,6 @@ def __init__(self, settings: TSSettings):
1920
2021 self .main = QVBoxLayout (self )
2122
22- # ---
23- self .darkMode_Label = QLabel ()
24- self .darkMode_Value = QCheckBox ()
25- self .darkMode_Row = QHBoxLayout ()
26- self .darkMode_Row .addWidget (self .darkMode_Label )
27- self .darkMode_Row .addWidget (self .darkMode_Value )
28-
29- self .darkMode_Label .setText ("Dark Mode" )
30- self .darkMode_Value .setChecked (self .tempSettings .dark_mode )
31-
32- self .darkMode_Value .stateChanged .connect (
33- lambda state : setattr (self .tempSettings , "dark_mode" , bool (state ))
34- )
35-
3623 # ---
3724 self .language_Label = QLabel ()
3825 self .language_Value = QComboBox ()
@@ -41,12 +28,8 @@ def __init__(self, settings: TSSettings):
4128 self .language_Row .addWidget (self .language_Value )
4229
4330 self .language_Label .setText ("Language" )
44- language_list = [ # TODO: put this somewhere else
45- "en-US" ,
46- "en-GB" ,
47- "es-MX" ,
48- # etc...
49- ]
31+ translations_folder = Path ("tagstudio/resources/translations" )
32+ language_list = [x .stem for x in translations_folder .glob ("*.json" )]
5033 self .language_Value .addItems (language_list )
5134 self .language_Value .setCurrentIndex (language_list .index (self .tempSettings .language ))
5235 self .language_Value .currentTextChanged .connect (
@@ -59,7 +42,7 @@ def __init__(self, settings: TSSettings):
5942 self .show_library_list_Row = QHBoxLayout ()
6043 self .show_library_list_Row .addWidget (self .show_library_list_Label )
6144 self .show_library_list_Row .addWidget (self .show_library_list_Value )
62- self .show_library_list_Label .setText ("Load library list on startup:" )
45+ self .show_library_list_Label .setText ("Load library list on startup (requires restart) :" )
6346 self .show_library_list_Value .setChecked (self .tempSettings .show_library_list )
6447
6548 self .show_library_list_Value .stateChanged .connect (
0 commit comments