[chronojump] Encoder separate_session_in_days only for F0V0



commit 0bb46139ac07dfc212c84e8bca57cb6f0eaa16e2
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Feb 14 18:46:23 2019 +0100

    Encoder separate_session_in_days only for F0V0

 glade/app1.glade   | 45 ++++++++++++++++++++++++---------------------
 src/gui/encoder.cs | 15 ++++++++++++---
 2 files changed, 36 insertions(+), 24 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 610ee4d4..968900a9 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -1836,6 +1836,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>
@@ -19475,12 +19478,6 @@ Concentric</property>
                                                             <placeholder/>
                                                             </child>
                                                             <child>
-                                                            <placeholder/>
-                                                            </child>
-                                                            <child>
-                                                            <placeholder/>
-                                                            </child>
-                                                            <child>
                                                             <widget class="GtkCheckButton" 
id="checkbutton_force_sensor_ai_b">
                                                             <property name="width_request">30</property>
                                                             <property name="visible">True</property>
@@ -19611,6 +19608,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -24735,21 +24735,6 @@ then click this button.</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkCheckButton" 
id="check_encoder_separate_session_in_days">
-                                                            <property name="label" translatable="yes">By 
days</property>
-                                                            <property name="can_focus">True</property>
-                                                            <property 
name="receives_default">False</property>
-                                                            <property name="tooltip" 
translatable="yes">Separate session by days</property>
-                                                            <property name="draw_indicator">True</property>
-                                                            <signal name="toggled" 
handler="on_check_encoder_separate_session_in_days_toggled" swapped="no"/>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="position">5</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
                                                             <widget class="GtkHBox" 
id="hbox_combo_encoder_analyze_cross_sup">
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">6</property>
@@ -24783,6 +24768,21 @@ then click this button.</property>
                                                             <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
+                                                            <property name="position">5</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkCheckButton" 
id="check_encoder_separate_session_in_days">
+                                                            <property name="label" translatable="yes">By 
days</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="tooltip" 
translatable="yes">Separate session by days</property>
+                                                            <property name="draw_indicator">True</property>
+                                                            <signal name="toggled" 
handler="on_check_encoder_separate_session_in_days_toggled" swapped="no"/>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
                                                             <property name="position">6</property>
                                                             </packing>
                                                             </child>
@@ -27930,6 +27930,9 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 59d3e8d4..cc1467c8 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -3318,7 +3318,6 @@ public partial class ChronoJumpWindow
                radiobutton_encoder_analyze_cross.Active = true;
                hbox_encoder_analyze_intersession.Visible = true;
                
-               check_encoder_separate_session_in_days.Visible = true;
                set_check_encoder_separate_session_in_days();
 
                //this analysis only when not comparing
@@ -3425,9 +3424,17 @@ public partial class ChronoJumpWindow
 
        private void set_check_encoder_separate_session_in_days()
        {
-               check_encoder_separate_session_in_days.Sensitive = ! 
check_encoder_intersession_x_is_date.Active;
-               if(check_encoder_intersession_x_is_date.Active)
+               bool neededConditions =
+                       ! check_encoder_intersession_x_is_date.Active &&
+                       encoderSelectedAnalysis == "cross" &&
+                       UtilGtk.ComboGetActive(combo_encoder_analyze_cross) == "Pmax(F0,V0)";
+
+               check_encoder_separate_session_in_days.Sensitive = neededConditions;
+
+               if(! neededConditions)
                        check_encoder_separate_session_in_days.Active = false;
+
+               check_encoder_separate_session_in_days.Visible = neededConditions;
        }
 
 
@@ -4171,6 +4178,8 @@ public partial class ChronoJumpWindow
                        check_encoder_analyze_mean_or_max.Sensitive = true;
                }
 
+               set_check_encoder_separate_session_in_days();
+
                button_encoder_analyze_sensitiveness();
        }
        


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