[chronojump] Networks: on downloading jumps, jumpsRj updates all needed combos just once



commit 96aff9a36ee48a04c8afd4660463bf7de4acbcb8
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Aug 24 16:54:48 2022 +0200

    Networks: on downloading jumps,jumpsRj updates all needed combos just once

 src/gui/networks.cs | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/src/gui/networks.cs b/src/gui/networks.cs
index 64f37ecdd..f98b6af2a 100644
--- a/src/gui/networks.cs
+++ b/src/gui/networks.cs
@@ -1219,6 +1219,7 @@ public partial class ChronoJumpWindow
                        json.GetJumpStationExercises (configChronojump.CompujumpStationID);
 
                        // 3a1) Jumps simple
+                       bool insertedJumps = false;
                        foreach(SelectJumpTypes exRemote in json.JumpSimpleExercises_l)
                        {
                                bool found = false;
@@ -1232,10 +1233,18 @@ public partial class ChronoJumpWindow
                                if(! found)
                                {
                                        SqliteJumpType.JumpTypeInsert (exRemote.Id, exRemote.ToSQLString (), 
false);
-                                       createComboSelectJumps (false);
+                                       insertedJumps = true;
                                }
                        }
+                       if (insertedJumps)
+                       {
+                               createComboSelectJumps (false);
+                               if (current_mode == Constants.Modes.JUMPSSIMPLE)
+                                       createComboSelectContactsTop ();
+                       }
+
                        // 3a2) Jumps Reactive
+                       insertedJumps = false;
                        foreach(SelectJumpRjTypes exRemote in json.JumpRjExercises_l)
                        {
                                bool found = false;
@@ -1249,9 +1258,15 @@ public partial class ChronoJumpWindow
                                if(! found)
                                {
                                        SqliteJumpType.JumpRjTypeInsert (exRemote.Id, exRemote.ToSQLString 
(), false);
-                                       createComboSelectJumpsRj (false);
+                                       insertedJumps = true;
                                }
                        }
+                       if (insertedJumps)
+                       {
+                               createComboSelectJumpsRj (false);
+                               if (current_mode == Constants.Modes.JUMPSSIMPLE)
+                                       createComboSelectContactsTop ();
+                       }
                }
                // 3b) encoder
                else if(configChronojump.CompujumpStationMode == Constants.Modes.POWERGRAVITATORY ||


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]