SettingsDialog: Call Aspect::cancel on cancel

Previously the SettingsDialog did not call Aspect::cancel().

Without this, the volatile value is not reset if the user did some
changes before pressing cancel.

This "should" mean that re-opening the settings dialog should present
the changed values again. But since not all aspects are implemented
correctly, they reinitialize from their value instead of their
volatileValue.

When the Settings Dialog is reopened and applied, a warning is triggered
as the container thinks its dirty, but the Aspect::apply returns false.

Change-Id: I8fac66fc95f9118d69c789ced22481d121769f0b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-03-11 11:37:43 +01:00
parent 1942506b2c
commit 685f452d91
8 changed files with 53 additions and 9 deletions

View File

@@ -63,8 +63,14 @@ public:
Git::Tr::tr("P&rotocol:"), httpsCheckBox
}.attachTo(this);
setOnApply([this, hostLineEdit, userLineEdit, sshChooser,
curlChooser, portSpinBox, httpsCheckBox, onChanged] {
setOnApply([this,
hostLineEdit,
userLineEdit,
sshChooser,
curlChooser,
portSpinBox,
httpsCheckBox,
onChanged] {
GerritParameters newParameters;
newParameters.server = GerritServer(hostLineEdit->text().trimmed(),
static_cast<unsigned short>(portSpinBox->value()),