[chronojump] runEncoderCaptureDisplaySimple stored on SQL and correctly managed



commit 8448829529ba54dfade841706b0b3e7b3849426b
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Aug 9 18:30:23 2021 +0200

    runEncoderCaptureDisplaySimple stored on SQL and correctly managed

 src/gui/app1/chronojump.cs |  4 ++++
 src/gui/app1/runEncoder.cs | 18 ++++++++++++++++++
 2 files changed, 22 insertions(+)
---
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index 85d929e94..79ced0590 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -2834,6 +2834,10 @@ public partial class ChronoJumpWindow
                        SqlitePreferences.Update("encoderCaptureShowOnlyBars",
                                        preferences.encoderCaptureShowOnlyBars.GetInt.ToString(), false);
 
+               if(preferences.runEncoderCaptureDisplaySimple != 
preferences.runEncoderCaptureDisplaySimpleStored)
+                       SqlitePreferences.Update(SqlitePreferences.RunEncoderCaptureDisplaySimple,
+                                       preferences.runEncoderCaptureDisplaySimple.ToString(), false);
+
                LogB.Information("Bye3!");
 
                //TODO: if camera is opened close it! Note that this is intended to kill a remaining ffmpeg 
process
diff --git a/src/gui/app1/runEncoder.cs b/src/gui/app1/runEncoder.cs
index a8a5b9349..be9e7a3eb 100644
--- a/src/gui/app1/runEncoder.cs
+++ b/src/gui/app1/runEncoder.cs
@@ -53,6 +53,7 @@ public partial class ChronoJumpWindow
        //[Widget] Gtk.Label label_race_analyzer_capture_speed;
        [Widget] Gtk.HBox hbox_race_analyzer_capture_tab_result_views;
        [Widget] Gtk.RadioButton radio_race_analyzer_capture_view_simple;
+       [Widget] Gtk.RadioButton radio_race_analyzer_capture_view_complete;
        [Widget] Gtk.Alignment alignment_drawingarea_race_analyzer_capture_velocimeter_topleft;
        [Widget] Gtk.Alignment alignment_hbox_race_analyzer_capture_bottom;
        [Widget] Gtk.DrawingArea drawingarea_race_analyzer_capture_velocimeter_topleft;
@@ -105,6 +106,13 @@ public partial class ChronoJumpWindow
 
        private void initRunEncoder ()
        {
+               followSignals = false;
+               if(preferences.runEncoderCaptureDisplaySimple)
+                       radio_race_analyzer_capture_view_simple.Active = true;
+               else
+                       radio_race_analyzer_capture_view_complete.Active = true;
+               followSignals = true;
+
                manageRunEncoderCaptureViews();
 
                createRunEncoderExerciseCombo();
@@ -129,10 +137,20 @@ public partial class ChronoJumpWindow
                        cairoRadial = null;
                        drawingarea_race_analyzer_capture_velocimeter_bottom.QueueDraw(); //will fire 
ExposeEvent
                }
+
+               /*
+                  update the preferences variable
+                  note as can be changed while capturing, it will be saved to SQL on exit
+                  to not have problems with SQL while capturing
+                  */
+               preferences.runEncoderCaptureDisplaySimple = radio_race_analyzer_capture_view_simple.Active;
        }
 
        private void on_radio_race_analyzer_capture_view_clicked (object o, EventArgs args)
        {
+               if(! followSignals)
+                       return;
+
                manageRunEncoderCaptureViews();
        }
 


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