Commit b0226e6e authored by Petar Perisin's avatar Petar Perisin

Open project if it was not added to VC system.

Currently project will be created, but if it fails to add it to VC
system, it asks user to open project anyway.

Task-number: QTCREATORBUG-8892
Change-Id: I8d6cfad4a5d6b4810491d355f916dfe031e82a52
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent a2df8cb0
......@@ -526,7 +526,8 @@ void BaseFileWizard::runWizard(const QString &path, QWidget *parent, const QStri
foreach (IFileWizardExtension *ex, extensions) {
bool remove;
if (!ex->processFiles(files, &remove, &errorMessage)) {
QMessageBox::critical(parent, tr("File Generation Failure"), errorMessage);
if (!errorMessage.isEmpty())
QMessageBox::critical(parent, tr("File Generation Failure"), errorMessage);
return;
}
removeOpenProjectAttribute |= remove;
......
......@@ -58,6 +58,7 @@
#include <QDir>
#include <QTextDocument>
#include <QTextCursor>
#include <QMessageBox>
/*!
\class ProjectExplorer::Internal::ProjectFileWizardExtension
......@@ -444,8 +445,21 @@ bool ProjectFileWizardExtension::processFiles(
const QList<Core::GeneratedFile> &files,
bool *removeOpenProjectAttribute, QString *errorMessage)
{
return processProject(files, removeOpenProjectAttribute, errorMessage) &&
processVersionControl(files, errorMessage);
if (!processProject(files, removeOpenProjectAttribute, errorMessage))
return false;
if (!processVersionControl(files, errorMessage)) {
QString message;
if (errorMessage) {
message = *errorMessage;
message.append(QLatin1String("\n\n"));
errorMessage->clear();
}
message.append(tr("Open project anyway?"));
if (QMessageBox::question(Core::ICore::mainWindow(), tr("Version Control Failure"), message,
QMessageBox::Yes, QMessageBox::No) == QMessageBox::No)
return false;
}
return true;
}
// Add files to project && version control
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment