JAL-898 - ensure we only remove a clargs progress bar if we added it
authorjprocter <jprocter@compbio.dundee.ac.uk>
Wed, 17 Aug 2011 10:57:54 +0000 (11:57 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Wed, 17 Aug 2011 10:57:54 +0000 (11:57 +0100)
src/jalview/bin/Jalview.java

index 5357e81..aae30b5 100755 (executable)
@@ -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);
     }
   }