aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt17
-rw-r--r--src/MainWindow.cpp32
-rw-r--r--src/Mime.cpp2
-rw-r--r--src/gpg/GpgContext.cpp11
-rw-r--r--src/gpg/result_analyse/DecryptResultAnalyse.cpp20
-rw-r--r--src/gpg/result_analyse/EncryptResultAnalyse.cpp18
-rw-r--r--src/gpg/result_analyse/SignResultAnalyse.cpp28
-rw-r--r--src/gpg/result_analyse/VerifyResultAnalyse.cpp26
-rw-r--r--src/ui/KeyServerImportDialog.cpp16
-rwxr-xr-xsrc/ui/QuitDialog.cpp25
-rwxr-xr-xsrc/ui/SettingsDialog.cpp2
-rw-r--r--src/ui/VerifyDetailsDialog.cpp4
-rw-r--r--src/ui/keygen/KeygenDialog.cpp2
-rw-r--r--src/ui/keygen/KeygenThread.cpp4
-rw-r--r--src/ui/keygen/SubkeyGenerateDialog.cpp2
-rw-r--r--src/ui/keygen/SubkeyGenerateThread.cpp3
-rw-r--r--src/ui/keypair_details/KeyNewUIDDialog.cpp2
-rw-r--r--src/ui/widgets/InfoBoardWidget.cpp2
18 files changed, 90 insertions, 126 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8d0750b7..37807770 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -27,13 +27,16 @@ file(COPY ${CMAKE_SOURCE_DIR}/resource/css DESTINATION ${EXECUTABLE_OUTPUT_PATH}
file(COPY ${CMAKE_SOURCE_DIR}/resource/icons DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN)
file(COPY ${CMAKE_SOURCE_DIR}/resource/help DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN)
file(COPY ${CMAKE_SOURCE_DIR}/resource/conf DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN)
-file(COPY ${CMAKE_SOURCE_DIR}/resource/utils/lib/ DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN)
-file(COPY ${CMAKE_SOURCE_DIR}/resource/utils/gpgme/ DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN)
-file(COPY ${CMAKE_SOURCE_DIR}/resource/utils/bearer DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN)
-file(COPY ${CMAKE_SOURCE_DIR}/resource/utils/iconengines DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN)
-file(COPY ${CMAKE_SOURCE_DIR}/resource/utils/imageformats DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN)
-file(COPY ${CMAKE_SOURCE_DIR}/resource/utils/printsupport DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN)
-file(COPY ${CMAKE_SOURCE_DIR}/resource/utils/platforms DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN)
+if(MINGW)
+ message(STATUS "Copying Dependent DLL For Windows Runtime Env")
+ file(COPY ${CMAKE_SOURCE_DIR}/resource/utils/lib/ DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN)
+ file(COPY ${CMAKE_SOURCE_DIR}/resource/utils/gpgme/ DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN)
+ file(COPY ${CMAKE_SOURCE_DIR}/resource/utils/bearer DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN)
+ file(COPY ${CMAKE_SOURCE_DIR}/resource/utils/iconengines DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN)
+ file(COPY ${CMAKE_SOURCE_DIR}/resource/utils/imageformats DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN)
+ file(COPY ${CMAKE_SOURCE_DIR}/resource/utils/printsupport DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN)
+ file(COPY ${CMAKE_SOURCE_DIR}/resource/utils/platforms DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN)
+endif()
set(RESOURCE_FILES ${CMAKE_SOURCE_DIR}/gpgfrontend.qrc ${APP_ICON_RESOURCE_WINDOWS} ${QON_QM_FILES})
add_custom_target(resources ALL DEPENDS ${RESOURCE_FILES})
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
index caec9f30..e2e610a2 100644
--- a/src/MainWindow.cpp
+++ b/src/MainWindow.cpp
@@ -361,18 +361,6 @@ void MainWindow::createActions() {
aboutAct->setToolTip(tr("Show the application's About box"));
connect(aboutAct, SIGNAL(triggered()), this, SLOT(slotAbout()));
- openHelpAct = new QAction(tr("Integrated Help"), this);
- openHelpAct->setToolTip(tr("Open integrated Help"));
- connect(openHelpAct, SIGNAL(triggered()), this, SLOT(slotOpenHelp()));
-
- openTutorialAct = new QAction(tr("Online &Tutorials"), this);
- openTutorialAct->setToolTip(tr("Open Online Tutorials"));
- connect(openTutorialAct, SIGNAL(triggered()), this, SLOT(slotOpenTutorial()));
-
- openTranslateAct = new QAction(tr("Translate gpg4usb"), this);
- openTranslateAct->setToolTip(tr("Translate gpg4usb yourself"));
- connect(openTranslateAct, SIGNAL(triggered()), this, SLOT(slotOpenTranslate()));
-
startWizardAct = new QAction(tr("Open &Wizard"), this);
startWizardAct->setToolTip(tr("Open the wizard"));
connect(startWizardAct, SIGNAL(triggered()), this, SLOT(slotStartWizard()));
@@ -524,12 +512,8 @@ void MainWindow::createMenus() {
viewMenu = menuBar()->addMenu(tr("&View"));
helpMenu = menuBar()->addMenu(tr("&Help"));
- helpMenu->addAction(openHelpAct);
helpMenu->addAction(startWizardAct);
helpMenu->addSeparator();
- helpMenu->addAction(openTutorialAct);
- helpMenu->addAction(openTranslateAct);
- helpMenu->addSeparator();
helpMenu->addAction(aboutAct);
}
@@ -682,22 +666,6 @@ void MainWindow::slotAbout() {
new AboutDialog(this);
}
-void MainWindow::slotOpenTranslate() {
- QDesktopServices::openUrl(QUrl("http://gpg4usb.cpunk.de/docu_translate.html"));
-}
-
-void MainWindow::slotOpenTutorial() {
- QDesktopServices::openUrl(QUrl("http://gpg4usb.cpunk.de/docu.html"));
-}
-
-void MainWindow::slotOpenHelp() {
- slotOpenHelp("docu.html");
-}
-
-void MainWindow::slotOpenHelp(const QString &page) {
- edit->slotNewHelpTab("help", "file:" + qApp->applicationDirPath() + "/help/" + page);
-}
-
void MainWindow::slotSetStatusBarText(const QString &text) {
statusBar()->showMessage(text, 20000);
}
diff --git a/src/Mime.cpp b/src/Mime.cpp
index 20dae922..8e4c8d72 100644
--- a/src/Mime.cpp
+++ b/src/Mime.cpp
@@ -140,7 +140,7 @@ Header Mime::getHeader(const QByteArray *message) {
return parseHeader(&header);
}
-[[maybe_unused]] bool Mime::isMultipart(QByteArray *message) {
+bool Mime::isMultipart(QByteArray *message) {
return message->startsWith("Content-Type: multipart/mixed;");
}
diff --git a/src/gpg/GpgContext.cpp b/src/gpg/GpgContext.cpp
index d0cf30d5..962ebaf4 100644
--- a/src/gpg/GpgContext.cpp
+++ b/src/gpg/GpgContext.cpp
@@ -23,17 +23,16 @@
*/
#include "gpg/GpgContext.h"
-#include "ui/keygen/KeygenThread.h"
#include <unistd.h> /* contains read/write */
#include <Mime.h>
#ifdef _WIN32
-
#include <windows.h>
-
#endif
+#define INT2VOIDP(i) (void*)(uintptr_t)(i)
+
namespace GpgME {
/** Constructor
@@ -163,7 +162,7 @@ namespace GpgME {
GpgImportedKey key;
key.importStatus = static_cast<int>(status->status);
key.fpr = status->fpr;
- importInformation->importedKeys.append(key);
+ importInformation->importedKeys.emplace_back(key);
status = status->next;
}
checkErr(err);
@@ -294,7 +293,7 @@ namespace GpgME {
qDebug() << "Append Key" << key->subkeys->keyid;
- keys.append(GpgKey(key));
+ keys.emplace_back(key);
keys_map.insert(keys.back().id, &keys.back());
gpgme_key_unref(key);
}
@@ -553,7 +552,7 @@ namespace GpgME {
#ifdef _WIN32
DWORD written;
- HANDLE hd = (HANDLE) fd;
+ auto hd = INT2VOIDP(fd);
#endif
if (last_was_bad) {
diff --git a/src/gpg/result_analyse/DecryptResultAnalyse.cpp b/src/gpg/result_analyse/DecryptResultAnalyse.cpp
index d0f3ae99..7eda4027 100644
--- a/src/gpg/result_analyse/DecryptResultAnalyse.cpp
+++ b/src/gpg/result_analyse/DecryptResultAnalyse.cpp
@@ -7,33 +7,33 @@
DecryptResultAnalyse::DecryptResultAnalyse(GpgME::GpgContext *ctx, gpgme_error_t error, gpgme_decrypt_result_t result)
: mCtx(ctx) {
- stream << "Decrypt Report: " << endl << "-----" << endl;
+ stream << "Decrypt Report: " << Qt::endl << "-----" << Qt::endl;
if (gpgme_err_code(error) == GPG_ERR_NO_ERROR) {
- stream << "Status: Success" << endl;
+ stream << "Status: Success" << Qt::endl;
} else {
setStatus(-1);
- stream << "Status: " << gpgme_strerror(error) << endl;
+ stream << "Status: " << gpgme_strerror(error) << Qt::endl;
if (result != nullptr && result->unsupported_algorithm != nullptr)
- stream << "Unsupported algo: " << result->unsupported_algorithm << endl;
+ stream << "Unsupported algo: " << result->unsupported_algorithm << Qt::endl;
}
if(result != nullptr) {
if (result->file_name != nullptr)
- stream << "File name: " << result->file_name << endl;
- stream << endl;
+ stream << "File name: " << result->file_name << Qt::endl;
+ stream << Qt::endl;
auto reci = result->recipients;
if (reci != nullptr)
- stream << "Recipient(s): " << endl;
+ stream << "Recipient(s): " << Qt::endl;
while (reci != nullptr) {
printReci(stream, reci);
reci = reci->next;
}
}
- stream << "-----" << endl << endl;
+ stream << "-----" << Qt::endl << Qt::endl;
}
@@ -52,8 +52,8 @@ bool DecryptResultAnalyse::printReci(QTextStream &stream, gpgme_recipient_t reci
setStatus(0);
keyFound = false;
}
- stream << endl;
+ stream << Qt::endl;
- stream << "Public algo: " << gpgme_pubkey_algo_name(reci->pubkey_algo) << endl << endl;
+ stream << "Public algo: " << gpgme_pubkey_algo_name(reci->pubkey_algo) << Qt::endl << Qt::endl;
return keyFound;
}
diff --git a/src/gpg/result_analyse/EncryptResultAnalyse.cpp b/src/gpg/result_analyse/EncryptResultAnalyse.cpp
index 8cdd7750..dfcad1ac 100644
--- a/src/gpg/result_analyse/EncryptResultAnalyse.cpp
+++ b/src/gpg/result_analyse/EncryptResultAnalyse.cpp
@@ -6,28 +6,28 @@
EncryptResultAnalyse::EncryptResultAnalyse(gpgme_error_t error, gpgme_encrypt_result_t result) {
- stream << "# Encrypt Report: " << endl << "-----" << endl;
+ stream << "# Encrypt Report: " << Qt::endl << "-----" << Qt::endl;
if(gpgme_err_code(error) == GPG_ERR_NO_ERROR) {
- stream << "Status: Encrypt Success" << endl;
+ stream << "Status: Encrypt Success" << Qt::endl;
}
else {
- stream << "Status:" << gpgme_strerror(error) << endl;
+ stream << "Status:" << gpgme_strerror(error) << Qt::endl;
setStatus(-1);
if (result != nullptr) {
- stream << "Invalid Recipients: " << endl;
+ stream << "Invalid Recipients: " << Qt::endl;
auto inv_reci = result->invalid_recipients;
while (inv_reci != nullptr) {
- stream << "Fingerprint: " << inv_reci->fpr << endl;
- stream << "Reason: " << gpgme_strerror(inv_reci->reason) << endl;
- stream << endl;
+ stream << "Fingerprint: " << inv_reci->fpr << Qt::endl;
+ stream << "Reason: " << gpgme_strerror(inv_reci->reason) << Qt::endl;
+ stream << Qt::endl;
inv_reci = inv_reci->next;
}
}
}
- stream << "-----" << endl;
- stream << endl;
+ stream << "-----" << Qt::endl;
+ stream << Qt::endl;
}
diff --git a/src/gpg/result_analyse/SignResultAnalyse.cpp b/src/gpg/result_analyse/SignResultAnalyse.cpp
index 15d6ddf5..fac598d5 100644
--- a/src/gpg/result_analyse/SignResultAnalyse.cpp
+++ b/src/gpg/result_analyse/SignResultAnalyse.cpp
@@ -26,9 +26,9 @@
SignResultAnalyse::SignResultAnalyse(gpgme_error_t error, gpgme_sign_result_t result) {
- stream << "# Sign Report: " << endl
- << "-----" << endl;
- stream << "Status: " << gpgme_strerror(error) << endl << endl;
+ stream << "# Sign Report: " << Qt::endl
+ << "-----" << Qt::endl;
+ stream << "Status: " << gpgme_strerror(error) << Qt::endl << Qt::endl;
if(gpg_err_code(error) != GPG_ERR_NO_ERROR) {
setStatus(-1);
@@ -39,7 +39,7 @@ SignResultAnalyse::SignResultAnalyse(gpgme_error_t error, gpgme_sign_result_t re
auto new_sign = result->signatures;
while (new_sign != nullptr) {
- stream << "> A New Signature: " << endl;
+ stream << "> A New Signature: " << Qt::endl;
stream << "Sign mode: ";
if (new_sign->type == GPGME_SIG_MODE_NORMAL)
@@ -49,13 +49,13 @@ SignResultAnalyse::SignResultAnalyse(gpgme_error_t error, gpgme_sign_result_t re
else if (new_sign->type == GPGME_SIG_MODE_DETACH)
stream << "Detach";
- stream << endl;
+ stream << Qt::endl;
- stream << "Public key algo: " << gpgme_pubkey_algo_name(new_sign->pubkey_algo) << endl;
- stream << "Hash algo: " << gpgme_hash_algo_name(new_sign->hash_algo) << endl;
- stream << "Date of signature: " << QDateTime::fromTime_t(new_sign->timestamp).toString() << 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 << endl;
+ stream << Qt::endl;
new_sign = new_sign->next;
}
@@ -63,19 +63,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: " << endl;
+ stream << "Invalid Signers: " << Qt::endl;
while (invalid_signer != nullptr) {
setStatus(0);
- stream << "Fingerprint: " << invalid_signer->fpr << endl;
- stream << "Reason: " << gpgme_strerror(invalid_signer->reason) << endl;
- stream << endl;
+ stream << "Fingerprint: " << invalid_signer->fpr << Qt::endl;
+ stream << "Reason: " << gpgme_strerror(invalid_signer->reason) << Qt::endl;
+ stream << Qt::endl;
invalid_signer = invalid_signer->next;
}
}
- stream << "-----" << endl << endl;
+ stream << "-----" << Qt::endl << Qt::endl;
}
diff --git a/src/gpg/result_analyse/VerifyResultAnalyse.cpp b/src/gpg/result_analyse/VerifyResultAnalyse.cpp
index 898d62e1..79442c9a 100644
--- a/src/gpg/result_analyse/VerifyResultAnalyse.cpp
+++ b/src/gpg/result_analyse/VerifyResultAnalyse.cpp
@@ -8,23 +8,23 @@
VerifyResultAnalyse::VerifyResultAnalyse(GpgME::GpgContext *ctx, gpgme_error_t error, gpgme_verify_result_t result)
: mCtx(ctx) {
- stream << "# Verify Report: " << endl << "-----" << endl;
- stream << "Status: " << gpgme_strerror(error) << endl;
+ stream << "# Verify Report: " << Qt::endl << "-----" << Qt::endl;
+ stream << "Status: " << gpgme_strerror(error) << Qt::endl;
if(result != nullptr) {
auto sign = result->signatures;
if (sign == nullptr) {
- stream << "> Not Signature Found" << endl;
+ stream << "> Not Signature Found" << Qt::endl;
setStatus(-1);
return;
}
- stream << "> It was Signed ON " << QDateTime::fromTime_t(sign->timestamp).toString() << endl;
+ stream << "> It was Signed ON " << QDateTime::fromTime_t(sign->timestamp).toString() << Qt::endl;
- stream << endl << "> It Contains:" << endl;
+ stream << Qt::endl << "> It Contains:" << Qt::endl;
bool canContinue = true;
@@ -32,7 +32,7 @@ VerifyResultAnalyse::VerifyResultAnalyse(GpgME::GpgContext *ctx, gpgme_error_t e
switch (gpg_err_code(sign->status)) {
case GPG_ERR_BAD_SIGNATURE:
- stream << QApplication::tr("One or More Bad Signatures.") << endl;
+ stream << QApplication::tr("One or More Bad Signatures.") << Qt::endl;
canContinue = false;
setStatus(-1);
break;
@@ -61,9 +61,9 @@ VerifyResultAnalyse::VerifyResultAnalyse(GpgME::GpgContext *ctx, gpgme_error_t e
}
if (sign->summary & GPGME_SIGSUM_VALID) {
- stream << QApplication::tr("Signature Fully Valid.") << endl;
+ stream << QApplication::tr("Signature Fully Valid.") << Qt::endl;
} else {
- stream << QApplication::tr("Signature NOT Fully Valid.") << endl;
+ stream << QApplication::tr("Signature NOT Fully Valid.") << Qt::endl;
}
if (!(sign->status & GPGME_SIGSUM_KEY_MISSING)) {
@@ -71,7 +71,7 @@ VerifyResultAnalyse::VerifyResultAnalyse(GpgME::GpgContext *ctx, gpgme_error_t e
setStatus(0);
}
} else {
- stream << QApplication::tr("Key is NOT present with ID 0x") << QString(sign->fpr) << endl;
+ stream << QApplication::tr("Key is NOT present with ID 0x") << QString(sign->fpr) << Qt::endl;
}
setStatus(1);
@@ -114,13 +114,13 @@ VerifyResultAnalyse::VerifyResultAnalyse(GpgME::GpgContext *ctx, gpgme_error_t e
GpgME::GpgContext::beautifyFingerprint(QString(sign->fpr));
setStatus(-1);
}
- stream << endl;
+ stream << Qt::endl;
sign = sign->next;
}
}
- stream << "-----" << endl;
- stream << endl;
+ stream << "-----" << Qt::endl;
+ stream << Qt::endl;
}
bool VerifyResultAnalyse::printSigner(QTextStream &stream, gpgme_signature_t sign) {
@@ -136,7 +136,7 @@ bool VerifyResultAnalyse::printSigner(QTextStream &stream, gpgme_signature_t sig
if (!key.email.isEmpty()) {
stream << "<" << key.email << ">";
}
- stream << endl;
+ stream << Qt::endl;
return keyFound;
} \ No newline at end of file
diff --git a/src/ui/KeyServerImportDialog.cpp b/src/ui/KeyServerImportDialog.cpp
index 789e194d..88ec1c11 100644
--- a/src/ui/KeyServerImportDialog.cpp
+++ b/src/ui/KeyServerImportDialog.cpp
@@ -27,9 +27,8 @@
#include <utility>
KeyServerImportDialog::KeyServerImportDialog(GpgME::GpgContext *ctx, KeyList *keyList, QWidget *parent)
- : QDialog(parent) {
- mCtx = ctx;
- mKeyList = keyList;
+ : QDialog(parent), appPath(qApp->applicationDirPath()),
+ settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat), mCtx(ctx), mKeyList(keyList) {
// Buttons
closeButton = createButton(tr("&Close"), SLOT(close()));
importButton = createButton(tr("&Import"), SLOT(slotImport()));
@@ -87,7 +86,6 @@ QComboBox *KeyServerImportDialog::createComboBox() {
comboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
// Read keylist from ini-file and fill it into combobox
- QSettings settings;
comboBox->addItems(settings.value("keyserver/keyServerList").toStringList());
// set default keyserver in combobox
@@ -180,13 +178,11 @@ void KeyServerImportDialog::slotSearchFinished() {
auto line_buff = reply->readLine().trimmed();
QString decoded = QString::fromUtf8(line_buff.constData(), line_buff.size());
QStringList line = decoded.split(":");
-
//TODO: have a look at two following pub lines
if (line[0] == "pub") {
strikeout = false;
QString flags = line[line.size() - 1];
-
keysTable->setRowCount(row + 1);
// flags can be "d" for disabled, "r" for revoked
@@ -211,16 +207,16 @@ void KeyServerImportDialog::slotSearchFinished() {
uid->setText(line2[1]);
keysTable->setItem(row, 0, uid);
}
- auto *creationdate = new QTableWidgetItem(
+ auto *creation_date = new QTableWidgetItem(
QDateTime::fromTime_t(line[4].toInt()).toString("dd. MMM. yyyy"));
- keysTable->setItem(row, 1, creationdate);
+ keysTable->setItem(row, 1, creation_date);
auto *keyid = new QTableWidgetItem(line[1]);
keysTable->setItem(row, 2, keyid);
if (strikeout) {
QFont strike = uid->font();
strike.setStrikeOut(true);
uid->setFont(strike);
- creationdate->setFont(strike);
+ creation_date->setFont(strike);
keyid->setFont(strike);
}
row++;
@@ -255,7 +251,6 @@ void KeyServerImportDialog::slotImport() {
}
void KeyServerImportDialog::slotImport(QStringList keyIds) {
- QSettings settings;
QString keyserver = settings.value("keyserver/defaultKeyServer").toString();;
slotImport(std::move(keyIds), QUrl(keyserver));
}
@@ -288,7 +283,6 @@ void KeyServerImportDialog::slotImportFinished() {
setMessage(tr("Key imported"), false);
// Add keyserver to list in config-file, if it isn't contained
- QSettings settings;
QStringList keyServerList = settings.value("keyserver/keyServerList").toStringList();
if (!keyServerList.contains(keyServerComboBox->currentText())) {
keyServerList.append(keyServerComboBox->currentText());
diff --git a/src/ui/QuitDialog.cpp b/src/ui/QuitDialog.cpp
index 8472902e..5ebedc20 100755
--- a/src/ui/QuitDialog.cpp
+++ b/src/ui/QuitDialog.cpp
@@ -26,7 +26,7 @@
QuitDialog::QuitDialog(QWidget *parent, const QHash<int, QString>& unsavedDocs)
: QDialog(parent) {
- setWindowTitle(tr("Unsaved files"));
+ setWindowTitle(tr("Unsaved Files"));
setModal(true);
discarded = false;
@@ -46,9 +46,9 @@ QuitDialog::QuitDialog(QWidget *parent, const QHash<int, QString>& unsavedDocs)
mFileList->setFocusPolicy(Qt::NoFocus);
mFileList->horizontalHeader()->setStretchLastSection(true);
// fill the table
- i.toBack(); //jump to the end of list to fill the table backwards
- while (i.hasPrevious()) {
- i.previous();
+ i.toFront(); //jump to the end of list to fill the table backwards
+ while (i.hasNext()) {
+ i.next();
mFileList->setRowCount(mFileList->rowCount() + 1);
// checkbox in front of filename
@@ -69,14 +69,15 @@ QuitDialog::QuitDialog(QWidget *parent, const QHash<int, QString>& unsavedDocs)
/*
* Warnbox with icon and text
*/
- auto *pixmap = new QPixmap(":error.png");
- auto *warnicon = new QLabel();
- warnicon->setPixmap(*pixmap);
- auto *warnlabel = new QLabel(
+ auto pixmap = QPixmap(":error.png");
+ pixmap = pixmap.scaled(50, 50, Qt::KeepAspectRatio, Qt::SmoothTransformation);
+ auto *warn_icon = new QLabel();
+ warn_icon->setPixmap(pixmap);
+ auto *warn_label = new QLabel(
tr("<h3>%1 files contain unsaved information.<br/>Save the changes before closing?</h3>").arg(row));
auto *warnBoxLayout = new QHBoxLayout();
- warnBoxLayout->addWidget(warnicon);
- warnBoxLayout->addWidget(warnlabel);
+ warnBoxLayout->addWidget(warn_icon);
+ warnBoxLayout->addWidget(warn_label);
warnBoxLayout->setAlignment(Qt::AlignLeft);
auto *warnBox = new QWidget(this);
warnBox->setLayout(warnBoxLayout);
@@ -85,7 +86,7 @@ QuitDialog::QuitDialog(QWidget *parent, const QHash<int, QString>& unsavedDocs)
* Two labels on top and under the filelist
*/
auto *checkLabel = new QLabel(tr("Check the files you want to save:"));
- auto *notelabel = new QLabel(tr("<b>Note:</b> If you don't save these files, all changes are lost.<br/>"));
+ auto *note_label = new QLabel(tr("<b>Note:</b> If you don't save these files, all changes are lost.<br/>"));
/*
* Buttonbox
@@ -104,7 +105,7 @@ QuitDialog::QuitDialog(QWidget *parent, const QHash<int, QString>& unsavedDocs)
vbox->addWidget(warnBox);
vbox->addWidget(checkLabel);
vbox->addWidget(mFileList);
- vbox->addWidget(notelabel);
+ vbox->addWidget(note_label);
vbox->addWidget(buttonBox);
this->setLayout(vbox);
}
diff --git a/src/ui/SettingsDialog.cpp b/src/ui/SettingsDialog.cpp
index 7d9547b2..5501dedd 100755
--- a/src/ui/SettingsDialog.cpp
+++ b/src/ui/SettingsDialog.cpp
@@ -317,7 +317,7 @@ void GeneralTab::slotOwnKeyIdChanged() {
// add line with hidden-encrypt-to, if a key is chosen
if (!ownKeyId.isEmpty()) {
QByteArray string("recipient ");
- string.append(ownKeyId);
+ string.append(ownKeyId.toUtf8());
string.append("\n");
gpgConfTempFile.write(string);
}
diff --git a/src/ui/VerifyDetailsDialog.cpp b/src/ui/VerifyDetailsDialog.cpp
index 9c6ad014..e1403e14 100644
--- a/src/ui/VerifyDetailsDialog.cpp
+++ b/src/ui/VerifyDetailsDialog.cpp
@@ -67,10 +67,10 @@ void VerifyDetailsDialog::slotRefresh() {
mVboxLayout->addWidget(new QLabel(tr("Error Validating signature")));
} else if (mInputSignature != nullptr) {
mVboxLayout->addWidget(new QLabel(
- tr("File was signed on %1 <br/> It Contains:<br/>").arg(timestamp.toString(Qt::SystemLocaleLongDate))));
+ tr("File was signed on %1 <br/> It Contains:<br/>").arg(QLocale::system().toString(timestamp))));
} else {
mVboxLayout->addWidget(new QLabel(tr("Signed on %1 <br/> It Contains:<br/>").arg(
- timestamp.toString(Qt::SystemLocaleLongDate))));
+ QLocale::system().toString(timestamp))));
}
// Add informationbox for every single key
while (sign) {
diff --git a/src/ui/keygen/KeygenDialog.cpp b/src/ui/keygen/KeygenDialog.cpp
index 347ebedc..b9fdae3f 100644
--- a/src/ui/keygen/KeygenDialog.cpp
+++ b/src/ui/keygen/KeygenDialog.cpp
@@ -127,7 +127,7 @@ void KeyGenDialog::slotKeyGenAccept() {
*/
errorLabel->setAutoFillBackground(true);
QPalette error = errorLabel->palette();
- error.setColor(QPalette::Background, "#ff8080");
+ error.setColor(QPalette::Window, "#ff8080");
errorLabel->setPalette(error);
errorLabel->setText(errorString);
diff --git a/src/ui/keygen/KeygenThread.cpp b/src/ui/keygen/KeygenThread.cpp
index 5922138d..d7b9d840 100644
--- a/src/ui/keygen/KeygenThread.cpp
+++ b/src/ui/keygen/KeygenThread.cpp
@@ -24,8 +24,8 @@
#include "ui/keygen/KeygenThread.h"
-KeyGenThread::KeyGenThread(GenKeyInfo* keyGenParams, GpgME::GpgContext *ctx):
-mCtx(ctx), keyGenParams(keyGenParams), abort(false), QThread(nullptr) {
+KeyGenThread::KeyGenThread(GenKeyInfo* keyGenParams, GpgME::GpgContext *ctx)
+: mCtx(ctx), keyGenParams(keyGenParams), QThread(nullptr) {
connect(this, &KeyGenThread::finished, this, &KeyGenThread::deleteLater);
}
diff --git a/src/ui/keygen/SubkeyGenerateDialog.cpp b/src/ui/keygen/SubkeyGenerateDialog.cpp
index ae0c2bca..c545381f 100644
--- a/src/ui/keygen/SubkeyGenerateDialog.cpp
+++ b/src/ui/keygen/SubkeyGenerateDialog.cpp
@@ -258,7 +258,7 @@ void SubkeyGenerateDialog::slotKeyGenAccept() {
*/
errorLabel->setAutoFillBackground(true);
QPalette error = errorLabel->palette();
- error.setColor(QPalette::Background, "#ff8080");
+ error.setColor(QPalette::Window, "#ff8080");
errorLabel->setPalette(error);
errorLabel->setText(errorString);
diff --git a/src/ui/keygen/SubkeyGenerateThread.cpp b/src/ui/keygen/SubkeyGenerateThread.cpp
index 1ef141f0..4f19ac1f 100644
--- a/src/ui/keygen/SubkeyGenerateThread.cpp
+++ b/src/ui/keygen/SubkeyGenerateThread.cpp
@@ -27,8 +27,7 @@
#include <utility>
SubkeyGenerateThread::SubkeyGenerateThread(GpgKey key, GenKeyInfo *keyGenParams, GpgME::GpgContext *ctx)
- : mKey(std::move(key)), keyGenParams(keyGenParams) , mCtx(ctx), abort(
- false) {
+ : mKey(std::move(key)), keyGenParams(keyGenParams) , mCtx(ctx) {
connect(this, &SubkeyGenerateThread::finished, this, &SubkeyGenerateThread::deleteLater);
}
diff --git a/src/ui/keypair_details/KeyNewUIDDialog.cpp b/src/ui/keypair_details/KeyNewUIDDialog.cpp
index 7605bfae..e12af750 100644
--- a/src/ui/keypair_details/KeyNewUIDDialog.cpp
+++ b/src/ui/keypair_details/KeyNewUIDDialog.cpp
@@ -89,7 +89,7 @@ void KeyNewUIDDialog::slotCreateNewUID() {
*/
errorLabel->setAutoFillBackground(true);
QPalette error = errorLabel->palette();
- error.setColor(QPalette::Background, "#ff8080");
+ error.setColor(QPalette::Window, "#ff8080");
errorLabel->setPalette(error);
errorLabel->setText(errorString);
diff --git a/src/ui/widgets/InfoBoardWidget.cpp b/src/ui/widgets/InfoBoardWidget.cpp
index 0e85e72f..bfd0c643 100644
--- a/src/ui/widgets/InfoBoardWidget.cpp
+++ b/src/ui/widgets/InfoBoardWidget.cpp
@@ -86,7 +86,7 @@ void InfoBoardWidget::setInfoBoard(const QString &text, InfoBoardStatus verifyLa
QPalette status = infoBoard->palette();
status.setColor(QPalette::Text, color);
infoBoard->setPalette(status);
- infoBoard->setFont(QFont("Times", 12));
+ infoBoard->setFont(QFont("Times", 10));
}
void InfoBoardWidget::slotRefresh(const QString &text, InfoBoardStatus status) {