diff options
| author | Tobias Hunger <tobias.hunger@digia.com> | 2012-09-28 14:35:32 +0200 |
|---|---|---|
| committer | Tobias Hunger <tobias.hunger@digia.com> | 2012-10-04 16:51:18 +0200 |
| commit | 0bcf6930d3691e7a805697b47bf11b88b51e5761 (patch) | |
| tree | a3980fe816f7ec5c9c762f8ed1eef8ec041cd157 | |
| parent | 9c2c8db4ed1d02f9b31cfcf21e9658af17048ee4 (diff) | |
| download | qt-creator-0bcf6930d3691e7a805697b47bf11b88b51e5761.tar.gz | |
Add Close button to window asking what to do with changed documents
Add a close button to window asking what to do with documents that
were changed outside Creator. Finally a simple way to get rid of
open moc-files that trigger this window over and over again:-)
Task-number: QTCREATORBUG-7360
Change-Id: I7a373ed60d85d810caf6604bc7dae7bb7fa186a9
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
| -rw-r--r-- | src/libs/utils/reloadpromptutils.cpp | 4 | ||||
| -rw-r--r-- | src/libs/utils/reloadpromptutils.h | 2 | ||||
| -rw-r--r-- | src/plugins/coreplugin/documentmanager.cpp | 3 |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/libs/utils/reloadpromptutils.cpp b/src/libs/utils/reloadpromptutils.cpp index cbbe1dde5a..794213c289 100644 --- a/src/libs/utils/reloadpromptutils.cpp +++ b/src/libs/utils/reloadpromptutils.cpp @@ -59,7 +59,7 @@ QTCREATOR_UTILS_EXPORT Utils::ReloadPromptAnswer Utils::reloadPrompt(const QString &title, const QString &prompt, const QString &details, QWidget *parent) { QMessageBox msg(parent); - msg.setStandardButtons(QMessageBox::Yes|QMessageBox::YesToAll|QMessageBox::No|QMessageBox::NoToAll); + msg.setStandardButtons(QMessageBox::Yes|QMessageBox::YesToAll|QMessageBox::Close|QMessageBox::No|QMessageBox::NoToAll); msg.setDefaultButton(QMessageBox::YesToAll); msg.setWindowTitle(title); msg.setText(prompt); @@ -72,6 +72,8 @@ QTCREATOR_UTILS_EXPORT Utils::ReloadPromptAnswer return ReloadAll; case QMessageBox::No: return ReloadSkipCurrent; + case QMessageBox::Close: + return CloseCurrent; default: break; } diff --git a/src/libs/utils/reloadpromptutils.h b/src/libs/utils/reloadpromptutils.h index b7cb73ff51..edfde0172c 100644 --- a/src/libs/utils/reloadpromptutils.h +++ b/src/libs/utils/reloadpromptutils.h @@ -40,7 +40,7 @@ QT_END_NAMESPACE namespace Utils { -enum ReloadPromptAnswer { ReloadCurrent, ReloadAll, ReloadSkipCurrent, ReloadNone }; +enum ReloadPromptAnswer { ReloadCurrent, ReloadAll, ReloadSkipCurrent, ReloadNone, CloseCurrent }; QTCREATOR_UTILS_EXPORT ReloadPromptAnswer reloadPrompt(const QString &fileName, bool modified, QWidget *parent); QTCREATOR_UTILS_EXPORT ReloadPromptAnswer reloadPrompt(const QString &title, const QString &prompt, const QString &details, QWidget *parent); diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index a6eae6c95d..732ceb4956 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -1034,6 +1034,9 @@ void DocumentManager::checkForReload() case Utils::ReloadNone: success = document->reload(&errorString, IDocument::FlagIgnore, IDocument::TypeContents); break; + case Utils::CloseCurrent: + editorsToClose << EditorManager::instance()->editorsForDocument(document); + break; } } // IDocument wants us to ask, and it's the TypeRemoved case |
