aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/KeyList.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-05-21 16:15:54 +0000
committerSaturneric <[email protected]>2021-05-21 16:15:54 +0000
commit21f4730e92d088c06dea01684f3f736f3f9beff0 (patch)
treec1dc4dc6836903adc688b03cafabc06fc845743f /src/ui/KeyList.cpp
parentModified KeyList and Add Usage Support; (diff)
downloadGpgFrontend-21f4730e92d088c06dea01684f3f736f3f9beff0.tar.gz
GpgFrontend-21f4730e92d088c06dea01684f3f736f3f9beff0.zip
Expand Key Details Dialog;
Expand and Improve GpgKey and GpgSubKey; Change Interface getKeyDetails(); Code Modified; Signed-off-by: Saturneric <[email protected]>
Diffstat (limited to 'src/ui/KeyList.cpp')
-rw-r--r--src/ui/KeyList.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/ui/KeyList.cpp b/src/ui/KeyList.cpp
index ab812b22..a561b738 100644
--- a/src/ui/KeyList.cpp
+++ b/src/ui/KeyList.cpp
@@ -48,7 +48,7 @@ KeyList::KeyList(GpgME::GpgContext *ctx, QWidget *parent)
mKeyList->setAlternatingRowColors(true);
QStringList labels;
- labels << "" << tr("Type") << tr("Name") << tr("Email Address")
+ labels << tr("Select") << tr("Type") << tr("Name") << tr("Email Address")
<< tr("Usage") << tr("Validity") << tr("Finger Print");
mKeyList->setHorizontalHeaderLabels(labels);
mKeyList->horizontalHeader()->setStretchLastSection(true);
@@ -84,8 +84,9 @@ void KeyList::slotRefresh()
buffered_keys.push_back(*it);
- auto *tmp0 = new QTableWidgetItem();
+ auto *tmp0 = new QTableWidgetItem(QString::number(row));
tmp0->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable);
+ tmp0->setTextAlignment(Qt::AlignCenter);
tmp0->setCheckState(Qt::Unchecked);
mKeyList->setItem(row, 0, tmp0);
@@ -124,10 +125,16 @@ void KeyList::slotRefresh()
usage_steam << "A";
auto *temp_usage = new QTableWidgetItem(usage);
- mKeyList->setToolTip(usage);
temp_usage->setTextAlignment(Qt::AlignCenter);
mKeyList->setItem(row, 4, temp_usage);
+ auto *temp_validity = new QTableWidgetItem(it->owner_trust);
+ temp_validity->setTextAlignment(Qt::AlignCenter);
+ mKeyList->setItem(row, 5, temp_validity);
+
+ auto *temp_fpr = new QTableWidgetItem(it->fpr);
+ temp_fpr->setTextAlignment(Qt::AlignCenter);
+ mKeyList->setItem(row, 6, temp_fpr);
it++;
++row;
@@ -152,7 +159,7 @@ QStringList *KeyList::getAllPrivateKeys()
auto *ret = new QStringList();
for (int i = 0; i < mKeyList->rowCount(); i++) {
if (mKeyList->item(i, 1)) {
- *ret << mKeyList->item(i, 4)->text();
+ *ret << buffered_keys[i].id;
}
}
return ret;
@@ -163,7 +170,7 @@ QStringList *KeyList::getPrivateChecked()
auto *ret = new QStringList();
for (int i = 0; i < mKeyList->rowCount(); i++) {
if ((mKeyList->item(i, 0)->checkState() == Qt::Checked) && (mKeyList->item(i, 1))) {
- *ret << mKeyList->item(i, 4)->text();
+ *ret << buffered_keys[i].id;
}
}
return ret;
@@ -173,7 +180,7 @@ void KeyList::setChecked(QStringList *keyIds)
{
if (!keyIds->isEmpty()) {
for (int i = 0; i < mKeyList->rowCount(); i++) {
- if (keyIds->contains(mKeyList->item(i, 4)->text())) {
+ if (keyIds->contains(buffered_keys[i].id)) {
mKeyList->item(i, 0)->setCheckState(Qt::Checked);
}
}
@@ -186,7 +193,7 @@ QStringList *KeyList::getSelected()
for (int i = 0; i < mKeyList->rowCount(); i++) {
if (mKeyList->item(i, 0)->isSelected() == 1) {
- *ret << mKeyList->item(i, 4)->text();
+ *ret << buffered_keys[i].id;
}
}
return ret;