[PATCH] (Issue25) Fix typos change order and add better date formating
Wald Commits
scm-commit at wald.intevation.org
Wed Jul 2 16:07:06 CEST 2014
# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1404309957 -7200
# Node ID 57bd73145e48e0a8f6efdd2bef9813b15b421595
# Parent cdf8a924e4800dc52fce3d161fa814b3c5d19393
(Issue25) Fix typos change order and add better date formating
diff -r cdf8a924e480 -r 57bd73145e48 ui/mainwindow.cpp
--- 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());
}
More information about the Trustbridge-commits
mailing list