[chronojump] encoder exercise will not change on change person or analyze mode



commit e295fd6b50228522b46dd4a0e33b13725d06c20d
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Jan 8 13:50:14 2019 +0100

    encoder exercise will not change on change person or analyze mode

 src/gui/encoder.cs | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 3af32747..f92856b5 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -3920,11 +3920,18 @@ public partial class ChronoJumpWindow
                        exerciseNamesToCombo[i] = Catalog.GetString(ex.name);
                        i++;
                }
-               
+
+               //get previous combo_encoder_exercise_capture value
+               string previousExerciseCapture = UtilGtk.ComboGetActive(combo_encoder_exercise_capture);
+
                UtilGtk.ComboUpdate(combo_encoder_exercise_capture, exerciseNamesToCombo, "");
-               combo_encoder_exercise_capture.Active = 
UtilGtk.ComboMakeActive(combo_encoder_exercise_capture, 
-                               Catalog.GetString(((EncoderExercise) encoderExercises[0]).name));
-       
+               if(previousExerciseCapture == "")
+                       combo_encoder_exercise_capture.Active = 
UtilGtk.ComboMakeActive(combo_encoder_exercise_capture,
+                                       Catalog.GetString(((EncoderExercise) encoderExercises[0]).name));
+               else
+                       combo_encoder_exercise_capture.Active = 
UtilGtk.ComboMakeActive(combo_encoder_exercise_capture,
+                                       previousExerciseCapture);
+
                exerciseNamesToCombo = addAllExercisesToComboExerciseAnalyze(exerciseNamesToCombo);
                
                UtilGtk.ComboUpdate(combo_encoder_exercise_analyze, exerciseNamesToCombo, "");


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