[chronojump] Device button at encoder sensitive even when there's no person



commit 2b0d8b7baf90b535cbf1514eaff2acf994b3d75d
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed May 29 16:44:39 2019 -0300

    Device button at encoder sensitive even when there's no person

 glade/app1.glade      | 13 +++++++++++--
 src/gui/chronojump.cs |  9 +++++----
 src/gui/encoder.cs    | 17 +++++++++++++++--
 3 files changed, 31 insertions(+), 8 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index d110ee79..b8063aae 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -1914,6 +1914,9 @@
                                                             <placeholder/>
                                                             </child>
                                                             <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
                                                             <widget class="GtkLabel" 
id="label_start_selector_jumps">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
@@ -20898,6 +20901,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -22049,7 +22055,7 @@ Concentric</property>
                                                       </packing>
                                                     </child>
                                                     <child>
-                                                      <widget class="GtkHBox" id="hbox168">
+                                                      <widget class="GtkHBox" 
id="hbox_encoder_capture_actions">
                                                         <property name="visible">True</property>
                                                         <property name="can_focus">False</property>
                                                         <property name="spacing">16</property>
@@ -23025,7 +23031,7 @@ Concentric</property>
                                                   </packing>
                                                 </child>
                                                 <child>
-                                                  <widget class="GtkHPaned" id="hpaned3">
+                                                  <widget class="GtkHPaned" id="hpaned_encoder">
                                                     <property name="visible">True</property>
                                                     <property name="can_focus">True</property>
                                                     <property name="position">400</property>
@@ -29548,6 +29554,9 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 155d013f..eb05e425 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -7134,7 +7134,8 @@ LogB.Debug("mc finished 5");
                notebook_analyze.Sensitive = false;
                notebook_results.Sensitive = false;
                notebook_options_top.Sensitive = false;
-               notebook_encoder_sup.Sensitive = false;
+               encoder_sensitive_all_except_device(false);
+
                vbox_stats.Sensitive = false;
                
                sensitiveLastTestButtons(false);
@@ -7182,7 +7183,8 @@ LogB.Debug("mc finished 5");
                notebook_analyze.Sensitive = false;
                notebook_results.Sensitive = false;
                notebook_options_top.Sensitive = false;
-               notebook_encoder_sup.Sensitive = false;
+               encoder_sensitive_all_except_device(false);
+
                treeview_persons.Sensitive = false;
                
                menuPersonSelectedSensitive(false);
@@ -7204,7 +7206,7 @@ LogB.Debug("mc finished 5");
                notebook_analyze.Sensitive = true;
                notebook_results.Sensitive = true;
                notebook_options_top.Sensitive = true;
-               notebook_encoder_sup.Sensitive = true;
+               encoder_sensitive_all_except_device(true);
 
                if(! configChronojump.Exhibition)
                        treeview_persons.Sensitive = true;
@@ -7389,7 +7391,6 @@ LogB.Debug("mc finished 5");
         * sensitive GUI on executeAuto methods 
         */
 
-
        private void chronopicRegisterUpdate(bool openWindow)
        {
                //on Windows need to close the port before reading with FTDI dll
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index bf23c2a4..b184cb9b 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -69,6 +69,8 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Box hbox_encoder_sup_capture_analyze_two_buttons;
        [Widget] Gtk.Box hbox_encoder_configuration;
        [Widget] Gtk.Frame frame_encoder_capture_options;
+       [Widget] Gtk.HBox hbox_encoder_capture_actions;
+       [Widget] Gtk.HPaned hpaned_encoder;
        
        [Widget] Gtk.Box hbox_encoder_capture_wait;
        [Widget] Gtk.Box vbox_encoder_capture_doing;
@@ -4883,10 +4885,8 @@ public partial class ChronoJumpWindow
                                table = doneYesSignal;
                                break;
                }
-
                button_encoder_capture.Sensitive = Util.IntToBool(table[0]);
                hbox_encoder_sup_capture_analyze_two_buttons.Sensitive = Util.IntToBool(table[0]);
-               hbox_encoder_configuration.Sensitive = Util.IntToBool(table[0]);
                frame_encoder_capture_options.Sensitive = Util.IntToBool(table[0]);
 
                button_encoder_recalculate.Sensitive = Util.IntToBool(table[1]);
@@ -4964,6 +4964,19 @@ public partial class ChronoJumpWindow
                button_encoder_analyze.Sensitive = analyze_sensitive;
        }
 
+       /*
+        * we want to have device sensitive
+        * and sensitive/unsensitive the rest of widgets
+        * suitable to change device without having a person loaded
+        */
+       private void encoder_sensitive_all_except_device(bool s)
+       {
+               frame_encoder_capture_options.Sensitive = s;
+               hbox_encoder_capture_actions.Sensitive = s;
+               hbox_video_encoder.Sensitive = s;
+               hpaned_encoder.Sensitive = s;
+       }
+
 
        /* end of sensitivity stuff */  
        


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