Remove auto-format-on-file-save dependency from custom formatter widgets

We can use custom formatter not only with auto-formatting on file save,
but also tools/qmljs/reformat file action. Hence, command and arguments
lineedits of custom formatter should only be enabled/disabled by
useCustomFormatter checkbox. useCustomFormatter also should not depend
on auto-format-on-file-save checkbox's state.

Change-Id: If1a634612f38395fd846166f4cc72593f5150f91
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Xavier BESSON <developer@xavi-b.fr>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Semih Yavuz
2023-03-19 21:48:27 +01:00
parent 83d40683d9
commit 8bf24bac3a

View File

@@ -287,8 +287,7 @@ public:
Utils::globalMacroExpander());
const auto updateFormatCommandState = [&, formatCommandLabel, formatCommandOptionsLabel] {
const bool enabled = useCustomFormatCommand->isChecked()
&& autoFormatOnSave->isChecked();
const bool enabled = useCustomFormatCommand->isChecked();
formatCommandLabel->setEnabled(enabled);
formatCommand->setEnabled(enabled);
formatCommandOptionsLabel->setEnabled(enabled);
@@ -298,7 +297,6 @@ public:
connect(autoFormatOnSave, &QCheckBox::toggled, this, [&, updateFormatCommandState]() {
autoFormatOnlyCurrentProject->setEnabled(autoFormatOnSave->isChecked());
useCustomFormatCommand->setEnabled(autoFormatOnSave->isChecked());
updateFormatCommandState();
});
connect(useCustomFormatCommand, &QCheckBox::toggled, this, updateFormatCommandState);