diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp index 2afde49fe..fbcb38fa6 100644 --- a/src/gui/DatabaseWidget.cpp +++ b/src/gui/DatabaseWidget.cpp @@ -1902,7 +1902,7 @@ void DatabaseWidget::onDatabaseNonDataChanged() { // Force mark the database modified if we are not auto-saving non-data changes if (!config()->get(Config::AutoSaveNonDataChanges).toBool()) { - m_db->markAsModified(); + emit databaseNonDataChanged(); } } diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 1056091d7..0761bd6a2 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -1041,7 +1041,11 @@ void MainWindow::updateMenuActionState() m_ui->actionGroupDownloadFavicons->setEnabled(groupSelected && groupHasEntries && !inRecycleBin); // Database Menu - m_ui->actionDatabaseSave->setEnabled(databaseUnlocked && m_ui->tabWidget->canSave()); + bool enableSave = databaseUnlocked + && (m_ui->tabWidget->canSave() + || (dbWidget && dbWidget->database() && dbWidget->database()->hasNonDataChanges() + && !config()->get(Config::AutoSaveNonDataChanges).toBool())); + m_ui->actionDatabaseSave->setEnabled(enableSave); m_ui->actionDatabaseSaveAs->setEnabled(databaseUnlocked); m_ui->actionDatabaseSaveBackup->setEnabled(databaseUnlocked); m_ui->actionDatabaseClose->setEnabled(dbWidget); @@ -1094,7 +1098,12 @@ void MainWindow::updateWindowTitle() if (isModified && customWindowTitlePart.endsWith("*")) { customWindowTitlePart.remove(customWindowTitlePart.size() - 1, 1); } - m_ui->actionDatabaseSave->setEnabled(m_ui->tabWidget->canSave(tabWidgetIndex)); + auto dbWidget = m_ui->tabWidget->databaseWidgetFromIndex(tabWidgetIndex); + bool enableSave = (dbWidget && !dbWidget->isLocked()) + && (m_ui->tabWidget->canSave(tabWidgetIndex) + || (dbWidget->database() && dbWidget->database()->hasNonDataChanges() + && !config()->get(Config::AutoSaveNonDataChanges).toBool())); + m_ui->actionDatabaseSave->setEnabled(enableSave); } else if (stackedWidgetIndex == StackedWidgetIndex::SettingsScreen) { customWindowTitlePart = tr("Settings"); } else if (stackedWidgetIndex == StackedWidgetIndex::PasswordGeneratorScreen) {