From: Mateusz Warowny Date: Tue, 19 Oct 2021 13:25:37 +0000 (+0200) Subject: JAL-3878 Fix progress updater bar to account for cancelled state. X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=22757dee67436691d8a7570391115d551b30e096;p=jalview.git JAL-3878 Fix progress updater bar to account for cancelled state. --- diff --git a/src/jalview/ws2/gui/ProgressBarUpdater.java b/src/jalview/ws2/gui/ProgressBarUpdater.java index 476308c..24c71d7 100644 --- a/src/jalview/ws2/gui/ProgressBarUpdater.java +++ b/src/jalview/ws2/gui/ProgressBarUpdater.java @@ -3,7 +3,6 @@ package jalview.ws2.gui; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; -import jalview.gui.AlignFrame; import jalview.gui.IProgressIndicator; import jalview.ws2.WSJob; import jalview.ws2.WSJobStatus; @@ -33,13 +32,11 @@ public class ProgressBarUpdater implements PropertyChangeListener var job = (WSJob) evt.getSource(); var oldStatus = (WSJobStatus) evt.getOldValue(); var newStatus = (WSJobStatus) evt.getNewValue(); - boolean wasRunning = oldStatus.isRunning() || oldStatus.isSubmitted(); - boolean isRunning = newStatus.isRunning() || newStatus.isSubmitted(); - if (!wasRunning && isRunning) + if (!oldStatus.isSubmitted() && newStatus.isSubmitted()) { progressIndicator.setProgressBar(job.getServiceName(), job.getUid()); } - else if (wasRunning && !isRunning) + if (newStatus.isDone() || newStatus.isCancelled()) { progressIndicator.removeProgressBar(job.getUid()); }