comparison 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
comparison
equal deleted inserted replaced
1124:fd2194295218 1125:dd9094d92899
117 mMessageTimer->setInterval(NAG_INTERVAL_MINUTES * 60 * 1000); 117 mMessageTimer->setInterval(NAG_INTERVAL_MINUTES * 60 * 1000);
118 mMessageTimer->start(); 118 mMessageTimer->start();
119 checkUpdates(); 119 checkUpdates();
120 loadUnselectedCertificates(); 120 loadUnselectedCertificates();
121 loadCertificateList(); 121 loadCertificateList();
122 if (!trayMode) { 122
123 if (mSettings.value("ShowOnNextStart").toBool()) {
124 mSettings.remove("ShowOnNextStart");
125 show();
126 } else if (!trayMode) {
123 show(); 127 show();
124 } 128 }
125 } 129 }
126 130
127 void MainWindow::iconActivated(QSystemTrayIcon::ActivationReason reason) 131 void MainWindow::iconActivated(QSystemTrayIcon::ActivationReason reason)
375 /* On linux installDir is <prefix>/bin */ 379 /* On linux installDir is <prefix>/bin */
376 QStringList parameters; 380 QStringList parameters;
377 installDir.cdUp(); 381 installDir.cdUp();
378 parameters << "--prefix" << installDir.path(); 382 parameters << "--prefix" << installDir.path();
379 parameters << "--update"; 383 parameters << "--update";
380 if (isVisible()) {
381 parameters << "--show-after-update";
382 }
383 bool sudo_started = false; 384 bool sudo_started = false;
384 bool use_sudo = is_admin() && is_system_install(); 385 bool use_sudo = is_admin() && is_system_install();
385 if (use_sudo) { 386 if (use_sudo) {
386 QStringList sudoPrograms; 387 QStringList sudoPrograms;
387 sudoPrograms << "pkexec" << "kdesudo" << "sudo"; 388 sudoPrograms << "pkexec" << "kdesudo" << "sudo";
404 fclose(vres.fptr); 405 fclose(vres.fptr);
405 return; 406 return;
406 } 407 }
407 408
408 #endif 409 #endif
410 if (isVisible()) {
411 mSettings.setValue("ShowOnNextStart", true);
412 mSettings.sync();
413 }
409 414
410 syslog_info_printf ("Installing update: %s\n", fileName.toUtf8().constData()); 415 syslog_info_printf ("Installing update: %s\n", fileName.toUtf8().constData());
411 /* Installer process should now be running. We exit */ 416 /* Installer process should now be running. We exit */
412 fclose(vres.fptr); 417 fclose(vres.fptr);
413 closeApp(); 418 closeApp();

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