Editor: Added a close all option to the deleted file dialog.

Change-Id: Ibacfc31c4cd6193e85c84f8553bae7495aea08c7
Reviewed-by: Simon Schäfer <simon.schaefer@koeln.de>
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
This commit is contained in:
David Schulz
2013-09-06 11:01:37 +02:00
parent d5d019a31d
commit 70019a85a3
3 changed files with 23 additions and 7 deletions

View File

@@ -91,6 +91,7 @@ QTCREATOR_UTILS_EXPORT Utils::FileDeletedPromptAnswer
"The file %1 was removed. Do you want to save it under a different name, or close the editor?").arg(QDir::toNativeSeparators(fileName));
QMessageBox box(QMessageBox::Question, title, msg, QMessageBox::NoButton, parent);
QPushButton *close = box.addButton(QCoreApplication::translate("Utils::fileDeletedPrompt", "&Close"), QMessageBox::RejectRole);
QPushButton *closeAll = box.addButton(QCoreApplication::translate("Utils::fileDeletedPrompt", "C&lose All"), QMessageBox::RejectRole);
QPushButton *saveas = box.addButton(QCoreApplication::translate("Utils::fileDeletedPrompt", "Save &as..."), QMessageBox::ActionRole);
QPushButton *save = box.addButton(QCoreApplication::translate("Utils::fileDeletedPrompt", "&Save"), QMessageBox::AcceptRole);
box.setDefaultButton(saveas);
@@ -98,6 +99,8 @@ QTCREATOR_UTILS_EXPORT Utils::FileDeletedPromptAnswer
QAbstractButton *clickedbutton = box.clickedButton();
if (clickedbutton == close)
return FileDeletedClose;
else if (clickedbutton == closeAll)
return FileDeletedCloseAll;
else if (clickedbutton == saveas)
return FileDeletedSaveAs;
else if (clickedbutton == save)