From 535613fb5fd9a2e33c5d5717dd17a2afaf2139ff Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Fri, 27 Apr 2007 14:36:16 +0000
Subject: [PATCH] Addresses issues with GUI access to builds repository - Fixes a bug in which caused the connection problem dialog to fail to appear - Fixes a presentation problem with the HTML presented in the connection problem dialog - Properly associates the web proxy dialog with its parent and centers on the screen

---
 opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/ChooseVersionPanel.java |   28 +++++++++++++++++++++++-----
 1 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/ChooseVersionPanel.java b/opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/ChooseVersionPanel.java
index 576e093..15e3fc2 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/ChooseVersionPanel.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/ChooseVersionPanel.java
@@ -70,7 +70,7 @@
    */
   public ChooseVersionPanel(GuiApplication application) {
     super(application);
-    createBuildLoader();
+    getBuildLoader();
   }
 
   /**
@@ -245,7 +245,7 @@
     return getMsg("upgrade-choose-version-panel-instructions");
   }
 
-  private RemoteBuildListComboBoxModelCreator createBuildLoader() {
+  private RemoteBuildListComboBoxModelCreator getBuildLoader() {
     if (bld == null) {
       RemoteBuildManager rbm =
               ((Upgrader) getApplication()).getRemoteBuildManager();
@@ -356,15 +356,25 @@
       throws IOException
     {
       this.rbm = rbm;
-      this.in = rbm.getDailyBuildsInputStream(getMainWindow(),
-              "Reading build information");
+
+      // This is a lengthy operation that must be
+      // performed in the event thread.  So try
+      // to do this work now during construction
+      // rather than when the panel becomes visible
+      // for the first time.  If we fail we'll try
+      // again later.
+      try {
+        getInputStream();
+      } catch (IOException e) {
+        LOG.log(Level.INFO, "Error obtaining build list input stream", e);
+      }
     }
 
     /**
      * {@inheritDoc}
      */
     public java.util.List<Build> processBackgroundTask() throws Exception {
-      return rbm.listBuilds(in);
+      return rbm.listBuilds(getInputStream());
     }
 
     /**
@@ -424,6 +434,14 @@
         });
       }
     }
+
+    private InputStream getInputStream() throws IOException {
+      if (this.in == null) {
+        this.in = rbm.getDailyBuildsInputStream(getMainWindow(),
+                "Reading build information");
+      }
+      return this.in;
+    }
   }
 
 }

--
Gitblit v1.10.0