From 9fa3ba5c4490374d1e8de261dacbf8a754f6d3b6 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Thu, 28 Jun 2012 18:00:17 +0200 Subject: [PATCH] Show a message box if opening a project fails via File/Open Task-number: QTCREATORBUG-7447 Change-Id: I421d93ccd9e12de854bd5a0ab35158b450863fec Reviewed-by: Daniel Teske --- src/plugins/projectexplorer/pluginfilefactory.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/pluginfilefactory.cpp b/src/plugins/projectexplorer/pluginfilefactory.cpp index ed72de44a8b..c1555dfe03c 100644 --- a/src/plugins/projectexplorer/pluginfilefactory.cpp +++ b/src/plugins/projectexplorer/pluginfilefactory.cpp @@ -44,6 +44,8 @@ #include #include +#include +#include using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; @@ -78,7 +80,10 @@ QString ProjectFileFactory::displayName() const Core::IDocument *ProjectFileFactory::open(const QString &fileName) { ProjectExplorerPlugin *pe = ProjectExplorerPlugin::instance(); - pe->openProject(fileName, 0); + QString errorMessage; + pe->openProject(fileName, &errorMessage); + if (!errorMessage.isEmpty()) + QMessageBox::critical(Core::ICore::mainWindow(), tr("Failed to open project"), errorMessage); return 0; }