Repository: nvaccess/nvda

Issue:
After clicking the "Restore Default" button under the "Advanced" category, you cannot close the settings panel by clicking the "OK" button
### Steps to reproduce:
1. NVDA + N to open the "NVDA" menu, go to "Preferences" ➡ "Settings";
2. Use the down arrow to move to the "Advanced" category;
3. Use the Tab key to find and click the "Restore defaults" button;
4. Then click the "OK" button.
### Actual behavior:
NVDA plays an error tone and does not close the settings dialog.
### Expected behavior:
NVDA should restore the advanced settings to the default values ​​and close the dialog box correctly.
### System configuration
#### NVDA installed/portable/running from source:
installed/portable

#### NVDA version:
alpha-22370
#### Windows version:
Windows 10 20H2 (64-bit) build 19042.928
#### Name and version of other software in use when reproducing the issue:
none
#### Other information about your system:
none
### Other questions
#### Does the issue still occur after restarting your computer?
yes
#### Have you tried any other versions of NVDA? If so, please report their behaviors.
- NVDA2020.4 can work as expected.
- The internal version in #12152 can reproduce the problem
#### If add-ons are disabled, is your problem still occurring?
Yes
#### Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?
yes


Discussion:
The following is the log file:
[nvda_log.txt](https://github.com/nvaccess/nvda/files/6322015/nvda_log.txt)

But wait, there's more...

After that error occurs, it seems that there is a failure to clean up which shows up in subsequent entries into the settings panel.

I replicate the error in this log, and, at `Mark 2`, we can see what happens when I next enter the panel.
[secondary error.txt](https://github.com/nvaccess/nvda/files/6322096/secondary.error.txt)

CC @seanbudd 

I'm wondering if there is some last-ditch cleanup code that should be in a finally block instead of wherever it is now.
@cary-rowen As a further diagnostic point: if you check the box to actually change advanced settings, the restore button works fine, at least on my system.
Yes, thank you for your supplement. @XLTechie

Resolving patch:
diff --git a/source/gui/settingsDialogs.py b/source/gui/settingsDialogs.py
--- a/source/gui/settingsDialogs.py
+++ b/source/gui/settingsDialogs.py
@@ -2815,7 +2815,7 @@ def haveConfigDefaultsBeenRestored(self):
 			and self.ConsoleUIACheckBox.IsChecked() == (self.ConsoleUIACheckBox.defaultValue == 'UIA')
 			and self.winConsoleSpeakPasswordsCheckBox.IsChecked() == self.winConsoleSpeakPasswordsCheckBox.defaultValue
 			and self.cancelExpiredFocusSpeechCombo.GetSelection() == self.cancelExpiredFocusSpeechCombo.defaultValue
-			and self.UIAInChromiumCombo.selection == self.UIAInChromiumCombo.defaultValue
+			and self.UIAInChromiumCombo.GetSelection() == self.UIAInChromiumCombo.defaultValue
 			and self.keyboardSupportInLegacyCheckBox.IsChecked() == self.keyboardSupportInLegacyCheckBox.defaultValue
 			and self.diffAlgoCombo.GetSelection() == self.diffAlgoCombo.defaultValue
 			and self.caretMoveTimeoutSpinControl.GetValue() == self.caretMoveTimeoutSpinControl.defaultValue


Test patch: