diff options
Diffstat (limited to '')
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/MainWindow.cpp | 2 | ||||
-rwxr-xr-x | src/ui/KeyMgmt.cpp | 2 | ||||
-rw-r--r-- | src/ui/KeyServerImportDialog.cpp | 10 | ||||
-rwxr-xr-x | src/ui/SettingsDialog.cpp | 4 | ||||
-rw-r--r-- | src/ui/keygen/KeygenDialog.cpp | 2 | ||||
-rw-r--r-- | src/ui/keypair_details/KeyPairDetailTab.cpp | 54 | ||||
-rw-r--r-- | src/ui/keypair_details/KeyPairUIDTab.cpp | 4 | ||||
-rw-r--r-- | src/ui/widgets/InfoBoardWidget.cpp | 2 |
9 files changed, 43 insertions, 39 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 03eaac9e..ddbcfc66 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -36,7 +36,7 @@ message(STATUS "RESOURCE_OUTPUT_DIRECTORY ${RESOURCE_OUTPUT_DIRECTORY}") file(GLOB_RECURSE ALL_SOURCE_FILES RELACTIVE ${CMAKE_SOURCE_DIR}/src/*.cpp) # Set Translation Files -set(QT_TS_FILES gpgfrontend_en_us.ts gpgfrontend_zh_chs.ts gpgfrontend_zh_cht.ts gpg_frontend_fr.ts gpg_frontend_ru.ts) +set(QT_TS_FILES gpgfrontend_en_us.ts gpgfrontend_zh_cn.ts gpgfrontend_zh_tw.ts gpg_frontend_fr.ts gpg_frontend_ru.ts) list(TRANSFORM QT_TS_FILES PREPEND ${CMAKE_SOURCE_DIR}/resource/ts/) message(STATUS "QT_TS_FILES ${QT_TS_FILES}") set(QT_QM_FILES_OUTPUT_DIR ${RESOURCE_OUTPUT_DIRECTORY}/ts) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 08433da9..eb8b96b1 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -32,7 +32,7 @@ MainWindow::MainWindow() networkAccessManager = new QNetworkAccessManager(this); - auto waitingDialog = new WaitingDialog("Loading Gnupg", this); + auto waitingDialog = new WaitingDialog(tr("Loading Gnupg"), this); // Init Gnupg auto ctx_thread = QThread::create([&]() { mCtx = new GpgME::GpgContext(); }); diff --git a/src/ui/KeyMgmt.cpp b/src/ui/KeyMgmt.cpp index 0e2d9c9a..ce5343bf 100755 --- a/src/ui/KeyMgmt.cpp +++ b/src/ui/KeyMgmt.cpp @@ -78,7 +78,7 @@ KeyMgmt::KeyMgmt(GpgME::GpgContext *ctx, QWidget *parent ) : this->settings.setValue("keymgmt/setWindowSize", true); } - setWindowTitle(tr("KeyPairs Management")); + setWindowTitle(tr("Key Pair Management")); mKeyList->addMenuAction(deleteSelectedKeysAct); mKeyList->addMenuAction(showKeyDetailsAct); } diff --git a/src/ui/KeyServerImportDialog.cpp b/src/ui/KeyServerImportDialog.cpp index ec740691..a1355120 100644 --- a/src/ui/KeyServerImportDialog.cpp +++ b/src/ui/KeyServerImportDialog.cpp @@ -176,7 +176,7 @@ void KeyServerImportDialog::setMessage(const QString &text, bool error) { void KeyServerImportDialog::slotSearch() { if (searchLineEdit->text().isEmpty()) { - setMessage(tr("<h4>Text is empty.</h4>"), false); + setMessage("<h4>" + tr("Text is empty.") + "</h4>", false); return; } @@ -227,23 +227,23 @@ void KeyServerImportDialog::slotSearchFinished() { if (firstLine.contains("Error")) { QString text = QString(reply->readLine(1024)); if (text.contains("Too many responses")) { - setMessage(tr("<h4>CToo many responses from keyserver!</h4>"), true); + setMessage("<h4>" +tr("Too many responses from keyserver!") + "</h4>", true); return; } else if (text.contains("No keys found")) { // if string looks like hex string, search again with 0x prepended QRegExp rx("[0-9A-Fa-f]*"); QString query = searchLineEdit->text(); if (rx.exactMatch(query)) { - setMessage(tr("<h4>No keys found, input may be kexId, retrying search with 0x.</h4>"), true); + setMessage("<h4>" + tr("No keys found, input may be kexId, retrying search with 0x.") + "</h4>", true); searchLineEdit->setText(query.prepend("0x")); this->slotSearch(); return; } else { - setMessage(tr("<h4>No keys found containing the search string!</h4>"), true); + setMessage("<h4>" +tr("No keys found containing the search string!") + "</h4>", true); return; } } else if (text.contains("Insufficiently specific words")) { - setMessage(tr("<h4>Insufficiently specific search string!</h4>"), true); + setMessage("<h4>" + tr("Insufficiently specific search string!") + "</h4>", true); return; } else { setMessage(text, true); diff --git a/src/ui/SettingsDialog.cpp b/src/ui/SettingsDialog.cpp index d0a107c4..1732d718 100755 --- a/src/ui/SettingsDialog.cpp +++ b/src/ui/SettingsDialog.cpp @@ -498,7 +498,7 @@ AppearanceTab::AppearanceTab(QWidget *parent) infoBoardFontSizeSpin->setRange(9, 18); infoBoardFontSizeSpin->setValue(10); infoBoardFontSizeSpin->setSingleStep(1); - infoBoardLayout->addWidget(new QLabel(" Front Size")); + infoBoardLayout->addWidget(new QLabel(tr(" Front Size"))); infoBoardLayout->addWidget(infoBoardFontSizeSpin); infoBoardBox->setLayout(infoBoardLayout); @@ -604,7 +604,7 @@ KeyserverTab::KeyserverTab(QWidget *parent) auto *mainLayout = new QVBoxLayout(this); - auto *label = new QLabel(tr("Default Keyserver for import:")); + auto *label = new QLabel(tr("Default Key Server for import:")); comboBox = new QComboBox; comboBox->setEditable(false); comboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); diff --git a/src/ui/keygen/KeygenDialog.cpp b/src/ui/keygen/KeygenDialog.cpp index 8637a643..7991ddd1 100644 --- a/src/ui/keygen/KeygenDialog.cpp +++ b/src/ui/keygen/KeygenDialog.cpp @@ -147,7 +147,7 @@ QGroupBox *KeyGenDialog::create_key_usage_group_box() { auto *groupBox = new QGroupBox(this); auto *grid = new QGridLayout(this); - groupBox->setTitle("Key Usage"); + groupBox->setTitle(tr("Key Usage")); auto* encrypt = new QCheckBox(tr("Encryption"), groupBox); encrypt->setTristate(false); diff --git a/src/ui/keypair_details/KeyPairDetailTab.cpp b/src/ui/keypair_details/KeyPairDetailTab.cpp index 0363ae30..9ca4e37e 100644 --- a/src/ui/keypair_details/KeyPairDetailTab.cpp +++ b/src/ui/keypair_details/KeyPairDetailTab.cpp @@ -25,7 +25,8 @@ #include "ui/keypair_details/KeyPairDetailTab.h" #include "ui/WaitingDialog.h" -KeyPairDetailTab::KeyPairDetailTab(GpgME::GpgContext *ctx, const GpgKey &mKey, QWidget *parent) : mKey(mKey), QWidget(parent) { +KeyPairDetailTab::KeyPairDetailTab(GpgME::GpgContext *ctx, const GpgKey &mKey, QWidget *parent) : mKey(mKey), + QWidget(parent) { mCtx = ctx; keyid = new QString(mKey.id); @@ -54,8 +55,8 @@ KeyPairDetailTab::KeyPairDetailTab(GpgME::GpgContext *ctx, const GpgKey &mKey, Q algorithmVarLabel = new QLabel(); // Show the situation that master key not exists. - masterKeyExistVarLabel = new QLabel(mKey.has_master_key ? "Exists" : "Not Exists"); - if(!mKey.has_master_key){ + masterKeyExistVarLabel = new QLabel(mKey.has_master_key ? tr("Exists") : tr("Not Exists")); + if (!mKey.has_master_key) { auto paletteExpired = masterKeyExistVarLabel->palette(); paletteExpired.setColor(masterKeyExistVarLabel->foregroundRole(), Qt::red); masterKeyExistVarLabel->setPalette(paletteExpired); @@ -65,7 +66,7 @@ KeyPairDetailTab::KeyPairDetailTab(GpgME::GpgContext *ctx, const GpgKey &mKey, Q masterKeyExistVarLabel->setPalette(paletteValid); } - if(mKey.expired){ + if (mKey.expired) { auto paletteExpired = expireVarLabel->palette(); paletteExpired.setColor(expireVarLabel->foregroundRole(), Qt::red); expireVarLabel->setPalette(paletteExpired); @@ -132,11 +133,11 @@ KeyPairDetailTab::KeyPairDetailTab(GpgME::GpgContext *ctx, const GpgKey &mKey, Q auto *privKeyBox = new QGroupBox(tr("Operations")); auto *vboxPK = new QVBoxLayout(); - auto *exportButton = new QPushButton(tr("Export Private Key (Include Subkeys)")); + auto *exportButton = new QPushButton(tr("Export Private Key (Include Subkey)")); vboxPK->addWidget(exportButton); connect(exportButton, SIGNAL(clicked()), this, SLOT(slotExportPrivateKey())); - if(mKey.has_master_key) { + if (mKey.has_master_key) { auto *editExpiresButton = new QPushButton(tr("Modify Expiration Datetime (Master Key)")); vboxPK->addWidget(editExpiresButton); connect(editExpiresButton, SIGNAL(clicked()), this, SLOT(slotModifyEditDatetime())); @@ -146,6 +147,7 @@ KeyPairDetailTab::KeyPairDetailTab(GpgME::GpgContext *ctx, const GpgKey &mKey, Q keyServerOperaButton->setStyleSheet("text-align:center;"); auto *revokeCertGenButton = new QPushButton(tr("Generate Revoke Certificate")); + revokeCertGenButton->setDisabled(true); connect(revokeCertGenButton, SIGNAL(clicked()), this, SLOT(slotGenRevokeCert())); hBoxLayout->addWidget(keyServerOperaButton); @@ -176,7 +178,7 @@ KeyPairDetailTab::KeyPairDetailTab(GpgME::GpgContext *ctx, const GpgKey &mKey, Q expLabel->setText(tr("Warning: The Master Key has been revoked")); } - iconLabel->setPixmap(pixmap.scaled(24,24,Qt::KeepAspectRatio)); + iconLabel->setPixmap(pixmap.scaled(24, 24, Qt::KeepAspectRatio)); QFont font = expLabel->font(); font.setBold(true); expLabel->setFont(font); @@ -198,22 +200,23 @@ KeyPairDetailTab::KeyPairDetailTab(GpgME::GpgContext *ctx, const GpgKey &mKey, Q void KeyPairDetailTab::slotExportPrivateKey() { // Show a information box with explanation about private key int ret = QMessageBox::information(this, tr("Exporting private Key"), - tr("<h3>You are about to export your <font color=\"red\">PRIVATE KEY</font>!</h3>\n" - "This is NOT your Public Key, so DON'T give it away.<br />" - "Do you REALLY want to export your PRIVATE KEY?"), + "<h3>" + tr("You are about to export your") + "<font color=\"red\">" + + tr("PRIVATE KEY") + "</font>!</h3>\n" + + tr("This is NOT your Public Key, so DON'T give it away.") + "<br />" + + tr("Do you REALLY want to export your PRIVATE KEY?"), QMessageBox::Cancel | QMessageBox::Ok); // export key, if ok was clicked if (ret == QMessageBox::Ok) { auto *keyArray = new QByteArray(); - if(!mCtx->exportSecretKey(mKey, keyArray)) { - QMessageBox::critical(this, "Error", "An error occurred during the export operation."); - return; - } + if (!mCtx->exportSecretKey(mKey, keyArray)) { + QMessageBox::critical(this, "Error", "An error occurred during the export operation."); + return; + } auto &key = mCtx->getKeyById(*keyid); - QString fileString = key.name + " " +key.email + "(" + + QString fileString = key.name + " " + key.email + "(" + key.id + ")_secret.asc"; QString fileName = QFileDialog::getSaveFileName(this, tr("Export Key To File"), fileString, tr("Key Files") + " (*.asc *.txt);;All Files (*)"); @@ -259,13 +262,13 @@ void KeyPairDetailTab::slotRefreshKeyInfo() { QString usage; QTextStream usage_steam(&usage); - if(mKey.can_certify) + if (mKey.can_certify) usage_steam << "Cert "; - if(mKey.can_encrypt) + if (mKey.can_encrypt) usage_steam << "Encr "; - if(mKey.can_sign) + if (mKey.can_sign) usage_steam << "Sign "; - if(mKey.can_authenticate) + if (mKey.can_authenticate) usage_steam << "Auth "; usageVarLabel->setText(usage); @@ -273,13 +276,13 @@ void KeyPairDetailTab::slotRefreshKeyInfo() { QString actualUsage; QTextStream actual_usage_steam(&actualUsage); - if(GpgME::GpgContext::checkIfKeyCanCert(mKey)) + if (GpgME::GpgContext::checkIfKeyCanCert(mKey)) actual_usage_steam << "Cert "; - if(GpgME::GpgContext::checkIfKeyCanEncr(mKey)) + if (GpgME::GpgContext::checkIfKeyCanEncr(mKey)) actual_usage_steam << "Encr "; - if(GpgME::GpgContext::checkIfKeyCanSign(mKey)) + if (GpgME::GpgContext::checkIfKeyCanSign(mKey)) actual_usage_steam << "Sign "; - if(GpgME::GpgContext::checkIfKeyCanAuth(mKey)) + if (GpgME::GpgContext::checkIfKeyCanAuth(mKey)) actual_usage_steam << "Auth "; actualUsageVarLabel->setText(actualUsage); @@ -336,13 +339,14 @@ void KeyPairDetailTab::slotUpdateKeyToServer() { void KeyPairDetailTab::slotGenRevokeCert() { auto mOutputFileName = QFileDialog::getSaveFileName(this, tr("Generate revocation certificate"), QString(), - QStringLiteral("%1 (*.rev)").arg(tr("Revocation Certificates"))); + QStringLiteral("%1 (*.rev)").arg( + tr("Revocation Certificates"))); auto process = mCtx->generateRevokeCert(mKey, mOutputFileName); auto *dialog = new WaitingDialog("Generating", this); - while(process->state() == QProcess::Running) { + while (process->state() == QProcess::Running) { QApplication::processEvents(); } diff --git a/src/ui/keypair_details/KeyPairUIDTab.cpp b/src/ui/keypair_details/KeyPairUIDTab.cpp index 2a84cef4..2954aadb 100644 --- a/src/ui/keypair_details/KeyPairUIDTab.cpp +++ b/src/ui/keypair_details/KeyPairUIDTab.cpp @@ -56,7 +56,7 @@ KeyPairUIDTab::KeyPairUIDTab(GpgME::GpgContext *ctx, const GpgKey &key, QWidget auto uidGroupBox = new QGroupBox(); uidGroupBox->setLayout(gridLayout); - uidGroupBox->setTitle("UIDs"); + uidGroupBox->setTitle(tr("UIDs")); auto signGridLayout = new QGridLayout(); signGridLayout->addWidget(sigList, 0, 0); @@ -64,7 +64,7 @@ KeyPairUIDTab::KeyPairUIDTab(GpgME::GpgContext *ctx, const GpgKey &key, QWidget auto signGroupBox = new QGroupBox(); signGroupBox->setLayout(signGridLayout); - signGroupBox->setTitle("Signature of Selected UID"); + signGroupBox->setTitle(tr("Signature of Selected UID")); auto vboxLayout = new QVBoxLayout(); vboxLayout->addWidget(uidGroupBox); diff --git a/src/ui/widgets/InfoBoardWidget.cpp b/src/ui/widgets/InfoBoardWidget.cpp index fb1e55d5..f26917a4 100644 --- a/src/ui/widgets/InfoBoardWidget.cpp +++ b/src/ui/widgets/InfoBoardWidget.cpp @@ -54,7 +54,7 @@ InfoBoardWidget::InfoBoardWidget(QWidget *parent, GpgME::GpgContext *ctx, KeyLis actionButtonLayout->setSpacing(0); actionButtonMenu->setLayout(actionButtonLayout); - auto label = new QLabel("Optional Actions Menu"); + auto label = new QLabel(tr("Optional Actions Menu")); label->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); label->setContentsMargins(0, 0, 0, 0); |