[chronojump] jump/run type delete button unsensitive if isPredefined



commit 15c19ea8d500470e8e7b9c5ba7cf009c1204fa94
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Jan 28 13:46:17 2020 +0100

    jump/run type delete button unsensitive if isPredefined

 glade/app1.glade     | 32 +++++++++++++++++++-------------
 src/gui/app1/jump.cs | 10 ++++++++--
 src/gui/app1/run.cs  |  6 ++++++
 3 files changed, 33 insertions(+), 15 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index a23af6f1..9cd5d97e 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -12099,7 +12099,7 @@ EncoderInertialCapture</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkButton" id="button3">
+                                                            <widget class="GtkButton" 
id="button_run_type_delete_interval">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">True</property>
@@ -22815,6 +22815,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -25186,6 +25189,18 @@ Concentric</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">6</property>
                                                             <child>
+                                                            <widget class="GtkLabel" 
id="label_video_encoder_tests_will_be_filmed">
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" translatable="yes">Tests 
will be filmed</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="pack_type">end</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
                                                             <widget class="GtkHBox" 
id="hbox_video_encoder_capturing">
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">4</property>
@@ -25222,18 +25237,6 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkLabel" 
id="label_video_encoder_tests_will_be_filmed">
-                                                            <property name="can_focus">False</property>
-                                                            <property name="label" translatable="yes">Tests 
will be filmed</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="pack_type">end</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
                                                             <widget class="GtkHBox" 
id="hbox_video_encoder_no_capturing">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
@@ -32494,6 +32497,9 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/src/gui/app1/jump.cs b/src/gui/app1/jump.cs
index fa87692a..8ec11b73 100644
--- a/src/gui/app1/jump.cs
+++ b/src/gui/app1/jump.cs
@@ -33,6 +33,7 @@ using Mono.Unix;
 public partial class ChronoJumpWindow
 {
        //options jumps
+       [Widget] Gtk.Button button_jump_type_delete_simple;
        [Widget] Gtk.SpinButton extra_window_jumps_spinbutton_weight;
        [Widget] Gtk.Box extra_window_jumps_hbox_fall;
        [Widget] Gtk.CheckButton extra_window_jumps_check_dj_fall_calculate;
@@ -61,6 +62,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.SpinButton extra_window_jumps_spin_single_leg_angle;
        
        //options jumps_rj
+       [Widget] Gtk.Button button_jump_type_delete_reactive;
        [Widget] Gtk.Label extra_window_jumps_rj_label_limit;
        [Widget] Gtk.SpinButton extra_window_jumps_rj_spinbutton_limit;
        [Widget] Gtk.Label extra_window_jumps_rj_label_limit_units;
@@ -221,7 +223,9 @@ public partial class ChronoJumpWindow
                        extra_window_showTechniqueArmsData(true, true); //visible, sensitive
                } else 
                        extra_window_showTechniqueArmsData(false, false); //visible, sensitive
-               
+
+               button_jump_type_delete_simple.Sensitive = ! myJumpType.IsPredefined;
+
                extra_window_jumps_spinbutton_weight.Value = 100;
                extra_window_jumps_spinbutton_fall.Value = extra_window_jumps_fall;
                if (extra_window_jumps_option == "Kg") {
@@ -320,7 +324,9 @@ public partial class ChronoJumpWindow
                        extra_window_showFallData(myJumpType, true);    
                } else
                        extra_window_showFallData(myJumpType, false);
-               
+
+               button_jump_type_delete_reactive.Sensitive = ! myJumpType.IsPredefined;
+
                extra_window_jumps_rj_spinbutton_weight.Value = extra_window_jumps_rj_weight;
                extra_window_jumps_rj_spinbutton_fall.Value = extra_window_jumps_rj_fall;
                if (extra_window_jumps_rj_option == "Kg") {
diff --git a/src/gui/app1/run.cs b/src/gui/app1/run.cs
index ac73335a..e69dd80c 100644
--- a/src/gui/app1/run.cs
+++ b/src/gui/app1/run.cs
@@ -33,12 +33,14 @@ using Mono.Unix;
 public partial class ChronoJumpWindow
 {
        //options runs
+       [Widget] Gtk.Button button_run_type_delete_simple;
        [Widget] Gtk.CheckButton check_run_simple_with_reaction_time;
        [Widget] Gtk.Button button_runs_simple_track_distance;
        [Widget] Gtk.Label label_runs_simple_track_distance_value;
        [Widget] Gtk.Label label_runs_simple_track_distance_units;
 
        //options runs interval
+       [Widget] Gtk.Button button_run_type_delete_interval;
        [Widget] Gtk.Button button_runs_interval_track_distance;
        [Widget] Gtk.Label label_runs_interval_track_distance_value;
        //[Widget] Gtk.Label label_runs_interval_track_distance_units; //always "m"
@@ -131,6 +133,8 @@ public partial class ChronoJumpWindow
                        extra_window_showDistanceData(myRunType, true, true);   //visible, sensitive
                }
 
+               button_run_type_delete_simple.Sensitive = ! myRunType.IsPredefined;
+
                updateGraphRunsSimple();
                setLabelContactsExerciseSelectedOptionsRunsSimple();
        }
@@ -208,6 +212,8 @@ public partial class ChronoJumpWindow
                        extra_window_showLimitData(false, false);       //visible, sensitive
                }
 
+               button_run_type_delete_interval.Sensitive = ! myRunType.IsPredefined;
+
                setLabelContactsExerciseSelectedOptionsRunsInterval();
        }
 


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