Mercurial > trustbridge
comparison ui/mainwindow.cpp @ 1104:a7a72353d6d2
(issue111) Wording and German translation.
author | Emanuel Schuetze <emanuel@intevation.de> |
---|---|
date | Mon, 15 Sep 2014 14:08:40 +0200 |
parents | c4e3498e716f |
children | 6f7b7d88f048 |
comparison
equal
deleted
inserted
replaced
1103:c4e3498e716f | 1104:a7a72353d6d2 |
---|---|
47 | 47 |
48 // The amount of time in minutes stay silent if we have | 48 // The amount of time in minutes stay silent if we have |
49 // something to say | 49 // something to say |
50 #define NAG_INTERVAL_MINUTES 70 | 50 #define NAG_INTERVAL_MINUTES 70 |
51 | 51 |
52 #define DATETIME_FORMAT "d. MMM yyyy HH:mm:ss" | 52 #define DATETIME_FORMAT "d. MMM yyyy HH:mm" |
53 | 53 |
54 #ifndef APPNAME | 54 #ifndef APPNAME |
55 #define APPNAME "TrustBridge" | 55 #define APPNAME "TrustBridge" |
56 #endif | 56 #endif |
57 | 57 |
650 QHBoxLayout *updateDateAndSearchButton = new QHBoxLayout; | 650 QHBoxLayout *updateDateAndSearchButton = new QHBoxLayout; |
651 mCertListVersion = | 651 mCertListVersion = |
652 new QLabel(QString()); | 652 new QLabel(QString()); |
653 mCertListVersionContents = new QLabel(QString()); | 653 mCertListVersionContents = new QLabel(QString()); |
654 const QDateTime lastCheck = mSettings.value("lastUpdateCheck").toDateTime().toLocalTime(); | 654 const QDateTime lastCheck = mSettings.value("lastUpdateCheck").toDateTime().toLocalTime(); |
655 mLastUpdateCheck = new QLabel(tr("Last update check:")); | |
655 if (lastCheck.isValid()) { | 656 if (lastCheck.isValid()) { |
656 const QString lastUpdateCheck = QLocale::system().toString(lastCheck, DATETIME_FORMAT); | 657 const QString lastUpdateCheck = QLocale::system().toString(lastCheck, DATETIME_FORMAT); |
657 mLastUpdateCheck = | |
658 new QLabel(tr("Last successful update check:")); | |
659 mLastUpdateCheckContents = new QLabel(lastUpdateCheck); | 658 mLastUpdateCheckContents = new QLabel(lastUpdateCheck); |
660 } else { | 659 } else { |
661 mLastUpdateCheck = new QLabel(tr("Last successful update check:")); | |
662 mLastUpdateCheckContents = new QLabel(tr("No connection with the updateserver.")); | 660 mLastUpdateCheckContents = new QLabel(tr("No connection with the updateserver.")); |
663 } | 661 } |
664 QPushButton *searchUpdates = new QPushButton(" " + tr("Update")); | 662 QPushButton *searchUpdates = new QPushButton(" " + tr("Update")); |
665 searchUpdates->setFixedHeight(18); | 663 searchUpdates->setFixedHeight(22); |
666 searchUpdates->setToolTip(tr("Check for Updates")); | 664 searchUpdates->setToolTip(tr("Check for Updates")); |
667 searchUpdates->setStyleSheet("font-size: 10px;"); | 665 searchUpdates->setStyleSheet("font-size: 10px;"); |
668 searchUpdates->setIcon(QIcon(":/img/update-list.png")); | 666 searchUpdates->setIcon(QIcon(":/img/update-list.png")); |
669 connect(searchUpdates, SIGNAL(clicked()), this, SLOT(checkUpdates())); | 667 connect(searchUpdates, SIGNAL(clicked()), this, SLOT(checkUpdates())); |
670 updateDateAndSearchButton->addWidget(mLastUpdateCheckContents); | 668 updateDateAndSearchButton->addWidget(mLastUpdateCheckContents); |
883 QImage *logoImage = new QImage(":/img/logo.png"); | 881 QImage *logoImage = new QImage(":/img/logo.png"); |
884 QLabel *logo = new QLabel; | 882 QLabel *logo = new QLabel; |
885 logo->setBackgroundRole(QPalette::Base); | 883 logo->setBackgroundRole(QPalette::Base); |
886 logo->setPixmap(QPixmap::fromImage(*logoImage)); | 884 logo->setPixmap(QPixmap::fromImage(*logoImage)); |
887 QLabel *title = new QLabel("<h1>" + QString::fromLatin1(APPNAME) + "</h1>"); | 885 QLabel *title = new QLabel("<h1>" + QString::fromLatin1(APPNAME) + "</h1>"); |
888 QLabel *subTitle = new QLabel(QString::fromLatin1("<h3>") + | 886 QLabel *subTitle = new QLabel(tr("Trust in your digital communication")); |
889 tr("Trust in your digital communication") + QString::fromLatin1("</h3>")); | |
890 QLabel *swVersion = new QLabel(QString::fromLatin1("<i>") + | 887 QLabel *swVersion = new QLabel(QString::fromLatin1("<i>") + |
891 tr("Version") + " " + QApplication::applicationVersion() + | 888 tr("Version") + " " + QApplication::applicationVersion() + |
892 QString::fromLatin1(" </i>")); | 889 QString::fromLatin1(" </i>")); |
893 | 890 |
894 swVersion->setTextInteractionFlags(Qt::TextSelectableByKeyboard | Qt::TextSelectableByMouse); | 891 swVersion->setTextInteractionFlags(Qt::TextSelectableByKeyboard | Qt::TextSelectableByMouse); |
1015 | 1012 |
1016 /* Show a different tip in case of manual changes, updates aviailable, updates and manual | 1013 /* Show a different tip in case of manual changes, updates aviailable, updates and manual |
1017 * changes available */ | 1014 * changes available */ |
1018 if (changeCount() && !mUpdatesManual->activeCertificates()) { | 1015 if (changeCount() && !mUpdatesManual->activeCertificates()) { |
1019 mUpdatesTip->setText( | 1016 mUpdatesTip->setText( |
1020 tr("You should apply the following, recommended changes to your certificate stores.")); | 1017 tr("You should apply the following, recommended changes to your certificate stores:")); |
1021 } else if (changeCount()) { | 1018 } else if (changeCount()) { |
1022 mUpdatesTip->setText( | 1019 mUpdatesTip->setText( |
1023 tr("You can apply the following, changes to your certificate stores.")); | 1020 tr("You can apply the following, changes to your certificate stores:")); |
1024 } else { | 1021 } else { |
1025 mUpdatesTip->setText( | 1022 mUpdatesTip->setText( |
1026 tr("There are currently no changes for your certificate stores.")); | 1023 tr("There are currently no changes for your certificate stores.")); |
1027 } | 1024 } |
1028 | 1025 |
1032 mUpdatesHeader->setText("<h2>" + tr("Certificates unchanged") + | 1029 mUpdatesHeader->setText("<h2>" + tr("Certificates unchanged") + |
1033 "</h2>"); | 1030 "</h2>"); |
1034 mInstallButton->setText(" " + tr("Install certificates again")); | 1031 mInstallButton->setText(" " + tr("Install certificates again")); |
1035 } else { | 1032 } else { |
1036 mQuitButton->setText(" " + tr("Quit without saving")); | 1033 mQuitButton->setText(" " + tr("Quit without saving")); |
1037 mUpdatesHeader->setText("<h2>" + tr("Outstanding changes (%1)") | 1034 mUpdatesHeader->setText("<h2>" + tr("Pending changes (%1)") |
1038 .arg(changeCount()) + | 1035 .arg(changeCount()) + |
1039 "</h2>"); | 1036 "</h2>"); |
1040 mInstallButton->setText(" " + tr("Apply changes")); | 1037 mInstallButton->setText(" " + tr("Apply changes")); |
1041 } | 1038 } |
1042 | 1039 |
1047 } else { | 1044 } else { |
1048 mUpdatesDetailsManual->hide(); | 1045 mUpdatesDetailsManual->hide(); |
1049 mUpdatesManual->hide(); | 1046 mUpdatesManual->hide(); |
1050 } | 1047 } |
1051 mUpdatesManualCertificates->setText("<h2>" + | 1048 mUpdatesManualCertificates->setText("<h2>" + |
1052 tr("Manually changed certificates (%1)").arg(mUpdatesManual->activeCertificates()) + | 1049 tr("Manual changes (%1)").arg(mUpdatesManual->activeCertificates()) + |
1053 "</h2>"); | 1050 "</h2>"); |
1054 | 1051 |
1055 if (mUpdatesNew->certificates().size()) { | 1052 if (mUpdatesNew->certificates().size()) { |
1056 mUpdatesNewCertificates->setText("<h3>" + | 1053 mUpdatesNewCertificates->setText("<h3>" + |
1057 tr("Install new trusted certificates (%1/%2)") | 1054 tr("Install new trusted certificates (%1/%2)") |
1098 mUpdatesDetailsHeader->setText(QString::fromLatin1("<h2>") + | 1095 mUpdatesDetailsHeader->setText(QString::fromLatin1("<h2>") + |
1099 tr("No new recommendations") + QString::fromLatin1("</h2>")); | 1096 tr("No new recommendations") + QString::fromLatin1("</h2>")); |
1100 } | 1097 } |
1101 | 1098 |
1102 if (mListToInstall.isValid()) { | 1099 if (mListToInstall.isValid()) { |
1103 mCertListVersion->setText(tr("Certificatelist from:")); | 1100 mCertListVersion->setText(tr("Certificate list from:")); |
1104 mCertListVersionContents->setText(QLocale::system().toString( | 1101 mCertListVersionContents->setText(QLocale::system().toString( |
1105 mListToInstall.date().toLocalTime(), DATETIME_FORMAT)); | 1102 mListToInstall.date().toLocalTime(), DATETIME_FORMAT)); |
1106 } else { | 1103 } else { |
1107 if (mInstalledList.isValid()) { | 1104 if (mInstalledList.isValid()) { |
1108 mCertListVersion->setText(tr("Currently installed Certificatelist:")); | 1105 mCertListVersion->setText(tr("Currently installed certificate list:")); |
1109 mCertListVersionContents->setText(QLocale::system().toString( | 1106 mCertListVersionContents->setText(QLocale::system().toString( |
1110 mInstalledList.date().toLocalTime(), DATETIME_FORMAT)); | 1107 mInstalledList.date().toLocalTime(), DATETIME_FORMAT)); |
1111 } else { | 1108 } else { |
1112 mCertListVersion->setText(tr("No Certificatelist installed.")); | 1109 mCertListVersion->setText(tr("No certificate list installed.")); |
1113 mCertListVersionContents->setText(""); | 1110 mCertListVersionContents->setText(""); |
1114 } | 1111 } |
1115 } | 1112 } |
1116 } | 1113 } |
1117 | 1114 |
1413 return; | 1410 return; |
1414 } | 1411 } |
1415 | 1412 |
1416 static void deactivateDetailsButton(QPushButton *btn) { | 1413 static void deactivateDetailsButton(QPushButton *btn) { |
1417 btn->setToolTip(QObject::tr("Hide details")); | 1414 btn->setToolTip(QObject::tr("Hide details")); |
1418 btn->setText(QObject::tr("Less")); | 1415 btn->setText(" " + QObject::tr("Less")); |
1419 btn->setIcon(QIcon(":/img/dialog-information_grey_16px.png")); | 1416 btn->setIcon(QIcon(":/img/dialog-information_grey_16px.png")); |
1420 } | 1417 } |
1421 | 1418 |
1422 static void activateDetailsButton(QPushButton *btn) { | 1419 static void activateDetailsButton(QPushButton *btn) { |
1423 btn->setToolTip(QObject::tr("Show details")); | 1420 btn->setToolTip(QObject::tr("Show details")); |
1424 btn->setText(QObject::tr("Details")); | 1421 btn->setText(" " + QObject::tr("Details")); |
1425 btn->setIcon(QIcon(":/img/dialog-information_16px.png")); | 1422 btn->setIcon(QIcon(":/img/dialog-information_16px.png")); |
1426 } | 1423 } |
1427 | 1424 |
1428 void MainWindow::toggleUpdatesNew() { | 1425 void MainWindow::toggleUpdatesNew() { |
1429 if (!mUpdatesNew->isVisible()) { | 1426 if (!mUpdatesNew->isVisible()) { |