From a83c6e28a16f998d89b956688f07ce5352a2864f Mon Sep 17 00:00:00 2001 From: saturneric Date: Wed, 27 Nov 2024 21:23:51 +0100 Subject: feat: improve ui logic and support more email operations --- src/ui/widgets/KeyList.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/ui/widgets/KeyList.cpp') diff --git a/src/ui/widgets/KeyList.cpp b/src/ui/widgets/KeyList.cpp index 73328885..9498480e 100644 --- a/src/ui/widgets/KeyList.cpp +++ b/src/ui/widgets/KeyList.cpp @@ -328,6 +328,17 @@ auto KeyList::GetChecked() -> KeyIdArgsListPtr { return ret; } +auto KeyList::GetCheckedKeys() -> QStringList { + auto* key_table = qobject_cast(ui_->keyGroupTab->currentWidget()); + QStringList key_id_list; + for (int i = 0; i < key_table->GetRowCount(); i++) { + if (key_table->IsRowChecked(i)) { + key_id_list.append(key_table->GetKeyIdByRow(i)); + } + } + return key_id_list; +} + auto KeyList::GetAllPrivateKeys() -> KeyIdArgsListPtr { auto* key_table = qobject_cast(ui_->keyGroupTab->currentWidget()); auto ret = std::make_unique(); -- cgit v1.2.3