Merge branch 'develop' into features/JAL-3010ontologyFeatureSettings
[jalview.git] / getdown / src / getdown / launcher / src / main / java / com / threerings / getdown / launcher / StatusPanel.java
index 99f44ca..620182b 100644 (file)
@@ -28,6 +28,7 @@ import com.samskivert.swing.util.SwingUtil;
 import com.samskivert.util.Throttle;
 
 import com.threerings.getdown.data.Application.UpdateInterface;
+import com.threerings.getdown.data.Build;
 import com.threerings.getdown.util.MessageUtil;
 import com.threerings.getdown.util.Rectangle;
 import com.threerings.getdown.util.StringUtil;
@@ -106,7 +107,7 @@ public final class StatusPanel extends JComponent
         // maybe update the progress label
         if (_progress != percent) {
             _progress = percent;
-            if (!_ifc.hideProgressText) {
+            if (_ifc != null && !_ifc.hideProgressText) {
                 String msg = MessageFormat.format(get("m.complete"), percent);
                 _newplab = createLabel(msg, new Color(_ifc.progressText, true));
             }
@@ -128,7 +129,7 @@ public final class StatusPanel extends JComponent
             }
             remaining /= values;
 
-            if (!_ifc.hideProgressText) {
+            if (_ifc != null && !_ifc.hideProgressText) {
                 // now compute our display value
                 int minutes = (int)(remaining / 60), seconds = (int)(remaining % 60);
                 String remstr = minutes + ":" + ((seconds < 10) ? "0" : "") + seconds;
@@ -265,13 +266,28 @@ public final class StatusPanel extends JComponent
      */
     protected void updateStatusLabel ()
     {
+        if (_ifc == null) {
+               return;
+        }
         String status = _status;
         if (!_displayError) {
             for (int ii = 0; ii < _statusDots; ii++) {
                 status += " .";
             }
         }
-        _newlab = createLabel(status, new Color(_ifc.statusText, true));
+       StringBuilder labelText = new StringBuilder();
+       if (_ifc.displayVersion) {
+               labelText.append("launcher version: "+Build.version());
+               labelText.append("\n");
+       }
+       if (_ifc.displayAppbase) {
+               labelText.append("appbase: "+_appbase);
+               labelText.append("\n");
+       }
+       labelText.append(status); 
+        
+        _newlab = createLabel(labelText.toString(), new Color(_ifc.statusText, true));
         // set the width of the label to the width specified
         int width = _ifc.status.width;
         if (width == 0) {
@@ -370,6 +386,10 @@ public final class StatusPanel extends JComponent
             return key;
         }
     }
+    
+    public void setAppbase(String appbase) {
+       _appbase = appbase;
+    }
 
     protected Image _barimg;
     protected RotatingBackgrounds _bg;
@@ -393,4 +413,6 @@ public final class StatusPanel extends JComponent
     protected Throttle _rthrottle = new Throttle(1, 1000L);
 
     protected static final Font FONT = new Font("SansSerif", Font.BOLD, 12);
+    
+    public String _appbase;
 }