Commit 3565fe4e authored by dt's avatar dt
Browse files

Fix always to end of line jumping cursor in MakeStepConfigWidget

Also rename some methods/signal to make clearer that those only are
relevevant for user changes not for all arguments.
parent 2de390cf
......@@ -54,7 +54,7 @@ MakeStep::MakeStep(ProjectExplorer::BuildConfiguration *bc)
MakeStep::MakeStep(MakeStep *bs, ProjectExplorer::BuildConfiguration *bc)
: AbstractMakeStep(bs, bc),
m_clean(bs->m_clean),
m_makeargs(bs->m_makeargs),
m_userArgs(bs->m_userArgs),
m_makeCmd(bs->m_makeCmd)
{
......@@ -84,7 +84,7 @@ void MakeStep::restoreFromGlobalMap(const QMap<QString, QVariant> &map)
void MakeStep::restoreFromLocalMap(const QMap<QString, QVariant> &map)
{
m_makeargs = map.value("makeargs").toStringList();
m_userArgs = map.value("makeargs").toStringList();
m_makeCmd = map.value("makeCmd").toString();
if (map.value("clean").isValid() && map.value("clean").toBool())
m_clean = true;
......@@ -93,7 +93,7 @@ void MakeStep::restoreFromLocalMap(const QMap<QString, QVariant> &map)
void MakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
{
map["makeargs"] = m_makeargs;
map["makeargs"] = m_userArgs;
map["makeCmd"] = m_makeCmd;
if (m_clean)
map["clean"] = true;
......@@ -128,7 +128,7 @@ bool MakeStep::init()
// we should stop the clean queue
// That is mostly so that rebuild works on a alrady clean project
setIgnoreReturnValue(m_clean);
QStringList args = m_makeargs;
QStringList args = m_userArgs;
if (!m_clean) {
if (!bc->defaultMakeTarget().isEmpty())
args << bc->defaultMakeTarget();
......@@ -196,19 +196,19 @@ ProjectExplorer::BuildStepConfigWidget *MakeStep::createConfigWidget()
return new MakeStepConfigWidget(this);
}
QStringList MakeStep::makeArguments()
QStringList MakeStep::userArguments()
{
return m_makeargs;
return m_userArgs;
}
void MakeStep::setMakeArguments(const QStringList &arguments)
void MakeStep::setUserArguments(const QStringList &arguments)
{
m_makeargs = arguments;
emit changed();
m_userArgs = arguments;
emit userArgumentsChanged();
}
MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
: BuildStepConfigWidget(), m_makeStep(makeStep)
: BuildStepConfigWidget(), m_makeStep(makeStep), m_ignoreChange(false)
{
m_ui.setupUi(this);
connect(m_ui.makeLineEdit, SIGNAL(textEdited(QString)),
......@@ -216,8 +216,8 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
connect(m_ui.makeArgumentsLineEdit, SIGNAL(textEdited(QString)),
this, SLOT(makeArgumentsLineEditTextEdited()));
connect(makeStep, SIGNAL(changed()),
this, SLOT(update()));
connect(makeStep, SIGNAL(userArgumentsChanged()),
this, SLOT(userArgumentsChanged()));
connect(makeStep->buildConfiguration(), SIGNAL(buildDirectoryChanged()),
this, SLOT(updateDetails()));
......@@ -257,7 +257,7 @@ void MakeStepConfigWidget::updateDetails()
// FIXME doing this without the user having a way to override this is rather bad
// so we only do it for unix and if the user didn't override the make command
// but for now this is the least invasive change
QStringList args = m_makeStep->makeArguments();
QStringList args = m_makeStep->userArguments();
ProjectExplorer::ToolChain::ToolChainType t = ProjectExplorer::ToolChain::UNKNOWN;
ProjectExplorer::ToolChain *toolChain = bc->toolChain();
if (toolChain)
......@@ -281,9 +281,11 @@ QString MakeStepConfigWidget::displayName() const
return m_makeStep->displayName();
}
void MakeStepConfigWidget::update()
void MakeStepConfigWidget::userArgumentsChanged()
{
init();
const QStringList &makeArguments = m_makeStep->userArguments();
m_ui.makeArgumentsLineEdit->setText(ProjectExplorer::Environment::joinArgumentList(makeArguments));
updateDetails();
}
void MakeStepConfigWidget::init()
......@@ -293,7 +295,7 @@ void MakeStepConfigWidget::init()
const QString &makeCmd = m_makeStep->m_makeCmd;
m_ui.makeLineEdit->setText(makeCmd);
const QStringList &makeArguments = m_makeStep->makeArguments();
const QStringList &makeArguments = m_makeStep->userArguments();
m_ui.makeArgumentsLineEdit->setText(ProjectExplorer::Environment::joinArgumentList(makeArguments));
updateDetails();
}
......@@ -306,8 +308,10 @@ void MakeStepConfigWidget::makeLineEditTextEdited()
void MakeStepConfigWidget::makeArgumentsLineEditTextEdited()
{
m_makeStep->setMakeArguments(
m_ignoreChange = true;
m_makeStep->setUserArguments(
ProjectExplorer::Environment::parseCombinedArgString(m_ui.makeArgumentsLineEdit->text()));
m_ignoreChange = false;
updateDetails();
}
......
......@@ -80,8 +80,8 @@ public:
virtual QString displayName();
virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
virtual bool immutable() const;
QStringList makeArguments();
void setMakeArguments(const QStringList &arguments);
QStringList userArguments();
void setUserArguments(const QStringList &arguments);
virtual void restoreFromGlobalMap(const QMap<QString, QVariant> &map);
......@@ -91,10 +91,10 @@ public:
virtual void storeIntoLocalMap(QMap<QString, QVariant> &map);
signals:
void changed();
void userArgumentsChanged();
private:
bool m_clean;
QStringList m_makeargs;
QStringList m_userArgs;
QString m_makeCmd;
};
......@@ -109,13 +109,14 @@ public:
private slots:
void makeLineEditTextEdited();
void makeArgumentsLineEditTextEdited();
void update();
void updateMakeOverrideLabel();
void updateDetails();
void userArgumentsChanged();
private:
Ui::MakeStep m_ui;
MakeStep *m_makeStep;
QString m_summaryText;
bool m_ignoreChange;
};
} // Qt4ProjectManager
......
......@@ -327,6 +327,8 @@ void QMakeStepConfigWidget::userArgumentsChanged()
return;
QString qmakeArgs = ProjectExplorer::Environment::joinArgumentList(m_step->userArguments());
m_ui.qmakeAdditonalArgumentsLineEdit->setText(qmakeArgs);
updateTitleLabel();
updateEffectiveQMakeCall();
}
void QMakeStepConfigWidget::init()
......
......@@ -480,7 +480,7 @@ Qt4BuildConfiguration *Qt4Project::addQt4BuildConfiguration(QString displayName,
// set some options for qmake and make
if (qmakeBuildConfiguration & QtVersion::BuildAll) // debug_and_release => explicit targets
makeStep->setMakeArguments(QStringList() << (debug ? "debug" : "release"));
makeStep->setUserArguments(QStringList() << (debug ? "debug" : "release"));
bc->setValue("buildConfiguration", int(qmakeBuildConfiguration));
......
......@@ -306,7 +306,7 @@ void Qt4ProjectConfigWidget::importLabelClicked()
// If we are switching to BuildAll we want "release" in there and no "debug"
// or "debug" in there and no "release"
// If we are switching to not BuildAl we want neither "release" nor "debug" in there
QStringList makeCmdArguments = makeStep->makeArguments();
QStringList makeCmdArguments = makeStep->userArguments();
bool debug = qmakeBuildConfig & QtVersion::DebugBuild;
if (qmakeBuildConfig & QtVersion::BuildAll) {
makeCmdArguments.removeAll(debug ? "release" : "debug");
......@@ -316,7 +316,7 @@ void Qt4ProjectConfigWidget::importLabelClicked()
makeCmdArguments.removeAll("debug");
makeCmdArguments.removeAll("release");
}
makeStep->setMakeArguments(makeCmdArguments);
makeStep->setUserArguments(makeCmdArguments);
}
}
setupQtVersionsComboBox();
......
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