summaryrefslogtreecommitdiff
path: root/grapher/Models/AccelGUI.cs
diff options
context:
space:
mode:
authora1xd <[email protected]>2021-09-16 20:45:06 -0400
committera1xd <[email protected]>2021-09-21 22:22:36 -0400
commitb5161317281a4c32b6a8d332389ee8178f244ce0 (patch)
treea58f23598aa0a1b556769ce18a298ff87e1c15c6 /grapher/Models/AccelGUI.cs
parentrename disable button to reset (diff)
downloadrawaccel-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.cs33
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);