diff options
author | saturneric <[email protected]> | 2024-01-16 17:41:52 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-01-16 17:41:52 +0000 |
commit | 5bcf07c5f6a3429bc787c31d26edd796c8cad9c6 (patch) | |
tree | f473d3c278b64396852403e5e334f87f02f5505a /src/ui/main_window/MainWindowUI.cpp | |
parent | fix: slove some issues and update translations (diff) | |
download | GpgFrontend-5bcf07c5f6a3429bc787c31d26edd796c8cad9c6.tar.gz GpgFrontend-5bcf07c5f6a3429bc787c31d26edd796c8cad9c6.zip |
fix: solve discovered issues
Diffstat (limited to 'src/ui/main_window/MainWindowUI.cpp')
-rw-r--r-- | src/ui/main_window/MainWindowUI.cpp | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/src/ui/main_window/MainWindowUI.cpp b/src/ui/main_window/MainWindowUI.cpp index f62f6d9f..39ef9aed 100644 --- a/src/ui/main_window/MainWindowUI.cpp +++ b/src/ui/main_window/MainWindowUI.cpp @@ -347,28 +347,34 @@ void MainWindow::create_actions() { clean_gpg_password_cache_act_->setToolTip( tr("Clear Password Cache of GnuPG")); connect(clean_gpg_password_cache_act_, &QAction::triggered, this, [=]() { - if (GpgFrontend::GpgAdvancedOperator::ClearGpgPasswordCache()) { - QMessageBox::information(this, tr("Successful Operation"), - tr("Clear password cache successfully")); - } else { - QMessageBox::critical(this, tr("Failed Operation"), - tr("Failed to clear password cache of GnuPG")); - } + GpgFrontend::GpgAdvancedOperator::ClearGpgPasswordCache([=](int err, + DataObjectPtr) { + if (err >= 0) { + QMessageBox::information(this, tr("Successful Operation"), + tr("Clear password cache successfully")); + } else { + QMessageBox::critical(this, tr("Failed Operation"), + tr("Failed to clear password cache of GnuPG")); + } + }); }); reload_components_act_ = new QAction(tr("Reload All Components"), this); reload_components_act_->setIcon(QIcon(":/icons/configure.png")); reload_components_act_->setToolTip(tr("Reload All GnuPG's Components")); connect(reload_components_act_, &QAction::triggered, this, [=]() { - if (GpgFrontend::GpgAdvancedOperator::ReloadGpgComponents()) { - QMessageBox::information( - this, tr("Successful Operation"), - tr("Reload all the GnuPG's components successfully")); - } else { - QMessageBox::critical( - this, tr("Failed Operation"), - tr("Failed to reload all or one of the GnuPG's component(s)")); - } + GpgFrontend::GpgAdvancedOperator::ReloadGpgComponents( + [=](int err, DataObjectPtr) { + if (err >= 0) { + QMessageBox::information( + this, tr("Successful Operation"), + tr("Reload all the GnuPG's components successfully")); + } else { + QMessageBox::critical( + this, tr("Failed Operation"), + tr("Failed to reload all or one of the GnuPG's component(s)")); + } + }); }); restart_components_act_ = new QAction(tr("Restart All Components"), this); |