Close database without asking when unmodified.

Don't ask for confirmation when closing/locking a database and
- it's in edit entry mode
- there haven't been any modifications

Refs #511
This commit is contained in:
Felix Geyer 2016-08-01 00:22:04 +02:00 committed by Jonathan White
parent cf8186312a
commit 8a50ee8b22
5 changed files with 32 additions and 2 deletions

View file

@ -194,6 +194,18 @@ bool DatabaseWidget::isInEditMode() const
return currentMode() == DatabaseWidget::EditMode;
}
bool DatabaseWidget::isEditWidgetModified() const
{
if (currentWidget() == m_editEntryWidget) {
return m_editEntryWidget->hasBeenModified();
}
else {
// other edit widget don't have a hasBeenModified() method yet
// assume that they already have been modified
return true;
}
}
QList<int> DatabaseWidget::splitterSizes() const
{
return m_splitter->sizes();