diff options
| author | Petar Perisin <petar.perisin@gmail.com> | 2013-12-07 15:04:14 +0100 |
|---|---|---|
| committer | Petar Perisin <petar.perisin@gmail.com> | 2013-12-09 11:09:00 +0100 |
| commit | 56c26fe6c01697ecd34d24c1800e5e981cf643a6 (patch) | |
| tree | 233509f674b7496c5726c9b0b606e2bfe0d29161 | |
| parent | 817f99d3eee90fb7b33c27472f0b4801717a411e (diff) | |
| download | qt-creator-56c26fe6c01697ecd34d24c1800e5e981cf643a6.tar.gz | |
EditorManager: Add command to reload current file
Change-Id: Ic6d246c27540689a68d338d7e62c3d85fd5236b4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
| -rw-r--r-- | src/plugins/coreplugin/editormanager/editormanager.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 253662a78f..ca62088313 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1988,8 +1988,7 @@ void EditorManager::setupSaveActions(IDocument *document, QAction *saveAction, Q { saveAction->setEnabled(document != 0 && document->isModified()); saveAsAction->setEnabled(document != 0 && document->isSaveAsAllowed()); - revertToSavedAction->setEnabled(document != 0 - && !document->filePath().isEmpty() && document->isModified()); + revertToSavedAction->setEnabled(document != 0 && !document->filePath().isEmpty()); const QString documentName = document ? document->displayName() : QString(); QString quotedName; @@ -1998,7 +1997,9 @@ void EditorManager::setupSaveActions(IDocument *document, QAction *saveAction, Q quotedName = QLatin1Char('"') + documentName + QLatin1Char('"'); saveAction->setText(tr("&Save %1").arg(quotedName)); saveAsAction->setText(tr("Save %1 &As...").arg(quotedName)); - revertToSavedAction->setText(tr("Revert %1 to Saved").arg(quotedName)); + revertToSavedAction->setText(document->isModified() + ? tr("Revert %1 to Saved").arg(quotedName) + : tr("Reload %1").arg(quotedName)); } } |
