@@ -21,19 +21,15 @@ def settings_table_update() -> Dict[str, Any]:
2121    }
2222
2323
24- SETTINGS_IMPORT_STATUS : List [str ] =  ["" ]
25- SETTINGS_INS : List [Dict [str , Any ]] =  [settings_ins_update ()]
26- SETTINGS_NOTIFICATION : List [str ] =  ["" ]
27- SETTINGS_TABLE : List [Dict [str , Any ]] =  [settings_table_update ()]
28- 
29- 
3024class  SettingsTabData (QObject ):
3125
3226    _import_status : str  =  "" 
3327    _recommended_ins_settings : List [List [Any ]] =  []
3428    _new_ins_confirmation : bool  =  False 
3529    _notification : str  =  "" 
36-     _data_updated  =  Signal ()
30+     _import_status_updated  =  Signal (str )
31+     _ins_updated  =  Signal (dict )
32+     _notification_updated  =  Signal (str )
3733    settings_import_status : str  =  "" 
3834    settings_ins : Dict [str , Any ] =  {}
3935    settings_notification : str  =  "" 
@@ -42,31 +38,36 @@ def __init__(self):
4238        super ().__init__ ()
4339        assert  getattr (self .__class__ , "_instance" , None ) is  None 
4440        self .__class__ ._instance  =  self 
45-         self .settings_import_status  =  SETTINGS_IMPORT_STATUS [0 ]
46-         self .settings_ins  =  SETTINGS_INS [0 ]
47-         self .settings_notification  =  SETTINGS_NOTIFICATION [0 ]
48-         self ._data_updated .connect (self .handle_data_updated )
41+         self .settings_import_status  =  "" 
42+         self .settings_ins  =  settings_ins_update ()
43+         self .settings_notification  =  "" 
44+         self ._import_status_updated .connect (self .handle_import_status_updated )
45+         self ._ins_updated .connect (self .handle_ins_updated )
46+         self ._notification_updated .connect (self .handle_notification_updated )
4947
5048    @classmethod  
5149    def  post_import_status_update (cls , update_data : str ) ->  None :
52-         SETTINGS_IMPORT_STATUS [0 ] =  update_data 
53-         cls ._instance ._data_updated .emit ()
50+         cls ._instance ._import_status_updated .emit (update_data )
5451
5552    @classmethod  
5653    def  post_ins_update (cls , update_data : Dict [str , Any ]) ->  None :
57-         SETTINGS_INS [0 ] =  update_data 
58-         cls ._instance ._data_updated .emit ()
54+         cls ._instance ._ins_updated .emit (update_data )
5955
6056    @classmethod  
6157    def  post_notification_update (cls , update_data : str ) ->  None :
62-         SETTINGS_NOTIFICATION [0 ] =  update_data 
63-         cls ._instance ._data_updated .emit ()
58+         cls ._instance ._notification_updated .emit (update_data )
59+ 
60+     @Slot (str )  # type: ignore  
61+     def  handle_import_status_updated (self , data : str ) ->  None :
62+         self .settings_import_status  =  data 
63+ 
64+     @Slot (dict )  # type: ignore  
65+     def  handle_ins_updated (self , update_data : Dict [str , Any ]) ->  None :
66+         self .settings_ins  =  update_data 
6467
65-     @Slot ()  # type: ignore  
66-     def  handle_data_updated (self ) ->  None :
67-         self .settings_import_status  =  SETTINGS_IMPORT_STATUS [0 ]
68-         self .settings_ins  =  SETTINGS_INS [0 ]
69-         self .settings_notification  =  SETTINGS_NOTIFICATION [0 ]
68+     @Slot (str )  # type: ignore  
69+     def  handle_notification_updated (self , data : str ) ->  None :
70+         self .settings_notification  =  data 
7071
7172    def  get_import_status (self ) ->  str :
7273        return  self ._import_status 
@@ -129,24 +130,23 @@ def clear_new_ins_confirmation(self, cp: SettingsTabData) -> SettingsTabData:  #
129130class  SettingsTableEntries (QObject ):
130131
131132    _entries : List [dict ] =  []
132-     _data_updated  =  Signal ()
133+     _data_updated  =  Signal (dict )
133134    settings_table : Dict [str , Any ] =  {}
134135
135136    def  __init__ (self ):
136137        super ().__init__ ()
137138        assert  getattr (self .__class__ , "_instance" , None ) is  None 
138139        self .__class__ ._instance  =  self 
139-         self .settings_table  =  SETTINGS_TABLE [ 0 ] 
140+         self .settings_table  =  settings_table_update () 
140141        self ._data_updated .connect (self .handle_data_updated )
141142
142143    @classmethod  
143144    def  post_data_update (cls , update_data : Dict [str , Any ]) ->  None :
144-         SETTINGS_TABLE [0 ] =  update_data 
145-         cls ._instance ._data_updated .emit ()
145+         cls ._instance ._data_updated .emit (update_data )
146146
147-     @Slot ()  # type: ignore  
148-     def  handle_data_updated (self ) ->  None :
149-         self .settings_table  =  SETTINGS_TABLE [ 0 ] 
147+     @Slot (dict )  # type: ignore  
148+     def  handle_data_updated (self ,  update_data :  Dict [ str ,  Any ] ) ->  None :
149+         self .settings_table  =  update_data 
150150
151151    def  get_entries (self ) ->  List [dict ]:
152152        return  self ._entries 
0 commit comments