mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-28 00:39:43 -05:00
Coding style fixes.
This commit is contained in:
parent
a5f7d0277f
commit
871cdc5bb8
@ -49,38 +49,28 @@ void ChangeMasterKeyWidget::togglePassword(bool checked)
|
|||||||
|
|
||||||
void ChangeMasterKeyWidget::createKeyFile()
|
void ChangeMasterKeyWidget::createKeyFile()
|
||||||
{
|
{
|
||||||
QString fileName = fileDialog()->getSaveFileName(this, tr("CreateKeyFile..."), QString(),
|
QString filters = QString("%1 (*.key);;%2 (*)").arg(tr("Key files"), tr("All files"));
|
||||||
tr("Key Files") + " (*.key);;" + tr("All files (*)"));
|
QString fileName = fileDialog()->getSaveFileName(this, tr("Create Key File..."), QString(), filters);
|
||||||
|
|
||||||
if (!fileName.isEmpty()) {
|
if (!fileName.isEmpty()) {
|
||||||
QString errorMsg;
|
QString errorMsg;
|
||||||
bool created = FileKey::create(fileName, &errorMsg);
|
bool created = FileKey::create(fileName, &errorMsg);
|
||||||
if(!created)
|
if (!created) {
|
||||||
{
|
|
||||||
QMessageBox::warning(this, tr("Error"), tr("Unable to create Key File : ") + errorMsg);
|
QMessageBox::warning(this, tr("Error"), tr("Unable to create Key File : ") + errorMsg);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
m_ui->keyFileCombo->setEditText(fileName);
|
||||||
if(m_ui->keyFileGroup->isEnabled())
|
|
||||||
{
|
|
||||||
m_ui->keyFileCombo->setEditText(fileName);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChangeMasterKeyWidget::browseKeyFile()
|
void ChangeMasterKeyWidget::browseKeyFile()
|
||||||
{
|
{
|
||||||
QString fileName = fileDialog()->getOpenFileName(this, tr("Select a key file"), QString(),
|
QString filters = QString("%1 (*.key);;%2 (*)").arg(tr("Key files"), tr("All files"));
|
||||||
tr("Key Files") + " (*.key);;" + tr("All files (*)"));
|
QString fileName = fileDialog()->getOpenFileName(this, tr("Select a key file"), QString(), filters);
|
||||||
|
|
||||||
if(!fileName.isEmpty())
|
if (!fileName.isEmpty()) {
|
||||||
{
|
m_ui->keyFileCombo->setEditText(fileName);
|
||||||
if(m_ui->keyFileGroup->isEnabled())
|
|
||||||
{
|
|
||||||
m_ui->keyFileCombo->setEditText(fileName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user