mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-27 06:47:02 -05:00
Implement browse key file in ChangeMasterKeyWidget
This commit is contained in:
parent
5217199d0a
commit
a5f7d0277f
@ -34,6 +34,7 @@ ChangeMasterKeyWidget::ChangeMasterKeyWidget(QWidget* parent)
|
|||||||
connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(reject()));
|
connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(reject()));
|
||||||
connect(m_ui->togglePasswordButton, SIGNAL(toggled(bool)), SLOT(togglePassword(bool)));
|
connect(m_ui->togglePasswordButton, SIGNAL(toggled(bool)), SLOT(togglePassword(bool)));
|
||||||
connect(m_ui->createKeyFileButton, SIGNAL(clicked()), SLOT(createKeyFile()));
|
connect(m_ui->createKeyFileButton, SIGNAL(clicked()), SLOT(createKeyFile()));
|
||||||
|
connect(m_ui->browseKeyFileButton, SIGNAL(clicked()), SLOT(browseKeyFile()));
|
||||||
}
|
}
|
||||||
|
|
||||||
ChangeMasterKeyWidget::~ChangeMasterKeyWidget()
|
ChangeMasterKeyWidget::~ChangeMasterKeyWidget()
|
||||||
@ -69,6 +70,20 @@ void ChangeMasterKeyWidget::createKeyFile()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ChangeMasterKeyWidget::browseKeyFile()
|
||||||
|
{
|
||||||
|
QString fileName = fileDialog()->getOpenFileName(this, tr("Select a key file"), QString(),
|
||||||
|
tr("Key Files") + " (*.key);;" + tr("All files (*)"));
|
||||||
|
|
||||||
|
if(!fileName.isEmpty())
|
||||||
|
{
|
||||||
|
if(m_ui->keyFileGroup->isEnabled())
|
||||||
|
{
|
||||||
|
m_ui->keyFileCombo->setEditText(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ChangeMasterKeyWidget::clearForms()
|
void ChangeMasterKeyWidget::clearForms()
|
||||||
{
|
{
|
||||||
m_key.clear();
|
m_key.clear();
|
||||||
|
@ -47,6 +47,7 @@ private Q_SLOTS:
|
|||||||
void reject();
|
void reject();
|
||||||
void togglePassword(bool checked);
|
void togglePassword(bool checked);
|
||||||
void createKeyFile();
|
void createKeyFile();
|
||||||
|
void browseKeyFile();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const QScopedPointer<Ui::ChangeMasterKeyWidget> m_ui;
|
const QScopedPointer<Ui::ChangeMasterKeyWidget> m_ui;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user