Notify on single plugin update

This commit is contained in:
Raymond 2021-07-15 10:21:12 -04:00
parent ea9ce0d776
commit d6fbe7a837
2 changed files with 7 additions and 3 deletions

View file

@ -789,7 +789,7 @@ namespace Dalamud.Interface.Internal.Windows
{ {
this.installStatus = OperationStatus.InProgress; this.installStatus = OperationStatus.InProgress;
Task.Run(() => this.dalamud.PluginManager.UpdateSinglePlugin(update, false)) Task.Run(() => this.dalamud.PluginManager.UpdateSinglePlugin(update, true, false))
.ContinueWith(task => .ContinueWith(task =>
{ {
// There is no need to set as Complete for an individual plugin installation // There is no need to set as Complete for an individual plugin installation

View file

@ -606,7 +606,7 @@ namespace Dalamud.Plugin.Internal
// Prevent collection was modified errors // Prevent collection was modified errors
for (var i = 0; i < this.updatablePlugins.Count; i++) for (var i = 0; i < this.updatablePlugins.Count; i++)
{ {
updatedList.Add(this.UpdateSinglePlugin(this.updatablePlugins[i], dryRun)); updatedList.Add(this.UpdateSinglePlugin(this.updatablePlugins[i], false, dryRun));
} }
this.NotifyInstalledPluginsChanged(); this.NotifyInstalledPluginsChanged();
@ -620,10 +620,11 @@ namespace Dalamud.Plugin.Internal
/// Update a single plugin, provided a valid <see cref="AvailablePluginUpdate"/>. /// Update a single plugin, provided a valid <see cref="AvailablePluginUpdate"/>.
/// </summary> /// </summary>
/// <param name="metadata">The available plugin update.</param> /// <param name="metadata">The available plugin update.</param>
/// <param name="notify">Whether to notify that installed plugins have changed afterwards.</param>
/// <param name="dryRun">Whether or not to actually perform the update, or just indicate success.</param> /// <param name="dryRun">Whether or not to actually perform the update, or just indicate success.</param>
/// <returns>The status of the update.</returns> /// <returns>The status of the update.</returns>
[CanBeNull] [CanBeNull]
public PluginUpdateStatus UpdateSinglePlugin(AvailablePluginUpdate metadata, bool dryRun) public PluginUpdateStatus UpdateSinglePlugin(AvailablePluginUpdate metadata, bool notify, bool dryRun)
{ {
var plugin = metadata.InstalledPlugin; var plugin = metadata.InstalledPlugin;
@ -685,6 +686,9 @@ namespace Dalamud.Plugin.Internal
} }
} }
if (notify && updateStatus.WasUpdated)
this.NotifyInstalledPluginsChanged();
return updateStatus; return updateStatus;
} }