Commit 99911c5f authored by Kai Koehne's avatar Kai Koehne

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
parent 6b25d6fb
......@@ -106,6 +106,11 @@ DebuggingHelperBuildTask::DebuggingHelperBuildTask(const BaseQtVersion *version,
m_qmakeCommand = version->qmakeCommand();
m_makeCommand = tc->makeCommand();
m_mkspec = version->mkspec();
// Make sure QtVersion cache is invalidated
connect(this, SIGNAL(finished(int,QString,DebuggingHelperBuildTask::Tools)),
QtVersionManager::instance(), SLOT(updateQtVersion(int)),
Qt::QueuedConnection);
}
DebuggingHelperBuildTask::~DebuggingHelperBuildTask()
......
......@@ -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();
......
......@@ -137,6 +137,7 @@ public:
private slots:
// slots for handling buildconfiguration/step signals
void qtVersionChanged();
void qtVersionsUpdated(const QString &qmakeCommand);
void qmakeBuildConfigChanged();
void userArgumentsChanged();
void linkQmlDebuggingLibraryChanged();
......@@ -148,7 +149,6 @@ private slots:
// other
void buildQmlDebuggingHelper();
void debuggingHelperBuildFinished(int qtVersionId, const QString &output);
private:
void updateSummaryLabel();
......
......@@ -192,6 +192,9 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList<BaseQtVersion *>
connect(m_ui->cleanUpButton, SIGNAL(clicked()), this, SLOT(cleanUpQtVersions()));
userChangedCurrentVersion();
updateCleanUpButton();
connect(QtVersionManager::instance(), SIGNAL(qtVersionsUpdated(QString)),
this, SLOT(qtVersionsUpdated(QString)));
}
bool QtOptionsPageWidget::eventFilter(QObject *o, QEvent *e)
......@@ -270,6 +273,7 @@ void QtOptionsPageWidget::debuggingHelperBuildFinished(int qtVersionId, const QS
if (index == currentIndex()) {
updateDebuggingHelperUi();
}
if (!success)
showDebuggingBuildLog(item);
}
......@@ -304,6 +308,19 @@ void QtOptionsPageWidget::cleanUpQtVersions()
updateCleanUpButton();
}
void QtOptionsPageWidget::qtVersionsUpdated(const QString &qmakeCommand)
{
foreach (BaseQtVersion *version, m_versions) {
if (version->qmakeCommand() == qmakeCommand)
version->recheckDumper();
}
if (currentVersion()->qmakeCommand() == qmakeCommand) {
updateWidgets();
updateDescriptionLabel();
updateDebuggingHelperUi();
}
}
void QtOptionsPageWidget::buildDebuggingHelper(DebuggingHelperBuildTask::Tools tools)
{
const int index = currentIndex();
......
......@@ -107,6 +107,8 @@ private slots:
void slotShowDebuggingBuildLog();
void debuggingHelperBuildFinished(int qtVersionId, const QString &output, DebuggingHelperBuildTask::Tools tools);
void cleanUpQtVersions();
void qtVersionsUpdated(const QString &qmakeCommand);
};
class QtOptionsPage : public Core::IOptionsPage
......
......@@ -381,6 +381,7 @@ void QtVersionManager::updateQtVersion(int id)
if (v->qmakeCommand() == qmakeCommand)
v->recheckDumper();
}
emit qtVersionsUpdated(qmakeCommand);
}
void QtVersionManager::updateSettings()
......
......@@ -118,6 +118,8 @@ public:
QString popPendingMwcUpdate();
QString popPendingGcceUpdate();
signals:
// qt version information cache has been invalidated
void qtVersionsUpdated(const QString &qmakeCommand);
void qtVersionsChanged(const QList<int> &uniqueIds);
void updateExamples(QString, QString, QString);
......
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