forked from qt-creator/qt-creator
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:
@@ -106,6 +106,11 @@ DebuggingHelperBuildTask::DebuggingHelperBuildTask(const BaseQtVersion *version,
|
|||||||
m_qmakeCommand = version->qmakeCommand();
|
m_qmakeCommand = version->qmakeCommand();
|
||||||
m_makeCommand = tc->makeCommand();
|
m_makeCommand = tc->makeCommand();
|
||||||
m_mkspec = version->mkspec();
|
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()
|
DebuggingHelperBuildTask::~DebuggingHelperBuildTask()
|
||||||
|
|||||||
@@ -451,6 +451,8 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step)
|
|||||||
this, SLOT(qtVersionChanged()));
|
this, SLOT(qtVersionChanged()));
|
||||||
connect(step->qt4BuildConfiguration(), SIGNAL(qmakeBuildConfigurationChanged()),
|
connect(step->qt4BuildConfiguration(), SIGNAL(qmakeBuildConfigurationChanged()),
|
||||||
this, SLOT(qmakeBuildConfigChanged()));
|
this, SLOT(qmakeBuildConfigChanged()));
|
||||||
|
connect(QtVersionManager::instance(), SIGNAL(qtVersionsUpdated(QString)),
|
||||||
|
this, SLOT(qtVersionsUpdated(QString)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void QMakeStepConfigWidget::init()
|
void QMakeStepConfigWidget::init()
|
||||||
@@ -482,6 +484,12 @@ void QMakeStepConfigWidget::qtVersionChanged()
|
|||||||
updateQmlDebuggingOption();
|
updateQmlDebuggingOption();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QMakeStepConfigWidget::qtVersionsUpdated(const QString &qmakeCommand)
|
||||||
|
{
|
||||||
|
if (m_step->qt4BuildConfiguration()->qtVersion()->qmakeCommand() == qmakeCommand)
|
||||||
|
qtVersionChanged();
|
||||||
|
}
|
||||||
|
|
||||||
void QMakeStepConfigWidget::qmakeBuildConfigChanged()
|
void QMakeStepConfigWidget::qmakeBuildConfigChanged()
|
||||||
{
|
{
|
||||||
Qt4BuildConfiguration *bc = m_step->qt4BuildConfiguration();
|
Qt4BuildConfiguration *bc = m_step->qt4BuildConfiguration();
|
||||||
@@ -510,7 +518,6 @@ void QMakeStepConfigWidget::linkQmlDebuggingLibraryChanged()
|
|||||||
{
|
{
|
||||||
if (m_ignoreChange)
|
if (m_ignoreChange)
|
||||||
return;
|
return;
|
||||||
m_ui.qmlDebuggingLibraryCheckBox->setEnabled(m_step->isQmlDebuggingLibrarySupported());
|
|
||||||
m_ui.qmlDebuggingLibraryCheckBox->setChecked(m_step->linkQmlDebuggingLibrary());
|
m_ui.qmlDebuggingLibraryCheckBox->setChecked(m_step->linkQmlDebuggingLibrary());
|
||||||
|
|
||||||
updateSummaryLabel();
|
updateSummaryLabel();
|
||||||
@@ -576,10 +583,6 @@ void QMakeStepConfigWidget::buildQmlDebuggingHelper()
|
|||||||
DebuggingHelperBuildTask *buildTask = new DebuggingHelperBuildTask(version,
|
DebuggingHelperBuildTask *buildTask = new DebuggingHelperBuildTask(version,
|
||||||
DebuggingHelperBuildTask::QmlDebugging);
|
DebuggingHelperBuildTask::QmlDebugging);
|
||||||
|
|
||||||
connect(buildTask, SIGNAL(finished(int,QString,DebuggingHelperBuildTask::Tools)),
|
|
||||||
this, SLOT(debuggingHelperBuildFinished(int,QString)),
|
|
||||||
Qt::QueuedConnection);
|
|
||||||
|
|
||||||
// pop up Application Output on error
|
// pop up Application Output on error
|
||||||
buildTask->showOutputOnError(true);
|
buildTask->showOutputOnError(true);
|
||||||
|
|
||||||
@@ -589,20 +592,6 @@ void QMakeStepConfigWidget::buildQmlDebuggingHelper()
|
|||||||
QLatin1String("Qt4ProjectManager::BuildHelpers"));
|
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()
|
void QMakeStepConfigWidget::updateSummaryLabel()
|
||||||
{
|
{
|
||||||
Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration();
|
Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration();
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ public:
|
|||||||
private slots:
|
private slots:
|
||||||
// slots for handling buildconfiguration/step signals
|
// slots for handling buildconfiguration/step signals
|
||||||
void qtVersionChanged();
|
void qtVersionChanged();
|
||||||
|
void qtVersionsUpdated(const QString &qmakeCommand);
|
||||||
void qmakeBuildConfigChanged();
|
void qmakeBuildConfigChanged();
|
||||||
void userArgumentsChanged();
|
void userArgumentsChanged();
|
||||||
void linkQmlDebuggingLibraryChanged();
|
void linkQmlDebuggingLibraryChanged();
|
||||||
@@ -148,7 +149,6 @@ private slots:
|
|||||||
|
|
||||||
// other
|
// other
|
||||||
void buildQmlDebuggingHelper();
|
void buildQmlDebuggingHelper();
|
||||||
void debuggingHelperBuildFinished(int qtVersionId, const QString &output);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateSummaryLabel();
|
void updateSummaryLabel();
|
||||||
|
|||||||
@@ -192,6 +192,9 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList<BaseQtVersion *>
|
|||||||
connect(m_ui->cleanUpButton, SIGNAL(clicked()), this, SLOT(cleanUpQtVersions()));
|
connect(m_ui->cleanUpButton, SIGNAL(clicked()), this, SLOT(cleanUpQtVersions()));
|
||||||
userChangedCurrentVersion();
|
userChangedCurrentVersion();
|
||||||
updateCleanUpButton();
|
updateCleanUpButton();
|
||||||
|
|
||||||
|
connect(QtVersionManager::instance(), SIGNAL(qtVersionsUpdated(QString)),
|
||||||
|
this, SLOT(qtVersionsUpdated(QString)));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QtOptionsPageWidget::eventFilter(QObject *o, QEvent *e)
|
bool QtOptionsPageWidget::eventFilter(QObject *o, QEvent *e)
|
||||||
@@ -270,6 +273,7 @@ void QtOptionsPageWidget::debuggingHelperBuildFinished(int qtVersionId, const QS
|
|||||||
if (index == currentIndex()) {
|
if (index == currentIndex()) {
|
||||||
updateDebuggingHelperUi();
|
updateDebuggingHelperUi();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
showDebuggingBuildLog(item);
|
showDebuggingBuildLog(item);
|
||||||
}
|
}
|
||||||
@@ -304,6 +308,19 @@ void QtOptionsPageWidget::cleanUpQtVersions()
|
|||||||
updateCleanUpButton();
|
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)
|
void QtOptionsPageWidget::buildDebuggingHelper(DebuggingHelperBuildTask::Tools tools)
|
||||||
{
|
{
|
||||||
const int index = currentIndex();
|
const int index = currentIndex();
|
||||||
|
|||||||
@@ -107,6 +107,8 @@ private slots:
|
|||||||
void slotShowDebuggingBuildLog();
|
void slotShowDebuggingBuildLog();
|
||||||
void debuggingHelperBuildFinished(int qtVersionId, const QString &output, DebuggingHelperBuildTask::Tools tools);
|
void debuggingHelperBuildFinished(int qtVersionId, const QString &output, DebuggingHelperBuildTask::Tools tools);
|
||||||
void cleanUpQtVersions();
|
void cleanUpQtVersions();
|
||||||
|
|
||||||
|
void qtVersionsUpdated(const QString &qmakeCommand);
|
||||||
};
|
};
|
||||||
|
|
||||||
class QtOptionsPage : public Core::IOptionsPage
|
class QtOptionsPage : public Core::IOptionsPage
|
||||||
|
|||||||
@@ -381,6 +381,7 @@ void QtVersionManager::updateQtVersion(int id)
|
|||||||
if (v->qmakeCommand() == qmakeCommand)
|
if (v->qmakeCommand() == qmakeCommand)
|
||||||
v->recheckDumper();
|
v->recheckDumper();
|
||||||
}
|
}
|
||||||
|
emit qtVersionsUpdated(qmakeCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtVersionManager::updateSettings()
|
void QtVersionManager::updateSettings()
|
||||||
|
|||||||
@@ -118,6 +118,8 @@ public:
|
|||||||
QString popPendingMwcUpdate();
|
QString popPendingMwcUpdate();
|
||||||
QString popPendingGcceUpdate();
|
QString popPendingGcceUpdate();
|
||||||
signals:
|
signals:
|
||||||
|
// qt version information cache has been invalidated
|
||||||
|
void qtVersionsUpdated(const QString &qmakeCommand);
|
||||||
void qtVersionsChanged(const QList<int> &uniqueIds);
|
void qtVersionsChanged(const QList<int> &uniqueIds);
|
||||||
void updateExamples(QString, QString, QString);
|
void updateExamples(QString, QString, QString);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user