[chronojump] RunsEncoder: Better sensitivity for capture



commit f6365dc34466efe142dc1ca46c6ae5bd52848f3c
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Sep 19 11:31:14 2019 +0200

    RunsEncoder: Better sensitivity for capture

 glade/app1.glade      |  4 ++--
 src/gui/runEncoder.cs | 22 +++++++++++++++-------
 2 files changed, 17 insertions(+), 9 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index d28d3ca1..3837ba92 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -7091,7 +7091,7 @@ EncoderInertialCapture</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkHBox" id="hbox286">
+                                                            <widget class="GtkHBox" 
id="hbox_run_encoder_capture_buttons">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <child>
@@ -10377,7 +10377,7 @@ Inverted values</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkHBox" id="hbox288_run_encoder">
+                                                            <widget class="GtkHBox" 
id="hbox_run_encoder_capture_options">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">20</property>
diff --git a/src/gui/runEncoder.cs b/src/gui/runEncoder.cs
index a8cf8599..2113a828 100644
--- a/src/gui/runEncoder.cs
+++ b/src/gui/runEncoder.cs
@@ -36,6 +36,8 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.MenuItem menuitem_race_encoder_open_folder;
        [Widget] Gtk.CheckMenuItem menuitem_check_race_encoder_capture_simulate;
 
+       [Widget] Gtk.HBox hbox_run_encoder_capture_buttons;
+       [Widget] Gtk.HBox hbox_run_encoder_capture_options;
        [Widget] Gtk.HBox hbox_combo_run_encoder_exercise;
        [Widget] Gtk.ComboBox combo_run_encoder_exercise;
        [Widget] Gtk.SpinButton race_analyzer_spinbutton_distance;
@@ -194,12 +196,6 @@ public partial class ChronoJumpWindow
 
        private void on_runs_encoder_capture_clicked ()
        {
-               if(chronopicRegister.NumConnectedOfType(ChronopicRegisterPort.Types.ARDUINO_RUN_ENCODER) == 0)
-               {
-                       event_execute_label_message.Text = runEncoderNotConnectedString;
-                       return;
-               }
-
                if(currentPersonSession.Weight == 0)
                {
                        new DialogMessage(Constants.MessageTypes.WARNING,
@@ -214,6 +210,14 @@ public partial class ChronoJumpWindow
                        return;
                }
 
+               runEncoderButtonsSensitive(false);
+
+               if(chronopicRegister.NumConnectedOfType(ChronopicRegisterPort.Types.ARDUINO_RUN_ENCODER) == 0)
+               {
+                       event_execute_label_message.Text = runEncoderNotConnectedString;
+                       return;
+               }
+
                runEncoderCapturePre2_GTK_cameraCall();
        }
 
@@ -228,7 +232,6 @@ public partial class ChronoJumpWindow
                textview_race_analyzer_comment.Buffer.Text = "";
                assignCurrentRunEncoderExercise();
                raceEncoderReadWidgets();
-               runEncoderButtonsSensitive(false);
                button_run_encoder_recalculate.Sensitive = false;
                button_race_analyzer_save_comment.Sensitive = false;
 
@@ -1024,8 +1027,13 @@ LogB.Information(" fc R ");
 
        void runEncoderButtonsSensitive(bool sensitive)
        {
+               //runEncoder related buttons
+               hbox_run_encoder_capture_buttons.Sensitive = sensitive;
+               hbox_run_encoder_capture_options.Sensitive = sensitive;
                button_execute_test.Sensitive = sensitive;
 
+               vbox_contacts_camera.Sensitive = sensitive;
+
                //other gui buttons
                main_menu.Sensitive = sensitive;
                hbox_contacts_sup_capture_analyze_two_buttons.Sensitive = sensitive;


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