comparison ui/mainwindow.cpp @ 456:37a97621b466

Added label for current and updated list date.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 23 Apr 2014 14:00:10 +0200
parents 94613c91a3d4
children 1ce835c40eb7
comparison
equal deleted inserted replaced
455:4204ae2753d9 456:37a97621b466
288 QVBoxLayout *detailContentLayout = new QVBoxLayout; 288 QVBoxLayout *detailContentLayout = new QVBoxLayout;
289 QHBoxLayout *headerLayout = new QHBoxLayout; 289 QHBoxLayout *headerLayout = new QHBoxLayout;
290 QVBoxLayout *headerTextLayout = new QVBoxLayout; 290 QVBoxLayout *headerTextLayout = new QVBoxLayout;
291 QHBoxLayout *bottomLayout = new QHBoxLayout; 291 QHBoxLayout *bottomLayout = new QHBoxLayout;
292 QVBoxLayout *settingsLayout = new QVBoxLayout; 292 QVBoxLayout *settingsLayout = new QVBoxLayout;
293 QVBoxLayout *listInfoLayout = new QVBoxLayout;
293 294
294 // The certificate list 295 // The certificate list
295 QGroupBox *certBox = new QGroupBox(tr("Managed Certificates")); 296 QGroupBox *certBox = new QGroupBox(tr("Managed Certificates"));
296 mCertListWidget = new QListWidget; 297 mCertListWidget = new QListWidget;
297 connect(mCertListWidget, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), 298 connect(mCertListWidget, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),
298 this, SLOT(showDetails(QListWidgetItem*))); 299 this, SLOT(showDetails(QListWidgetItem*)));
299 certLayout->addWidget(mCertListWidget); 300 certLayout->addWidget(mCertListWidget);
301
302 mCurrentListDate = new QLabel(tr("Current List Date: %1").arg(""));
303 mNewListDate = new QLabel("");
304 listInfoLayout->addWidget(mCurrentListDate);
305 listInfoLayout->addWidget(mNewListDate);
306 certLayout->addLayout(listInfoLayout);
307
300 certBox->setLayout(certLayout); 308 certBox->setLayout(certLayout);
301 309
302 // The header (icon, about text) 310 // The header (icon, about text)
303 QImage *logoImage = new QImage(":/img/logo.png"); 311 QImage *logoImage = new QImage(":/img/logo.png");
304 QLabel *logo = new QLabel; 312 QLabel *logo = new QLabel;
409 } 417 }
410 else { 418 else {
411 oldRemoveCerts.append(cert); 419 oldRemoveCerts.append(cert);
412 } 420 }
413 } 421 }
422 // Set the date of the old list.
423 mCurrentListDate->setText(tr("Current List Date: %1")
424 .arg(mInstalledList.date().toString()));
414 } 425 }
415 else { 426 else {
416 // Sort and filter both lists. 427 // Sort and filter both lists.
417 foreach (const Certificate &cert, mListToInstall.getCertificates()) { 428 foreach (const Certificate &cert, mListToInstall.getCertificates()) {
418 if (cert.isInstallCert()) { 429 if (cert.isInstallCert()) {
437 // status "remove". 448 // status "remove".
438 newRemoveCerts.append(cert); 449 newRemoveCerts.append(cert);
439 } 450 }
440 } 451 }
441 } 452 }
453 mCurrentListDate->setText(tr("Current List Date: %1")
454 .arg(mInstalledList.date().toString()));
455 mNewListDate->setText(tr("New List Date: %1").arg(mListToInstall.date().toString()));
442 } 456 }
443 457
444 // Add separators and certificates to list widget. 458 // Add separators and certificates to list widget.
445 mCertListWidget->addItem(createSeparator(tr("New certificates to install"), i++)); 459 mCertListWidget->addItem(createSeparator(tr("New certificates to install"), i++));
446 foreach (const Certificate &cert, newInstallCerts) { 460 foreach (const Certificate &cert, newInstallCerts) {

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