aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/main_window/MainWindowUI.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-11-17 13:56:57 +0000
committersaturneric <[email protected]>2024-11-17 13:56:57 +0000
commitaa2a6e3834a640c1cab0b2d7433c6f0c4f236cda (patch)
tree0fbbedcf646ef8064a0cea72123a7da785a169d8 /src/ui/main_window/MainWindowUI.cpp
parentfeat: can open key db by menu action triggered by right click (diff)
downloadGpgFrontend-aa2a6e3834a640c1cab0b2d7433c6f0c4f236cda.tar.gz
GpgFrontend-aa2a6e3834a640c1cab0b2d7433c6f0c4f236cda.zip
fix: should import or export keys to selected key db
Diffstat (limited to 'src/ui/main_window/MainWindowUI.cpp')
-rw-r--r--src/ui/main_window/MainWindowUI.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/ui/main_window/MainWindowUI.cpp b/src/ui/main_window/MainWindowUI.cpp
index 2163f382..151e5cfa 100644
--- a/src/ui/main_window/MainWindowUI.cpp
+++ b/src/ui/main_window/MainWindowUI.cpp
@@ -310,21 +310,20 @@ void MainWindow::create_actions() {
import_key_from_file_act_ = new QAction(tr("File"), this);
import_key_from_file_act_->setIcon(QIcon(":/icons/import_key_from_file.png"));
import_key_from_file_act_->setToolTip(tr("Import New Key From File"));
- connect(import_key_from_file_act_, &QAction::triggered, this,
- [=, channel = m_key_list_->GetCurrentGpgContextChannel()]() {
- CommonUtils::GetInstance()->SlotImportKeyFromFile(this, channel);
- });
+ connect(import_key_from_file_act_, &QAction::triggered, this, [=]() {
+ CommonUtils::GetInstance()->SlotImportKeyFromFile(
+ this, m_key_list_->GetCurrentGpgContextChannel());
+ });
import_key_from_clipboard_act_ = new QAction(tr("Clipboard"), this);
import_key_from_clipboard_act_->setIcon(
QIcon(":/icons/import_key_from_clipboard.png"));
import_key_from_clipboard_act_->setToolTip(
tr("Import New Key From Clipboard"));
- connect(import_key_from_clipboard_act_, &QAction::triggered, this,
- [this, channel = m_key_list_->GetCurrentGpgContextChannel()]() {
- CommonUtils::GetInstance()->SlotImportKeyFromClipboard(this,
- channel);
- });
+ connect(import_key_from_clipboard_act_, &QAction::triggered, this, [this]() {
+ CommonUtils::GetInstance()->SlotImportKeyFromClipboard(
+ this, m_key_list_->GetCurrentGpgContextChannel());
+ });
bool forbid_all_gnupg_connection =
GlobalSettingStation::GetInstance()
@@ -338,11 +337,10 @@ void MainWindow::create_actions() {
import_key_from_key_server_act_->setToolTip(
tr("Import New Key From Keyserver"));
import_key_from_key_server_act_->setDisabled(forbid_all_gnupg_connection);
- connect(import_key_from_key_server_act_, &QAction::triggered, this,
- [this, channel = m_key_list_->GetCurrentGpgContextChannel()]() {
- CommonUtils::GetInstance()->SlotImportKeyFromKeyServer(this,
- channel);
- });
+ connect(import_key_from_key_server_act_, &QAction::triggered, this, [this]() {
+ CommonUtils::GetInstance()->SlotImportKeyFromKeyServer(
+ this, m_key_list_->GetCurrentGpgContextChannel());
+ });
import_key_from_edit_act_ = new QAction(tr("Editor"), this);
import_key_from_edit_act_->setIcon(QIcon(":/icons/editor.png"));