JAL-3246 JAL-3247 Reworked JVL files as getdown.txt config with limitations
[jalview.git] / getdown / src / getdown / launcher / src / main / java / com / threerings / getdown / launcher / GetdownApp.java
index 0c8cac5..5e168ff 100644 (file)
@@ -29,6 +29,7 @@ import javax.swing.WindowConstants;
 
 import com.install4j.api.launcher.StartupNotification;
 import com.samskivert.swing.util.SwingUtil;
+import com.threerings.getdown.data.Application;
 import com.threerings.getdown.data.EnvConfig;
 import com.threerings.getdown.data.SysProps;
 import com.threerings.getdown.util.LaunchUtil;
@@ -93,14 +94,13 @@ public class GetdownApp
 
     try
     {
-      log.info("**** Registering i4j StartupNotification Listener");
       StartupNotification.registerStartupListener(
               new StartupNotification.Listener() {
                 @Override
                 public void startupPerformed(String parameters)
-                {
-                  log.info("**** adding startup parameters '"+parameters+"'");
-                  GetdownApp.setStartupFilesParameterString(parameters);
+                { 
+                  log.warning("StartupNotification.Listener.startupPerformed: '"+parameters+"'");
+                  setStartupFilesParameterString(parameters);
                 }
               });
     } catch (Exception e)
@@ -108,8 +108,6 @@ public class GetdownApp
       e.printStackTrace();
     }
     
-    Thread.sleep(500);
-
     // record a few things for posterity
     log.info("------------------ VM Info ------------------");
     log.info("-- OS Name: " + System.getProperty("os.name"));
@@ -120,7 +118,6 @@ public class GetdownApp
     log.info("-- User Name: " + System.getProperty("user.name"));
     log.info("-- User Home: " + System.getProperty("user.home"));
     log.info("-- Cur dir: " + System.getProperty("user.dir"));
-    log.info("-- JVL: " + System.getProperty("jvl"));
     log.info("-- startupFilesParameterString: " + startupFilesParameterString);
     log.info("---------------------------------------------");
 
@@ -270,6 +267,12 @@ public class GetdownApp
 
       protected JFrame _frame;
     };
+    
+    String startupFile = getStartupFilesParameterString();
+    if (!StringUtil.isBlank(startupFile)) {
+      Application.setStartupFilesFromParameterString(startupFile);
+    }
     app.start();
     return app;
   }
@@ -277,4 +280,8 @@ public class GetdownApp
   public static void setStartupFilesParameterString(String parameters) {
     startupFilesParameterString = parameters;
   }
+  
+  public static String getStartupFilesParameterString() {
+    return startupFilesParameterString;
+  }
 }