diff ui/mainwindow.cpp @ 1125:dd9094d92899

(issue54) If the MainWindows is visible when an update is triggered start it visible after upadte
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 17 Sep 2014 12:12:44 +0200
parents df2297e741ad
children a07030035349
line wrap: on
line diff
--- a/ui/mainwindow.cpp	Wed Sep 17 12:11:57 2014 +0200
+++ b/ui/mainwindow.cpp	Wed Sep 17 12:12:44 2014 +0200
@@ -119,7 +119,11 @@
     checkUpdates();
     loadUnselectedCertificates();
     loadCertificateList();
-    if (!trayMode) {
+
+    if (mSettings.value("ShowOnNextStart").toBool()) {
+        mSettings.remove("ShowOnNextStart");
+        show();
+    } else if (!trayMode) {
         show();
     }
 }
@@ -377,9 +381,6 @@
     installDir.cdUp();
     parameters << "--prefix" << installDir.path();
     parameters << "--update";
-    if (isVisible()) {
-        parameters << "--show-after-update";
-    }
     bool sudo_started = false;
     bool use_sudo = is_admin() && is_system_install();
     if (use_sudo) {
@@ -406,6 +407,10 @@
     }
 
 #endif
+    if (isVisible()) {
+        mSettings.setValue("ShowOnNextStart", true);
+        mSettings.sync();
+    }
 
     syslog_info_printf ("Installing update: %s\n", fileName.toUtf8().constData());
     /* Installer process should now be running. We exit */

http://wald.intevation.org/projects/trustbridge/