From 6f5064fe39dbf67f92b51e56b0554e016b7e0b00 Mon Sep 17 00:00:00 2001 From: jprocter Date: Wed, 17 Aug 2011 11:57:54 +0100 Subject: [PATCH] JAL-898 - ensure we only remove a clargs progress bar if we added it --- src/jalview/bin/Jalview.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 5357e81..aae30b5 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -318,9 +318,14 @@ public class Jalview } } } + long progress=-1; // Finally, deal with the remaining input data. if (file != null) { + if (!headless) + { + desktop.setProgressBar("Processing commandline arguments...", progress=System.currentTimeMillis()); + } System.out.println("Opening file: " + file); if (!file.startsWith("http://")) @@ -334,10 +339,6 @@ public class Jalview } } } - if (!headless) - { - desktop.setProgressBar("Processing commandline arguments...", Jalview.class.hashCode()); - } protocol = jalview.io.AppletFormatAdapter.checkProtocol(file); @@ -562,7 +563,9 @@ public class Jalview // and finally, turn off batch mode indicator - if the desktop still exists if (desktop != null) { - desktop.setProgressBar(null, Jalview.class.hashCode()); + if (progress!=-1) { + desktop.setProgressBar(null, progress); + } desktop.setInBatchMode(false); } } -- 1.7.10.2