diff options
| author | a1xd <[email protected]> | 2021-09-16 20:45:06 -0400 |
|---|---|---|
| committer | a1xd <[email protected]> | 2021-09-21 22:22:36 -0400 |
| commit | b5161317281a4c32b6a8d332389ee8178f244ce0 (patch) | |
| tree | a58f23598aa0a1b556769ce18a298ff87e1c15c6 /grapher/Models/AccelGUI.cs | |
| parent | rename disable button to reset (diff) | |
| download | rawaccel-b5161317281a4c32b6a8d332389ee8178f244ce0.tar.xz rawaccel-b5161317281a4c32b6a8d332389ee8178f244ce0.zip | |
handle lut mode exceptions on apply
Diffstat (limited to 'grapher/Models/AccelGUI.cs')
| -rw-r--r-- | grapher/Models/AccelGUI.cs | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index e694dd4..4ce6ed8 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -112,7 +112,7 @@ namespace grapher } } - public void UpdateActiveSettingsFromFields() + public DriverSettings MakeSettingsFromFields() { var settings = new DriverSettings(); @@ -130,19 +130,38 @@ namespace grapher Settings.SetHiddenOptions(settings); - ButtonDelay(WriteButton); + return settings; + } - SettingsErrors errors = Settings.TryActivate(settings); - if (errors.Empty()) + public void UpdateActiveSettingsFromFields() + { + string error_message; + + try { - RefreshActive(); + ButtonDelay(WriteButton); + + var settings = MakeSettingsFromFields(); + SettingsErrors errors = Settings.TryActivate(settings); + if (errors.Empty()) + { + RefreshActive(); + return; + } + else + { + error_message = errors.ToString(); + } } - else + catch (ApplicationException e) { - new MessageDialog(errors.ToString(), "bad input").ShowDialog(); + error_message = e.Message; } + + new MessageDialog(error_message, "bad input").ShowDialog(); } + public void UpdateInputManagers() { MouseWatcher.UpdateHandles(Settings.ActiveSettings.baseSettings.deviceID); |