[chronojump] Jump type add: message on drop jump unsensitive if normal jump



commit 3093d693d7cd7ebe8784c492bf1033e9af042d1d
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Dec 11 11:13:26 2020 +0100

    Jump type add: message on drop jump unsensitive if normal jump

 glade/jump_type_add.glade |  4 +++-
 src/gui/jumpType.cs       | 14 ++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/glade/jump_type_add.glade b/glade/jump_type_add.glade
index fb27d482..0d43ef34 100644
--- a/glade/jump_type_add.glade
+++ b/glade/jump_type_add.glade
@@ -413,6 +413,7 @@ options</property>
                                 <property name="use_underline">True</property>
                                 <property name="active">True</property>
                                 <property name="draw_indicator">True</property>
+                                <signal name="toggled" handler="on_radiobutton_startIn_yes_toggled" 
swapped="no"/>
                               </widget>
                               <packing>
                                 <property name="expand">False</property>
@@ -429,6 +430,7 @@ options</property>
                                 <property name="use_underline">True</property>
                                 <property name="draw_indicator">True</property>
                                 <property name="group">radiobutton_startIn_yes</property>
+                                <signal name="toggled" handler="on_radiobutton_startIn_no_toggled" 
swapped="no"/>
                               </widget>
                               <packing>
                                 <property name="expand">False</property>
@@ -444,7 +446,7 @@ options</property>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="label2">
+                          <widget class="GtkLabel" id="label_drop_jump">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="label" translatable="yes">Drop jump can also start inside 
platform.</property>
diff --git a/src/gui/jumpType.cs b/src/gui/jumpType.cs
index 8e32c7a3..8fc3813c 100644
--- a/src/gui/jumpType.cs
+++ b/src/gui/jumpType.cs
@@ -53,8 +53,10 @@ public class JumpTypeAddWindow
        [Widget] Gtk.SpinButton spin_fixed_num;
 
        [Widget] Gtk.RadioButton radiobutton_startIn_yes;
+       [Widget] Gtk.RadioButton radiobutton_startIn_no;
        [Widget] Gtk.RadioButton radiobutton_extra_weight_yes;
        [Widget] Gtk.RadioButton radiobutton_extra_weight_no;
+       [Widget] Gtk.Label label_drop_jump;
        [Widget] Gtk.TextView textview_description;
 
        static JumpTypeAddWindow JumpTypeAddWindowBox;
@@ -100,6 +102,7 @@ public class JumpTypeAddWindow
                button_accept.Sensitive = false;
                spin_fixed_num.Sensitive = false;
                radiobutton_extra_weight_no.Active = true;
+               label_drop_jump.Sensitive = false;
 
                //active the desired radio
                if(simple)
@@ -252,6 +255,17 @@ public class JumpTypeAddWindow
                }
        }
 
+       private void on_radiobutton_startIn_yes_toggled (object o, EventArgs args)
+       {
+               if(radiobutton_startIn_yes.Active)
+                       label_drop_jump.Sensitive = false;
+       }
+       private void on_radiobutton_startIn_no_toggled (object o, EventArgs args)
+       {
+               if(radiobutton_startIn_no.Active)
+                       label_drop_jump.Sensitive = true;
+       }
+
        void on_entries_required_changed (object o, EventArgs args)
        {
                entry_name.Text = Util.MakeValidSQL(entry_name.Text);


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