Skip to content
Snippets Groups Projects
Commit 0bcf6930 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

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: default avatarDaniel Teske <daniel.teske@digia.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 9c2c8db4
No related branches found
No related tags found
No related merge requests found
...@@ -59,7 +59,7 @@ QTCREATOR_UTILS_EXPORT Utils::ReloadPromptAnswer ...@@ -59,7 +59,7 @@ QTCREATOR_UTILS_EXPORT Utils::ReloadPromptAnswer
Utils::reloadPrompt(const QString &title, const QString &prompt, const QString &details, QWidget *parent) Utils::reloadPrompt(const QString &title, const QString &prompt, const QString &details, QWidget *parent)
{ {
QMessageBox msg(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.setDefaultButton(QMessageBox::YesToAll);
msg.setWindowTitle(title); msg.setWindowTitle(title);
msg.setText(prompt); msg.setText(prompt);
...@@ -72,6 +72,8 @@ QTCREATOR_UTILS_EXPORT Utils::ReloadPromptAnswer ...@@ -72,6 +72,8 @@ QTCREATOR_UTILS_EXPORT Utils::ReloadPromptAnswer
return ReloadAll; return ReloadAll;
case QMessageBox::No: case QMessageBox::No:
return ReloadSkipCurrent; return ReloadSkipCurrent;
case QMessageBox::Close:
return CloseCurrent;
default: default:
break; break;
} }
......
...@@ -40,7 +40,7 @@ QT_END_NAMESPACE ...@@ -40,7 +40,7 @@ QT_END_NAMESPACE
namespace Utils { 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 &fileName, bool modified, QWidget *parent);
QTCREATOR_UTILS_EXPORT ReloadPromptAnswer reloadPrompt(const QString &title, const QString &prompt, const QString &details, QWidget *parent); QTCREATOR_UTILS_EXPORT ReloadPromptAnswer reloadPrompt(const QString &title, const QString &prompt, const QString &details, QWidget *parent);
......
...@@ -1034,6 +1034,9 @@ void DocumentManager::checkForReload() ...@@ -1034,6 +1034,9 @@ void DocumentManager::checkForReload()
case Utils::ReloadNone: case Utils::ReloadNone:
success = document->reload(&errorString, IDocument::FlagIgnore, IDocument::TypeContents); success = document->reload(&errorString, IDocument::FlagIgnore, IDocument::TypeContents);
break; break;
case Utils::CloseCurrent:
editorsToClose << EditorManager::instance()->editorsForDocument(document);
break;
} }
} }
// IDocument wants us to ask, and it's the TypeRemoved case // IDocument wants us to ask, and it's the TypeRemoved case
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment