Mercurial > trustbridge
comparison ui/mainwindow.cpp @ 692:3791a277f00b
Remove code duplication and calculate headers only in listchanged
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Tue, 01 Jul 2014 16:39:28 +0200 |
parents | 315103410002 |
children | 0fc1a20adaff |
comparison
equal
deleted
inserted
replaced
691:315103410002 | 692:3791a277f00b |
---|---|
629 updatesManualLayout->insertStretch(2, 10); | 629 updatesManualLayout->insertStretch(2, 10); |
630 mUpdatesManual = new CertificateListWidget(this); | 630 mUpdatesManual = new CertificateListWidget(this); |
631 mUpdatesManual->hide(); | 631 mUpdatesManual->hide(); |
632 connect(mUpdatesManual, SIGNAL(certChanged(bool, const Certificate&)), | 632 connect(mUpdatesManual, SIGNAL(certChanged(bool, const Certificate&)), |
633 this, SLOT(removeFromManual(bool, const Certificate&))); | 633 this, SLOT(removeFromManual(bool, const Certificate&))); |
634 connect(mUpdatesManual, SIGNAL(certListChanged(int)), | |
635 this, SLOT(listChanged(int))); | |
634 | 636 |
635 updatesNewLayout->setAlignment(Qt::AlignTop); | 637 updatesNewLayout->setAlignment(Qt::AlignTop); |
636 updatesRemoveLayout->setAlignment(Qt::AlignTop); | 638 updatesRemoveLayout->setAlignment(Qt::AlignTop); |
637 updatesManualLayout->setAlignment(Qt::AlignTop); | 639 updatesManualLayout->setAlignment(Qt::AlignTop); |
638 updatesCenterLayout->addLayout(updatesNewLayout); | 640 updatesCenterLayout->addLayout(updatesNewLayout); |
881 mUpdatesRemove->addCertificate(cert, state); | 883 mUpdatesRemove->addCertificate(cert, state); |
882 } | 884 } |
883 } | 885 } |
884 } | 886 } |
885 } | 887 } |
886 mUpdatesHeader->setText("<h2>" + | 888 |
887 tr("Updates (%1/%2)") | |
888 .arg(mUpdatesNew->selectedCertCount() + mUpdatesRemove->selectedCertCount()) | |
889 .arg(newRemoveCerts.size() + newInstallCerts.size()) + "</h2>"); | |
890 mLastCertUpdate->setText(tr("Last update of certificates: %1") | 889 mLastCertUpdate->setText(tr("Last update of certificates: %1") |
891 .arg(mInstalledList.date().toString())); | 890 .arg(mInstalledList.date().toString())); |
892 mUpdatesNewCertificates->setText("<h3>" + | |
893 tr("Install new trusted certificates (%1/%2)") | |
894 .arg(mUpdatesNew->selectedCertCount()) | |
895 .arg(mUpdatesNew->certificates().size()) + | |
896 "</h3>"); | |
897 | |
898 mUpdatesRemoveCertificates->setText("<h3>" + | |
899 tr("Remove revoked certificates (%1/%2)") | |
900 .arg(mUpdatesRemove->selectedCertCount()) | |
901 .arg(mUpdatesRemove->certificates().size()) + | |
902 "</h3>"); | |
903 mUpdatesManualCertificates->setText("<h3>" + | 891 mUpdatesManualCertificates->setText("<h3>" + |
904 tr("Manually changed certificates (%1)").arg(0) + | 892 tr("Manually changed certificates (%1)").arg(0) + |
905 "</h3>"); | 893 "</h3>"); |
894 listChanged(0); | |
906 } | 895 } |
907 | 896 |
908 void MainWindow::installerError(const QString& errMsg) { | 897 void MainWindow::installerError(const QString& errMsg) { |
909 QMessageBox::warning(this, tr("Error executing update"), errMsg); | 898 QMessageBox::warning(this, tr("Error executing update"), errMsg); |
910 } | 899 } |