Plugins - Added button to delete plugin settings

UI - Try to release SDKs on Windows logout/shutdown
Plugins UI - Increased width and fixed long feature names not wrapping
This commit is contained in:
Robert committed 2021-03-30 19:15:16 +02:00
1 parent 7a5f07c686
commit 1eebb1f247
15 files changed
+174 -116

No files matched your search

@@ -74,7 +74,14 @@ namespace Artemis.Core.Services
/// Unloads and permanently removes the provided plugin
/// </summary>
/// <param name="plugin">The plugin to remove</param>
void RemovePlugin(Plugin plugin);
/// <param name="removeSettings"></param>
void RemovePlugin(Plugin plugin, bool removeSettings);
/// <summary>
/// Removes the settings of a disabled plugin
/// </summary>
/// <param name="plugin">The plugin whose settings to remove</param>
void RemovePluginSettings(Plugin plugin);
/// <summary>
/// Enables the provided plugin feature
@@ -134,8 +141,6 @@ namespace Artemis.Core.Services
/// <param name="pluginAction">The action to take</param>
void QueuePluginAction(Plugin plugin, PluginManagementAction pluginAction);
#region Events
/// <summary>
/// Occurs when built-in plugins are being loaded
/// </summary>
@@ -190,7 +195,5 @@ namespace Artemis.Core.Services
/// Occurs when a plugin feature has been disabled
/// </summary>
public event EventHandler<PluginFeatureEventArgs> PluginFeatureDisabled;
#endregion
}
}
@@ -479,7 +479,7 @@ namespace Artemis.Core.Services
if (existing != null)
try
{
RemovePlugin(existing);
RemovePlugin(existing, false);
}
catch (Exception e)
{
@@ -519,7 +519,7 @@ namespace Artemis.Core.Services
return LoadPlugin(directoryInfo);
}
public void RemovePlugin(Plugin plugin)
public void RemovePlugin(Plugin plugin, bool removeSettings)
{
DirectoryInfo directory = plugin.Directory;
lock (_plugins)
@@ -529,6 +529,16 @@ namespace Artemis.Core.Services
}
directory.Delete(true);
if (removeSettings)
RemovePluginSettings(plugin);
}
public void RemovePluginSettings(Plugin plugin)
{
if (plugin.IsEnabled)
throw new ArtemisCoreException("Cannot remove the settings of an enabled plugin");
_pluginRepository.RemoveSettings(plugin.Guid);
plugin.Settings?.ClearSettings();
}
#endregion