mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Enable save button when not auto-saving non-data changes (#9634)
* Fix #9501 * Also fix bug where context menu did not update when entry moved to very top or bottom of list
This commit is contained in:
parent
5804e63559
commit
f293aad74f
@ -939,6 +939,7 @@ void Database::markAsClean()
|
||||
void Database::markNonDataChange()
|
||||
{
|
||||
m_hasNonDataChange = true;
|
||||
emit databaseNonDataChanged();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -171,6 +171,7 @@ signals:
|
||||
void databaseSaved();
|
||||
void databaseDiscarded();
|
||||
void databaseFileChanged();
|
||||
void databaseNonDataChanged();
|
||||
void tagListUpdated();
|
||||
|
||||
private:
|
||||
|
@ -1108,6 +1108,8 @@ void DatabaseWidget::connectDatabaseSignals()
|
||||
connect(m_db.data(), &Database::modified, this, &DatabaseWidget::onDatabaseModified);
|
||||
connect(m_db.data(), &Database::databaseSaved, this, &DatabaseWidget::databaseSaved);
|
||||
connect(m_db.data(), &Database::databaseFileChanged, this, &DatabaseWidget::reloadDatabaseFile);
|
||||
connect(m_db.data(), &Database::databaseNonDataChanged, this, &DatabaseWidget::databaseNonDataChanged);
|
||||
connect(m_db.data(), &Database::databaseNonDataChanged, this, &DatabaseWidget::onDatabaseNonDataChanged);
|
||||
}
|
||||
|
||||
void DatabaseWidget::loadDatabase(bool accepted)
|
||||
@ -1538,6 +1540,14 @@ void DatabaseWidget::onDatabaseModified()
|
||||
refreshSearch();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
QString DatabaseWidget::getCurrentSearch()
|
||||
{
|
||||
return m_lastSearchText;
|
||||
|
@ -129,6 +129,7 @@ signals:
|
||||
// relayed Database signals
|
||||
void databaseFilePathChanged(const QString& oldPath, const QString& newPath);
|
||||
void databaseModified();
|
||||
void databaseNonDataChanged();
|
||||
void databaseSaved();
|
||||
void databaseUnlocked();
|
||||
void databaseLockRequested();
|
||||
@ -253,6 +254,7 @@ private slots:
|
||||
void onEntryChanged(Entry* entry);
|
||||
void onGroupChanged();
|
||||
void onDatabaseModified();
|
||||
void onDatabaseNonDataChanged();
|
||||
void connectDatabaseSignals();
|
||||
void loadDatabase(bool accepted);
|
||||
void unlockDatabase(bool accepted);
|
||||
|
@ -442,6 +442,7 @@ MainWindow::MainWindow()
|
||||
SIGNAL(currentModeChanged(DatabaseWidget::Mode)), this, SLOT(setMenuActionState(DatabaseWidget::Mode)));
|
||||
m_actionMultiplexer.connect(SIGNAL(groupChanged()), this, SLOT(setMenuActionState()));
|
||||
m_actionMultiplexer.connect(SIGNAL(entrySelectionChanged()), this, SLOT(setMenuActionState()));
|
||||
m_actionMultiplexer.connect(SIGNAL(databaseNonDataChanged()), this, SLOT(setMenuActionState()));
|
||||
m_actionMultiplexer.connect(SIGNAL(groupContextMenuRequested(QPoint)), this, SLOT(showGroupContextMenu(QPoint)));
|
||||
m_actionMultiplexer.connect(SIGNAL(entryContextMenuRequested(QPoint)), this, SLOT(showEntryContextMenu(QPoint)));
|
||||
m_actionMultiplexer.connect(SIGNAL(groupChanged()), this, SLOT(updateEntryCountLabel()));
|
||||
|
Loading…
Reference in New Issue
Block a user