forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user