disable the save button if there isn't anything to save

This commit is contained in:
thez3ro 2017-10-24 19:23:55 +02:00
parent ca59ae4f4f
commit 4076b37378
No known key found for this signature in database
GPG key ID: F628F9E41DD7C073
3 changed files with 13 additions and 1 deletions

View file

@ -539,6 +539,16 @@ bool DatabaseTabWidget::readOnly(int index)
return indexDatabaseManagerStruct(index).readOnly;
}
bool DatabaseTabWidget::canSave(int index)
{
if (index == -1) {
index = currentIndex();
}
const DatabaseManagerStruct& dbStruct = indexDatabaseManagerStruct(index);
return !dbStruct.saveToFilename || (dbStruct.modified && !dbStruct.readOnly);
}
bool DatabaseTabWidget::isModified(int index)
{
if (index == -1) {