2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-04-05 17:39:39 -04:00

Ensures notify-only plugin configuration UI is rendered (#12)

Switching the basic Announcer plugin to implement only `IObservatoryNotifier`, I noticed the config UI went missing. This PR fixes that.
This commit is contained in:
F K 2021-08-19 07:01:46 -04:00 committed by GitHub
parent 3b28662e55
commit f7d5aa4bd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -271,25 +271,25 @@ namespace Observatory.UI.Views
Binding = new Binding("Status") Binding = new Binding("Status")
}); });
Dictionary<string, PluginView> uniquePlugins = new(); Dictionary<IObservatoryPlugin, PluginView> uniquePlugins = new();
foreach(var (plugin, signed) in pluginManager.workerPlugins) foreach(var (plugin, signed) in pluginManager.workerPlugins)
{ {
if (!uniquePlugins.ContainsKey(plugin.Name)) if (!uniquePlugins.ContainsKey(plugin))
{ {
uniquePlugins.Add(plugin.Name, uniquePlugins.Add(plugin,
new PluginView() { Name = plugin.Name, Types = new() { typeof(IObservatoryWorker).Name }, Version = plugin.Version, Status = GetStatusText(signed) }); new PluginView() { Name = plugin.Name, Types = new() { typeof(IObservatoryWorker).Name }, Version = plugin.Version, Status = GetStatusText(signed) });
} }
} }
foreach (var (plugin, signed) in pluginManager.notifyPlugins) foreach (var (plugin, signed) in pluginManager.notifyPlugins)
{ {
if (!uniquePlugins.ContainsKey(plugin.Name)) if (!uniquePlugins.ContainsKey(plugin))
{ {
uniquePlugins.Add(plugin.Name, uniquePlugins.Add(plugin,
new PluginView() { Name = plugin.Name, Types = new() { typeof(IObservatoryNotifier).Name }, Version = plugin.Version, Status = GetStatusText(signed) }); new PluginView() { Name = plugin.Name, Types = new() { typeof(IObservatoryNotifier).Name }, Version = plugin.Version, Status = GetStatusText(signed) });
} else } else
{ {
uniquePlugins[plugin.Name].Types.Add(typeof(IObservatoryNotifier).Name); uniquePlugins[plugin].Types.Add(typeof(IObservatoryNotifier).Name);
} }
} }
@ -300,7 +300,7 @@ namespace Observatory.UI.Views
#region Plugin Settings #region Plugin Settings
foreach(var plugin in pluginManager.workerPlugins.Select(p => p.plugin)) foreach(var plugin in uniquePlugins.Keys)
{ {
GeneratePluginSettingUI(corePanel, plugin); GeneratePluginSettingUI(corePanel, plugin);
} }