[chronojump] DB 1.14 slCMJ -> slCMJleft, slCMJright



commit c82106a71a773a35d8307512dea1ef63a27abeb0
Author: Xavier de Blas <xaviblas gmail com>
Date:   Sat Oct 18 18:28:28 2014 -0300

    DB 1.14 slCMJ -> slCMJleft, slCMJright

 glade/chronojump.glade   |  228 ++++++++++++++--------------------------------
 src/gui/chronojump.cs    |    4 +-
 src/gui/jump.cs          |   89 ++++++------------
 src/jumpType.cs          |    8 +-
 src/sqlite/jumpType.cs   |    3 +-
 src/sqlite/main.cs       |   14 +++-
 src/sqlite/oldConvert.cs |   28 ++++++
 7 files changed, 145 insertions(+), 229 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 6314324..ce2cacb 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -3542,79 +3542,6 @@ weight</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">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="left_padding">12</property>
-                                                            <child>
-                                                            <widget class="GtkHBox" id="hbox98">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">6</property>
-                                                            <child>
-                                                            <widget class="GtkRadioButton" 
id="extra_window_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="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="extra_window_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="draw_indicator">True</property>
-                                                            <property 
name="group">extra_window_jumps_radiobutton_single_leg_right</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="position">1</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">False</property>
-                                                            <property name="fill">False</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>
@@ -3700,7 +3627,7 @@ weight</property>
                                                             <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
-                                                            <property name="position">2</property>
+                                                            <property name="position">1</property>
                                                             </packing>
                                                             </child>
                                                             <child>
@@ -3789,7 +3716,7 @@ weight</property>
                                                             <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
-                                                            <property name="position">3</property>
+                                                            <property name="position">2</property>
                                                             </packing>
                                                             </child>
                                                             </widget>
@@ -6318,6 +6245,9 @@ Second Chronopic to platforms.</property>
                                                         <child>
                                                           <placeholder/>
                                                         </child>
+                                                        <child>
+                                                          <placeholder/>
+                                                        </child>
                                                       </widget>
                                                       <packing>
                                                         <property name="expand">True</property>
@@ -7015,6 +6945,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             </child>
                                                             <child>
@@ -7846,6 +7779,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">2</property>
@@ -8436,6 +8372,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">4</property>
@@ -18152,6 +18091,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -18650,6 +18592,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -19640,6 +19585,9 @@ by you</property>
               <placeholder/>
             </child>
             <child>
+              <placeholder/>
+            </child>
+            <child>
               <widget class="GtkButton" id="button_video_url">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
@@ -19687,6 +19635,9 @@ by you</property>
             <child>
               <placeholder/>
             </child>
+            <child>
+              <placeholder/>
+            </child>
           </widget>
           <packing>
             <property name="expand">True</property>
@@ -21223,82 +21174,6 @@ comments</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="xpad">12</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="GtkHBox" id="hbox98">
-                            <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="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="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>
-                        </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>
-                <child>
                   <widget class="GtkVBox" id="vbox81">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
@@ -21335,7 +21210,7 @@ comments</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"/>
+                                <signal name="toggled" handler="on_radio_single_leg_2_toggled" swapped="no"/>
                               </widget>
                               <packing>
                                 <property name="expand">False</property>
@@ -21351,7 +21226,7 @@ comments</property>
                                 <property name="receives_default">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"/>
+                                <signal name="toggled" handler="on_radio_single_leg_2_toggled" swapped="no"/>
                               </widget>
                               <packing>
                                 <property name="expand">False</property>
@@ -21367,7 +21242,7 @@ comments</property>
                                 <property name="receives_default">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"/>
+                                <signal name="toggled" handler="on_radio_single_leg_2_toggled" swapped="no"/>
                               </widget>
                               <packing>
                                 <property name="expand">False</property>
@@ -21388,7 +21263,7 @@ comments</property>
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">False</property>
-                    <property name="position">2</property>
+                    <property name="position">1</property>
                   </packing>
                 </child>
                 <child>
@@ -21428,7 +21303,7 @@ comments</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"/>
+                                <signal name="toggled" handler="on_radio_single_leg_3_toggled" swapped="no"/>
                               </widget>
                               <packing>
                                 <property name="expand">False</property>
@@ -21444,7 +21319,7 @@ comments</property>
                                 <property name="receives_default">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"/>
+                                <signal name="toggled" handler="on_radio_single_leg_3_toggled" swapped="no"/>
                               </widget>
                               <packing>
                                 <property name="expand">False</property>
@@ -21460,7 +21335,7 @@ comments</property>
                                 <property name="receives_default">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"/>
+                                <signal name="toggled" handler="on_radio_single_leg_3_toggled" swapped="no"/>
                               </widget>
                               <packing>
                                 <property name="expand">False</property>
@@ -21481,7 +21356,7 @@ comments</property>
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">False</property>
-                    <property name="position">3</property>
+                    <property name="position">2</property>
                   </packing>
                 </child>
                 <child>
@@ -21612,7 +21487,7 @@ comments</property>
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">False</property>
-                    <property name="position">4</property>
+                    <property name="position">3</property>
                   </packing>
                 </child>
               </widget>
@@ -28416,6 +28291,24 @@ options</property>
                             <child>
                               <placeholder/>
                             </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
                           </widget>
                         </child>
                       </widget>
@@ -30304,6 +30197,9 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
                                 <child>
                                   <placeholder/>
                                 </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
                               </widget>
                             </child>
                           </widget>
@@ -30861,6 +30757,9 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -33391,6 +33290,9 @@ show elevation as:</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                       <packing>
                         <property name="left_attach">2</property>
@@ -33553,6 +33455,9 @@ show elevation as:</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -33730,6 +33635,9 @@ show elevation as:</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 8b33d42..f08b123 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -3447,7 +3447,7 @@ Console.WriteLine("X");
                }
 
                string description = "";
-               if(currentJumpType.Name == "slCMJ") {
+               if(currentJumpType.Name == "slCMJleft" || currentJumpType.Name == "slCMJright") {
                        description = slCMJString(); 
 
                        frame_extra_window_jumps_single_leg_input.Sensitive = false;
@@ -3532,7 +3532,7 @@ Log.WriteLine("DDD 1");
                if ( ! currentEventExecute.Cancel ) {
                        currentJump = (Jump) currentEventExecute.EventDone;
                
-                       if(currentJumpType.Name == "slCMJ") {
+                       if(currentJumpType.Name == "slCMJleft" || currentJumpType.Name == "slCMJright") {
                                if(extra_window_jumps_radiobutton_single_leg_mode_vertical.Active)
                                        currentJump.Description += " 0 90";
                                else {
diff --git a/src/gui/jump.cs b/src/gui/jump.cs
index 7418a78..7caccc9 100644
--- a/src/gui/jump.cs
+++ b/src/gui/jump.cs
@@ -38,8 +38,6 @@ public class EditJumpWindow : EditEventWindow
        [Widget] private Gtk.RadioButton jumps_radiobutton_single_leg_mode_vertical;
        [Widget] private Gtk.RadioButton jumps_radiobutton_single_leg_mode_horizontal;
        [Widget] private Gtk.RadioButton jumps_radiobutton_single_leg_mode_lateral;
-       [Widget] private Gtk.RadioButton jumps_radiobutton_single_leg_right;
-       [Widget] private Gtk.RadioButton jumps_radiobutton_single_leg_left;
        [Widget] private Gtk.RadioButton jumps_radiobutton_single_leg_dominance_this_limb;
        [Widget] private Gtk.RadioButton jumps_radiobutton_single_leg_dominance_opposite;
        [Widget] private Gtk.RadioButton jumps_radiobutton_single_leg_dominance_unknown;
@@ -90,7 +88,7 @@ public class EditJumpWindow : EditEventWindow
 
                EditJumpWindowBox.fillDialog (myEvent);
                
-               if(myEvent.Type == "slCMJ")
+               if(myEvent.Type == "slCMJleft" || myEvent.Type == "slCMJright")
                        EditJumpWindowBox.fillSingleLeg (myEvent.Description);
                
                EditJumpWindowBox.edit_event.Show ();
@@ -201,23 +199,21 @@ public class EditJumpWindow : EditEventWindow
 
        private bool slCMJDescriptionIsValid(string description) {
                string [] d = description.Split(new char[] {' '});
-               if(d.Length != 6)
+               if(d.Length != 5)
                        return false;
                if(! Util.IsNumber(d[4], false))
                        return false;
                if(d[0] != "Vertical" && d[0] != "Horizontal" && d[0] != "Lateral")
                        return false;
-               if(d[1] != "Right" && d[1] != "Left")
+               if(d[1] != "This" && d[1] != "Opposite" && d[1] != "Unknown")
                        return false;
-               if(d[2] != "This" && d[2] != "Opposite" && d[2] != "Unknown")
-                       return false;
-               if(d[3] != "This" && d[3] != "Opposite" && d[3] != "Both")
+               if(d[2] != "This" && d[2] != "Opposite" && d[2] != "Both")
                        return false;
 
                return true;
        }
        private string slCMJDescriptionDefault() {
-               string descDefault = "Vertical Right This This 0 90";
+               string descDefault = "Vertical This This 0 90";
                entry_description.Text = descDefault;
                return descDefault;
        }
@@ -243,26 +239,22 @@ public class EditJumpWindow : EditEventWindow
                        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]);
-                               jumps_spinbutton_single_leg_jump_angle.Value = Convert.ToInt32(d[5]);
+                               jumps_spinbutton_single_leg_distance.Value = Convert.ToInt32(d[3]);
+                               jumps_spinbutton_single_leg_jump_angle.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]);
-                               jumps_spinbutton_single_leg_jump_angle.Value = Convert.ToInt32(d[5]);
+                               jumps_spinbutton_single_leg_distance.Value = Convert.ToInt32(d[3]);
+                               jumps_spinbutton_single_leg_jump_angle.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]) {
+               switch(d[2]) {
                        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;
@@ -280,7 +272,7 @@ public class EditJumpWindow : EditEventWindow
 
                        if(jumps_radiobutton_single_leg_mode_vertical.Active) {
                                d[0] = "Vertical";      
-                               d[4] = "0";     
+                               d[3] = "0";     //distance
                        }
                        else if(jumps_radiobutton_single_leg_mode_horizontal.Active)
                                d[0] = "Horizontal";
@@ -288,7 +280,7 @@ public class EditJumpWindow : EditEventWindow
                                d[0] = "Lateral";
                        
                        entry_description.Text = 
-                               d[0] + " " + d[1] + " " + d[2] + " " + d[3] + " " + d[4] + " " + d[5];
+                               d[0] + " " + d[1] + " " + d[2] + " " + d[3] + " " + d[4];
                        fillSingleLeg(entry_description.Text);
                }
        }
@@ -300,38 +292,20 @@ public class EditJumpWindow : EditEventWindow
                                description = slCMJDescriptionDefault();
                        string [] d = description.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] + " " + d[5];
-                       fillSingleLeg(entry_description.Text);
-               }
-       }
-
-       protected override void on_radio_single_leg_3_toggled(object o, EventArgs args) {
-               if(toggleRaisesSignal) {
-                       string description = entry_description.Text;
-                       if(! slCMJDescriptionIsValid(description))
-                               description = slCMJDescriptionDefault();
-                       string [] d = description.Split(new char[] {' '});
-
                        if(jumps_radiobutton_single_leg_dominance_this_limb.Active)
-                               d[2] = "This";  
+                               d[1] = "This";  
                        else if(jumps_radiobutton_single_leg_dominance_opposite.Active)
-                               d[2] = "Opposite";
+                               d[1] = "Opposite";
                        else
-                               d[2] = "Unknown";
+                               d[1] = "Unknown";
 
                        entry_description.Text = 
-                               d[0] + " " + d[1] + " " + d[2] + " " + d[3] + " " + d[4] + " " + d[5];
+                               d[0] + " " + d[1] + " " + d[2] + " " + d[3] + " " + d[4];
                        fillSingleLeg(entry_description.Text);
                }
        }
 
-       protected override void on_radio_single_leg_4_toggled(object o, EventArgs args) {
+       protected override void on_radio_single_leg_3_toggled(object o, EventArgs args) {
                if(toggleRaisesSignal) {
                        string description = entry_description.Text;
                        if(! slCMJDescriptionIsValid(description))
@@ -339,14 +313,14 @@ public class EditJumpWindow : EditEventWindow
                        string [] d = description.Split(new char[] {' '});
 
                        if(jumps_radiobutton_single_leg_fall_this_limb.Active)
-                               d[3] = "This";  
+                               d[2] = "This";  
                        else if(jumps_radiobutton_single_leg_fall_opposite.Active)
-                               d[3] = "Opposite";
+                               d[2] = "Opposite";
                        else
-                               d[3] = "Both";
+                               d[2] = "Both";
 
                        entry_description.Text = 
-                               d[0] + " " + d[1] + " " + d[2] + " " + d[3] + " " + d[4] + " " + d[5];
+                               d[0] + " " + d[1] + " " + d[2] + " " + d[3] + " " + d[4];
                        fillSingleLeg(entry_description.Text);
                }
        }
@@ -359,14 +333,14 @@ public class EditJumpWindow : EditEventWindow
                        string [] d = description.Split(new char[] {' '});
 
                        int distance = Convert.ToInt32(jumps_spinbutton_single_leg_distance.Value);
-                       d[4] = distance.ToString();
+                       d[3] = distance.ToString();
                        
-                       d[5] = Util.CalculateJumpAngle(
+                       d[4] = Util.CalculateJumpAngle(
                                        Convert.ToDouble(Util.GetHeightInCentimeters(entryTv)), 
                                        distance ).ToString();
 
                        entry_description.Text = 
-                               d[0] + " " + d[1] + " " + d[2] + " " + d[3] + " " + d[4] + " " + d[5];
+                               d[0] + " " + d[1] + " " + d[2] + " " + d[3] + " " + d[4];
                        fillSingleLeg(entry_description.Text);
                }
        }
@@ -405,9 +379,9 @@ public class EditJumpWindow : EditEventWindow
                        entry_weight_value.Sensitive = false;
                }
                
-               frame_jumps_single_leg.Visible = myJumpType.Name == "slCMJ";
-               entry_description.Sensitive = myJumpType.Name != "slCMJ";
-               if(myJumpType.Name == "slCMJ") {
+               frame_jumps_single_leg.Visible = (myJumpType.Name == "slCMJleft" || myJumpType.Name == 
"slCMJright");
+               entry_description.Sensitive = (myJumpType.Name != "slCMJleft" && myJumpType.Name != 
"slCMJright");
+               if(myJumpType.Name == "slCMJleft" || myJumpType.Name == "slCMJright") {
                        fillSingleLeg(entry_description.Text);
                }
        }
@@ -1016,8 +990,6 @@ partial class ChronoJumpWindow
        [Widget] Gtk.RadioButton extra_window_jumps_radiobutton_single_leg_mode_vertical;
        [Widget] Gtk.RadioButton extra_window_jumps_radiobutton_single_leg_mode_horizontal;
        [Widget] Gtk.RadioButton extra_window_jumps_radiobutton_single_leg_mode_lateral;
-       [Widget] Gtk.RadioButton extra_window_jumps_radiobutton_single_leg_right;
-       [Widget] Gtk.RadioButton extra_window_jumps_radiobutton_single_leg_left;
        [Widget] Gtk.RadioButton extra_window_jumps_radiobutton_single_leg_dominance_this_limb;
        [Widget] Gtk.RadioButton extra_window_jumps_radiobutton_single_leg_dominance_opposite;
        [Widget] Gtk.RadioButton extra_window_jumps_radiobutton_single_leg_dominance_unknown;
@@ -1163,8 +1135,8 @@ partial class ChronoJumpWindow
                        extra_window_jumps_radiobutton_weight.Active = true;
                }
 
-               extra_window_showSingleLegStuff(myJumpType.Name == "slCMJ");
-               if(myJumpType.Name == "slCMJ") {
+               extra_window_showSingleLegStuff(myJumpType.Name == "slCMJleft" || myJumpType.Name == 
"slCMJright");
+               if(myJumpType.Name == "slCMJleft" || myJumpType.Name == "slCMJright") {
                        hasOptions = true;
                        frame_extra_window_jumps_single_leg_input.Sensitive = false;
                        extra_window_jumps_spin_single_leg_distance.Value = 0;
@@ -1392,9 +1364,6 @@ partial class ChronoJumpWindow
                else if(extra_window_jumps_radiobutton_single_leg_mode_horizontal.Active) str = "Horizontal";
                else str = "Lateral";
                
-               if(extra_window_jumps_radiobutton_single_leg_right.Active) str += " Right";
-               else str += " Left";
-               
                if(extra_window_jumps_radiobutton_single_leg_dominance_this_limb.Active) str += " This";
                else if(extra_window_jumps_radiobutton_single_leg_dominance_opposite.Active) str += " 
Opposite";
                else str += " Unknown";
diff --git a/src/jumpType.cs b/src/jumpType.cs
index 619539e..d8a50f3 100644
--- a/src/jumpType.cs
+++ b/src/jumpType.cs
@@ -40,7 +40,7 @@ public class JumpType : EventType
        public override bool FindIfIsPredefined() {
                string [] predefinedTests = {
                        "Free", "SJ", "CMJ", "ABK", "Rocket",
-                       "SJl", "CMJl", "slCMJ", "ABKl", "DJa", "DJna",
+                       "SJl", "CMJl", "slCMJleft", "slCMJright", "ABKl", "DJa", "DJna",
                        "RJ(j)", "RJ(t)", "RJ(unlimited)",
                        "RJ(hexagon)", "triple jump"
                };
@@ -64,7 +64,8 @@ public class JumpType : EventType
                imageFileName = "";
                
                //if this changes, sqlite/jumpType.cs initialize tables should change
-               if(name == "Free" || name == "SJ" || name == "CMJ" || name == "slCMJ" || 
+               if(name == "Free" || name == "SJ" || name == "CMJ" || 
+                               name == "slCMJleft" || name == "slCMJright" || 
                                name == "ABK" || name == "Rocket") {
                        startIn         = true;
                        hasWeight       = false;
@@ -91,8 +92,7 @@ public class JumpType : EventType
                                        "Hands are on the hips";
 
                        } 
-                       else if (name == "slCMJ") {
-                               //imageFileName = "jump_cmj.png";
+                       else if (name == "slCMJleft" || name == "slCMJright") {
                                description     = Catalog.GetString("Single-leg CounterMovement Jump");
                                longDescription = "";
                        } 
diff --git a/src/sqlite/jumpType.cs b/src/sqlite/jumpType.cs
index 49d9dde..4617bb3 100644
--- a/src/sqlite/jumpType.cs
+++ b/src/sqlite/jumpType.cs
@@ -55,7 +55,8 @@ class SqliteJumpType : Sqlite
                        "SJl:1:1:SJ jump with weight", 
                        "CMJ:1:0:CMJ jump", 
                        "CMJl:1:1:CMJ jump with weight", 
-                       "slCMJ:1:0:Single-leg CMJ jump",
+                       "slCMJleft:1:0:Single-leg CMJ jump",
+                       "slCMJright:1:0:Single-leg CMJ jump",
                        "ABK:1:0:ABK jump", 
                        "ABKl:1:1:ABK jump with weight", 
                        "Max:1:0:;Maximum jump", 
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index 7440012..6f645cb 100644
--- a/src/sqlite/main.cs
+++ b/src/sqlite/main.cs
@@ -74,7 +74,7 @@ class Sqlite
         * Important, change this if there's any update to database
         * Important2: if database version get numbers higher than 1, check if the comparisons with 
currentVersion works ok
         */
-       static string lastChronojumpDatabaseVersion = "1.13";
+       static string lastChronojumpDatabaseVersion = "1.14";
 
        public Sqlite() {
        }
@@ -1664,7 +1664,17 @@ class Sqlite
 
                                currentVersion = "1.13";
                        }
-                               
+                       if(currentVersion == "1.13") {
+                               dbcon.Open();
+                       
+                               Log.WriteLine("slCMJ -> slCMJleft, slCMJright");
+
+                               SqliteOldConvert.slCMJDivide();
+                               SqlitePreferences.Update ("databaseVersion", "1.14", true); 
+                               dbcon.Close();
+
+                               currentVersion = "1.14";
+                       }
                }
 
                //if changes are made here, remember to change also in CreateTables()
diff --git a/src/sqlite/oldConvert.cs b/src/sqlite/oldConvert.cs
index 273f8b7..a51eb07 100644
--- a/src/sqlite/oldConvert.cs
+++ b/src/sqlite/oldConvert.cs
@@ -55,6 +55,34 @@ class SqliteOldConvert : Sqlite
 
        }       
 
+       //convert slCMJ to slCMJleft, slCMJright
+       //DB 1.13 -> DB 1.14
+       public static void slCMJDivide() {
+               //it's a conversion, dbcon is opened
+
+               //changes on jumpType table
+               SqliteJumpType.Delete(Constants.JumpTypeTable, "slCMJ", true);
+               SqliteJumpType.JumpTypeInsert("slCMJleft:1:0:Single-leg CMJ jump", true);
+               SqliteJumpType.JumpTypeInsert("slCMJright:1:0:Single-leg CMJ jump", true);
+
+
+               //changes on jump table
+               dbcmd.CommandText = "UPDATE " + Constants.JumpTable + " SET type = 'slCMJleft' WHERE 
description LIKE '%Left%'";
+               Log.WriteLine(dbcmd.CommandText.ToString());
+               dbcmd.ExecuteNonQuery();
+               
+               dbcmd.CommandText = "UPDATE " + Constants.JumpTable + " SET type = 'slCMJright' WHERE 
description LIKE '%Right%'";
+               Log.WriteLine(dbcmd.CommandText.ToString());
+               dbcmd.ExecuteNonQuery();
+               
+               dbcmd.CommandText = "UPDATE " + Constants.JumpTable + " SET description=replace(description, 
' Left', '')";
+               Log.WriteLine(dbcmd.CommandText.ToString());
+               dbcmd.ExecuteNonQuery();
+               
+               dbcmd.CommandText = "UPDATE " + Constants.JumpTable + " SET description=replace(description, 
' Right', '')";
+               Log.WriteLine(dbcmd.CommandText.ToString());
+               dbcmd.ExecuteNonQuery();
+       }
 
        //pass uniqueID value and then will return one record. do like this:
        //EncoderSQL eSQL = (EncoderSQL) SqliteEncoder.Select(false, myUniqueID, 0, 0, "")[0];



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