diff ui/mainwindow.cpp @ 841:216a65d7fc4b

(issue66) Implement is_system_install and use it This has completly different implementations for linux and Windows. The commit also moves some code into util.c for better reuse.
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 29 Jul 2014 18:12:57 +0200
parents 78c8ce22d9f4
children bd33c6585cd0
line wrap: on
line diff
--- a/ui/mainwindow.cpp	Tue Jul 29 13:15:32 2014 +0200
+++ b/ui/mainwindow.cpp	Tue Jul 29 18:12:57 2014 +0200
@@ -277,7 +277,7 @@
   //  shExecInfo.fMask = SEE_MASK_NOASYNC;
     shExecInfo.nShow = SW_SHOWDEFAULT;
 
-    if (!is_admin()) {
+    if (!is_system_install() || !is_admin()) {
         shExecInfo.lpVerb = L"open";
     } else {
         shExecInfo.lpVerb = L"runas";
@@ -299,7 +299,7 @@
     QStringList parameters;
     parameters << "--prefix" << installDir.path();
     bool sudo_started = false;
-    bool use_sudo = is_admin();
+    bool use_sudo = is_admin() && is_system_install();
     if (use_sudo) {
         QStringList sudoPrograms;
         sudoPrograms << "gksudo" << "kdesudo" << "sudo";
@@ -566,7 +566,7 @@
     mInstallButton = new QPushButton(" " + tr("Install certificates again"));
     mInstallButton->setFixedHeight(30);
 #ifdef Q_OS_WIN
-    if (is_admin()) {
+    if (is_admin() && is_system_install()) {
         QIcon uacShield = QApplication::style()->standardIcon(QStyle::SP_VistaShield);
         mInstallButton->setIcon(uacShield);
     }

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