alterNERDtive-base: fixed settings dialog closing prematurely
This commit is contained in:
parent
8a3b17d674
commit
e81f3961ea
1 changed files with 8 additions and 2 deletions
|
@ -94,6 +94,8 @@ namespace alterNERDtive
|
|||
|
||||
private void okButton_Click(object sender, RoutedEventArgs reargs)
|
||||
{
|
||||
bool error = false;
|
||||
|
||||
foreach (Setting setting in values)
|
||||
{
|
||||
dynamic state = null;
|
||||
|
@ -130,14 +132,18 @@ namespace alterNERDtive
|
|||
log.Log($@"Configuration changed via settings dialog: ""{setting.Profile}.{setting.Option.Name}"" → ""{state}""", util.LogLevel.DEBUG);
|
||||
config.SetConfig(setting.Profile, setting.Option.Name, state);
|
||||
}
|
||||
|
||||
Window.GetWindow(this).Close();
|
||||
}
|
||||
catch (Exception e) when (e is ArgumentNullException || e is FormatException || e is OverflowException)
|
||||
{
|
||||
log.Log($@"Invalid value for ""{setting.Profile}.{setting.Option.Name}"": ""{((TextBox)setting.UiElement).Text}""", util.LogLevel.ERROR);
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!error)
|
||||
{
|
||||
Window.GetWindow(this).Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue