DebuggingHelper: Keep state of different UI's for same version in sync

QtVersionManager got a signal 'qtVersionsUpdated(QString)', which the UI's in
QMakeStep & in the Qt Options react to.

Change-Id: Ib774332daf6cf008afb46914ebd839420cf23e25
This commit is contained in:
Kai Koehne
2011-05-09 17:32:24 +02:00
parent 6b25d6fbe1
commit 99911c5f3d
7 changed files with 36 additions and 20 deletions

View File

@@ -451,6 +451,8 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step)
this, SLOT(qtVersionChanged()));
connect(step->qt4BuildConfiguration(), SIGNAL(qmakeBuildConfigurationChanged()),
this, SLOT(qmakeBuildConfigChanged()));
connect(QtVersionManager::instance(), SIGNAL(qtVersionsUpdated(QString)),
this, SLOT(qtVersionsUpdated(QString)));
}
void QMakeStepConfigWidget::init()
@@ -482,6 +484,12 @@ void QMakeStepConfigWidget::qtVersionChanged()
updateQmlDebuggingOption();
}
void QMakeStepConfigWidget::qtVersionsUpdated(const QString &qmakeCommand)
{
if (m_step->qt4BuildConfiguration()->qtVersion()->qmakeCommand() == qmakeCommand)
qtVersionChanged();
}
void QMakeStepConfigWidget::qmakeBuildConfigChanged()
{
Qt4BuildConfiguration *bc = m_step->qt4BuildConfiguration();
@@ -510,7 +518,6 @@ void QMakeStepConfigWidget::linkQmlDebuggingLibraryChanged()
{
if (m_ignoreChange)
return;
m_ui.qmlDebuggingLibraryCheckBox->setEnabled(m_step->isQmlDebuggingLibrarySupported());
m_ui.qmlDebuggingLibraryCheckBox->setChecked(m_step->linkQmlDebuggingLibrary());
updateSummaryLabel();
@@ -576,10 +583,6 @@ void QMakeStepConfigWidget::buildQmlDebuggingHelper()
DebuggingHelperBuildTask *buildTask = new DebuggingHelperBuildTask(version,
DebuggingHelperBuildTask::QmlDebugging);
connect(buildTask, SIGNAL(finished(int,QString,DebuggingHelperBuildTask::Tools)),
this, SLOT(debuggingHelperBuildFinished(int,QString)),
Qt::QueuedConnection);
// pop up Application Output on error
buildTask->showOutputOnError(true);
@@ -589,20 +592,6 @@ void QMakeStepConfigWidget::buildQmlDebuggingHelper()
QLatin1String("Qt4ProjectManager::BuildHelpers"));
}
void QMakeStepConfigWidget::debuggingHelperBuildFinished(int qtVersionId, const QString &output)
{
BaseQtVersion *version = QtVersionManager::instance()->version(qtVersionId);
if (!version) // qt version got deleted in between
return;
if (version == m_step->qt4BuildConfiguration()->qtVersion()) {
m_ui.qmlDebuggingLibraryCheckBox->setChecked(m_step->linkQmlDebuggingLibrary());
updateSummaryLabel();
updateEffectiveQMakeCall();
updateQmlDebuggingOption();
}
}
void QMakeStepConfigWidget::updateSummaryLabel()
{
Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration();