Commit 2d8acad3 authored by Kai Koehne's avatar Kai Koehne

QMakeStep: Move recompilation dialog to QMakeStepConfigWidget

Change-Id: I20576fa99d9a1d04c24f9615317663e943619200
Reviewed-on: http://codereview.qt-project.org/4089Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent 06723f8d
......@@ -419,15 +419,6 @@ void QMakeStep::setLinkQmlDebuggingLibrary(bool enable)
qt4BuildConfiguration()->emitQMakeBuildConfigurationChanged();
qt4BuildConfiguration()->emitProFileEvaluateNeeded();
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()
......@@ -495,20 +486,6 @@ 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
////
......@@ -651,6 +628,16 @@ void QMakeStepConfigWidget::linkQmlDebuggingLibraryChecked(bool checked)
updateSummaryLabel();
updateEffectiveQMakeCall();
updateQmlDebuggingOption();
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();
}
void QMakeStepConfigWidget::buildQmlDebuggingHelper()
......@@ -722,6 +709,20 @@ void QMakeStepConfigWidget::updateEffectiveQMakeCall()
m_ui->qmakeArgumentsEdit->setPlainText(program + QLatin1Char(' ') + m_step->allArguments());
}
void QMakeStepConfigWidget::recompileMessageBoxFinished(int button)
{
if (button == QMessageBox::Yes) {
Qt4BuildConfiguration *bc = m_step->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);
}
}
////
// QMakeStepFactory
////
......
......@@ -114,9 +114,6 @@ 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);
......@@ -163,6 +160,9 @@ private slots:
// other
void buildQmlDebuggingHelper();
private slots:
void recompileMessageBoxFinished(int button);
private:
void updateSummaryLabel();
void updateQmlDebuggingOption();
......
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