Disable merge when database is locked

This commit is contained in:
Jonathan White 2018-05-18 17:06:28 -04:00
parent 0a155d89a3
commit 2eb3159f8a
No known key found for this signature in database
GPG key ID: 440FC65F2E0C6E01
2 changed files with 8 additions and 6 deletions

View file

@ -198,11 +198,14 @@ void DatabaseTabWidget::importCsv()
void DatabaseTabWidget::mergeDatabase()
{
QString filter = QString("%1 (*.kdbx);;%2 (*)").arg(tr("KeePass 2 Database"), tr("All files"));
const QString fileName = fileDialog()->getOpenFileName(this, tr("Merge database"), QString(),
filter);
if (!fileName.isEmpty()) {
mergeDatabase(fileName);
auto dbWidget = currentDatabaseWidget();
if (dbWidget && dbWidget->currentMode() != DatabaseWidget::LockedMode) {
QString filter = QString("%1 (*.kdbx);;%2 (*)").arg(tr("KeePass 2 Database"), tr("All files"));
const QString fileName = fileDialog()->getOpenFileName(this, tr("Merge database"), QString(),
filter);
if (!fileName.isEmpty()) {
mergeDatabase(fileName);
}
}
}