forked from qt-creator/qt-creator
Mac: Show modified state in window decoration.
Task-number: QTCREATORBUG-1118
This commit is contained in:
@@ -844,8 +844,10 @@ bool EditorManager::closeEditors(const QList<IEditor*> &editorsToClose, bool ask
|
|||||||
activateEditor(currentSplitterOrView->view(), editor);
|
activateEditor(currentSplitterOrView->view(), editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!currentEditor())
|
if (!currentEditor()) {
|
||||||
emit currentEditorChanged(0);
|
emit currentEditorChanged(0);
|
||||||
|
updateActions();
|
||||||
|
}
|
||||||
|
|
||||||
return !closingFailed;
|
return !closingFailed;
|
||||||
}
|
}
|
||||||
@@ -1527,6 +1529,7 @@ void EditorManager::updateActions()
|
|||||||
fName = curEditor->displayName();
|
fName = curEditor->displayName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window()->setWindowModified(curEditor->file()->isModified());
|
||||||
if (curEditor->file()->isModified() && curEditor->file()->isReadOnly()) {
|
if (curEditor->file()->isModified() && curEditor->file()->isReadOnly()) {
|
||||||
// we are about to change a read-only file, warn user
|
// we are about to change a read-only file, warn user
|
||||||
showEditorInfoBar(QLatin1String("Core.EditorManager.MakeWritable"),
|
showEditorInfoBar(QLatin1String("Core.EditorManager.MakeWritable"),
|
||||||
@@ -1535,6 +1538,8 @@ void EditorManager::updateActions()
|
|||||||
} else {
|
} else {
|
||||||
hideEditorInfoBar(QLatin1String("Core.EditorManager.MakeWritable"));
|
hideEditorInfoBar(QLatin1String("Core.EditorManager.MakeWritable"));
|
||||||
}
|
}
|
||||||
|
} else { // curEditor
|
||||||
|
window()->setWindowModified(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_d->m_saveAction->setEnabled(curEditor != 0 && curEditor->file()->isModified());
|
m_d->m_saveAction->setEnabled(curEditor != 0 && curEditor->file()->isModified());
|
||||||
|
Reference in New Issue
Block a user