Commit 45e514ca authored by dt's avatar dt
Browse files

Check/Unchecking useJom should update various makestep config widgets.

parent bc913462
......@@ -175,6 +175,8 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
}
connect(m_targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
connect(ProjectExplorer::ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()),
this, SLOT(updateDetails()));
}
void MakeStepConfigWidget::additionalArgumentsEdited()
......
......@@ -82,8 +82,8 @@ public:
private slots:
void itemChanged(QListWidgetItem*);
void additionalArgumentsEdited();
private:
void updateDetails();
private:
QString m_buildConfiguration;
MakeStep *m_makeStep;
QListWidget *m_targetsList;
......
......@@ -169,6 +169,11 @@ GenericMakeStepConfigWidget::GenericMakeStepConfigWidget(GenericMakeStep *makeSt
this, SLOT(makeLineEditTextEdited()));
connect(m_ui->makeArgumentsLineEdit, SIGNAL(textEdited(QString)),
this, SLOT(makeArgumentsLineEditTextEdited()));
connect(ProjectExplorer::ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()),
this, SLOT(updateMakeOverrrideLabel()));
connect(ProjectExplorer::ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()),
this, SLOT(updateDetails()));
}
QString GenericMakeStepConfigWidget::displayName() const
......@@ -176,12 +181,17 @@ QString GenericMakeStepConfigWidget::displayName() const
return "Make";
}
// TODO: Label should update when tool chain is changed
void GenericMakeStepConfigWidget::updateMakeOverrrideLabel()
{
m_ui->makeLabel->setText(tr("Override %1:").arg(m_makeStep->makeCommand(m_buildConfiguration)));
}
void GenericMakeStepConfigWidget::init(const QString &buildConfiguration)
{
m_buildConfiguration = buildConfiguration;
// TODO: Label should update when tool chain is changed
m_ui->makeLabel->setText(tr("Override %1:").arg(m_makeStep->makeCommand(buildConfiguration)));
updateMakeOverrrideLabel();
QString makeCommand = m_makeStep->value(buildConfiguration, "makeCommand").toString();
m_ui->makeLineEdit->setText(makeCommand);
......
......@@ -80,6 +80,7 @@ private slots:
void itemChanged(QListWidgetItem*);
void makeLineEditTextEdited();
void makeArgumentsLineEditTextEdited();
void updateMakeOverrrideLabel();
private:
void updateDetails();
QString m_buildConfiguration;
......
......@@ -1989,7 +1989,10 @@ void ProjectExplorerPlugin::setSession(QAction *action)
void ProjectExplorerPlugin::setProjectExplorerSettings(const Internal::ProjectExplorerSettings &pes)
{
if (m_projectExplorerSettings == pes)
return;
m_projectExplorerSettings = pes;
emit settingsChanged();
}
Internal::ProjectExplorerSettings ProjectExplorerPlugin::projectExplorerSettings() const
......
......@@ -81,6 +81,12 @@ struct ProjectExplorerSettings
bool saveBeforeBuild;
bool showCompilerOutput;
bool useJom;
bool operator==(const ProjectExplorerSettings &other) {
return this->buildBeforeRun == other.buildBeforeRun
&& this->saveBeforeBuild == other.saveBeforeBuild
&& this->showCompilerOutput == other.showCompilerOutput
&& this->useJom == other.useJom;
}
};
} // namespace Internal
......@@ -136,6 +142,8 @@ signals:
void currentNodeChanged(ProjectExplorer::Node *node, ProjectExplorer::Project *project);
void aboutToExecuteProject(ProjectExplorer::Project *project);
void settingsChanged();
private slots:
void buildStateChanged(ProjectExplorer::Project * pro);
void buildQueueFinished(bool success);
......
......@@ -174,9 +174,18 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
connect(makeStep, SIGNAL(changed()),
this, SLOT(update()));
connect(ProjectExplorer::ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()),
this, SLOT(updateMakeOverrideLabel()));
connect(ProjectExplorer::ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()),
this, SLOT(updateSummary()));
}
void MakeStepConfigWidget::updateTitle()
void MakeStepConfigWidget::updateMakeOverrideLabel()
{
m_ui.makeLabel->setText(tr("Override %1:").arg(static_cast<Qt4Project *>(m_makeStep->project())->makeCommand(m_buildConfiguration)));
}
void MakeStepConfigWidget::updateSummary()
{
// TODO reduce heavy code duplication
QString workingDirectory;
......@@ -244,7 +253,7 @@ void MakeStepConfigWidget::init(const QString &buildConfiguration)
m_makeStep->setValue(buildConfiguration, "makeargs", QStringList() << "clean");
}
m_ui.makeLabel->setText(tr("Override %1:").arg(pro->makeCommand(buildConfiguration)));
updateMakeOverrideLabel();
const QString &makeCmd = m_makeStep->value(buildConfiguration, "makeCmd").toString();
m_ui.makeLineEdit->setText(makeCmd);
......@@ -252,14 +261,14 @@ void MakeStepConfigWidget::init(const QString &buildConfiguration)
const QStringList &makeArguments =
m_makeStep->value(buildConfiguration, "makeargs").toStringList();
m_ui.makeArgumentsLineEdit->setText(ProjectExplorer::Environment::joinArgumentList(makeArguments));
updateTitle();
updateSummary();
}
void MakeStepConfigWidget::makeLineEditTextEdited()
{
Q_ASSERT(!m_buildConfiguration.isNull());
m_makeStep->setValue(m_buildConfiguration, "makeCmd", m_ui.makeLineEdit->text());
updateTitle();
updateSummary();
}
void MakeStepConfigWidget::makeArgumentsLineEditTextEdited()
......@@ -267,7 +276,7 @@ void MakeStepConfigWidget::makeArgumentsLineEditTextEdited()
Q_ASSERT(!m_buildConfiguration.isNull());
m_makeStep->setValue(m_buildConfiguration, "makeargs",
ProjectExplorer::Environment::parseCombinedArgString(m_ui.makeArgumentsLineEdit->text()));
updateTitle();
updateSummary();
}
///
......
......@@ -91,8 +91,9 @@ private slots:
void makeLineEditTextEdited();
void makeArgumentsLineEditTextEdited();
void update();
void updateMakeOverrideLabel();
void updateSummary();
private:
void updateTitle();
QString m_buildConfiguration;
Ui::MakeStep m_ui;
MakeStep *m_makeStep;
......
......@@ -178,7 +178,6 @@ bool QMakeStep::immutable() const
return false;
}
void QMakeStep::processStartupFailed()
{
m_forced = true;
......
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