Indicate read-only state in window title.

This commit is contained in:
Florian Geyer 2012-05-28 18:38:33 +02:00
parent 5201001f3a
commit 8aefb1ed82
3 changed files with 32 additions and 1 deletions

View file

@ -387,6 +387,15 @@ void DatabaseTabWidget::toggleSearch()
currentDatabaseWidget()->toggleSearch();
}
bool DatabaseTabWidget::readOnly(int index)
{
if (index == -1) {
index = currentIndex();
}
return indexDatabaseManagerStruct(index).readOnly;
}
void DatabaseTabWidget::updateTabName(Database* db)
{
int index = databaseIndex(db);
@ -451,6 +460,21 @@ Database* DatabaseTabWidget::indexDatabase(int index)
return 0;
}
DatabaseManagerStruct DatabaseTabWidget::indexDatabaseManagerStruct(int index)
{
QWidget* dbWidget = widget(index);
QHashIterator<Database*, DatabaseManagerStruct> i(m_dbList);
while (i.hasNext()) {
i.next();
if (i.value().dbWidget == dbWidget) {
return i.value();
}
}
return DatabaseManagerStruct();
}
Database* DatabaseTabWidget::databaseFromDatabaseWidget(DatabaseWidget* dbWidget)
{
QHashIterator<Database*, DatabaseManagerStruct> i(m_dbList);