aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/KeyImportDetailDialog.cpp19
-rw-r--r--src/ui/KeyList.cpp2
-rwxr-xr-xsrc/ui/KeyMgmt.cpp2
-rw-r--r--src/ui/VerifyKeyDetailBox.cpp5
-rw-r--r--src/ui/VerifyNotification.cpp3
-rw-r--r--src/ui/keypair_details/KeyPairUIDTab.cpp9
6 files changed, 29 insertions, 11 deletions
diff --git a/src/ui/KeyImportDetailDialog.cpp b/src/ui/KeyImportDetailDialog.cpp
index 2533cfb0..4c60ad0f 100644
--- a/src/ui/KeyImportDetailDialog.cpp
+++ b/src/ui/KeyImportDetailDialog.cpp
@@ -106,15 +106,16 @@ void KeyImportDetailDialog::createKeysTable() {
keysTable->setHorizontalHeaderLabels(headerLabels);
int row = 0;
- foreach (GpgImportedKey impKey, mResult.importedKeys) {
- keysTable->setRowCount(row + 1);
- GpgKey key = mCtx->getKeyByFpr(impKey.fpr);
- keysTable->setItem(row, 0, new QTableWidgetItem(key.name));
- keysTable->setItem(row, 1, new QTableWidgetItem(key.email));
- keysTable->setItem(row, 2, new QTableWidgetItem(getStatusString(impKey.importStatus)));
- keysTable->setItem(row, 3, new QTableWidgetItem(impKey.fpr));
- row++;
- }
+ for (const auto &impKey : mResult.importedKeys) {
+ keysTable->setRowCount(row + 1);
+ GpgKey key = mCtx->getKeyByFpr(impKey.fpr);
+ if(!key.good) continue;
+ keysTable->setItem(row, 0, new QTableWidgetItem(key.name));
+ keysTable->setItem(row, 1, new QTableWidgetItem(key.email));
+ keysTable->setItem(row, 2, new QTableWidgetItem(getStatusString(impKey.importStatus)));
+ keysTable->setItem(row, 3, new QTableWidgetItem(impKey.fpr));
+ row++;
+ }
keysTable->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
keysTable->horizontalHeader()->setStretchLastSection(true);
keysTable->resizeColumnsToContents();
diff --git a/src/ui/KeyList.cpp b/src/ui/KeyList.cpp
index 6931dc8d..c21a41ff 100644
--- a/src/ui/KeyList.cpp
+++ b/src/ui/KeyList.cpp
@@ -73,7 +73,7 @@ void KeyList::slotRefresh()
mKeyList->setSortingEnabled(false);
mKeyList->clearContents();
- GpgKeyList keys = mCtx->listKeys();
+ GpgKeyList keys = mCtx->getKeys();
mKeyList->setRowCount(keys.size());
int row = 0;
diff --git a/src/ui/KeyMgmt.cpp b/src/ui/KeyMgmt.cpp
index 1078778e..b1699483 100755
--- a/src/ui/KeyMgmt.cpp
+++ b/src/ui/KeyMgmt.cpp
@@ -233,7 +233,7 @@ void KeyMgmt::deleteKeysWithWarning(QStringList *uidList)
return;
}
QString keynames;
- foreach (QString uid, *uidList) {
+ for (const auto &uid : *uidList) {
GpgKey key;
mCtx->getKeyDetails(uid, key);
keynames.append(key.name);
diff --git a/src/ui/VerifyKeyDetailBox.cpp b/src/ui/VerifyKeyDetailBox.cpp
index fda67d55..57f70a62 100644
--- a/src/ui/VerifyKeyDetailBox.cpp
+++ b/src/ui/VerifyKeyDetailBox.cpp
@@ -50,6 +50,8 @@ VerifyKeyDetailBox::VerifyKeyDetailBox(QWidget *parent, GpgME::GpgContext *ctx,
case GPG_ERR_NO_ERROR: {
GpgKey key = mCtx->getKeyByFpr(signature->fpr);
+ if(!key.good) break;
+
this->setTitle(key.name);
grid->addWidget(new QLabel(tr("Name:")), 0, 0);
grid->addWidget(new QLabel(tr("EMail:")), 1, 0);
@@ -65,6 +67,9 @@ VerifyKeyDetailBox::VerifyKeyDetailBox(QWidget *parent, GpgME::GpgContext *ctx,
}
default: {
GpgKey key = mCtx->getKeyById(signature->fpr);
+
+ if(!key.good) break;
+
this->setTitle(tr("Error for key with id 0x") + fpr);
grid->addWidget(new QLabel(tr("Name:")), 0, 0);
grid->addWidget(new QLabel(tr("EMail:")), 1, 0);
diff --git a/src/ui/VerifyNotification.cpp b/src/ui/VerifyNotification.cpp
index 3111a39f..b5b2c890 100644
--- a/src/ui/VerifyNotification.cpp
+++ b/src/ui/VerifyNotification.cpp
@@ -131,6 +131,9 @@ bool VerifyNotification::slotRefresh() {
textIsSigned = 3;
verifyStatus = VERIFY_ERROR_CRITICAL;
GpgKey key = mCtx->getKeyById(sign->fpr);
+
+ if(!key.good) break;
+
verifyLabelText.append(key.name);
if (!key.email.isEmpty()) {
verifyLabelText.append("<" + key.email + ">");
diff --git a/src/ui/keypair_details/KeyPairUIDTab.cpp b/src/ui/keypair_details/KeyPairUIDTab.cpp
index e0128b55..8ca68d60 100644
--- a/src/ui/keypair_details/KeyPairUIDTab.cpp
+++ b/src/ui/keypair_details/KeyPairUIDTab.cpp
@@ -93,8 +93,10 @@ void KeyPairUIDTab::slotRefreshUIDList() {
uidList->clearContents();
uidList->setRowCount(key.uids.size());
+ uidList->setSelectionMode(QAbstractItemView::SingleSelection);
for(const auto& uid : key.uids) {
+
auto *tmp0 = new QTableWidgetItem(uid.name);
uidList->setItem(row, 0, tmp0);
@@ -108,6 +110,8 @@ void KeyPairUIDTab::slotRefreshUIDList() {
}
+
+
}
void KeyPairUIDTab::slotRefreshSigList() {
@@ -122,6 +126,11 @@ void KeyPairUIDTab::slotRefreshSigList() {
row = 0;
for(const auto& uid : key.uids) {
+
+ // Only Show Selected UID's Signatures
+ if(!uidList->item(row, 0)->isSelected())
+ continue;
+
for(const auto &sig : uid.signatures) {
auto *tmp0 = new QTableWidgetItem(sig.pubkey_algo);
uidList->setItem(row, 0, tmp0);