Merge pull request #420 from weslly/feature/window-modified-indicator

Set window modified indicator when database has unsaved changes
This commit is contained in:
Janek Bevendorff 2017-03-21 14:27:43 +01:00 committed by GitHub
commit 93dcf8231f
3 changed files with 12 additions and 0 deletions

View File

@ -543,6 +543,15 @@ bool DatabaseTabWidget::readOnly(int index)
return indexDatabaseManagerStruct(index).readOnly;
}
bool DatabaseTabWidget::isModified(int index)
{
if (index == -1) {
index = currentIndex();
}
return indexDatabaseManagerStruct(index).modified;
}
void DatabaseTabWidget::updateTabName(Database* db)
{
int index = databaseIndex(db);

View File

@ -78,6 +78,7 @@ public slots:
void changeMasterKey();
void changeDatabaseSettings();
bool readOnly(int index = -1);
bool isModified(int index = -1);
void performGlobalAutoType();
void lockDatabases();

View File

@ -530,6 +530,8 @@ void MainWindow::updateWindowTitle()
windowTitle = QString("%1 - %2").arg(customWindowTitlePart, BaseWindowTitle);
}
setWindowModified(m_ui->tabWidget->isModified(tabWidgetIndex));
setWindowTitle(windowTitle);
}