andre@609: /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik andre@609: * Software engineering by Intevation GmbH andre@609: * andre@609: * This file is Free Software under the GNU GPL (v>=2) andre@609: * and comes with ABSOLUTELY NO WARRANTY! andre@609: * See LICENSE.txt for details. andre@609: */ andre@609: #include andre@609: #include andre@609: #include andre@609: #include andre@609: #include andre@609: #include andre@609: andre@609: #include "processwaitdialog.h" andre@609: #include "processhelp.h" andre@609: andre@609: ProcessWaitDialog::ProcessWaitDialog(QWidget *parent, const QStringList& processNames) : andre@609: QDialog(parent), andre@609: mProcessNames(processNames) { andre@609: QHBoxLayout *theLayout = new QHBoxLayout(this); andre@609: andre@609: setWindowTitle(tr("Applications need to be closed.")); andre@613: setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint); andre@609: emanuel@661: QLabel *warnLabel = new QLabel(tr("Please close all running Firefox and Thunderbird instances to continue installation!")); andre@609: QLabel *warnIcon = new QLabel(); andre@609: warnIcon->setPixmap(QApplication::style()->standardPixmap(QStyle::SP_MessageBoxWarning)); andre@609: andre@609: theLayout->addWidget(warnIcon); andre@609: theLayout->addWidget(warnLabel); andre@613: andre@613: theLayout->setSizeConstraint(QLayout::SetFixedSize); andre@609: // mProcessList = new QListWidget(); andre@609: // theLayout->addWidget(mProcessList); andre@609: updateProcesses(); andre@609: } andre@609: andre@609: void ProcessWaitDialog::updateProcesses() { andre@609: QList pids; andre@609: foreach (const QString& pName, mProcessNames) { andre@609: pids.append(ProcessHelp::getProcessesIdForName(pName)); andre@609: } andre@609: if (pids.isEmpty()) { andre@609: accept(); andre@609: return; andre@609: } andre@609: andre@609: /* mProcessList->clear(); andre@609: andre@609: foreach (int pId, pids) { andre@609: mProcessList->addItem(QString::fromLatin1("Pid ") + pId); andre@609: } andre@609: */ andre@609: QTimer::singleShot(500, this, SLOT(updateProcesses())); andre@609: }