Hopefully fixed a bug tht was causing some settings to reset.

This commit is contained in:
Storm Dragon
2026-01-09 16:59:59 -05:00
parent 2939526c03
commit 862504b425

View File

@@ -458,19 +458,34 @@ class PluginManager(Plugin):
active_plugins.remove(plugin_name)
_settingsManager.setSetting('activePlugins', active_plugins)
if hasattr(_settingsManager, "general") and isinstance(_settingsManager.general, dict):
_settingsManager.general['activePlugins'] = active_plugins
try:
current_general = _settingsManager.getGeneralSettings()
active_profile = _settingsManager.getSetting('activeProfile')
if isinstance(active_profile, (list, tuple)) and len(active_profile) > 1:
profile_name = active_profile[1]
else:
profile_name = _settingsManager.profile or 'default'
current_general = _settingsManager.getGeneralSettings(profile_name) or {}
current_general['activePlugins'] = active_plugins
_settingsManager.profile = profile_name
_settingsManager._setProfileGeneral(current_general)
pronunciations = _settingsManager.getPronunciations(profile_name) or {}
keybindings = _settingsManager.getKeybindings(profile_name) or {}
backend = _settingsManager._backend
if backend:
backend.saveDefaultSettings(
current_general,
_settingsManager.getPronunciations(),
_settingsManager.getKeybindings()
backend.saveProfileSettings(
profile_name,
_settingsManager.profileGeneral,
pronunciations,
keybindings
)
debug.printMessage(debug.LEVEL_INFO, "PluginManager: Settings saved to backend", True)
debug.printMessage(debug.LEVEL_INFO, f"PluginManager: Settings saved to backend (profile {profile_name})", True)
else:
debug.printMessage(debug.LEVEL_INFO, "PluginManager: No backend available for saving", True)