diff --git a/src/jd/SplashScreen.java b/src/jd/SplashScreen.java index 3f2dd2ebe9..7c7838e606 100644 --- a/src/jd/SplashScreen.java +++ b/src/jd/SplashScreen.java @@ -77,10 +77,17 @@ public class SplashScreen implements ActionListener { imageCounter++; } + /* + * dieser konstruktor wird benutzt falls kein splash angezeigt werden soll + */ public SplashScreen() { + unused = true; } + /* + * dieser konstruktor wird benutzt falls ein splash angezeigt werden soll + */ public SplashScreen(Image image) throws IOException, AWTException { // final URL url = diff --git a/src/jd/utils/WebUpdate.java b/src/jd/utils/WebUpdate.java index b42421d307..155188e8ba 100644 --- a/src/jd/utils/WebUpdate.java +++ b/src/jd/utils/WebUpdate.java @@ -64,7 +64,7 @@ public class WebUpdate implements ControlListener { } public static boolean updateUpdater() { - final ProgressController progress = new ProgressController(JDLocale.LF("wrapper.webupdate.updateUpdater", "Download updater")); + final ProgressController progress = new ProgressController(JDLocale.LF("wrapper.webupdate.updatenewupdater", "Downloading new jdupdate.jar")); progress.increase(1); Thread ttmp = new Thread() { public void run() { @@ -136,7 +136,7 @@ public class WebUpdate implements ControlListener { } ttmp.interrupt(); progress.setColor(Color.RED); - progress.setStatusText(JDLocale.LF("wrapper.webupdate.updateUpdater.error_reqeust2", "Could not download current jdupdate.jar")); + progress.setStatusText(JDLocale.LF("wrapper.webupdate.updateUpdater.error_reqeust2", "Could not download new jdupdate.jar")); progress.finalize(5000); logger.info("Update of " + file.getAbsolutePath() + " failed"); return false; @@ -248,38 +248,42 @@ public class WebUpdate implements ControlListener { private static void doUpdate() { if (updateinprogress == true) return; - updateinprogress = true; - while (JDInitialized == false) { - int i = 0; - try { - Thread.sleep(1000); - i++; - logger.severe("Waiting on JD-Init-Complete since " + i + " secs!"); - } catch (InterruptedException e) { + new Thread() { + public void run() { + updateinprogress = true; + while (JDInitialized == false) { + int i = 0; + try { + Thread.sleep(1000); + i++; + logger.severe("Waiting on JD-Init-Complete since " + i + " secs!"); + } catch (InterruptedException e) { + } + } + + while (DynamicPluginsFinished == false) { + int i = 0; + try { + Thread.sleep(1000); + i++; + logger.severe("Waiting on DynamicPlugins since " + i + " secs!"); + } catch (InterruptedException e) { + } + } + + DownloadController.getInstance().backupDownloadLinksSync(); + + if (!WebUpdate.updateUpdater()) { + updateinprogress = false; + return; + } + JDIO.writeLocalFile(JDUtilities.getResourceFile("webcheck.tmp"), new Date().toString() + "\r\n(Revision" + JDUtilities.getRevision() + ")"); + logger.info(JDUtilities.runCommand("java", new String[] { "-jar", "jdupdate.jar", "/restart", "/rt" + JDUtilities.getRunType() }, JDUtilities.getResourceFile(".").getAbsolutePath(), 0)); + if (JDUtilities.getController() != null) JDUtilities.getController().prepareShutdown(); + updateinprogress = false; + System.exit(0); } - } - - while (DynamicPluginsFinished == false) { - int i = 0; - try { - Thread.sleep(1000); - i++; - logger.severe("Waiting on DynamicPlugins since " + i + " secs!"); - } catch (InterruptedException e) { - } - } - - DownloadController.getInstance().backupDownloadLinksSync(); - - if (!WebUpdate.updateUpdater()) { - updateinprogress = false; - return; - } - JDIO.writeLocalFile(JDUtilities.getResourceFile("webcheck.tmp"), new Date().toString() + "\r\n(Revision" + JDUtilities.getRevision() + ")"); - logger.info(JDUtilities.runCommand("java", new String[] { "-jar", "jdupdate.jar", "/restart", "/rt" + JDUtilities.getRunType() }, JDUtilities.getResourceFile(".").getAbsolutePath(), 0)); - if (JDUtilities.getController() != null) JDUtilities.getController().prepareShutdown(); - updateinprogress = false; - System.exit(0); + }.start(); } public void controlEvent(ControlEvent event) {