mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-12 07:49:55 -05:00
parent
92b30ae7ec
commit
83623c896f
@ -87,19 +87,15 @@ DatabaseOpenWidget::DatabaseOpenWidget(QWidget* parent)
|
||||
connect(m_ui->buttonBox, SIGNAL(accepted()), SLOT(openDatabase()));
|
||||
connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(reject()));
|
||||
|
||||
connect(m_ui->addKeyFileLinkLabel, &QLabel::linkActivated, this, [&](const QString&) {
|
||||
if (browseKeyFile()) {
|
||||
toggleKeyFileComponent(true);
|
||||
}
|
||||
});
|
||||
connect(m_ui->addKeyFileLinkLabel, &QLabel::linkActivated, this, &DatabaseOpenWidget::browseKeyFile);
|
||||
connect(m_ui->keyFileLineEdit, &PasswordWidget::textChanged, this, [&](const QString& text) {
|
||||
if (text.isEmpty() && m_ui->keyFileLineEdit->isVisible()) {
|
||||
toggleKeyFileComponent(false);
|
||||
}
|
||||
bool state = !text.isEmpty();
|
||||
m_ui->addKeyFileLinkLabel->setVisible(!state);
|
||||
m_ui->selectKeyFileComponent->setVisible(state);
|
||||
});
|
||||
connect(m_ui->useHardwareKeyCheckBox, &QCheckBox::toggled, m_ui->hardwareKeyCombo, &QComboBox::setEnabled);
|
||||
|
||||
toggleKeyFileComponent(false);
|
||||
m_ui->selectKeyFileComponent->setVisible(false);
|
||||
toggleHardwareKeyComponent(false);
|
||||
|
||||
QSizePolicy sp = m_ui->hardwareKeyProgress->sizePolicy();
|
||||
@ -140,12 +136,6 @@ DatabaseOpenWidget::DatabaseOpenWidget(QWidget* parent)
|
||||
|
||||
DatabaseOpenWidget::~DatabaseOpenWidget() = default;
|
||||
|
||||
void DatabaseOpenWidget::toggleKeyFileComponent(bool state)
|
||||
{
|
||||
m_ui->addKeyFileLinkLabel->setVisible(!state);
|
||||
m_ui->selectKeyFileComponent->setVisible(state);
|
||||
}
|
||||
|
||||
void DatabaseOpenWidget::toggleHardwareKeyComponent(bool state)
|
||||
{
|
||||
m_ui->hardwareKeyProgress->setVisible(false);
|
||||
@ -241,7 +231,6 @@ void DatabaseOpenWidget::load(const QString& filename)
|
||||
auto lastKeyFiles = config()->get(Config::LastKeyFiles).toHash();
|
||||
if (lastKeyFiles.contains(m_filename)) {
|
||||
m_ui->keyFileLineEdit->setText(lastKeyFiles[m_filename].toString());
|
||||
toggleKeyFileComponent(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,6 @@ protected slots:
|
||||
|
||||
private slots:
|
||||
bool browseKeyFile();
|
||||
void toggleKeyFileComponent(bool state);
|
||||
void toggleHardwareKeyComponent(bool state);
|
||||
void pollHardwareKey(bool manualTrigger = false);
|
||||
void hardwareKeyResponse(bool found);
|
||||
|
Loading…
Reference in New Issue
Block a user