JAL-3322 Once background displayed, allow asynchronous progress setting
authorBen Soares <bsoares@dundee.ac.uk>
Wed, 26 Jun 2019 23:55:20 +0000 (00:55 +0100)
committerBen Soares <bsoares@dundee.ac.uk>
Wed, 26 Jun 2019 23:55:20 +0000 (00:55 +0100)
getdown/lib/getdown-core.jar
getdown/lib/getdown-launcher.jar
getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Application.java
getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java
getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java
gradle.properties
j11lib/getdown-core.jar
j8lib/getdown-core.jar

index 7ee98a0..b3aa99b 100644 (file)
Binary files a/getdown/lib/getdown-core.jar and b/getdown/lib/getdown-core.jar differ
index 42efe3c..264ed45 100644 (file)
Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ
index c3a3d79..bbac55f 100644 (file)
@@ -150,9 +150,12 @@ public class Application
         /** Whether progress text should be hidden or not. */
         public final boolean hideProgressText;
 
-        /** Whether the splash screen should retain focus. */
+        /** Whether the splash screen should update non-asynchronously before being shown. */
         public final boolean progressSync;
 
+        /** Whether the splash screen should update non-asynchronously after being shown. */
+        public final boolean progressSyncAfterShown;
+
         /** Whether the splash screen should retain focus. */
         public final boolean keepOnTop;
 
@@ -180,7 +183,8 @@ public class Application
                 ", pb=" + progressBar + ", srect=" + status + ", st=" + statusText +
                 ", shadow=" + textShadow + ", err=" + installError + ", nrect=" + patchNotes +
                 ", notes=" + patchNotesUrl + ", stepPercentages=" + stepPercentages +
-                ", hideProgressText=" + hideProgressText + ", keepOnTop=" + keepOnTop + ", progressSync=" + progressSync + ", minShow=" + minShowSeconds +
+                ", hideProgressText=" + hideProgressText + ", keepOnTop=" + keepOnTop + ", progressSync=" + progressSync +
+                ", progressSyncAfterShown=" + progressSyncAfterShown + ", minShow=" + minShowSeconds +
                 ", displayAppbase=" + displayAppbase + ", displayVersion=" + displayVersion + "]";
         }
 
@@ -191,6 +195,7 @@ public class Application
             this.progressText = config.getColor("ui.progress_text", Color.BLACK);
             this.hideProgressText =  config.getBoolean("ui.hide_progress_text");
             this.progressSync =  config.getBoolean("ui.progress_sync");
+            this.progressSyncAfterShown =  config.getBoolean("ui.progress_sync_after_shown");
             this.keepOnTop =  config.getBoolean("ui.keep_on_top");
             this.displayAppbase =  config.getBoolean("ui.display_appbase");
             this.displayVersion =  config.getBoolean("ui.display_version");
index ba238de..f64959b 100644 (file)
@@ -1124,16 +1124,18 @@ public abstract class Getdown extends Thread
       } catch (Exception e) {
         log.warning("Could't read config when invoking GUI action", "Exception", e.getMessage());
       }
-      if (_ifc != null && _ifc.progressSync) {
+      if (_ifc != null && (_shownContainer?_ifc.progressSyncAfterShown:_ifc.progressSync)) {
         try {
           EventQueue.invokeAndWait(r);
           //r.run();
+          log.warning("INVOKEANDWAIT", "shownContainer", _shownContainer);
         } catch (Exception e) {
           log.warning("Tried to invokeAndWait but couldn't. Going to invokeLater instead", "Exception", e.getMessage());
           EventQueue.invokeLater(r);
         }
       } else {
         EventQueue.invokeLater(r);
+        log.warning("INVOKELATER", "ifc", _ifc, "shownContainer", _shownContainer);
         //r.run();
       }
       
@@ -1159,13 +1161,15 @@ public abstract class Getdown extends Thread
     protected boolean _launchInSilent;
     protected boolean _noUpdate;
     protected long _startup;
-    
     protected Set<Resource> _toInstallResources;
     protected boolean _readyToInstall;
 
     protected boolean _enableTracking = true;
     protected int _reportedProgress = 0;
 
+    protected boolean _shownContainer;
+
     /** Number of minutes to wait after startup before beginning any real heavy lifting. */
     protected int _delay;
 
index 4adc77c..7c54f80 100644 (file)
@@ -203,6 +203,7 @@ public class GetdownApp
           SwingUtil.centerWindow(_frame);
           _frame.setVisible(true);
         }
+        _shownContainer = true;
       }
 
       @Override
index 6f3092e..0cb5c68 100644 (file)
@@ -63,6 +63,7 @@ getdown_txt_strict_comments = true
 getdown_txt_title = Jalview
 getdown_txt_ui.name = Jalview
 getdown_txt_ui.progress_sync = true
+getdown_txt_ui.progress_sync_after_shown = false
 getdown_txt_ui.keep_on_top = true
 getdown_txt_ui.display_appbase = true
 getdown_txt_ui.display_version = true
index 7ee98a0..b3aa99b 100644 (file)
Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ
index 7ee98a0..b3aa99b 100644 (file)
Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ