CodeStyle: Remove edit pop-up

Removed the Edit pop-up on the CodeStyle page.
Now editing is available immediately after opening
CodeStyle tab.
I left a preview on the project CodeStyle page and
added a link to global settings.

ToDo:
In project CodeStyle page replace preview with CodeStyleEditor.
I'm not 100% sure that it is needed. If you have some thoughts
please write a comment.

Change-Id: I31032a97b9668b4f6b06fc6c5c704700fb44ee4f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Artem Sokolovskii
2022-08-01 17:28:42 +02:00
parent 4f0ac5678f
commit 74ac09346f
12 changed files with 113 additions and 179 deletions

View File

@@ -259,7 +259,7 @@ void CppCodeStylePreferencesWidget::setCodeStyleSettings(const CppCodeStyleSetti
void CppCodeStylePreferencesWidget::slotCurrentPreferencesChanged(ICodeStylePreferences *preferences, bool preview)
{
const bool enable = !preferences->isReadOnly() && !m_preferences->currentDelegate();
const bool enable = !preferences->isReadOnly();
m_ui->tabSettingsWidget->setEnabled(enable);
m_ui->contentGroupBox->setEnabled(enable);
m_ui->bracesGroupBox->setEnabled(enable);
@@ -369,6 +369,9 @@ void CppCodeStylePreferencesWidget::addTab(CppCodeStyleWidget *page, QString tab
connect(this, &CppCodeStylePreferencesWidget::applyEmitted,
page, &CppCodeStyleWidget::apply);
connect(this, &CppCodeStylePreferencesWidget::finishEmitted,
page, &CppCodeStyleWidget::finish);
page->synchronize();
}
@@ -377,6 +380,11 @@ void CppCodeStylePreferencesWidget::apply()
emit applyEmitted();
}
void CppCodeStylePreferencesWidget::finish()
{
emit finishEmitted();
}
// ------------------ CppCodeStyleSettingsPage
CppCodeStyleSettingsPage::CppCodeStyleSettingsPage()
@@ -431,6 +439,7 @@ void CppCodeStyleSettingsPage::apply()
void CppCodeStyleSettingsPage::finish()
{
m_widget->finish();
delete m_widget;
}