Commit a2c612c1 authored by Kai Koehne's avatar Kai Koehne

QMakeStep: Allow UI to update when asking user whether to recompile

Makes sure that the warning about security implications are visible
before the user answers whether to recompile.

Task-number: QTCREATORBUG-5411
Change-Id: I43fe6aeb9e24d25be4fb51f356b6238ce0cd3924
Reviewed-on: http://codereview.qt.nokia.com/1832Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent bbe5405a
......@@ -49,6 +49,7 @@
#include <projectexplorer/toolchain.h>
#include <coreplugin/icore.h>
#include <coreplugin/mainwindow.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/messagemanager.h>
#include <qtsupport/qtversionmanager.h>
......@@ -417,18 +418,14 @@ void QMakeStep::setLinkQmlDebuggingLibrary(bool enable)
qt4BuildConfiguration()->emitQMakeBuildConfigurationChanged();
qt4BuildConfiguration()->emitProFileEvaluateNeeded();
int button = QMessageBox::question(QApplication::activeWindow(), tr("QML Debugging"),
tr("The option will only take effect if the project is recompiled. Do you want to recompile now?"),
QMessageBox::Yes, QMessageBox::No);
if (button == QMessageBox::Yes) {
Qt4BuildConfiguration *bc = qt4BuildConfiguration();
QList<ProjectExplorer::BuildStepList *> stepLists;
stepLists << bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN);
stepLists << bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
ProjectExplorerPlugin::instance()->buildManager()->buildLists(stepLists);
}
Core::ICore * const core = Core::ICore::instance();
QMessageBox *question = new QMessageBox(core->mainWindow());
question->setWindowTitle(tr("QML Debugging"));
question->setText(tr("The option will only take effect if the project is recompiled. Do you want to recompile now?"));
question->setStandardButtons(QMessageBox::Yes | QMessageBox::No);
question->setModal(true);
connect(question, SIGNAL(finished(int)), this, SLOT(recompileMessageBoxFinished(int)));
question->show();
}
QStringList QMakeStep::parserArguments()
......@@ -491,6 +488,20 @@ bool QMakeStep::fromMap(const QVariantMap &map)
return BuildStep::fromMap(map);
}
void QMakeStep::recompileMessageBoxFinished(int button)
{
if (button == QMessageBox::Yes) {
Qt4BuildConfiguration *bc = qt4BuildConfiguration();
if (!bc)
return;
QList<ProjectExplorer::BuildStepList *> stepLists;
stepLists << bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN);
stepLists << bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
ProjectExplorerPlugin::instance()->buildManager()->buildLists(stepLists);
}
}
////
// QMakeStepConfigWidget
////
......
......@@ -115,6 +115,9 @@ signals:
void userArgumentsChanged();
void linkQmlDebuggingLibraryChanged();
private slots:
void recompileMessageBoxFinished(int button);
protected:
QMakeStep(ProjectExplorer::BuildStepList *parent, QMakeStep *source);
QMakeStep(ProjectExplorer::BuildStepList *parent, const QString &id);
......
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