[PATCH 4 of 5] (issue54) If the MainWindows is visible when an update is triggered start it visible after upadte

Wald Commits scm-commit at wald.intevation.org
Wed Sep 17 12:14:17 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1410948764 -7200
# Node ID dd9094d92899389e198d225c129bf43b55da3599
# Parent  fd2194295218995c6a62d2501ed4ba68b50f26eb
(issue54) If the MainWindows is visible when an update is triggered start it visible after upadte

diff -r fd2194295218 -r dd9094d92899 ui/mainwindow.cpp
--- 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 */


More information about the Trustbridge-commits mailing list