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