comparison ui/mainwindow.cpp @ 696:55f78c4166fb

(Issue32) Change Updates to Changes and track changes.
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 01 Jul 2014 17:20:07 +0200
parents 25a73bfec359
children 9dea3d895f53
comparison
equal deleted inserted replaced
695:0f4c480c41f4 696:55f78c4166fb
460 460
461 QToolButton *updatesButton = new QToolButton; 461 QToolButton *updatesButton = new QToolButton;
462 updatesButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); 462 updatesButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
463 updatesButton->setIcon(QIcon(":/img/view-refresh.png")); 463 updatesButton->setIcon(QIcon(":/img/view-refresh.png"));
464 updatesButton->setIconSize(QSize(40, 40)); 464 updatesButton->setIconSize(QSize(40, 40));
465 updatesButton->setText(tr("Updates")); 465 updatesButton->setText(tr("Changes"));
466 updatesButton->setFixedWidth(120); 466 updatesButton->setFixedWidth(120);
467 updatesButton->setFixedHeight(80); 467 updatesButton->setFixedHeight(80);
468 updatesButton->setCheckable(true); 468 updatesButton->setCheckable(true);
469 updatesButton->setChecked(true); 469 updatesButton->setChecked(true);
470 470
531 QVBoxLayout *updatesHeaderButtonLayout = new QVBoxLayout; 531 QVBoxLayout *updatesHeaderButtonLayout = new QVBoxLayout;
532 QHBoxLayout *updatesHeaderActionLayout = new QHBoxLayout; 532 QHBoxLayout *updatesHeaderActionLayout = new QHBoxLayout;
533 QHBoxLayout *updatesHeaderSearchLayout = new QHBoxLayout; 533 QHBoxLayout *updatesHeaderSearchLayout = new QHBoxLayout;
534 534
535 mUpdatesHeader = 535 mUpdatesHeader =
536 new QLabel("<h2>" + tr("Updates (%1/%2)").arg(0).arg(0)+ "</h2>"); 536 new QLabel("<h2>" + tr("Certificates unchanged")+ "</h2>");
537 mLastCertUpdate = 537 mLastCertUpdate =
538 new QLabel(tr("Last update of certificates: %1").arg("")); 538 new QLabel(tr("Last update of certificates: %1").arg(""));
539 mLastSWupdate = 539 mLastSWupdate =
540 new QLabel(tr("Last update of TrustBridge: %1").arg("")); 540 new QLabel(tr("Last update of TrustBridge: %1").arg(""));
541 QLabel *updatesTip = 541 QLabel *updatesTip =
542 new QLabel(tr("You should apply the following changes to your root certificates:")); 542 new QLabel(tr("You should apply the following changes to your root certificates:"));
543 updatesTip->setWordWrap(true);
543 544
544 updatesHeaderTextLayout->addWidget(mUpdatesHeader); 545 updatesHeaderTextLayout->addWidget(mUpdatesHeader);
545 updatesHeaderTextLayout->addWidget(mLastCertUpdate); 546 updatesHeaderTextLayout->addWidget(mLastCertUpdate);
546 updatesHeaderTextLayout->addWidget(mLastSWupdate); 547 updatesHeaderTextLayout->addWidget(mLastSWupdate);
547 updatesHeaderTextLayout->addSpacing(10); 548 updatesHeaderTextLayout->addSpacing(10);
549 550
550 QPushButton *searchUpdates = new QPushButton(tr("Check for updates")); 551 QPushButton *searchUpdates = new QPushButton(tr("Check for updates"));
551 searchUpdates->setIcon(QIcon(":/img/edit-find.png")); 552 searchUpdates->setIcon(QIcon(":/img/edit-find.png"));
552 mQuitButton = new QPushButton(tr("Quit without saving")); 553 mQuitButton = new QPushButton(tr("Quit without saving"));
553 mQuitButton->setIcon(QIcon(":/img/application-exit.png")); 554 mQuitButton->setIcon(QIcon(":/img/application-exit.png"));
554 QPushButton *installButton = new QPushButton(tr("Install updates")); 555 QPushButton *installButton = new QPushButton(tr("Apply changes"));
555 #ifdef Q_OS_WIN 556 #ifdef Q_OS_WIN
556 if (is_admin()) { 557 if (is_admin()) {
557 QIcon uacShield = QApplication::style()->standardIcon(QStyle::SP_VistaShield); 558 QIcon uacShield = QApplication::style()->standardIcon(QStyle::SP_VistaShield);
558 installButton->setIcon(uacShield); 559 installButton->setIcon(uacShield);
559 } 560 }
809 setCentralWidget(base); 810 setCentralWidget(base);
810 } 811 }
811 812
812 void MainWindow::listChanged(int selected) 813 void MainWindow::listChanged(int selected)
813 { 814 {
814 if (mUpdatesRemove->selectedCertCount() + 815 int totalCount = mUpdatesRemove->selectedCertCount() +
815 mUpdatesNew->selectedCertCount() + 816 mUpdatesNew->selectedCertCount() + mUpdatesManual->certificates().size();
816 mUpdatesManual->selectedCertCount() == 0) { 817
818 if (!totalCount) {
817 /* No changes */ 819 /* No changes */
818 mQuitButton->setText(tr("Quit")); 820 mQuitButton->setText(tr("Quit"));
821 mUpdatesHeader->setText("<h2>" + tr("Certificates unchanged") +
822 "</h2>");
819 } else { 823 } else {
820 mQuitButton->setText(tr("Quit without saving")); 824 mQuitButton->setText(tr("Quit without saving"));
821 } 825 mUpdatesHeader->setText("<h2>" + tr("Changes (%1)")
822 826 .arg(totalCount) +
823 mUpdatesHeader->setText("<h2>" + tr("Updates (%1/%2)") 827 "</h2>");
824 .arg(mUpdatesRemove->selectedCertCount() + mUpdatesNew->selectedCertCount()) 828 }
825 .arg(mUpdatesRemove->certificates().size() + mUpdatesNew->certificates().size()) + 829
826 "</h2>");
827 mUpdatesNewCertificates->setText("<h3>" + 830 mUpdatesNewCertificates->setText("<h3>" +
828 tr("Install new trusted certificates (%1/%2)") 831 tr("Install new trusted certificates (%1/%2)")
829 .arg(mUpdatesNew->selectedCertCount()) 832 .arg(mUpdatesNew->selectedCertCount())
830 .arg(mUpdatesNew->certificates().size()) + 833 .arg(mUpdatesNew->certificates().size()) +
831 "</h3>"); 834 "</h3>");

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