[chronojump] jumpRj add shows start inside/outside



commit 40a4643fe9042f101c7ed10101f57bf4d669495a
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Dec 11 13:16:39 2020 +0100

    jumpRj add shows start inside/outside

 glade/jump_type_add.glade | 92 ++++++++++++++++++++++++++++++++++++++---------
 src/gui/jumpType.cs       | 47 ++++++++++++++++++------
 2 files changed, 112 insertions(+), 27 deletions(-)
---
diff --git a/glade/jump_type_add.glade b/glade/jump_type_add.glade
index 0d43ef34..0fcaa8bc 100644
--- a/glade/jump_type_add.glade
+++ b/glade/jump_type_add.glade
@@ -44,7 +44,7 @@
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="border_width">10</property>
-                    <property name="n_rows">5</property>
+                    <property name="n_rows">6</property>
                     <property name="n_columns">2</property>
                     <property name="column_spacing">20</property>
                     <property name="row_spacing">10</property>
@@ -69,8 +69,8 @@
                         <property name="label" translatable="yes">Description</property>
                       </widget>
                       <packing>
-                        <property name="top_attach">4</property>
-                        <property name="bottom_attach">5</property>
+                        <property name="top_attach">5</property>
+                        <property name="bottom_attach">6</property>
                         <property name="x_options">GTK_FILL</property>
                         <property name="y_options"/>
                       </packing>
@@ -89,8 +89,8 @@
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="right_attach">2</property>
-                        <property name="top_attach">4</property>
-                        <property name="bottom_attach">5</property>
+                        <property name="top_attach">5</property>
+                        <property name="bottom_attach">6</property>
                         <property name="x_options">GTK_FILL</property>
                         <property name="y_options">GTK_FILL</property>
                       </packing>
@@ -119,8 +119,8 @@
                         <property name="label" translatable="yes">Extra weight</property>
                       </widget>
                       <packing>
-                        <property name="top_attach">3</property>
-                        <property name="bottom_attach">4</property>
+                        <property name="top_attach">4</property>
+                        <property name="bottom_attach">5</property>
                         <property name="x_options">GTK_FILL</property>
                         <property name="y_options"/>
                       </packing>
@@ -165,8 +165,8 @@
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="right_attach">2</property>
-                        <property name="top_attach">3</property>
-                        <property name="bottom_attach">4</property>
+                        <property name="top_attach">4</property>
+                        <property name="bottom_attach">5</property>
                         <property name="x_options">GTK_FILL</property>
                         <property name="y_options">GTK_FILL</property>
                       </packing>
@@ -395,7 +395,7 @@ options</property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkVBox" id="vbox1">
+                      <widget class="GtkVBox" id="vbox_simple_type">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="spacing">6</property>
@@ -405,7 +405,7 @@ options</property>
                             <property name="can_focus">False</property>
                             <property name="spacing">20</property>
                             <child>
-                              <widget class="GtkRadioButton" id="radiobutton_startIn_yes">
+                              <widget class="GtkRadioButton" id="radiobutton_simple_startIn_yes">
                                 <property name="label" translatable="yes">Normal jump</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
@@ -413,7 +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"/>
+                                <signal name="toggled" handler="on_radiobutton_simple_startIn_yes_toggled" 
swapped="no"/>
                               </widget>
                               <packing>
                                 <property name="expand">False</property>
@@ -422,15 +422,15 @@ options</property>
                               </packing>
                             </child>
                             <child>
-                              <widget class="GtkRadioButton" id="radiobutton_startIn_no">
+                              <widget class="GtkRadioButton" id="radiobutton_simple_startIn_no">
                                 <property name="label" translatable="yes">Drop jump</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</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"/>
+                                <property name="group">radiobutton_simple_startIn_yes</property>
+                                <signal name="toggled" handler="on_radiobutton_simple_startIn_no_toggled" 
swapped="no"/>
                               </widget>
                               <packing>
                                 <property name="expand">False</property>
@@ -466,7 +466,7 @@ options</property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkLabel" id="label83">
+                      <widget class="GtkLabel" id="label_jump_type_simple">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="xalign">0</property>
@@ -479,6 +479,66 @@ options</property>
                         <property name="y_options">GTK_FILL</property>
                       </packing>
                     </child>
+                    <child>
+                      <widget class="GtkLabel" id="label_jump_type_multiple">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Type</property>
+                      </widget>
+                      <packing>
+                        <property name="top_attach">3</property>
+                        <property name="bottom_attach">4</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkHBox" id="hbox_multiple_type">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">20</property>
+                        <child>
+                          <widget class="GtkRadioButton" id="radiobutton_multiple_startIn_yes">
+                            <property name="label" translatable="yes">Start inside</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_underline">True</property>
+                            <property name="active">True</property>
+                            <property name="draw_indicator">True</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkRadioButton" id="radiobutton_multiple_startIn_no">
+                            <property name="label" translatable="yes">Start outside</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_underline">True</property>
+                            <property name="active">True</property>
+                            <property name="draw_indicator">True</property>
+                            <property name="group">radiobutton_multiple_startIn_yes</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">3</property>
+                        <property name="bottom_attach">4</property>
+                      </packing>
+                    </child>
                   </widget>
                 </child>
               </widget>
diff --git a/src/gui/jumpType.cs b/src/gui/jumpType.cs
index 8fc3813c..b42cbcbf 100644
--- a/src/gui/jumpType.cs
+++ b/src/gui/jumpType.cs
@@ -52,8 +52,15 @@ public class JumpTypeAddWindow
        [Widget] Gtk.CheckButton checkbutton_limited_fixed;
        [Widget] Gtk.SpinButton spin_fixed_num;
 
-       [Widget] Gtk.RadioButton radiobutton_startIn_yes;
-       [Widget] Gtk.RadioButton radiobutton_startIn_no;
+       [Widget] Gtk.Label label_jump_type_simple;
+       [Widget] Gtk.Label label_jump_type_multiple;
+       [Widget] Gtk.VBox vbox_simple_type;
+       [Widget] Gtk.HBox hbox_multiple_type;
+
+       [Widget] Gtk.RadioButton radiobutton_simple_startIn_yes;
+       [Widget] Gtk.RadioButton radiobutton_simple_startIn_no;
+       [Widget] Gtk.RadioButton radiobutton_multiple_startIn_yes;
+       [Widget] Gtk.RadioButton radiobutton_multiple_startIn_no;
        [Widget] Gtk.RadioButton radiobutton_extra_weight_yes;
        [Widget] Gtk.RadioButton radiobutton_extra_weight_no;
        [Widget] Gtk.Label label_drop_jump;
@@ -105,11 +112,22 @@ public class JumpTypeAddWindow
                label_drop_jump.Sensitive = false;
 
                //active the desired radio
-               if(simple)
+               if(simple) {
                        radiobutton_simple.Active = true;
-               else
+
+                       label_jump_type_simple.Visible = true;
+                       vbox_simple_type.Visible = true;
+                       label_jump_type_multiple.Visible = false;
+                       hbox_multiple_type.Visible = false;
+               } else {
                        radiobutton_repetitive.Active = true;
 
+                       label_jump_type_simple.Visible = false;
+                       vbox_simple_type.Visible = false;
+                       label_jump_type_multiple.Visible = true;
+                       hbox_multiple_type.Visible = true;
+               }
+
                //don't show the radios
                radiobutton_simple.Visible = false;
                radiobutton_repetitive.Visible = false;
@@ -169,11 +187,18 @@ public class JumpTypeAddWindow
                        ErrorWindow.Show(myString);
                } else {
                        string myJump = name;
-                       if(radiobutton_startIn_yes.Active) {
-                               myJump = myJump + ":1"; 
+                       if(radiobutton_simple.Active) {
+                               if(radiobutton_simple_startIn_yes.Active)
+                                       myJump = myJump + ":1";
+                               else
+                                       myJump = myJump + ":0";
                        } else {
-                               myJump = myJump + ":0"; 
+                               if(radiobutton_multiple_startIn_yes.Active)
+                                       myJump = myJump + ":1";
+                               else
+                                       myJump = myJump + ":0";
                        }
+
                        if(radiobutton_extra_weight_yes.Active) {
                                myJump = myJump + ":1"; 
                        } else {
@@ -255,14 +280,14 @@ public class JumpTypeAddWindow
                }
        }
 
-       private void on_radiobutton_startIn_yes_toggled (object o, EventArgs args)
+       private void on_radiobutton_simple_startIn_yes_toggled (object o, EventArgs args)
        {
-               if(radiobutton_startIn_yes.Active)
+               if(radiobutton_simple_startIn_yes.Active)
                        label_drop_jump.Sensitive = false;
        }
-       private void on_radiobutton_startIn_no_toggled (object o, EventArgs args)
+       private void on_radiobutton_simple_startIn_no_toggled (object o, EventArgs args)
        {
-               if(radiobutton_startIn_no.Active)
+               if(radiobutton_simple_startIn_no.Active)
                        label_drop_jump.Sensitive = true;
        }
 


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