From 41c324856937b9f0d2f5a5c85ee5687dee1747b5 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Mon, 20 Nov 2006 16:59:18 +0000
Subject: [PATCH] The following modifications are targeted to improve the output displayed by the Java WebStart Setup.  There were two issues with the existing code:

---
 opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/installer/webstart/WebStartInstaller.java |   34 ++++++++++++++++++++++++++--------
 1 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/installer/webstart/WebStartInstaller.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/installer/webstart/WebStartInstaller.java
index a5cbccb..490e944 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/installer/webstart/WebStartInstaller.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/installer/webstart/WebStartInstaller.java
@@ -186,10 +186,6 @@
 
     } catch (InstallException ex)
     {
-      if (ex.getCause() != null)
-      {
-        ex.getCause().printStackTrace();
-      }
       status = InstallProgressStep.FINISHED_WITH_ERROR;
       String html = getHtmlError(ex, true);
       notifyListeners(html);
@@ -330,17 +326,39 @@
   private void waitForLoader(Integer maxRatio) throws InstallException
   {
     int lastPercentage = -1;
+    WebStartDownloader.Status lastStatus =
+      WebStartDownloader.Status.DOWNLOADING;
     while (!loader.isFinished() && (loader.getException() == null))
     {
       // Pool until is over
       int perc = loader.getDownloadPercentage();
-      if (perc != lastPercentage)
+      WebStartDownloader.Status downloadStatus = loader.getStatus();
+      if ((perc != lastPercentage) || (downloadStatus != lastStatus))
       {
         lastPercentage = perc;
         int ratio = (perc * maxRatio) / 100;
-        String[] arg =
-          { String.valueOf(perc) };
-        String summary = getMsg("downloading-ratio", arg);
+        String summary;
+        switch (downloadStatus)
+        {
+        case VALIDATING:
+          String[] argsValidating =
+            { String.valueOf(perc),
+              String.valueOf(loader.getCurrentValidatingPercentage())};
+
+          summary = getMsg("validating-ratio", argsValidating);
+          break;
+        case UPGRADING:
+          String[] argsUpgrading =
+            { String.valueOf(perc),
+              String.valueOf(loader.getCurrentUpgradingPercentage())};
+          summary = getMsg("upgrading-ratio", argsUpgrading);
+          break;
+        default:
+          String[] arg =
+            { String.valueOf(perc) };
+
+          summary = getMsg("downloading-ratio", arg);
+        }
         hmSummary.put(InstallProgressStep.DOWNLOADING, summary);
         notifyListeners(ratio, summary, null);
 

--
Gitblit v1.10.0