Mercurial > trustbridge
comparison ui/mainwindow.cpp @ 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 | 33a17569812a |
children | 9a482182f80f |
comparison
equal
deleted
inserted
replaced
1245:1c77c4c6aff4 | 1246:8748223990eb |
---|---|
1560 qApp->quit(); | 1560 qApp->quit(); |
1561 } | 1561 } |
1562 | 1562 |
1563 void MainWindow::checkAndInstallCerts() | 1563 void MainWindow::checkAndInstallCerts() |
1564 { | 1564 { |
1565 #ifdef WIN32 | |
1565 /* Checking before opening the dialog should be cheaper */ | 1566 /* Checking before opening the dialog should be cheaper */ |
1566 QList<int> pids = ProcessHelp::getProcessesIdForName("firefox"); | 1567 QList<int> pids = ProcessHelp::getProcessesIdForName("firefox"); |
1567 pids.append(ProcessHelp::getProcessesIdForName("thunderbird")); | 1568 pids.append(ProcessHelp::getProcessesIdForName("thunderbird")); |
1568 | 1569 |
1569 if (pids.isEmpty()) { | 1570 if (pids.isEmpty()) { |
1579 connect(waitDialog, SIGNAL(accepted()), this, SLOT(installCerts())); | 1580 connect(waitDialog, SIGNAL(accepted()), this, SLOT(installCerts())); |
1580 connect(waitDialog, SIGNAL(accepted()), waitDialog, SLOT(deleteLater())); | 1581 connect(waitDialog, SIGNAL(accepted()), waitDialog, SLOT(deleteLater())); |
1581 | 1582 |
1582 waitDialog->exec(); | 1583 waitDialog->exec(); |
1583 return; | 1584 return; |
1585 #else | |
1586 /* On GNU Linux finding all firefox / thunderbird instances which | |
1587 * could be found on the filesystem is more difficult. So | |
1588 * for now we just show a generic warning dialog. */ | |
1589 QMessageBox* warnMessage = new QMessageBox (QMessageBox::Information, | |
1590 tr("Firefox and Thunderbird certificate installation."), | |
1591 tr("Please close all running Firefox and Thunderbird instances " | |
1592 "before continuing with the installation."), QMessageBox::Ok | QMessageBox::No, | |
1593 this); | |
1594 warnMessage->button(QMessageBox::Ok)->setText(tr("Continue")); | |
1595 warnMessage->setDefaultButton(QMessageBox::Ok); | |
1596 warnMessage->button(QMessageBox::No)->setText(tr("Cancel")); | |
1597 warnMessage->setWindowIcon(windowIcon()); | |
1598 warnMessage->setIconPixmap(QIcon(":/img/dialog-warning.png").pixmap(QSize(48,48))); | |
1599 | |
1600 connect(warnMessage->button(QMessageBox::Ok), SIGNAL(clicked()), this, SLOT(installCerts())); | |
1601 warnMessage->exec(); | |
1602 return; | |
1603 #endif | |
1584 } | 1604 } |
1585 | 1605 |
1586 void MainWindow::togglePages(int button) | 1606 void MainWindow::togglePages(int button) |
1587 { | 1607 { |
1588 mUpdatesWidget->hide(); | 1608 mUpdatesWidget->hide(); |