[chronojump] 689655 - Add single-leg jumps (90% done)



commit 3407819cb0a36ee65edfc6154954a73f04c35a37
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Dec 6 22:20:47 2012 +0100

    689655 - Add single-leg jumps (90% done)

 glade/chronojump.glade   |  663 ++++++++++++++++++++++++++--------------------
 src/gui/chronojump.cs    |   28 ++-
 src/gui/event.cs         |    2 +-
 src/gui/genericWindow.cs |    2 +
 src/gui/jump.cs          |  143 ++++++++--
 src/sqlite/jump.cs       |   10 +
 6 files changed, 532 insertions(+), 316 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index a6b3a3c..e80249d 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -1335,7 +1335,7 @@ Chronopic</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">False</property>
                                                             <property name="has_tooltip">True</property>
-                                                            <property name="tooltip" translatable="yes">CounterMovement Jump</property>
+                                                            <property name="tooltip" translatable="yes">Single-leg CounterMovement Jump</property>
                                                             <property name="use_action_appearance">False</property>
                                                             <property name="relief">none</property>
                                                             <property name="draw_indicator">False</property>
@@ -3612,8 +3612,8 @@ weight</property>
                                                             <property name="label" translatable="yes">Type</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
                                                             <property name="position">0</property>
                                                             </packing>
                                                             </child>
@@ -3687,8 +3687,8 @@ weight</property>
                                                             </child>
                                                             </widget>
                                                             <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
                                                             <property name="position">0</property>
                                                             </packing>
                                                             </child>
@@ -3762,8 +3762,8 @@ weight</property>
                                                             </child>
                                                             </widget>
                                                             <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
@@ -3779,8 +3779,8 @@ weight</property>
                                                             <property name="label" translatable="yes">Dominance</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
                                                             <property name="position">0</property>
                                                             </packing>
                                                             </child>
@@ -3827,7 +3827,7 @@ weight</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkRadioButton" id="extra_window_jumps_radiobutton_single_leg_dominancie_unknown">
+                                                            <widget class="GtkRadioButton" id="extra_window_jumps_radiobutton_single_leg_dominance_unknown">
                                                             <property name="label" translatable="yes">Unknown</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
@@ -3854,8 +3854,8 @@ weight</property>
                                                             </child>
                                                             </widget>
                                                             <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
                                                             <property name="position">2</property>
                                                             </packing>
                                                             </child>
@@ -3871,8 +3871,8 @@ weight</property>
                                                             <property name="label" translatable="yes">Fall</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
                                                             <property name="position">0</property>
                                                             </packing>
                                                             </child>
@@ -3946,15 +3946,15 @@ weight</property>
                                                             </child>
                                                             </widget>
                                                             <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
                                                             <property name="position">3</property>
                                                             </packing>
                                                             </child>
                                                             </widget>
                                                             <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
                                                             <property name="position">3</property>
                                                             </packing>
                                                             </child>
@@ -18133,160 +18133,178 @@ comments</property>
           </packing>
         </child>
         <child>
-          <widget class="GtkVBox" id="jumps_single_leg">
+          <widget class="GtkFrame" id="frame1">
+            <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="spacing">4</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">out</property>
             <child>
-              <widget class="GtkVBox" id="vbox82">
-                <property name="visible">True</property>
+              <widget class="GtkVBox" id="jumps_single_leg">
                 <property name="can_focus">False</property>
+                <property name="spacing">6</property>
                 <child>
-                  <widget class="GtkLabel" id="label101">
-                    <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="expand">True</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkAlignment" id="alignment26">
+                  <widget class="GtkVBox" id="vbox82">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="left_padding">12</property>
                     <child>
-                      <widget class="GtkHBox" id="hbox97">
+                      <widget class="GtkLabel" id="label101">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="spacing">6</property>
-                        <child>
-                          <widget class="GtkRadioButton" id="jumps_radiobutton_single_leg_mode_vertical">
-                            <property name="label" translatable="yes">Vertical</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="use_action_appearance">False</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="jumps_radiobutton_single_leg_mode_horizontal">
-                            <property name="label" translatable="yes">Horizontal</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="use_action_appearance">False</property>
-                            <property name="draw_indicator">True</property>
-                            <property name="group">jumps_radiobutton_single_leg_mode_vertical</property>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Type</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkAlignment" id="alignment26">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="left_padding">12</property>
                         <child>
-                          <widget class="GtkRadioButton" id="jumps_radiobutton_single_leg_mode_lateral">
-                            <property name="label" translatable="yes">Lateral</property>
+                          <widget class="GtkHBox" id="hbox97">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="use_action_appearance">False</property>
-                            <property name="draw_indicator">True</property>
-                            <property name="group">jumps_radiobutton_single_leg_mode_vertical</property>
+                            <property name="can_focus">False</property>
+                            <property name="spacing">6</property>
+                            <child>
+                              <widget class="GtkRadioButton" id="jumps_radiobutton_single_leg_mode_vertical">
+                                <property name="label" translatable="yes">Vertical</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="active">True</property>
+                                <property name="draw_indicator">True</property>
+                                <signal name="toggled" handler="on_radio_single_leg_1_toggled" swapped="no"/>
+                              </widget>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <widget class="GtkRadioButton" id="jumps_radiobutton_single_leg_mode_horizontal">
+                                <property name="label" translatable="yes">Horizontal</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="draw_indicator">True</property>
+                                <property name="group">jumps_radiobutton_single_leg_mode_vertical</property>
+                                <signal name="toggled" handler="on_radio_single_leg_1_toggled" swapped="no"/>
+                              </widget>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <widget class="GtkRadioButton" id="jumps_radiobutton_single_leg_mode_lateral">
+                                <property name="label" translatable="yes">Lateral</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="draw_indicator">True</property>
+                                <property name="group">jumps_radiobutton_single_leg_mode_vertical</property>
+                                <signal name="toggled" handler="on_radio_single_leg_1_toggled" swapped="no"/>
+                              </widget>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
                           </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">2</property>
-                          </packing>
                         </child>
                       </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
                     </child>
                   </widget>
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">False</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-              </widget>
-              <packing>
-                <property name="expand">True</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkVBox" id="vbox73">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <child>
-                  <widget class="GtkLabel" id="label99">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">Limb</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkAlignment" id="alignment25">
+                  <widget class="GtkVBox" id="vbox73">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="left_padding">12</property>
                     <child>
-                      <widget class="GtkHBox" id="hbox98">
+                      <widget class="GtkLabel" id="label99">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="spacing">6</property>
-                        <child>
-                          <widget class="GtkRadioButton" id="jumps_radiobutton_single_leg_right">
-                            <property name="label" translatable="yes">Right</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="use_action_appearance">False</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>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Limb</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkAlignment" id="alignment25">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="left_padding">12</property>
                         <child>
-                          <widget class="GtkRadioButton" id="jumps_radiobutton_single_leg_left">
-                            <property name="label" translatable="yes">Left</property>
+                          <widget class="GtkHBox" id="hbox98">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="use_action_appearance">False</property>
-                            <property name="draw_indicator">True</property>
-                            <property name="group">jumps_radiobutton_single_leg_right</property>
+                            <property name="can_focus">False</property>
+                            <property name="spacing">6</property>
+                            <child>
+                              <widget class="GtkRadioButton" id="jumps_radiobutton_single_leg_right">
+                                <property name="label" translatable="yes">Right</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="active">True</property>
+                                <property name="draw_indicator">True</property>
+                                <signal name="toggled" handler="on_radio_single_leg_2_toggled" swapped="no"/>
+                              </widget>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <widget class="GtkRadioButton" id="jumps_radiobutton_single_leg_left">
+                                <property name="label" translatable="yes">Left</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="draw_indicator">True</property>
+                                <property name="group">jumps_radiobutton_single_leg_right</property>
+                                <signal name="toggled" handler="on_radio_single_leg_2_toggled" swapped="no"/>
+                              </widget>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
                           </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">1</property>
-                          </packing>
                         </child>
                       </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
                     </child>
                   </widget>
                   <packing>
@@ -18295,195 +18313,266 @@ comments</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
-              </widget>
-              <packing>
-                <property name="expand">True</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkVBox" id="vbox81">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <child>
-                  <widget class="GtkLabel" id="label100">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">Dominance</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
                 <child>
-                  <widget class="GtkAlignment" id="alignment23">
+                  <widget class="GtkVBox" id="vbox81">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="left_padding">12</property>
                     <child>
-                      <widget class="GtkHBox" id="hbox99">
+                      <widget class="GtkLabel" id="label100">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="spacing">6</property>
-                        <child>
-                          <widget class="GtkRadioButton" id="jumps_radiobutton_single_leg_dominance_this_limb">
-                            <property name="label" translatable="yes">This limb</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="use_action_appearance">False</property>
-                            <property name="xalign">0</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="jumps_radiobutton_single_leg_dominance_opposite">
-                            <property name="label" translatable="yes">Opposite</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="use_action_appearance">False</property>
-                            <property name="draw_indicator">True</property>
-                            <property name="group">jumps_radiobutton_single_leg_dominance_this_limb</property>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Dominance</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkAlignment" id="alignment23">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="left_padding">12</property>
                         <child>
-                          <widget class="GtkRadioButton" id="jumps_radiobutton_single_leg_dominancie_unknown">
-                            <property name="label" translatable="yes">Unknown</property>
+                          <widget class="GtkHBox" id="hbox99">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="use_action_appearance">False</property>
-                            <property name="draw_indicator">True</property>
-                            <property name="group">jumps_radiobutton_single_leg_dominance_this_limb</property>
+                            <property name="can_focus">False</property>
+                            <property name="spacing">6</property>
+                            <child>
+                              <widget class="GtkRadioButton" id="jumps_radiobutton_single_leg_dominance_this_limb">
+                                <property name="label" translatable="yes">This limb</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="xalign">0</property>
+                                <property name="active">True</property>
+                                <property name="draw_indicator">True</property>
+                                <signal name="toggled" handler="on_radio_single_leg_3_toggled" swapped="no"/>
+                              </widget>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <widget class="GtkRadioButton" id="jumps_radiobutton_single_leg_dominance_opposite">
+                                <property name="label" translatable="yes">Opposite</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="draw_indicator">True</property>
+                                <property name="group">jumps_radiobutton_single_leg_dominance_this_limb</property>
+                                <signal name="toggled" handler="on_radio_single_leg_3_toggled" swapped="no"/>
+                              </widget>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <widget class="GtkRadioButton" id="jumps_radiobutton_single_leg_dominance_unknown">
+                                <property name="label" translatable="yes">Unknown</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="draw_indicator">True</property>
+                                <property name="group">jumps_radiobutton_single_leg_dominance_this_limb</property>
+                                <signal name="toggled" handler="on_radio_single_leg_3_toggled" swapped="no"/>
+                              </widget>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
                           </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">2</property>
-                          </packing>
                         </child>
                       </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
                     </child>
                   </widget>
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">False</property>
-                    <property name="position">1</property>
+                    <property name="position">2</property>
                   </packing>
                 </child>
-              </widget>
-              <packing>
-                <property name="expand">True</property>
-                <property name="fill">True</property>
-                <property name="position">2</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkVBox" id="vbox83">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
                 <child>
-                  <widget class="GtkLabel" id="label102">
+                  <widget class="GtkVBox" id="vbox83">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">Fall</property>
+                    <child>
+                      <widget class="GtkLabel" id="label102">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Fall</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkAlignment" id="alignment27">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <widget class="GtkHBox" id="hbox100">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="spacing">6</property>
+                            <child>
+                              <widget class="GtkRadioButton" id="jumps_radiobutton_single_leg_fall_this_limb">
+                                <property name="label" translatable="yes">This limb</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="xalign">0</property>
+                                <property name="active">True</property>
+                                <property name="draw_indicator">True</property>
+                                <signal name="toggled" handler="on_radio_single_leg_4_toggled" swapped="no"/>
+                              </widget>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <widget class="GtkRadioButton" id="jumps_radiobutton_single_leg_fall_opposite">
+                                <property name="label" translatable="yes">Opposite</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="draw_indicator">True</property>
+                                <property name="group">jumps_radiobutton_single_leg_fall_this_limb</property>
+                                <signal name="toggled" handler="on_radio_single_leg_4_toggled" swapped="no"/>
+                              </widget>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <widget class="GtkRadioButton" id="jumps_radiobutton_single_leg_fall_both">
+                                <property name="label" translatable="yes">Both</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="draw_indicator">True</property>
+                                <property name="group">jumps_radiobutton_single_leg_fall_this_limb</property>
+                                <signal name="toggled" handler="on_radio_single_leg_4_toggled" swapped="no"/>
+                              </widget>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
+                          </widget>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
                   </widget>
                   <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">3</property>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkAlignment" id="alignment27">
+                  <widget class="GtkHBox" id="hbox3">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="left_padding">12</property>
+                    <property name="spacing">8</property>
                     <child>
-                      <widget class="GtkHBox" id="hbox100">
+                      <widget class="GtkLabel" id="label2">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="spacing">6</property>
-                        <child>
-                          <widget class="GtkRadioButton" id="jumps_radiobutton_single_leg_fall_this_limb">
-                            <property name="label" translatable="yes">This limb</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="use_action_appearance">False</property>
-                            <property name="xalign">0</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="jumps_radiobutton_single_leg_fall_opposite">
-                            <property name="label" translatable="yes">Opposite</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="use_action_appearance">False</property>
-                            <property name="draw_indicator">True</property>
-                            <property name="group">jumps_radiobutton_single_leg_fall_this_limb</property>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <widget class="GtkRadioButton" id="jumps_radiobutton_single_leg_fall_both">
-                            <property name="label" translatable="yes">Both</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="use_action_appearance">False</property>
-                            <property name="draw_indicator">True</property>
-                            <property name="group">jumps_radiobutton_single_leg_fall_this_limb</property>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">2</property>
-                          </packing>
-                        </child>
+                        <property name="label" translatable="yes">Distance</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkSpinButton" id="jumps_spinbutton_single_leg_distance">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="invisible_char">â</property>
+                        <property name="invisible_char_set">True</property>
+                        <property name="primary_icon_activatable">False</property>
+                        <property name="secondary_icon_activatable">False</property>
+                        <property name="primary_icon_sensitive">True</property>
+                        <property name="secondary_icon_sensitive">True</property>
+                        <property name="adjustment">0 0 200 1 1 0</property>
+                        <property name="climb_rate">1</property>
+                        <property name="snap_to_ticks">True</property>
+                        <property name="numeric">True</property>
+                        <property name="update_policy">if-valid</property>
+                        <signal name="value_changed" handler="on_spin_single_leg_changed" swapped="no"/>
                       </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label3">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">cm</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">2</property>
+                      </packing>
                     </child>
                   </widget>
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">False</property>
-                    <property name="position">1</property>
+                    <property name="position">4</property>
                   </packing>
                 </child>
               </widget>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">&lt;b&gt;slCMJ&lt;/b&gt;</property>
+                <property name="use_markup">True</property>
+              </widget>
               <packing>
-                <property name="expand">True</property>
-                <property name="fill">True</property>
-                <property name="position">3</property>
+                <property name="type">label_item</property>
               </packing>
             </child>
           </widget>
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 14cb84c..eba4934 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -3117,16 +3117,40 @@ Console.WriteLine("X");
 		currentEventExecute.FakeButtonUpdateGraph.Clicked += 
 			new EventHandler(on_event_execute_update_graph_in_progress_clicked);
 		currentEventExecute.FakeButtonEventEnded.Clicked += new EventHandler(on_event_execute_EventEnded);
-		currentEventExecute.FakeButtonFinished.Clicked += new EventHandler(on_jump_finished);
-	}	
 
+		//if jump is slCMJ and is not vertical, user has to input the length of jumpin cm
+		if(currentJumpType.Name == "slCMJ" && ! extra_window_jumps_radiobutton_single_leg_mode_vertical.Active)
+			currentEventExecute.FakeButtonFinished.Clicked += new EventHandler(on_jump_finished_ask_data);
+		else
+			currentEventExecute.FakeButtonFinished.Clicked += new EventHandler(on_jump_finished);
+	}	
 	
+	private void on_jump_finished_ask_data (object o, EventArgs args)
+	{
+		genericWin = GenericWindow.Show(Catalog.GetString("Input length oj jump in centimeters")
+				, Constants.GenericWindowShow.SPININT);
+
+		genericWin.LabelSpinInt = "";
+		genericWin.SetSpinRange(1.0, 200.0);
+		genericWin.Button_accept.Clicked += new EventHandler(on_jump_finished);
+	}
+
 	private void on_jump_finished (object o, EventArgs args)
 	{
+		//genericWin.Button_accept.Clicked -= new EventHandler(on_jump_finished);
 		currentEventExecute.FakeButtonFinished.Clicked -= new EventHandler(on_jump_finished);
 		
 		if ( ! currentEventExecute.Cancel ) {
 			currentJump = (Jump) currentEventExecute.EventDone;
+		
+			if(currentJumpType.Name == "slCMJ") {
+				if(extra_window_jumps_radiobutton_single_leg_mode_vertical.Active)
+					currentJump.Description += " 0";
+				else
+					currentJump.Description += " " + genericWin.SpinIntSelected.ToString();
+				SqliteJump.UpdateDescription(Constants.JumpTable, 
+						currentJump.UniqueID, currentJump.Description);
+			}
 
 			//move video file if exists
 			Util.MoveTempVideo(currentSession.UniqueID, Constants.TestTypes.JUMP, currentJump.UniqueID);
diff --git a/src/gui/event.cs b/src/gui/event.cs
index 22fc73c..389d621 100644
--- a/src/gui/event.cs
+++ b/src/gui/event.cs
@@ -515,7 +515,7 @@ public class EditEventWindow
 	protected virtual void on_radio_mtgug_4_toggled(object o, EventArgs args) { }
 	protected virtual void on_radio_mtgug_5_toggled(object o, EventArgs args) { }
 	protected virtual void on_radio_mtgug_6_toggled(object o, EventArgs args) { }
-
+	
 	protected virtual void on_button_cancel_clicked (object o, EventArgs args)
 	{
 		EditEventWindowBox.edit_event.Hide();
diff --git a/src/gui/genericWindow.cs b/src/gui/genericWindow.cs
index a387a45..e40dd50 100644
--- a/src/gui/genericWindow.cs
+++ b/src/gui/genericWindow.cs
@@ -143,6 +143,7 @@ public class GenericWindow
 		hbox_spin_int.Hide();
 		spin_double.Hide();
 		hbox_height_metric.Hide();
+		hbox_all_none_selected.Hide();
 		hbox_combo_all_none_selected.Hide();
 		scrolled_window_textview.Hide();
 		scrolled_window_treeview.Hide();
@@ -184,6 +185,7 @@ public class GenericWindow
 			combo_all_none_selected.Active = 
 				UtilGtk.ComboMakeActive(comboAllNoneSelectedOptions, Catalog.GetString("Selected"));
 			hbox_combo_all_none_selected.Show();
+			hbox_all_none_selected.Show();
 		}
 		else if(stuff == Constants.GenericWindowShow.TEXTVIEW) {
 			scrolled_window_textview.Show();
diff --git a/src/gui/jump.cs b/src/gui/jump.cs
index 6272773..66b2482 100644
--- a/src/gui/jump.cs
+++ b/src/gui/jump.cs
@@ -46,6 +46,7 @@ public class EditJumpWindow : EditEventWindow
 	[Widget] private Gtk.RadioButton jumps_radiobutton_single_leg_fall_this_limb;
 	[Widget] private Gtk.RadioButton jumps_radiobutton_single_leg_fall_opposite;
 	[Widget] private Gtk.RadioButton jumps_radiobutton_single_leg_fall_both;
+	[Widget] private Gtk.SpinButton jumps_spinbutton_single_leg_distance;
 
 	static EditJumpWindow EditJumpWindowBox;
 	protected double personWeight;
@@ -88,7 +89,8 @@ public class EditJumpWindow : EditEventWindow
 
 		EditJumpWindowBox.fillDialog (myEvent);
 		
-		EditJumpWindowBox.fillSpecialData (myEvent);
+		if(myEvent.Type == "slCMJ")
+			EditJumpWindowBox.fillSingleLeg (myEvent.Description);
 		
 		EditJumpWindowBox.edit_event.Show ();
 
@@ -192,38 +194,125 @@ public class EditJumpWindow : EditEventWindow
 			entry_angle_value.Text = entryAngle;
 		}
 	}
+	
+	//this disallows loops on radio actions	
+	private bool toggleRaisesSignal = true;
 
-	private void fillSpecialData(Event myEvent) {
-		Jump myJump = (Jump) myEvent;
-		//singleLeg
-		if(myJump.Type == "slCMJ") {
-			jumps_single_leg.Show();
-			entry_description.Sensitive = false;
+	private void fillSingleLeg(string description) {
+		jumps_single_leg.Show();
+		entry_description.Sensitive = false;
+
+		string [] d = description.Split(new char[] {' '});
 
-			string [] d = myJump.Description.Split(new char[] {' '});
+		toggleRaisesSignal = false;
 		
-			switch(d[0]) {
-				case "Vertical": jumps_radiobutton_single_leg_mode_vertical.Active = true; break;
-				case "Horizontal": jumps_radiobutton_single_leg_mode_horizontal.Active = true; break;
-				case "Lateral": jumps_radiobutton_single_leg_mode_lateral.Active = true; break;
-			}
-			switch(d[1]) {
-				case "Right": jumps_radiobutton_single_leg_right.Active = true; break;
-				case "Left": jumps_radiobutton_single_leg_left.Active = true; break;
-			}
-			switch(d[2]) {
-				case "This": jumps_radiobutton_single_leg_dominance_this_limb.Active = true; break;
-				case "Opposite": jumps_radiobutton_single_leg_dominance_opposite.Active = true; break;
-				case "Unknown": jumps_radiobutton_single_leg_dominance_unknown.Active = true; break;
-			}
-			switch(d[3]) {
-				case "This": jumps_radiobutton_single_leg_fall_this_limb.Active = true; break;
-				case "Opposite": jumps_radiobutton_single_leg_fall_opposite.Active = true; break;
-				case "Both": jumps_radiobutton_single_leg_fall_both.Active = true; break;
+		switch(d[0]) {
+			case "Vertical": 
+					jumps_radiobutton_single_leg_mode_vertical.Active = true; 
+					jumps_spinbutton_single_leg_distance.Sensitive = false;
+					jumps_spinbutton_single_leg_distance.Value = 0;
+					break;
+			case "Horizontal": 
+					jumps_radiobutton_single_leg_mode_horizontal.Active = true; 
+					jumps_spinbutton_single_leg_distance.Sensitive = true;
+					jumps_spinbutton_single_leg_distance.Value = Convert.ToInt32(d[4]);
+					break;
+			case "Lateral": 
+					jumps_radiobutton_single_leg_mode_lateral.Active = true; 
+					jumps_spinbutton_single_leg_distance.Sensitive = true;
+					jumps_spinbutton_single_leg_distance.Value = Convert.ToInt32(d[4]);
+					break;
+		}
+		switch(d[1]) {
+			case "Right": jumps_radiobutton_single_leg_right.Active = true; break;
+			case "Left": jumps_radiobutton_single_leg_left.Active = true; break;
+		}
+		switch(d[2]) {
+			case "This": jumps_radiobutton_single_leg_dominance_this_limb.Active = true; break;
+			case "Opposite": jumps_radiobutton_single_leg_dominance_opposite.Active = true; break;
+			case "Unknown": jumps_radiobutton_single_leg_dominance_unknown.Active = true; break;
+		}
+		switch(d[3]) {
+			case "This": jumps_radiobutton_single_leg_fall_this_limb.Active = true; break;
+			case "Opposite": jumps_radiobutton_single_leg_fall_opposite.Active = true; break;
+			case "Both": jumps_radiobutton_single_leg_fall_both.Active = true; break;
+		}
+			
+		toggleRaisesSignal = true;
+	}
+	
+	private void on_radio_single_leg_1_toggled(object o, EventArgs args) {
+		if(toggleRaisesSignal) {
+			string [] d = entry_description.Text.Split(new char[] {' '});
+			if(jumps_radiobutton_single_leg_mode_vertical.Active) {
+				d[0] = "Vertical";	
+				d[4] = "0";	
 			}
+			else if(jumps_radiobutton_single_leg_mode_horizontal.Active)
+				d[0] = "Horizontal";
+			else
+				d[0] = "Lateral";
+			
+			entry_description.Text = d[0] + " " + d[1] + " " + d[2] + " " + d[3] + " " + d[4];
+			fillSingleLeg(entry_description.Text);
 		}
 	}
 
+	private void on_radio_single_leg_2_toggled(object o, EventArgs args) {
+		if(toggleRaisesSignal) {
+			string [] d = entry_description.Text.Split(new char[] {' '});
+			if(jumps_radiobutton_single_leg_right.Active)
+				d[1] = "Right";	
+			else
+				d[1] = "Left";
+
+			entry_description.Text = d[0] + " " + d[1] + " " + d[2] + " " + d[3] + " " + d[4];
+			fillSingleLeg(entry_description.Text);
+		}
+	}
+
+	private void on_radio_single_leg_3_toggled(object o, EventArgs args) {
+		if(toggleRaisesSignal) {
+			string [] d = entry_description.Text.Split(new char[] {' '});
+			if(jumps_radiobutton_single_leg_dominance_this_limb.Active)
+				d[2] = "This";	
+			else if(jumps_radiobutton_single_leg_dominance_opposite.Active)
+				d[2] = "Opposite";
+			else
+				d[2] = "Unknown";
+
+			entry_description.Text = d[0] + " " + d[1] + " " + d[2] + " " + d[3] + " " + d[4];
+			fillSingleLeg(entry_description.Text);
+		}
+	}
+
+	private void on_radio_single_leg_4_toggled(object o, EventArgs args) {
+		if(toggleRaisesSignal) {
+			string [] d = entry_description.Text.Split(new char[] {' '});
+			if(jumps_radiobutton_single_leg_fall_this_limb.Active)
+				d[3] = "This";	
+			else if(jumps_radiobutton_single_leg_fall_opposite.Active)
+				d[3] = "Opposite";
+			else
+				d[3] = "Both";
+
+			entry_description.Text = d[0] + " " + d[1] + " " + d[2] + " " + d[3] + " " + d[4];
+			fillSingleLeg(entry_description.Text);
+		}
+	}
+
+	private void on_spin_single_leg_changed(object o, EventArgs args) {
+		if(toggleRaisesSignal) {
+			string [] d = entry_description.Text.Split(new char[] {' '});
+
+			d[4] = jumps_spinbutton_single_leg_distance.Value.ToString();
+
+			entry_description.Text = d[0] + " " + d[1] + " " + d[2] + " " + d[3] + " " + d[4];
+			fillSingleLeg(entry_description.Text);
+		}
+	}
+
+
 	
 	protected override void createSignal() {
 		//only for jumps & runs
@@ -256,6 +345,8 @@ public class EditJumpWindow : EditEventWindow
 			entry_weight_value.Text = "0";
 			entry_weight_value.Sensitive = false;
 		}
+		
+		jumps_single_leg.Visible = myJumpType.Name == "slCMJ";
 	}
 
 
diff --git a/src/sqlite/jump.cs b/src/sqlite/jump.cs
index 6d443a9..7ebd7a4 100644
--- a/src/sqlite/jump.cs
+++ b/src/sqlite/jump.cs
@@ -225,6 +225,16 @@ class SqliteJump : Sqlite
 		dbcon.Close();
 	}
 
+	public static void UpdateDescription(string tableName, int uniqueID, string description)
+	{
+		dbcon.Open();
+		dbcmd.CommandText = "UPDATE " + tableName + " SET description = '" + description + 
+			"' WHERE uniqueID == " + uniqueID ;
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		dbcmd.ExecuteNonQuery();
+		dbcon.Close();
+	}
+
 	//onle for change SJ+ CMJ+ and ABK+ to SJl...
 	public static void ChangeWeightToL()
 	{



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