Hopefully fixed a bug tht was causing some settings to reset.
This commit is contained in:
@@ -458,19 +458,34 @@ class PluginManager(Plugin):
|
|||||||
active_plugins.remove(plugin_name)
|
active_plugins.remove(plugin_name)
|
||||||
|
|
||||||
_settingsManager.setSetting('activePlugins', active_plugins)
|
_settingsManager.setSetting('activePlugins', active_plugins)
|
||||||
|
if hasattr(_settingsManager, "general") and isinstance(_settingsManager.general, dict):
|
||||||
|
_settingsManager.general['activePlugins'] = active_plugins
|
||||||
|
|
||||||
try:
|
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
|
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
|
backend = _settingsManager._backend
|
||||||
if backend:
|
if backend:
|
||||||
backend.saveDefaultSettings(
|
backend.saveProfileSettings(
|
||||||
current_general,
|
profile_name,
|
||||||
_settingsManager.getPronunciations(),
|
_settingsManager.profileGeneral,
|
||||||
_settingsManager.getKeybindings()
|
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:
|
else:
|
||||||
debug.printMessage(debug.LEVEL_INFO, "PluginManager: No backend available for saving", True)
|
debug.printMessage(debug.LEVEL_INFO, "PluginManager: No backend available for saving", True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user