[PATCH 2 of 2] (Issue32) Change Updates to Changes and track changes

Wald Commits scm-commit at wald.intevation.org
Tue Jul 1 17:20:11 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1404228007 -7200
# Node ID 55f78c4166fbcd408ec9307d97c3da972f66ac68
# Parent  0f4c480c41f4be7ba0c648d8cb80196d7e6796bb
(Issue32) Change Updates to Changes and track changes.

diff -r 0f4c480c41f4 -r 55f78c4166fb ui/mainwindow.cpp
--- a/ui/mainwindow.cpp	Tue Jul 01 17:19:02 2014 +0200
+++ b/ui/mainwindow.cpp	Tue Jul 01 17:20:07 2014 +0200
@@ -462,7 +462,7 @@
     updatesButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
     updatesButton->setIcon(QIcon(":/img/view-refresh.png"));
     updatesButton->setIconSize(QSize(40, 40));
-    updatesButton->setText(tr("Updates"));
+    updatesButton->setText(tr("Changes"));
     updatesButton->setFixedWidth(120);
     updatesButton->setFixedHeight(80);
     updatesButton->setCheckable(true);
@@ -533,13 +533,14 @@
     QHBoxLayout *updatesHeaderSearchLayout = new QHBoxLayout;
 
     mUpdatesHeader =
-        new QLabel("<h2>" + tr("Updates (%1/%2)").arg(0).arg(0)+ "</h2>");
+        new QLabel("<h2>" + tr("Certificates unchanged")+ "</h2>");
     mLastCertUpdate =
         new QLabel(tr("Last update of certificates: %1").arg(""));
     mLastSWupdate =
         new QLabel(tr("Last update of TrustBridge: %1").arg(""));
     QLabel *updatesTip =
         new QLabel(tr("You should apply the following changes to your root certificates:"));
+    updatesTip->setWordWrap(true);
 
     updatesHeaderTextLayout->addWidget(mUpdatesHeader);
     updatesHeaderTextLayout->addWidget(mLastCertUpdate);
@@ -551,7 +552,7 @@
     searchUpdates->setIcon(QIcon(":/img/edit-find.png"));
     mQuitButton = new QPushButton(tr("Quit without saving"));
     mQuitButton->setIcon(QIcon(":/img/application-exit.png"));
-    QPushButton *installButton = new QPushButton(tr("Install updates"));
+    QPushButton *installButton = new QPushButton(tr("Apply changes"));
 #ifdef Q_OS_WIN
     if (is_admin()) {
         QIcon uacShield = QApplication::style()->standardIcon(QStyle::SP_VistaShield);
@@ -811,19 +812,21 @@
 
 void MainWindow::listChanged(int selected)
 {
-    if (mUpdatesRemove->selectedCertCount() +
-        mUpdatesNew->selectedCertCount() +
-        mUpdatesManual->selectedCertCount() == 0) {
+    int totalCount = mUpdatesRemove->selectedCertCount() +
+        mUpdatesNew->selectedCertCount() + mUpdatesManual->certificates().size();
+
+    if (!totalCount) {
         /* No changes */
         mQuitButton->setText(tr("Quit"));
+        mUpdatesHeader->setText("<h2>" + tr("Certificates unchanged") +
+                "</h2>");
     } else {
         mQuitButton->setText(tr("Quit without saving"));
+        mUpdatesHeader->setText("<h2>" + tr("Changes (%1)")
+                .arg(totalCount) +
+                "</h2>");
     }
 
-    mUpdatesHeader->setText("<h2>" + tr("Updates (%1/%2)")
-            .arg(mUpdatesRemove->selectedCertCount() + mUpdatesNew->selectedCertCount())
-            .arg(mUpdatesRemove->certificates().size() + mUpdatesNew->certificates().size()) +
-            "</h2>");
     mUpdatesNewCertificates->setText("<h3>" +
             tr("Install new trusted certificates (%1/%2)")
             .arg(mUpdatesNew->selectedCertCount())


More information about the Trustbridge-commits mailing list