Show a message box if opening a project fails via File/Open

Task-number: QTCREATORBUG-7447

Change-Id: I421d93ccd9e12de854bd5a0ab35158b450863fec
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
Daniel Teske
2012-06-28 18:00:17 +02:00
parent 62a22e0aa3
commit 9fa3ba5c44

View File

@@ -44,6 +44,8 @@
#include <coreplugin/messagemanager.h>
#include <QDebug>
#include <QMessageBox>
#include <QMainWindow>
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;
}