aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/gpg/GpgContext.h6
-rw-r--r--include/gpg/result_analyse/DecryptResultAnalyse.h3
-rw-r--r--include/gpg/result_analyse/EncryptResultAnalyse.h3
-rw-r--r--include/gpg/result_analyse/ResultAnalyse.h3
-rw-r--r--include/gpg/result_analyse/SignResultAnalyse.h3
-rw-r--r--resource/css/default.qss8
-rw-r--r--src/gpg/gpg_context/GpgContext.cpp43
-rw-r--r--src/gpg/gpg_context/GpgContextKeyOpera.cpp78
-rw-r--r--src/gpg/result_analyse/DecryptResultAnalyse.cpp36
-rw-r--r--src/gpg/result_analyse/EncryptResultAnalyse.cpp21
-rw-r--r--src/gpg/result_analyse/SignResultAnalyse.cpp39
-rw-r--r--src/gpg/result_analyse/VerifyResultAnalyse.cpp28
-rw-r--r--src/ui/help/AboutDialog.cpp13
-rw-r--r--src/ui/keypair_details/KeyPairDetailTab.cpp13
-rw-r--r--src/ui/settings/SettingsDialog.cpp2
15 files changed, 151 insertions, 148 deletions
diff --git a/include/gpg/GpgContext.h b/include/gpg/GpgContext.h
index 286a3ced..3fbebb9c 100644
--- a/include/gpg/GpgContext.h
+++ b/include/gpg/GpgContext.h
@@ -131,7 +131,7 @@ namespace GpgME {
bool setExpire(const GpgKey &key, const GpgSubKey *subkey, QDateTime *expires);
- QProcess *generateRevokeCert(const GpgKey &key, const QString &outputFileName);
+ void generateRevokeCert(const GpgKey &key, const QString &outputFileName);
static bool checkIfKeyCanSign(const GpgKey &key);
@@ -216,9 +216,7 @@ namespace GpgME {
const char *passphrase_info,
int last_was_bad, int fd);
- QProcess *executeGpgCommand(const QStringList &arguments,
- QByteArray *stdOut,
- QByteArray *stdErr, const std::function<void(QProcess *)> &interactFunc);
+ void executeGpgCommand(const QStringList &arguments, const std::function<void(QProcess *)> &interactFunc);
};
} // namespace GpgME
diff --git a/include/gpg/result_analyse/DecryptResultAnalyse.h b/include/gpg/result_analyse/DecryptResultAnalyse.h
index 51cfbd5f..b1d0c7b4 100644
--- a/include/gpg/result_analyse/DecryptResultAnalyse.h
+++ b/include/gpg/result_analyse/DecryptResultAnalyse.h
@@ -28,7 +28,8 @@
#include "gpg/GpgContext.h"
#include "ResultAnalyse.h"
-class DecryptResultAnalyse: public ResultAnalyse{
+class DecryptResultAnalyse : public ResultAnalyse {
+Q_OBJECT
public:
explicit DecryptResultAnalyse(GpgME::GpgContext *ctx, gpgme_error_t error, gpgme_decrypt_result_t result);
diff --git a/include/gpg/result_analyse/EncryptResultAnalyse.h b/include/gpg/result_analyse/EncryptResultAnalyse.h
index c47b5835..447555c5 100644
--- a/include/gpg/result_analyse/EncryptResultAnalyse.h
+++ b/include/gpg/result_analyse/EncryptResultAnalyse.h
@@ -27,7 +27,8 @@
#include "ResultAnalyse.h"
-class EncryptResultAnalyse : public ResultAnalyse{
+class EncryptResultAnalyse : public ResultAnalyse {
+Q_OBJECT
public:
explicit EncryptResultAnalyse(gpgme_error_t error, gpgme_encrypt_result_t result);
diff --git a/include/gpg/result_analyse/ResultAnalyse.h b/include/gpg/result_analyse/ResultAnalyse.h
index 7b506e95..da2e5676 100644
--- a/include/gpg/result_analyse/ResultAnalyse.h
+++ b/include/gpg/result_analyse/ResultAnalyse.h
@@ -26,7 +26,8 @@
#include "GpgFrontend.h"
-class ResultAnalyse {
+class ResultAnalyse : public QObject {
+Q_OBJECT
public:
ResultAnalyse() = default;
diff --git a/include/gpg/result_analyse/SignResultAnalyse.h b/include/gpg/result_analyse/SignResultAnalyse.h
index a353a2f8..3db5978f 100644
--- a/include/gpg/result_analyse/SignResultAnalyse.h
+++ b/include/gpg/result_analyse/SignResultAnalyse.h
@@ -29,7 +29,8 @@
#include "ResultAnalyse.h"
-class SignResultAnalyse : public ResultAnalyse{
+class SignResultAnalyse : public ResultAnalyse {
+Q_OBJECT
public:
explicit SignResultAnalyse(gpgme_error_t error, gpgme_sign_result_t result);
diff --git a/resource/css/default.qss b/resource/css/default.qss
index f1d0ebf8..9ecc4681 100644
--- a/resource/css/default.qss
+++ b/resource/css/default.qss
@@ -463,7 +463,7 @@ QDateTimeEdit::up-button:pressed
QDateTimeEdit::up-arrow
{
- image: url(://arrow-up.png);
+ image: url("./icons/up-arrow.png");
width: 7px;
height: 7px;
@@ -503,7 +503,7 @@ QDateTimeEdit::down-button:pressed
QDateTimeEdit::down-arrow
{
- image: url(://arrow-up.png);
+ image: url("./icons/down.png");
width: 7px;
height: 7px;
@@ -550,7 +550,7 @@ QCalendarWidget::up-button:pressed
QCalendarWidget::up-arrow
{
- image: url(://arrow-up.png);
+ image: url("./icons/up-arrow.png");
width: 7px;
height: 7px;
@@ -586,7 +586,7 @@ QCalendarWidget::down-button:pressed
QCalendarWidget::down-arrow
{
- image: url(://arrow-down.png);
+ image: url("./icons/down.png");
width: 7px;
height: 7px;
diff --git a/src/gpg/gpg_context/GpgContext.cpp b/src/gpg/gpg_context/GpgContext.cpp
index 50de03a1..f7bbbe37 100644
--- a/src/gpg/gpg_context/GpgContext.cpp
+++ b/src/gpg/gpg_context/GpgContext.cpp
@@ -23,6 +23,7 @@
*/
#include "gpg/GpgContext.h"
+#include "ui/WaitingDialog.h"
#include <functional>
#include <unistd.h> /* contains read/write */
@@ -251,30 +252,28 @@ namespace GpgME {
}
/** return type should be gpgme_error_t*/
- QProcess *GpgContext::executeGpgCommand(const QStringList &arguments, QByteArray *stdOut, QByteArray *stdErr,
- const std::function<void(QProcess *)> &interactFunc) {
- QStringList args;
- args << arguments;
-
- auto *gpgProcess = new QProcess(this);
-
- gpgProcess->setReadChannel(QProcess::StandardOutput);
- connect(gpgProcess, SIGNAL(finished(int, QProcess::ExitStatus)),
- gpgProcess, SLOT(deleteLater()));
- connect(gpgProcess, &QProcess::readyReadStandardOutput, this, [gpgProcess, interactFunc]() {
- qDebug() << "Function Called" << &gpgProcess;
- // interactFunc(gpgProcess);
+ void
+ GpgContext::executeGpgCommand(const QStringList &arguments, const std::function<void(QProcess *)> &interactFunc) {
+ QEventLoop looper;
+ auto dialog = new WaitingDialog(tr("Processing"), nullptr);
+ dialog->show();
+ auto *gpgProcess = new QProcess(&looper);
+ gpgProcess->setProcessChannelMode(QProcess::MergedChannels);
+ connect(gpgProcess, qOverload<int, QProcess::ExitStatus>(&QProcess::finished), &looper, &QEventLoop::quit);
+ connect(gpgProcess, qOverload<int, QProcess::ExitStatus>(&QProcess::finished), dialog, &WaitingDialog::deleteLater);
+ connect(gpgProcess, &QProcess::errorOccurred, []() -> void { qDebug("Error in Process"); });
+ connect(gpgProcess, &QProcess::errorOccurred, &looper, &QEventLoop::quit);
+ connect(gpgProcess, &QProcess::started, []() -> void { qDebug() << "Gpg Process Started Success"; });
+ connect(gpgProcess, &QProcess::readyReadStandardOutput, [interactFunc, gpgProcess]() {
+ qDebug() << "Function Called";
+ interactFunc(gpgProcess);
});
+ gpgProcess->setProgram(info.appPath);
+ gpgProcess->setArguments(arguments);
+ gpgProcess->start();
+ looper.exec();
+ dialog->close();
- gpgProcess->start(info.appPath, args);
-
- if (gpgProcess->waitForStarted()) {
- qDebug() << "Gpg Process Started Success";
- } else {
- qDebug() << "Gpg Process Started Failed";
- }
-
- return gpgProcess;
}
diff --git a/src/gpg/gpg_context/GpgContextKeyOpera.cpp b/src/gpg/gpg_context/GpgContextKeyOpera.cpp
index 54123405..5ead0629 100644
--- a/src/gpg/gpg_context/GpgContextKeyOpera.cpp
+++ b/src/gpg/gpg_context/GpgContextKeyOpera.cpp
@@ -364,48 +364,46 @@ bool GpgME::GpgContext::signKey(const GpgKey &target, const QString &uid, const
}
/**
- * Generate revoke cert of a key pair (TODO)
+ * Generate revoke cert of a key pair
* @param key target key pair
* @param outputFileName out file name(path)
* @return the process doing this job
*/
-QProcess *GpgME::GpgContext::generateRevokeCert(const GpgKey &key, const QString &outputFileName) {
- QByteArray out, stdErr;
- auto process = executeGpgCommand({
- "--command-fd",
- "0",
- "--status-fd", "1",
- "-o",
- outputFileName,
- "--gen-revoke",
- key.fpr
- }, &out, &stdErr,
- [](QProcess *proc) {
- qDebug() << "Function Called" << proc;
- while (proc->canReadLine()) {
- const QString line = QString::fromUtf8(proc->readLine()).trimmed();
- // Command-fd is a stable interface, while this is all kind of hacky we
- // are on a deadline :-/
- if (line == QLatin1String("[GNUPG:] GET_BOOL gen_revoke.okay")) {
- proc->write("y\n");
- } else if (line == QLatin1String(
- "[GNUPG:] GET_LINE ask_revocation_reason.code")) {
- proc->write("0\n");
- } else if (line == QLatin1String(
- "[GNUPG:] GET_LINE ask_revocation_reason.text")) {
- proc->write("\n");
- } else if (line == QLatin1String(
- "[GNUPG:] GET_BOOL openfile.overwrite.okay")) {
- // We asked before
- proc->write("y\n");
- } else if (line == QLatin1String(
- "[GNUPG:] GET_BOOL ask_revocation_reason.okay")) {
- proc->write("y\n");
- }
- }
- });
-
- qDebug() << "GenerateRevokeCert Process" << process;
-
- return process;
+void GpgME::GpgContext::generateRevokeCert(const GpgKey &key, const QString &outputFileName) {
+ executeGpgCommand({
+ "--command-fd",
+ "0",
+ "--status-fd",
+ "1",
+ //"--no-tty",
+ "-o",
+ outputFileName,
+ "--gen-revoke",
+ key.fpr
+ },
+ [](QProcess *proc) -> void {
+ qDebug() << "Function Called" << proc;
+ // Code From Gpg4Win
+ while (proc->canReadLine()) {
+ const QString line = QString::fromUtf8(proc->readLine()).trimmed();
+ if (line == QLatin1String("[GNUPG:] GET_BOOL gen_revoke.okay")) {
+ proc->write("y\n");
+ } else if (line == QLatin1String(
+ "[GNUPG:] GET_LINE ask_revocation_reason.code")) {
+ proc->write("0\n");
+ } else if (line == QLatin1String(
+ "[GNUPG:] GET_LINE ask_revocation_reason.text")) {
+ proc->write("\n");
+ } else if (line == QLatin1String(
+ "[GNUPG:] GET_BOOL openfile.overwrite.okay")) {
+ // We asked before
+ proc->write("y\n");
+ } else if (line == QLatin1String(
+ "[GNUPG:] GET_BOOL ask_revocation_reason.okay")) {
+ proc->write("y\n");
+ }
+ }
+ // Code From Gpg4Win
+ }
+ );
}
diff --git a/src/gpg/result_analyse/DecryptResultAnalyse.cpp b/src/gpg/result_analyse/DecryptResultAnalyse.cpp
index 6fab0067..efd0a599 100644
--- a/src/gpg/result_analyse/DecryptResultAnalyse.cpp
+++ b/src/gpg/result_analyse/DecryptResultAnalyse.cpp
@@ -27,39 +27,43 @@
DecryptResultAnalyse::DecryptResultAnalyse(GpgME::GpgContext *ctx, gpgme_error_t error, gpgme_decrypt_result_t result)
: mCtx(ctx) {
- stream << "Decrypt Report: " << Qt::endl << "-----" << Qt::endl;
+ stream << tr("[#] Decrypt Operation ");
if (gpgme_err_code(error) == GPG_ERR_NO_ERROR) {
- stream << "Status: Success" << Qt::endl;
+ stream << tr("[Success]") << Qt::endl;
} else {
+ stream << tr("[Failed] ") << gpgme_strerror(error) << Qt::endl;
setStatus(-1);
- stream << "Status: " << gpgme_strerror(error) << Qt::endl;
-
- if (result != nullptr && result->unsupported_algorithm != nullptr)
- stream << "Unsupported algo: " << result->unsupported_algorithm << Qt::endl;
+ if (result != nullptr && result->unsupported_algorithm != nullptr) {
+ stream << "------------>" << Qt::endl;
+ stream << tr("Unsupported Algo: ") << result->unsupported_algorithm << Qt::endl;
+ }
}
- if(result != nullptr) {
- if (result->file_name != nullptr)
- stream << "File name: " << result->file_name << Qt::endl;
- stream << Qt::endl;
+ if (result != nullptr && result->recipients != nullptr) {
+ stream << "------------>" << Qt::endl;
+ if (result->file_name != nullptr) {
+ stream << tr("File Name: ") << result->file_name << Qt::endl;
+ stream << Qt::endl;
+ }
auto reci = result->recipients;
if (reci != nullptr)
- stream << "Recipient(s): " << Qt::endl;
+ stream << tr("Recipient(s): ") << Qt::endl;
while (reci != nullptr) {
printReci(stream, reci);
reci = reci->next;
}
+ stream << "<------------" << Qt::endl;
}
- stream << "-----" << Qt::endl << Qt::endl;
+ stream << Qt::endl;
}
bool DecryptResultAnalyse::printReci(QTextStream &stream, gpgme_recipient_t reci) {
bool keyFound = true;
- stream << QApplication::tr(">Recipient: ");
+ stream << QApplication::tr(" {>} Recipient: ");
try {
auto key = mCtx->getKeyById(reci->keyid);
@@ -67,13 +71,15 @@ bool DecryptResultAnalyse::printReci(QTextStream &stream, gpgme_recipient_t reci
if (!key.email.isEmpty()) {
stream << "<" << key.email << ">";
}
- } catch(std::runtime_error &ignored) {
+ } catch (std::runtime_error &ignored) {
stream << "<Unknown>";
setStatus(0);
keyFound = false;
}
stream << Qt::endl;
- stream << "Public algo: " << gpgme_pubkey_algo_name(reci->pubkey_algo) << Qt::endl << Qt::endl;
+ stream << tr(" Keu ID: ") << reci->keyid << Qt::endl;
+ stream << tr(" Public Algo: ") << gpgme_pubkey_algo_name(reci->pubkey_algo) << Qt::endl;
+
return keyFound;
}
diff --git a/src/gpg/result_analyse/EncryptResultAnalyse.cpp b/src/gpg/result_analyse/EncryptResultAnalyse.cpp
index de12c4d8..55f2cb9f 100644
--- a/src/gpg/result_analyse/EncryptResultAnalyse.cpp
+++ b/src/gpg/result_analyse/EncryptResultAnalyse.cpp
@@ -26,28 +26,31 @@
EncryptResultAnalyse::EncryptResultAnalyse(gpgme_error_t error, gpgme_encrypt_result_t result) {
- stream << "# Encrypt Report: " << Qt::endl << "-----" << Qt::endl;
+ stream << "[#] Encrypt Operation ";
- if(gpgme_err_code(error) == GPG_ERR_NO_ERROR) {
- stream << "Status: Encrypt Success" << Qt::endl;
- }
+ if(gpgme_err_code(error) == GPG_ERR_NO_ERROR)
+ stream << "[Success]" << Qt::endl;
else {
- stream << "Status:" << gpgme_strerror(error) << Qt::endl;
+ stream << "[Failed] " << gpgme_strerror(error) << Qt::endl;
setStatus(-1);
+ }
+
+ if(!~status) {
+ stream << "------------>" << Qt::endl;
if (result != nullptr) {
- stream << "Invalid Recipients: " << Qt::endl;
+ stream << tr("Invalid Recipients: ") << Qt::endl;
auto inv_reci = result->invalid_recipients;
while (inv_reci != nullptr) {
- stream << "Fingerprint: " << inv_reci->fpr << Qt::endl;
- stream << "Reason: " << gpgme_strerror(inv_reci->reason) << Qt::endl;
+ stream << tr("Fingerprint: ") << inv_reci->fpr << Qt::endl;
+ stream << tr("Reason: ") << gpgme_strerror(inv_reci->reason) << Qt::endl;
stream << Qt::endl;
inv_reci = inv_reci->next;
}
}
+ stream << "<------------" << Qt::endl;
}
- stream << "-----" << Qt::endl;
stream << Qt::endl;
}
diff --git a/src/gpg/result_analyse/SignResultAnalyse.cpp b/src/gpg/result_analyse/SignResultAnalyse.cpp
index fac598d5..9173eaeb 100644
--- a/src/gpg/result_analyse/SignResultAnalyse.cpp
+++ b/src/gpg/result_analyse/SignResultAnalyse.cpp
@@ -26,34 +26,35 @@
SignResultAnalyse::SignResultAnalyse(gpgme_error_t error, gpgme_sign_result_t result) {
- stream << "# Sign Report: " << Qt::endl
- << "-----" << Qt::endl;
- stream << "Status: " << gpgme_strerror(error) << Qt::endl << Qt::endl;
+ stream << tr("[#] Sign Operation ");
- if(gpg_err_code(error) != GPG_ERR_NO_ERROR) {
+ if (gpgme_err_code(error) == GPG_ERR_NO_ERROR)
+ stream << tr("[Success]") << Qt::endl;
+ else {
+ stream << tr("[Failed] ") << gpgme_strerror(error) << Qt::endl;
setStatus(-1);
}
- if(result != nullptr) {
-
+ if (result != nullptr && (result->signatures != nullptr || result->invalid_signers != nullptr)) {
+ stream << "------------>" << Qt::endl;
auto new_sign = result->signatures;
while (new_sign != nullptr) {
- stream << "> A New Signature: " << Qt::endl;
+ stream << tr("[>] New Signature: ") << Qt::endl;
- stream << "Sign mode: ";
+ stream << tr(" Sign Mode: ");
if (new_sign->type == GPGME_SIG_MODE_NORMAL)
- stream << "Normal";
+ stream << tr("Normal");
else if (new_sign->type == GPGME_SIG_MODE_CLEAR)
- stream << "Clear";
+ stream << tr("Clear");
else if (new_sign->type == GPGME_SIG_MODE_DETACH)
- stream << "Detach";
+ stream << tr("Detach");
stream << Qt::endl;
- stream << "Public key algo: " << gpgme_pubkey_algo_name(new_sign->pubkey_algo) << Qt::endl;
- stream << "Hash algo: " << gpgme_hash_algo_name(new_sign->hash_algo) << Qt::endl;
- stream << "Date of signature: " << QDateTime::fromTime_t(new_sign->timestamp).toString() << Qt::endl;
+ stream << tr(" Public Key Algo: ") << gpgme_pubkey_algo_name(new_sign->pubkey_algo) << Qt::endl;
+ stream << tr(" Hash Algo: ") << gpgme_hash_algo_name(new_sign->hash_algo) << Qt::endl;
+ stream << tr(" Date & Time: ") << QDateTime::fromTime_t(new_sign->timestamp).toString() << Qt::endl;
stream << Qt::endl;
@@ -63,19 +64,19 @@ SignResultAnalyse::SignResultAnalyse(gpgme_error_t error, gpgme_sign_result_t re
auto invalid_signer = result->invalid_signers;
if (invalid_signer != nullptr)
- stream << "Invalid Signers: " << Qt::endl;
+ stream << tr("Invalid Signers: ") << Qt::endl;
while (invalid_signer != nullptr) {
setStatus(0);
- stream << "Fingerprint: " << invalid_signer->fpr << Qt::endl;
- stream << "Reason: " << gpgme_strerror(invalid_signer->reason) << Qt::endl;
+ stream << tr("[>] Signer: ") << Qt::endl;
+ stream << tr(" Fingerprint: ") << invalid_signer->fpr << Qt::endl;
+ stream << tr(" Reason: ") << gpgme_strerror(invalid_signer->reason) << Qt::endl;
stream << Qt::endl;
invalid_signer = invalid_signer->next;
}
+ stream << "<------------" << Qt::endl;
}
- stream << "-----" << Qt::endl << Qt::endl;
-
}
diff --git a/src/gpg/result_analyse/VerifyResultAnalyse.cpp b/src/gpg/result_analyse/VerifyResultAnalyse.cpp
index 3b4c450b..c4285351 100644
--- a/src/gpg/result_analyse/VerifyResultAnalyse.cpp
+++ b/src/gpg/result_analyse/VerifyResultAnalyse.cpp
@@ -28,23 +28,29 @@
VerifyResultAnalyse::VerifyResultAnalyse(GpgME::GpgContext *ctx, gpgme_error_t error, gpgme_verify_result_t result)
: mCtx(ctx) {
- stream << "# Verify Report: " << Qt::endl << "-----" << Qt::endl;
- stream << "Status: " << gpgme_strerror(error) << Qt::endl;
+ stream << tr("[#] Verify Operation ");
+
+ if (gpgme_err_code(error) == GPG_ERR_NO_ERROR)
+ stream << tr("[Success]") << Qt::endl;
+ else {
+ stream << tr("[Failed] ") << gpgme_strerror(error) << Qt::endl;
+ setStatus(-1);
+ }
- if(result != nullptr) {
+ if(result != nullptr && result->signatures) {
+ stream << "------------>" << Qt::endl;
auto sign = result->signatures;
if (sign == nullptr) {
- stream << "> Not Signature Found" << Qt::endl;
+ stream << "[>] Not Signature Found" << Qt::endl;
setStatus(0);
return;
}
+ stream << "[>] Signed On " << QDateTime::fromTime_t(sign->timestamp).toString() << Qt::endl;
- stream << "> It was Signed ON " << QDateTime::fromTime_t(sign->timestamp).toString() << Qt::endl;
-
- stream << Qt::endl << "> It Contains:" << Qt::endl;
+ stream << Qt::endl << "[>] Signatures:" << Qt::endl;
bool canContinue = true;
@@ -57,7 +63,7 @@ VerifyResultAnalyse::VerifyResultAnalyse(GpgME::GpgContext *ctx, gpgme_error_t e
setStatus(-1);
break;
case GPG_ERR_NO_ERROR:
- stream << QApplication::tr("A ");
+ stream << QApplication::tr("A ");
if (sign->summary & GPGME_SIGSUM_GREEN) {
stream << QApplication::tr("Good ");
}
@@ -137,10 +143,8 @@ VerifyResultAnalyse::VerifyResultAnalyse(GpgME::GpgContext *ctx, gpgme_error_t e
stream << Qt::endl;
sign = sign->next;
}
+ stream << "<------------" << Qt::endl;
}
-
- stream << "-----" << Qt::endl;
- stream << Qt::endl;
}
bool VerifyResultAnalyse::printSigner(QTextStream &stream, gpgme_signature_t sign) {
@@ -148,7 +152,7 @@ bool VerifyResultAnalyse::printSigner(QTextStream &stream, gpgme_signature_t sig
stream << QApplication::tr("Signed By: ");
auto key = mCtx->getKeyByFpr(sign->fpr);
if(!key.good) {
- stream << "<Unknown>";
+ stream << tr("<Unknown>");
setStatus(0);
keyFound = false;
}
diff --git a/src/ui/help/AboutDialog.cpp b/src/ui/help/AboutDialog.cpp
index 762f0208..e5798541 100644
--- a/src/ui/help/AboutDialog.cpp
+++ b/src/ui/help/AboutDialog.cpp
@@ -191,6 +191,7 @@ void UpdateTab::processReplyDataFromUpdateServer(const QByteArray& data) {
qDebug() << "Try to Process Reply Data From Update Server";
this->pb->setHidden(true);
+
Document d;
if (d.Parse(data.constData()).HasParseError() || !d.IsObject()) {
qDebug() << "VersionCheckThread Found Network Error";
@@ -203,18 +204,14 @@ void UpdateTab::processReplyDataFromUpdateServer(const QByteArray& data) {
qDebug() << "Latest Version From Github" << latestVersion;
- QRegularExpression re("^[vV](\\d+\\.)?(\\d+\\.)?(\\*|\\d+)");
+ QRegularExpression re(R"(^[vV](\d+\.)?(\d+\.)?(\*|\d+))");
QRegularExpressionMatch match = re.match(latestVersion);
if (match.hasMatch()) {
- latestVersion = match.captured(0); // matched == "23 def"
+ latestVersion = match.captured(0);
qDebug() << "Latest Version Matched" << latestVersion;
- } else {
- latestVersion = "Unknown";
- }
+ } else latestVersion = "Unknown";
latestVersionLabel->setText("<center><b>" + tr("Latest Version From Github: ") + latestVersion + "</b></center>");
- if(latestVersion > currentVersion) {
- upgradeLabel->setHidden(false);
- }
+ if(latestVersion > currentVersion) upgradeLabel->setHidden(false);
}
diff --git a/src/ui/keypair_details/KeyPairDetailTab.cpp b/src/ui/keypair_details/KeyPairDetailTab.cpp
index 9ca4e37e..bc818c58 100644
--- a/src/ui/keypair_details/KeyPairDetailTab.cpp
+++ b/src/ui/keypair_details/KeyPairDetailTab.cpp
@@ -147,7 +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);
+ // revokeCertGenButton->setDisabled(true);
connect(revokeCertGenButton, SIGNAL(clicked()), this, SLOT(slotGenRevokeCert()));
hBoxLayout->addWidget(keyServerOperaButton);
@@ -342,15 +342,8 @@ void KeyPairDetailTab::slotGenRevokeCert() {
QStringLiteral("%1 (*.rev)").arg(
tr("Revocation Certificates")));
- auto process = mCtx->generateRevokeCert(mKey, mOutputFileName);
-
- auto *dialog = new WaitingDialog("Generating", this);
-
- while (process->state() == QProcess::Running) {
- QApplication::processEvents();
- }
-
- dialog->close();
+ if(!mOutputFileName.isEmpty())
+ mCtx->generateRevokeCert(mKey, mOutputFileName);
}
diff --git a/src/ui/settings/SettingsDialog.cpp b/src/ui/settings/SettingsDialog.cpp
index 360fc854..0ca188f7 100644
--- a/src/ui/settings/SettingsDialog.cpp
+++ b/src/ui/settings/SettingsDialog.cpp
@@ -74,7 +74,7 @@ SettingsDialog::SettingsDialog(GpgME::GpgContext *ctx, QWidget *parent)
connect(this, SIGNAL(signalRestartNeeded(bool)), parent,
SLOT(slotSetRestartNeeded(bool)));
- this->resize(640, 640);
+ this->resize(480, 640);
this->show();
}