mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
SSH Agent: Update available attachments immediately
The list of available attachments for SSH agent is now updated immediately when adding or removing file attachments. Closes #1668.
This commit is contained in:
parent
dc1aead2a2
commit
46099fdd71
@ -281,6 +281,8 @@ void EditEntryWidget::setupSSHAgent()
|
|||||||
connect(m_sshAgentUi->decryptButton, SIGNAL(clicked()), SLOT(decryptPrivateKey()));
|
connect(m_sshAgentUi->decryptButton, SIGNAL(clicked()), SLOT(decryptPrivateKey()));
|
||||||
connect(m_sshAgentUi->copyToClipboardButton, SIGNAL(clicked()), SLOT(copyPublicKey()));
|
connect(m_sshAgentUi->copyToClipboardButton, SIGNAL(clicked()), SLOT(copyPublicKey()));
|
||||||
|
|
||||||
|
connect(m_advancedUi->attachmentsWidget->entryAttachments(), SIGNAL(modified()), SLOT(updateAttachments()));
|
||||||
|
|
||||||
addPage(tr("SSH Agent"), FilePath::instance()->icon("apps", "utilities-terminal"), m_sshAgentWidget);
|
addPage(tr("SSH Agent"), FilePath::instance()->icon("apps", "utilities-terminal"), m_sshAgentWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -299,6 +301,27 @@ void EditEntryWidget::updateSSHAgent()
|
|||||||
m_sshAgentUi->removeFromAgentButton->setEnabled(false);
|
m_sshAgentUi->removeFromAgentButton->setEnabled(false);
|
||||||
m_sshAgentUi->copyToClipboardButton->setEnabled(false);
|
m_sshAgentUi->copyToClipboardButton->setEnabled(false);
|
||||||
|
|
||||||
|
m_sshAgentSettings = settings;
|
||||||
|
updateSSHAgentAttachments();
|
||||||
|
|
||||||
|
if (settings.selectedType() == "attachment") {
|
||||||
|
m_sshAgentUi->attachmentRadioButton->setChecked(true);
|
||||||
|
} else {
|
||||||
|
m_sshAgentUi->externalFileRadioButton->setChecked(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateSSHAgentKeyInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
void EditEntryWidget::updateSSHAgentAttachment()
|
||||||
|
{
|
||||||
|
m_sshAgentUi->attachmentRadioButton->setChecked(true);
|
||||||
|
updateSSHAgentKeyInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
void EditEntryWidget::updateSSHAgentAttachments()
|
||||||
|
{
|
||||||
|
m_sshAgentUi->attachmentComboBox->clear();
|
||||||
m_sshAgentUi->attachmentComboBox->addItem("");
|
m_sshAgentUi->attachmentComboBox->addItem("");
|
||||||
|
|
||||||
auto attachments = m_advancedUi->attachmentsWidget->entryAttachments();
|
auto attachments = m_advancedUi->attachmentsWidget->entryAttachments();
|
||||||
@ -310,24 +333,8 @@ void EditEntryWidget::updateSSHAgent()
|
|||||||
m_sshAgentUi->attachmentComboBox->addItem(fileName);
|
m_sshAgentUi->attachmentComboBox->addItem(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_sshAgentUi->attachmentComboBox->setCurrentText(settings.attachmentName());
|
m_sshAgentUi->attachmentComboBox->setCurrentText(m_sshAgentSettings.attachmentName());
|
||||||
m_sshAgentUi->externalFileEdit->setText(settings.fileName());
|
m_sshAgentUi->externalFileEdit->setText(m_sshAgentSettings.fileName());
|
||||||
|
|
||||||
if (settings.selectedType() == "attachment") {
|
|
||||||
m_sshAgentUi->attachmentRadioButton->setChecked(true);
|
|
||||||
} else {
|
|
||||||
m_sshAgentUi->externalFileRadioButton->setChecked(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_sshAgentSettings = settings;
|
|
||||||
|
|
||||||
updateSSHAgentKeyInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
void EditEntryWidget::updateSSHAgentAttachment()
|
|
||||||
{
|
|
||||||
m_sshAgentUi->attachmentRadioButton->setChecked(true);
|
|
||||||
updateSSHAgentKeyInfo();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditEntryWidget::updateSSHAgentKeyInfo()
|
void EditEntryWidget::updateSSHAgentKeyInfo()
|
||||||
|
@ -103,6 +103,7 @@ private slots:
|
|||||||
#ifdef WITH_XC_SSHAGENT
|
#ifdef WITH_XC_SSHAGENT
|
||||||
void updateSSHAgent();
|
void updateSSHAgent();
|
||||||
void updateSSHAgentAttachment();
|
void updateSSHAgentAttachment();
|
||||||
|
void updateSSHAgentAttachments();
|
||||||
void updateSSHAgentKeyInfo();
|
void updateSSHAgentKeyInfo();
|
||||||
void browsePrivateKey();
|
void browsePrivateKey();
|
||||||
void addKeyToAgent();
|
void addKeyToAgent();
|
||||||
|
Loading…
Reference in New Issue
Block a user