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();
|
||||
}
|
||||
|
||||
void Internal::GccToolChainConfigWidget::makeReadOnly()
|
||||
{
|
||||
m_compilerPath->setEnabled(false);
|
||||
m_abiComboBox->setEnabled(false);
|
||||
ToolChainConfigWidget::makeReadOnly();
|
||||
}
|
||||
|
||||
void Internal::GccToolChainConfigWidget::handlePathChange()
|
||||
{
|
||||
QString path = m_compilerPath->path();
|
||||
|
||||
@@ -91,6 +91,7 @@ public:
|
||||
void apply();
|
||||
void discard() { setFromToolchain(); }
|
||||
bool isDirty() const;
|
||||
void makeReadOnly();
|
||||
|
||||
private slots:
|
||||
void handlePathChange();
|
||||
|
||||
@@ -83,6 +83,12 @@ ToolChain *ToolChainConfigWidget::toolChain() const
|
||||
return m_d->m_toolChain;
|
||||
}
|
||||
|
||||
void ToolChainConfigWidget::makeReadOnly()
|
||||
{
|
||||
if (m_d->m_debuggerPathChooser)
|
||||
m_d->m_debuggerPathChooser->setEnabled(false);
|
||||
}
|
||||
|
||||
void ToolChainConfigWidget::emitDirty()
|
||||
{
|
||||
emit dirty(toolChain());
|
||||
|
||||
@@ -68,6 +68,8 @@ public:
|
||||
|
||||
virtual bool isDirty() const = 0;
|
||||
|
||||
virtual void makeReadOnly();
|
||||
|
||||
signals:
|
||||
void dirty(ProjectExplorer::ToolChain *);
|
||||
|
||||
|
||||
@@ -63,7 +63,8 @@ public:
|
||||
p->childNodes.append(this);
|
||||
widget = tc ? tc->configurationWidget() : 0;
|
||||
if (widget) {
|
||||
widget->setEnabled(tc ? !tc->isAutoDetected() : false);
|
||||
if (tc && tc->isAutoDetected())
|
||||
widget->makeReadOnly();
|
||||
widget->setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -421,6 +421,14 @@ bool RvctToolChainConfigWidget::isDirty() const
|
||||
|| 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
|
||||
{
|
||||
Utils::Environment baseEnv;
|
||||
|
||||
@@ -147,6 +147,7 @@ public:
|
||||
void apply();
|
||||
void discard() { setFromToolChain(); }
|
||||
bool isDirty() const;
|
||||
void makeReadOnly();
|
||||
|
||||
private:
|
||||
void setFromToolChain();
|
||||
|
||||
Reference in New Issue
Block a user