aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/keypair_details/KeyPairOperaTab.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2023-12-03 12:28:46 +0000
committersaturneric <[email protected]>2023-12-03 12:28:46 +0000
commit883db05d54510e76b6548e107593187e1306117d (patch)
treea4de9d60d3bfeb69ba443129d208feef65250b2c /src/ui/dialog/keypair_details/KeyPairOperaTab.cpp
parentfeat: improve memory security of function framework (diff)
downloadGpgFrontend-883db05d54510e76b6548e107593187e1306117d.tar.gz
GpgFrontend-883db05d54510e76b6548e107593187e1306117d.zip
feat: general improvements of aync execution and memory security
Diffstat (limited to 'src/ui/dialog/keypair_details/KeyPairOperaTab.cpp')
-rw-r--r--src/ui/dialog/keypair_details/KeyPairOperaTab.cpp28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/ui/dialog/keypair_details/KeyPairOperaTab.cpp b/src/ui/dialog/keypair_details/KeyPairOperaTab.cpp
index 6f1bde9c..f7a8fb62 100644
--- a/src/ui/dialog/keypair_details/KeyPairOperaTab.cpp
+++ b/src/ui/dialog/keypair_details/KeyPairOperaTab.cpp
@@ -306,7 +306,7 @@ void KeyPairOperaTab::slot_export_private_key() {
}
void KeyPairOperaTab::slot_modify_edit_datetime() {
- auto dialog = new KeySetExpireDateDialog(m_key_.GetId(), this);
+ auto* dialog = new KeySetExpireDateDialog(m_key_.GetId(), this);
dialog->show();
}
@@ -330,8 +330,16 @@ void KeyPairOperaTab::slot_gen_revoke_cert() {
auto literal = QString("%1 (*.rev)").arg(_("Revocation Certificates"));
QString m_output_file_name;
- QFileDialog dialog(this, "Generate revocation certificate", QString(),
- literal);
+#ifndef WINDOWS
+ auto file_string = m_key_.GetName() + "<" + m_key_.GetEmail() + ">(" +
+ m_key_.GetId() + ").rev";
+#else
+ auto file_string = m_key_.GetName() + "[" + m_key_.GetEmail() + "](" +
+ m_key_.GetId() + ").rev";
+#endif
+
+ QFileDialog dialog(this, "Generate revocation certificate",
+ QString::fromStdString(file_string), literal);
dialog.setDefaultSuffix(".rev");
dialog.setAcceptMode(QFileDialog::AcceptSave);
@@ -344,12 +352,14 @@ void KeyPairOperaTab::slot_gen_revoke_cert() {
}
void KeyPairOperaTab::slot_modify_password() {
- GpgKeyOpera::GetInstance().ModifyPassword(m_key_, [this](GpgError err) {
- if (CheckGpgError(err) != GPG_ERR_NO_ERROR) {
- QMessageBox::critical(this, _("Not Successful"),
- QString(_("Modify password not successfully.")));
- }
- });
+ GpgKeyOpera::GetInstance().ModifyPassword(
+ m_key_, [this](GpgError err, const DataObjectPtr&) {
+ if (CheckGpgError(err) != GPG_ERR_NO_ERROR) {
+ QMessageBox::critical(
+ this, _("Not Successful"),
+ QString(_("Modify password not successfully.")));
+ }
+ });
}
void KeyPairOperaTab::slot_modify_tofu_policy() {