JAL-3394 Fixed jalviews?:// scheme for macOS startup
authorBen Soares <bsoares@dundee.ac.uk>
Wed, 18 Dec 2019 17:15:55 +0000 (17:15 +0000)
committerBen Soares <bsoares@dundee.ac.uk>
Wed, 18 Dec 2019 17:15:55 +0000 (17:15 +0000)
getdown/lib/getdown-core.jar
getdown/lib/getdown-launcher-local.jar
getdown/lib/getdown-launcher.jar
getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Application.java
j11lib/getdown-core.jar
j8lib/getdown-core.jar

index 5d88768..49e0431 100644 (file)
Binary files a/getdown/lib/getdown-core.jar and b/getdown/lib/getdown-core.jar differ
index 710ab06..8ddc526 100644 (file)
Binary files a/getdown/lib/getdown-launcher-local.jar and b/getdown/lib/getdown-launcher-local.jar differ
index e2b648d..b44d887 100644 (file)
Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ
index e7f21c6..1e53d62 100644 (file)
@@ -1087,7 +1087,10 @@ public class Application
             }
         }
 
-        // test for jalview/s URL
+        // test for jalview/s URL. Insert startupNotification URI into start of _appargs
+        if (! StringUtil.isBlank(_jalviewUri)) {
+          _appargs.add(0, _jalviewUri);
+        }
         if (_appargs.size() > 0) {
           String uri = _appargs.get(0);
           try {
@@ -1961,7 +1964,9 @@ public class Application
         for (int i = 0; i < filenames.length; i++) {
           String filename = filenames[i];
           // skip any other locator files in a multiple file list
-          if (! filename.toLowerCase().endsWith("."+Application.LOCATOR_FILE_EXTENSION)) {
+          if (filename.startsWith("jalview://") || filename.startsWith("jalviews://")) {
+            setJalviewUri(filename);
+          } else if (! filename.toLowerCase().endsWith("."+Application.LOCATOR_FILE_EXTENSION)) {
             addStartupFile(filename);
           }
         }
@@ -1976,6 +1981,10 @@ public class Application
       _startupFiles.add(new File(filename));
     }
     
+    public static void setJalviewUri(String uri) {
+      _jalviewUri = uri;
+    }
+    
     private Config createLocatorConfig(Config.ParseOpts opts) {
       if (_locatorFile == null) {
         return null;
@@ -2086,6 +2095,7 @@ public class Application
  
     protected static File _locatorFile;
     protected static List<File> _startupFiles = new ArrayList<>();
+    protected static String _jalviewUri;
     public static final String LOCATOR_FILE_EXTENSION = "jvl";
 
     private boolean _initialised = false;
index 5d88768..49e0431 100644 (file)
Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ
index 5d88768..49e0431 100644 (file)
Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ