diff options
5 files changed, 17 insertions, 13 deletions
diff --git a/src/ui/dialog/keypair_details/KeyNewUIDDialog.cpp b/src/ui/dialog/keypair_details/KeyNewUIDDialog.cpp index 76eb94c0..6cd423fc 100644 --- a/src/ui/dialog/keypair_details/KeyNewUIDDialog.cpp +++ b/src/ui/dialog/keypair_details/KeyNewUIDDialog.cpp @@ -51,25 +51,25 @@ KeyNewUIDDialog::KeyNewUIDDialog(int channel, const KeyId& key_id, create_button_ = new QPushButton("Create"); error_label_ = new QLabel(); - auto gridLayout = new QGridLayout(); - gridLayout->addWidget(new QLabel(tr("Name")), 0, 0); - gridLayout->addWidget(new QLabel(tr("Email")), 1, 0); - gridLayout->addWidget(new QLabel(tr("Comment")), 2, 0); + auto grid_layout = new QGridLayout(); + grid_layout->addWidget(new QLabel(tr("Name")), 0, 0); + grid_layout->addWidget(new QLabel(tr("Email")), 1, 0); + grid_layout->addWidget(new QLabel(tr("Comment")), 2, 0); - gridLayout->addWidget(name_, 0, 1); - gridLayout->addWidget(email_, 1, 1); - gridLayout->addWidget(comment_, 2, 1); + grid_layout->addWidget(name_, 0, 1); + grid_layout->addWidget(email_, 1, 1); + grid_layout->addWidget(comment_, 2, 1); - gridLayout->addWidget(create_button_, 3, 0, 1, 2); - gridLayout->addWidget( + grid_layout->addWidget(create_button_, 3, 0, 1, 2); + grid_layout->addWidget( new QLabel(tr("Notice: The New UID Created will be set as Primary.")), 4, 0, 1, 2); - gridLayout->addWidget(error_label_, 5, 0, 1, 2); + grid_layout->addWidget(error_label_, 5, 0, 1, 2); connect(create_button_, &QPushButton::clicked, this, &KeyNewUIDDialog::slot_create_new_uid); - this->setLayout(gridLayout); + this->setLayout(grid_layout); this->setWindowTitle(tr("Create New UID")); this->setAttribute(Qt::WA_DeleteOnClose, true); this->setModal(true); diff --git a/src/ui/dialog/keypair_details/KeyPairDetailTab.cpp b/src/ui/dialog/keypair_details/KeyPairDetailTab.cpp index bdc2c9e8..820e9963 100644 --- a/src/ui/dialog/keypair_details/KeyPairDetailTab.cpp +++ b/src/ui/dialog/keypair_details/KeyPairDetailTab.cpp @@ -285,6 +285,9 @@ void KeyPairDetailTab::slot_refresh_key_info() { } else if (key_.IsRevoked()) { slot_refresh_notice(":/icons/warning.png", tr("Warning: The primary key has been revoked.")); + } else if (key_.IsPrivateKey() && !key_.IsHasMasterKey()) { + slot_refresh_notice(":/icons/warning.png", + tr("Warning: The primary key is not exists.")); } else { slot_query_key_publish_state(); } diff --git a/src/ui/dialog/keypair_details/KeyPairOperaTab.cpp b/src/ui/dialog/keypair_details/KeyPairOperaTab.cpp index cd8eb335..ff796d6c 100644 --- a/src/ui/dialog/keypair_details/KeyPairOperaTab.cpp +++ b/src/ui/dialog/keypair_details/KeyPairOperaTab.cpp @@ -105,7 +105,7 @@ KeyPairOperaTab::KeyPairOperaTab(int channel, const QString& key_id, advance_h_box_layout->addWidget(key_server_opera_button); if (Module::IsModuleActivate(kPaperKeyModuleID)) { - if (!m_key_.IsPrivateKey() || !m_key_.IsHasMasterKey()) { + if (!m_key_.IsPrivateKey()) { auto* import_paper_key_button = new QPushButton(tr("Import A Paper Key")); import_paper_key_button->setStyleSheet("text-align:center;"); connect(import_paper_key_button, &QPushButton::clicked, this, diff --git a/src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp b/src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp index ded630e7..ee637abb 100644 --- a/src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp +++ b/src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp @@ -241,7 +241,7 @@ void KeyPairSubkeyTab::slot_refresh_subkey_list() { } } - if (subkey.IsExpired() || subkey.IsRevoked()) { + if (subkey.IsExpired() || subkey.IsRevoked() || !subkey.IsSecretKey()) { for (auto i = 0; i < subkey_list_->columnCount(); i++) { auto font = subkey_list_->item(row, i)->font(); font.setStrikeOut(true); diff --git a/src/ui/dialog/keypair_details/KeyPairUIDTab.cpp b/src/ui/dialog/keypair_details/KeyPairUIDTab.cpp index 87f5e10e..fdae5223 100644 --- a/src/ui/dialog/keypair_details/KeyPairUIDTab.cpp +++ b/src/ui/dialog/keypair_details/KeyPairUIDTab.cpp @@ -59,6 +59,7 @@ KeyPairUIDTab::KeyPairUIDTab(int channel, const QString& key_id, if (m_key_.IsHasMasterKey()) { manage_uid_button->setMenu(manage_selected_uid_menu_); } else { + add_uid_button->setDisabled(true); manage_uid_button->setDisabled(true); } |