diff ui/mainwindow.cpp @ 714:57bd73145e48

(Issue25) Fix typos change order and add better date formating
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 02 Jul 2014 16:05:57 +0200
parents cdf8a924e480
children 929c3db85eb7
line wrap: on
line diff
--- a/ui/mainwindow.cpp	Wed Jul 02 15:46:50 2014 +0200
+++ b/ui/mainwindow.cpp	Wed Jul 02 16:05:57 2014 +0200
@@ -47,6 +47,8 @@
 // something to say
 #define NAG_INTERVAL_MINUTES 70
 
+#define DATETIME_FORMAT "dddd, d.MMMM yyyy HH:mm:ss"
+
 #ifndef APPNAME
 #define APPNAME "TrustBridge"
 #endif
@@ -541,9 +543,9 @@
     mLastCertUpdate->hide();
     mSoftwareVersionLabel =
         new QLabel(tr("TrustBridge Version: %1").arg(QApplication::applicationVersion()));
-    const QDateTime lastCheck = mSettings.value("lastUpdateCheck").toDateTime();
+    const QDateTime lastCheck = mSettings.value("lastUpdateCheck").toDateTime().toLocalTime();
     if (lastCheck.isValid()) {
-        const QString lastUpdateCheck = QLocale::system().toString(lastCheck);
+        const QString lastUpdateCheck = QLocale::system().toString(lastCheck, DATETIME_FORMAT);
         mLastUpdateCheck =
             new QLabel(tr("Last sucessful update check: %1").arg(lastUpdateCheck));
     } else {
@@ -556,9 +558,9 @@
 
     // addWidget(*Widget, row, column, rowspan, colspan, [Qt::Alignment])
     updatesHeaderLayout->addWidget(mUpdatesHeader, 0, 0, 1, 2);
-    updatesHeaderLayout->addWidget(mLastCertUpdate, 1, 0, 1, 1);
-    updatesHeaderLayout->addWidget(mSoftwareVersionLabel, 2, 0, 1, 1);
-    updatesHeaderLayout->addWidget(mLastUpdateCheck, 3, 0, 1, 1);
+    updatesHeaderLayout->addWidget(mSoftwareVersionLabel, 1, 0, 1, 1);
+    updatesHeaderLayout->addWidget(mLastUpdateCheck, 2, 0, 1, 1);
+    updatesHeaderLayout->addWidget(mLastCertUpdate, 3, 0, 1, 1);
     updatesHeaderLayout->addWidget(searchUpdates, 1, 2, 2, 1, Qt::AlignRight);
     updatesHeaderLayout->setRowMinimumHeight(4, 15);
 
@@ -927,7 +929,8 @@
 
     if (mInstalledList.date().isValid()) {
         mLastCertUpdate->setText(tr("Installed certificates from: %1")
-                .arg(QLocale::system().toString(mInstalledList.date())));
+                .arg(QLocale::system().toString(mInstalledList.date().toLocalTime(),
+                        DATETIME_FORMAT)));
         mLastCertUpdate->show();
     }
     mUpdatesManualCertificates->setText("<h3>" +
@@ -1181,8 +1184,8 @@
     if (getState() != TransferError) {
         const QDateTime now = QDateTime::currentDateTime();
         mSettings.setValue("lastUpdateCheck", now);
-        mLastUpdateCheck->setText(tr("Last sucessful update check: %1").arg(
-                        QLocale::system().toString(now)));
+        mLastUpdateCheck->setText(tr("Last successful update check: %1").arg(
+                        QLocale::system().toString(now, DATETIME_FORMAT)));
         mLastUpdateCheck->show();
         syslog_info_printf(tr("Sucessfully checked for updates.").toUtf8().constData());
     }

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