changeset 1246:8748223990eb

(issue39) Show generic warning on installation for firefox/thunderbird instances
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 25 Sep 2014 11:11:37 +0200
parents 1c77c4c6aff4
children d4b24df4eed1
files ui/mainwindow.cpp
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ui/mainwindow.cpp	Thu Sep 25 09:11:05 2014 +0200
+++ b/ui/mainwindow.cpp	Thu Sep 25 11:11:37 2014 +0200
@@ -1562,6 +1562,7 @@
 
 void MainWindow::checkAndInstallCerts()
 {
+#ifdef WIN32
     /* Checking before opening the dialog should be cheaper */
     QList<int> pids = ProcessHelp::getProcessesIdForName("firefox");
     pids.append(ProcessHelp::getProcessesIdForName("thunderbird"));
@@ -1581,6 +1582,25 @@
 
     waitDialog->exec();
     return;
+#else
+    /* On GNU Linux finding all firefox / thunderbird instances which
+     * could be found on the filesystem is more difficult. So
+     * for now we just show a generic warning dialog. */
+    QMessageBox* warnMessage = new QMessageBox (QMessageBox::Information,
+            tr("Firefox and Thunderbird certificate installation."),
+            tr("Please close all running Firefox and Thunderbird instances "
+                "before continuing with the installation."), QMessageBox::Ok | QMessageBox::No,
+            this);
+    warnMessage->button(QMessageBox::Ok)->setText(tr("Continue"));
+    warnMessage->setDefaultButton(QMessageBox::Ok);
+    warnMessage->button(QMessageBox::No)->setText(tr("Cancel"));
+    warnMessage->setWindowIcon(windowIcon());
+    warnMessage->setIconPixmap(QIcon(":/img/dialog-warning.png").pixmap(QSize(48,48)));
+
+    connect(warnMessage->button(QMessageBox::Ok), SIGNAL(clicked()), this, SLOT(installCerts()));
+    warnMessage->exec();
+    return;
+#endif
 }
 
 void MainWindow::togglePages(int button)

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