forked from qt-creator/qt-creator
ClangFormat: Disable configuration UI instead of hiding
This is the first step without strings change. The next step is I201dbccb8b1f1738451f760af34cf588afb5f4d5. Change-Id: Ic0ce6a5ab3e74303a71a7c0bd8188d0284a241eb Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -125,11 +125,17 @@ void ClangFormatConfigWidget::initialize()
|
||||
if (lastItem->spacerItem())
|
||||
m_ui->verticalLayout->removeItem(lastItem);
|
||||
|
||||
m_ui->clangFormatOptionsTable->setEnabled(true);
|
||||
if (!m_ui->overrideDefault->isChecked()) {
|
||||
m_ui->clangFormatOptionsTable->hide();
|
||||
m_preview->hide();
|
||||
m_ui->verticalLayout->addStretch(1);
|
||||
return;
|
||||
if (m_project) {
|
||||
m_ui->clangFormatOptionsTable->hide();
|
||||
m_preview->hide();
|
||||
m_ui->verticalLayout->addStretch(1);
|
||||
return;
|
||||
} else {
|
||||
// Show the fallback configuration only globally.
|
||||
m_ui->clangFormatOptionsTable->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
m_ui->clangFormatOptionsTable->show();
|
||||
@@ -190,7 +196,7 @@ void ClangFormatConfigWidget::apply()
|
||||
}
|
||||
settings.write();
|
||||
|
||||
if (!m_ui->overrideDefault->isChecked())
|
||||
if (!m_ui->clangFormatOptionsTable->isVisible())
|
||||
return;
|
||||
|
||||
const QString text = m_ui->clangFormatOptionsTable->toPlainText();
|
||||
|
||||
Reference in New Issue
Block a user