forked from qt-creator/qt-creator
Toolchain: Add option to make toolchain readonly
Do not just disable the toolchain when it is read-only. Add a method to make it read-only instead. Task-number: QTCREATORBUG-4211
This commit is contained in:
@@ -626,6 +626,13 @@ bool Internal::GccToolChainConfigWidget::isDirty() const
|
|||||||
|| m_abiList.at(m_abiComboBox->currentIndex()) != tc->targetAbi();
|
|| m_abiList.at(m_abiComboBox->currentIndex()) != tc->targetAbi();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Internal::GccToolChainConfigWidget::makeReadOnly()
|
||||||
|
{
|
||||||
|
m_compilerPath->setEnabled(false);
|
||||||
|
m_abiComboBox->setEnabled(false);
|
||||||
|
ToolChainConfigWidget::makeReadOnly();
|
||||||
|
}
|
||||||
|
|
||||||
void Internal::GccToolChainConfigWidget::handlePathChange()
|
void Internal::GccToolChainConfigWidget::handlePathChange()
|
||||||
{
|
{
|
||||||
QString path = m_compilerPath->path();
|
QString path = m_compilerPath->path();
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ public:
|
|||||||
void apply();
|
void apply();
|
||||||
void discard() { setFromToolchain(); }
|
void discard() { setFromToolchain(); }
|
||||||
bool isDirty() const;
|
bool isDirty() const;
|
||||||
|
void makeReadOnly();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handlePathChange();
|
void handlePathChange();
|
||||||
|
|||||||
@@ -83,6 +83,12 @@ ToolChain *ToolChainConfigWidget::toolChain() const
|
|||||||
return m_d->m_toolChain;
|
return m_d->m_toolChain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ToolChainConfigWidget::makeReadOnly()
|
||||||
|
{
|
||||||
|
if (m_d->m_debuggerPathChooser)
|
||||||
|
m_d->m_debuggerPathChooser->setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
void ToolChainConfigWidget::emitDirty()
|
void ToolChainConfigWidget::emitDirty()
|
||||||
{
|
{
|
||||||
emit dirty(toolChain());
|
emit dirty(toolChain());
|
||||||
|
|||||||
@@ -68,6 +68,8 @@ public:
|
|||||||
|
|
||||||
virtual bool isDirty() const = 0;
|
virtual bool isDirty() const = 0;
|
||||||
|
|
||||||
|
virtual void makeReadOnly();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void dirty(ProjectExplorer::ToolChain *);
|
void dirty(ProjectExplorer::ToolChain *);
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,8 @@ public:
|
|||||||
p->childNodes.append(this);
|
p->childNodes.append(this);
|
||||||
widget = tc ? tc->configurationWidget() : 0;
|
widget = tc ? tc->configurationWidget() : 0;
|
||||||
if (widget) {
|
if (widget) {
|
||||||
widget->setEnabled(tc ? !tc->isAutoDetected() : false);
|
if (tc && tc->isAutoDetected())
|
||||||
|
widget->makeReadOnly();
|
||||||
widget->setVisible(false);
|
widget->setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -421,6 +421,14 @@ bool RvctToolChainConfigWidget::isDirty() const
|
|||||||
|| tc->debuggerCommand() != debuggerCommand();
|
|| tc->debuggerCommand() != debuggerCommand();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RvctToolChainConfigWidget::makeReadOnly()
|
||||||
|
{
|
||||||
|
m_ui->versionComboBox->setEnabled(false);
|
||||||
|
m_ui->compilerPath->setEnabled(false);
|
||||||
|
m_ui->environmentView->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||||
|
ProjectExplorer::ToolChainConfigWidget::makeReadOnly();
|
||||||
|
}
|
||||||
|
|
||||||
QList<Utils::EnvironmentItem> RvctToolChainConfigWidget::environmentChanges() const
|
QList<Utils::EnvironmentItem> RvctToolChainConfigWidget::environmentChanges() const
|
||||||
{
|
{
|
||||||
Utils::Environment baseEnv;
|
Utils::Environment baseEnv;
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ public:
|
|||||||
void apply();
|
void apply();
|
||||||
void discard() { setFromToolChain(); }
|
void discard() { setFromToolChain(); }
|
||||||
bool isDirty() const;
|
bool isDirty() const;
|
||||||
|
void makeReadOnly();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setFromToolChain();
|
void setFromToolChain();
|
||||||
|
|||||||
Reference in New Issue
Block a user