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: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Petar Perisin
2013-03-17 16:09:01 +01:00
parent a2df8cb0b7
commit b0226e6e96
2 changed files with 18 additions and 3 deletions

View File

@@ -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;

View File

@@ -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