# HG changeset patch # User StephaneLenclud # Date 1471789858 -7200 # Node ID 0220cb84df588cf049bc3cc55d6b5880a1edde41 # Parent afdbe76ab03b745008937401eb39bf575c828b5a Fixing EAR event edition. EAR HID event now displays 'Press a key' if not valid. diff -r afdbe76ab03b -r 0220cb84df58 Server/Events/EventHid.cs --- a/Server/Events/EventHid.cs Sun Aug 21 16:11:40 2016 +0200 +++ b/Server/Events/EventHid.cs Sun Aug 21 16:30:58 2016 +0200 @@ -85,6 +85,12 @@ { string brief = Name + ": "; + if (!IsValid()) + { + brief += "Press a key"; + return brief; + } + if (IsKeyboard) { brief += Key.ToString(); diff -r afdbe76ab03b -r 0220cb84df58 Server/FormMain.cs --- a/Server/FormMain.cs Sun Aug 21 16:11:40 2016 +0200 +++ b/Server/FormMain.cs Sun Aug 21 16:30:58 2016 +0200 @@ -2932,10 +2932,14 @@ FormEditObject ea = new FormEditObject(); ea.Text = "Edit event"; ea.Object = selectedEvent; - int actionIndex = iTreeViewEvents.SelectedNode.Index; + int index = iTreeViewEvents.SelectedNode.Index; DialogResult res = CodeProject.Dialog.DlgBox.ShowDialog(ea); if (res == DialogResult.OK) - { + { + //Make sure we keep the same actions as before + ea.Object.Actions = Properties.Settings.Default.EarManager.Events[index].Actions; + //Update our event + Properties.Settings.Default.EarManager.Events[index] = ea.Object; //Save and rebuild our event tree view Properties.Settings.Default.Save(); PopulateEventsTreeView();