@@ -93,6 +93,14 @@ def __init__(self, parent, vmr):
93
93
for profile in self .target .configs .keys ()
94
94
if profile not in self .config_defaults
95
95
]
96
+ elif self .parent .userconfigs :
97
+ [
98
+ self .menu_configs_load .add_command (
99
+ label = name , command = partial (self .load_custom_profile , data )
100
+ )
101
+ for name , data in self .parent .userconfigs .items ()
102
+ if name not in self .config_defaults
103
+ ]
96
104
else :
97
105
self .menu_configs .entryconfig (0 , state = "disabled" )
98
106
self .menu_configs .add_command (
@@ -213,6 +221,10 @@ def action_set_voicemeeter(self, cmd, val=True):
213
221
self ._unlock .set (not self ._lock .get ())
214
222
setattr (self .target .command , cmd , val )
215
223
224
+ def load_custom_profile (self , profile ):
225
+ self .logger .info (f"loading user profile { profile } " )
226
+ self .target .apply (profile )
227
+
216
228
def load_profile (self , profile ):
217
229
self .logger .info (f"loading user profile { profile } " )
218
230
self .target .apply_config (profile )
@@ -289,6 +301,11 @@ def menu_teardown(self, i):
289
301
for key in self .target .configs .keys ()
290
302
if key not in self .config_defaults
291
303
]
304
+ [
305
+ self .menu_configs_load .delete (key )
306
+ for key in self .parent .userconfigs .keys ()
307
+ if key not in self .config_defaults
308
+ ]
292
309
293
310
[
294
311
self .menu_vban .entryconfig (j , state = "disabled" )
@@ -307,6 +324,14 @@ def menu_setup(self):
307
324
for profile in self .target .configs .keys ()
308
325
if profile not in self .config_defaults
309
326
]
327
+ elif self .parent .userconfigs :
328
+ [
329
+ self .menu_configs_load .add_command (
330
+ label = name , command = partial (self .load_custom_profile , data )
331
+ )
332
+ for name , data in self .parent .userconfigs .items ()
333
+ if name not in self .config_defaults
334
+ ]
310
335
else :
311
336
self .menu_configs .entryconfig (0 , state = "disabled" )
312
337
@@ -346,6 +371,11 @@ def vban_connect(self, i):
346
371
self .menu_layout .entryconfig (
347
372
0 , state = f"{ 'normal' if kind .name == 'potato' else 'disabled' } "
348
373
)
374
+ # ensure the configs are reloaded into memory
375
+ if "config" in self .parent .target .__dict__ :
376
+ del self .parent .target .__dict__ ["config" ]
377
+ if "userconfigs" in self .parent .__dict__ :
378
+ del self .parent .__dict__ ["userconfigs" ]
349
379
self .menu_setup ()
350
380
351
381
def vban_disconnect (self , i ):
@@ -366,6 +396,11 @@ def vban_disconnect(self, i):
366
396
self .menu_layout .entryconfig (
367
397
0 , state = f"{ 'normal' if kind .name == 'potato' else 'disabled' } "
368
398
)
399
+ # ensure the configs are reloaded into memory
400
+ if "config" in self .parent .target .__dict__ :
401
+ del self .parent .target .__dict__ ["config" ]
402
+ if "userconfigs" in self .parent .__dict__ :
403
+ del self .parent .__dict__ ["userconfigs" ]
369
404
self .menu_setup ()
370
405
371
406
self .after (15000 , self .enable_vban_menus )
0 commit comments