fix checkboxes state for already accepted/signed keys on add friend dialog

This commit is contained in:
RetroPooh 2017-10-23 20:01:35 +03:00
parent b6f102cabb
commit e2bbbad590

View File

@ -475,33 +475,17 @@ void ConnectFriendWizard::initializePage(int id)
else else
ui->addKeyToKeyring_CB->setToolTip(tr("Check this to add the key to your keyring\nThis might be useful for sending\ndistant messages to this peer\neven if you don't make friends.")) ; ui->addKeyToKeyring_CB->setToolTip(tr("Check this to add the key to your keyring\nThis might be useful for sending\ndistant messages to this peer\neven if you don't make friends.")) ;
//set the radio button to sign the GPG key if(tmp_det.accept_connection) {
if (peerDetails.accept_connection && !peerDetails.ownsign) {
//gpg key connection is already accepted, don't propose to accept it again
ui->signGPGCheckBox->setChecked(false);
ui->acceptNoSignGPGCheckBox->hide();
ui->acceptNoSignGPGCheckBox->setChecked(false);
}
if (!peerDetails.accept_connection && peerDetails.ownsign) {
//gpg key is already signed, don't propose to sign it again
ui->acceptNoSignGPGCheckBox->setChecked(true); ui->acceptNoSignGPGCheckBox->setChecked(true);
ui->signGPGCheckBox->hide(); ui->acceptNoSignGPGCheckBox->setEnabled(false);
ui->signGPGCheckBox->setChecked(false); ui->acceptNoSignGPGCheckBox->setToolTip(tr("This key is already on your trusted list"));
} }
if (!peerDetails.accept_connection && !peerDetails.ownsign) { else
ui->acceptNoSignGPGCheckBox->setChecked(true);
ui->signGPGCheckBox->show();
ui->signGPGCheckBox->setChecked(false);
ui->acceptNoSignGPGCheckBox->show();
}
if (peerDetails.accept_connection && peerDetails.ownsign) {
ui->acceptNoSignGPGCheckBox->setChecked(false);
ui->acceptNoSignGPGCheckBox->hide();
ui->signGPGCheckBox->setChecked(false);
ui->signGPGCheckBox->hide();
ui->alreadyRegisteredLabel->show();
} else {
ui->alreadyRegisteredLabel->hide(); ui->alreadyRegisteredLabel->hide();
if(tmp_det.ownsign) {
ui->signGPGCheckBox->setChecked(true);
ui->signGPGCheckBox->setEnabled(false);
ui->signGPGCheckBox->setToolTip(tr("You have already signed this key"));
} }
QString trustString; QString trustString;