diff options
author | saturneric <[email protected]> | 2024-01-19 13:54:26 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-01-19 13:54:26 +0000 |
commit | 5baef3c4a3b947d3275e9ce44cfb7a68984f6cca (patch) | |
tree | 78ea7c8caeb4336d99596ae665061bb7f25611f1 /src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp | |
parent | fix: slove discovered faults and bugs (diff) | |
download | GpgFrontend-5baef3c4a3b947d3275e9ce44cfb7a68984f6cca.tar.gz GpgFrontend-5baef3c4a3b947d3275e9ce44cfb7a68984f6cca.zip |
fix: solve discovered bugs and improve ui operations
Diffstat (limited to 'src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp')
-rw-r--r-- | src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp b/src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp index ba12f232..a56a7fc7 100644 --- a/src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp +++ b/src/ui/dialog/keypair_details/KeyUIDSignDialog.cpp @@ -28,10 +28,10 @@ #include "KeyUIDSignDialog.h" -#include "core/GpgModel.h" #include "core/function/gpg/GpgKeyGetter.h" #include "core/function/gpg/GpgKeyManager.h" #include "ui/UISignalStation.h" +#include "ui/widgets/KeyList.h" namespace GpgFrontend::UI { @@ -70,23 +70,17 @@ KeyUIDSignDialog::KeyUIDSignDialog(const GpgKey& key, UIDArgsListPtr uid, non_expire_check_->setTristate(false); connect(non_expire_check_, &QCheckBox::stateChanged, this, - [this](int state) -> void { - if (state == 0) - expires_edit_->setDisabled(false); - else - expires_edit_->setDisabled(true); - }); + [this](int state) -> void { expires_edit_->setEnabled(state == 0); }); - auto layout = new QGridLayout(); - - auto timeLayout = new QGridLayout(); + auto* layout = new QGridLayout(); + auto* time_layout = new QGridLayout(); layout->addWidget(m_key_list_, 0, 0); layout->addWidget(sign_key_button_, 2, 0, Qt::AlignRight); - timeLayout->addWidget(new QLabel(tr("Expire Date")), 0, 0); - timeLayout->addWidget(expires_edit_, 0, 1); - timeLayout->addWidget(non_expire_check_, 0, 2); - layout->addLayout(timeLayout, 1, 0); + time_layout->addWidget(new QLabel(tr("Expire Date")), 0, 0); + time_layout->addWidget(expires_edit_, 0, 1); + time_layout->addWidget(non_expire_check_, 0, 2); + layout->addLayout(time_layout, 1, 0); connect(sign_key_button_, &QPushButton::clicked, this, &KeyUIDSignDialog::slot_sign_key); |