77 QLabel ,
88 QVBoxLayout ,
99)
10- from src .core .settings import TSSettings
10+ from src .core .settings import tssettings
1111from src .qt .widgets .panel import PanelWidget
1212
1313
1414class SettingsModal (PanelWidget ):
15- def __init__ (self , settings : TSSettings ):
15+ def __init__ (self , settings : tssettings ):
1616 super ().__init__ ()
1717 self .tempSettings = copy .deepcopy (settings )
1818
@@ -29,7 +29,7 @@ def __init__(self, settings: TSSettings):
2929 self .darkMode_Value .setChecked (self .tempSettings .dark_mode )
3030
3131 self .darkMode_Value .stateChanged .connect (
32- lambda state : self .set_property ( "dark_mode" , bool (state ))
32+ lambda state : setattr ( self .tempSettings , "dark_mode" , bool (state ))
3333 )
3434
3535 # ---
@@ -49,15 +49,29 @@ def __init__(self, settings: TSSettings):
4949 self .language_Value .addItems (language_list )
5050 self .language_Value .setCurrentIndex (language_list .index (self .tempSettings .language ))
5151 self .language_Value .currentTextChanged .connect (
52- lambda text : self .set_property ("language" , text )
52+ lambda text : setattr (self .tempSettings , "language" , text )
53+ )
54+
55+ # ---
56+ self .show_library_list_Label = QLabel ()
57+ self .show_library_list_Value = QCheckBox ()
58+ self .show_library_list_Row = QHBoxLayout ()
59+ self .show_library_list_Row .addWidget (self .show_library_list_Label )
60+ self .show_library_list_Row .addWidget (self .show_library_list_Value )
61+ self .show_library_list_Label .setText ("Load library list on startup:" )
62+ self .show_library_list_Value .setChecked (self .tempSettings .show_library_list )
63+
64+ self .show_library_list_Value .stateChanged .connect (
65+ lambda state : setattr (self .tempSettings , "show_library_list" , bool (state ))
5366 )
5467
5568 # ---
5669 self .main .addLayout (self .darkMode_Row )
5770 self .main .addLayout (self .language_Row )
71+ self .main .addLayout (self .show_library_list_Row )
5872
5973 def set_property (self , prop_name : str , value : any ) -> None :
6074 setattr (self .tempSettings , prop_name , value )
6175
62- def get_content (self ) -> TSSettings :
76+ def get_content (self ) -> tssettings :
6377 return self .tempSettings
0 commit comments