diff --git a/src/libs/utils/reloadpromptutils.cpp b/src/libs/utils/reloadpromptutils.cpp index 23678a9a41863c0c931ff4cb28311c2d807dbc39..c4463b7e07edf8f48118a34260810f4b608692d7 100644 --- a/src/libs/utils/reloadpromptutils.cpp +++ b/src/libs/utils/reloadpromptutils.cpp @@ -46,19 +46,25 @@ QTCREATOR_UTILS_EXPORT Utils::ReloadPromptAnswer if (modified) msg = QCoreApplication::translate("Utils::reloadPrompt", - "The unsaved file %1 has been changed outside Qt Creator. Do you want to reload it and discard your changes?").arg(QDir::toNativeSeparators(fileName)); + "The unsaved file <i>%1</i> has been changed outside Qt Creator. Do you want to reload it and discard your changes?"); else msg = QCoreApplication::translate("Utils::reloadPrompt", - "The file %1 has changed outside Qt Creator. Do you want to reload it?").arg(QDir::toNativeSeparators(fileName)); - return reloadPrompt(title, msg, parent); + "The file <i>%1</i> has changed outside Qt Creator. Do you want to reload it?"); + msg = msg.arg(QFileInfo(fileName).fileName()); + return reloadPrompt(title, msg, QDir::toNativeSeparators(fileName), parent); } QTCREATOR_UTILS_EXPORT Utils::ReloadPromptAnswer - Utils::reloadPrompt(const QString &title, const QString &prompt, QWidget *parent) + Utils::reloadPrompt(const QString &title, const QString &prompt, const QString &details, QWidget *parent) { - switch (QMessageBox::question(parent, title, prompt, - QMessageBox::Yes|QMessageBox::YesToAll|QMessageBox::No|QMessageBox::NoToAll, - QMessageBox::YesToAll)) { + QMessageBox msg(parent); + msg.setStandardButtons(QMessageBox::Yes|QMessageBox::YesToAll|QMessageBox::No|QMessageBox::NoToAll); + msg.setDefaultButton(QMessageBox::YesToAll); + msg.setWindowTitle(title); + msg.setText(prompt); + msg.setDetailedText(details); + + switch (msg.exec()) { case QMessageBox::Yes: return ReloadCurrent; case QMessageBox::YesToAll: diff --git a/src/libs/utils/reloadpromptutils.h b/src/libs/utils/reloadpromptutils.h index 8f0d3ad258cfac549ad31857664527a28472d360..5b379cb57fd8ecca62e820d837f7bc2c7e1f32a1 100644 --- a/src/libs/utils/reloadpromptutils.h +++ b/src/libs/utils/reloadpromptutils.h @@ -42,7 +42,7 @@ namespace Utils { enum ReloadPromptAnswer { ReloadCurrent, ReloadAll, ReloadSkipCurrent, ReloadNone }; QTCREATOR_UTILS_EXPORT ReloadPromptAnswer reloadPrompt(const QString &fileName, bool modified, QWidget *parent); -QTCREATOR_UTILS_EXPORT ReloadPromptAnswer reloadPrompt(const QString &title, const QString &prompt, QWidget *parent); +QTCREATOR_UTILS_EXPORT ReloadPromptAnswer reloadPrompt(const QString &title, const QString &prompt, const QString &details, QWidget *parent); enum FileDeletedPromptAnswer { FileDeletedClose, FileDeletedSaveAs, FileDeletedSave };