aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/widgets/KeyList.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-11-28 07:29:39 +0000
committerSaturneric <[email protected]>2021-11-28 07:29:39 +0000
commitc5918a7245b6124916799c0345026ef3ec02265e (patch)
treefa4ba76fc21570f88cd7c94f28f4a0d54e7051ca /src/ui/widgets/KeyList.cpp
parentCan be compiled with minimal UI support. (diff)
downloadGpgFrontend-c5918a7245b6124916799c0345026ef3ec02265e.tar.gz
GpgFrontend-c5918a7245b6124916799c0345026ef3ec02265e.zip
Solve key generation and related update issues.
Diffstat (limited to 'src/ui/widgets/KeyList.cpp')
-rw-r--r--src/ui/widgets/KeyList.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/ui/widgets/KeyList.cpp b/src/ui/widgets/KeyList.cpp
index f340cafc..4cb30acf 100644
--- a/src/ui/widgets/KeyList.cpp
+++ b/src/ui/widgets/KeyList.cpp
@@ -23,15 +23,16 @@
*/
#include "ui/widgets/KeyList.h"
-#include "gpg/function/GpgKeyGetter.h"
#include <utility>
+#include "gpg/function/GpgKeyGetter.h"
+#include "ui/SignalStation.h"
+
namespace GpgFrontend::UI {
KeyList::KeyList(KeyListRow::KeyType selectType,
- KeyListColumn::InfoType infoType,
- QWidget* parent)
+ KeyListColumn::InfoType infoType, QWidget* parent)
: QWidget(parent),
appPath(qApp->applicationDirPath()),
settings(RESOURCE_DIR(appPath) + "/conf/gpgfrontend.ini",
@@ -48,10 +49,10 @@ KeyList::KeyList(KeyListRow::KeyType selectType,
mKeyList->setSelectionBehavior(QAbstractItemView::SelectRows);
mKeyList->setSelectionMode(QAbstractItemView::SingleSelection);
- // tableitems not editable
+ // table items not editable
mKeyList->setEditTriggers(QAbstractItemView::NoEditTriggers);
- // no focus (rectangle around tableitems)
- // may be it should focus on whole row
+ // no focus (rectangle around table items)
+ // maybe it should focus on whole row
mKeyList->setFocusPolicy(Qt::NoFocus);
mKeyList->setAlternatingRowColors(true);
@@ -91,13 +92,20 @@ KeyList::KeyList(KeyListRow::KeyType selectType,
popupMenu = new QMenu(this);
+ // register key database refresh signal
+ connect(SignalStation::GetInstance(), SIGNAL(KeyDatabaseRefresh()), this,
+ SLOT(slotRefresh()));
connect(mKeyList, SIGNAL(doubleClicked(const QModelIndex&)), this,
SLOT(slotDoubleClicked(const QModelIndex&)));
+
setAcceptDrops(true);
slotRefresh();
}
void KeyList::slotRefresh() {
+
+ LOG(INFO) << "KeyList::slotRefresh Called";
+
auto keyList = getChecked();
// while filling the table, sort enabled causes errors
mKeyList->setSortingEnabled(false);
@@ -178,14 +186,10 @@ void KeyList::slotRefresh() {
QString usage;
QTextStream usage_steam(&usage);
- if (it->CanCertActual())
- usage_steam << "C";
- if (it->CanEncrActual())
- usage_steam << "E";
- if (it->CanSignActual())
- usage_steam << "S";
- if (it->CanAuthActual())
- usage_steam << "A";
+ if (it->CanCertActual()) usage_steam << "C";
+ if (it->CanEncrActual()) usage_steam << "E";
+ if (it->CanSignActual()) usage_steam << "S";
+ if (it->CanAuthActual()) usage_steam << "A";
auto* temp_usage = new QTableWidgetItem(usage);
temp_usage->setTextAlignment(Qt::AlignCenter);
@@ -291,13 +295,9 @@ void KeyList::contextMenuEvent(QContextMenuEvent* event) {
}
}
-void KeyList::addSeparator() {
- popupMenu->addSeparator();
-}
+void KeyList::addSeparator() { popupMenu->addSeparator(); }
-void KeyList::addMenuAction(QAction* act) {
- popupMenu->addAction(act);
-}
+void KeyList::addMenuAction(QAction* act) { popupMenu->addAction(act); }
void KeyList::dropEvent(QDropEvent* event) {
auto* dialog = new QDialog();