[chronojump] Removed showHeight from preferences. Added showStifness to SQL



commit ccc660b663765df2dd8bf907e352f61b7a25163d
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Jan 7 19:21:54 2015 +0100

    Removed showHeight from preferences. Added showStifness to SQL

 glade/chronojump.glade    |   70 ++++++++++++++++++++++++++++++++++++++------
 src/gui/preferences.cs    |   14 +--------
 src/preferences.cs        |   56 +-----------------------------------
 src/sqlite/main.cs        |   18 +++++++++--
 src/sqlite/preferences.cs |    6 +--
 src/treeViewJump.cs       |   50 ++++++++++++++------------------
 6 files changed, 101 insertions(+), 113 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 7ac7ef7..ee30d46 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -6366,6 +6366,9 @@ Second Chronopic to platforms.</property>
                                                         <child>
                                                           <placeholder/>
                                                         </child>
+                                                        <child>
+                                                          <placeholder/>
+                                                        </child>
                                                       </widget>
                                                       <packing>
                                                         <property name="expand">True</property>
@@ -7108,6 +7111,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             </child>
                                                             <child>
@@ -8102,6 +8108,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">2</property>
@@ -8737,6 +8746,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">4</property>
@@ -18507,6 +18519,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -19050,6 +19065,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -20085,6 +20103,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>
@@ -20177,6 +20198,9 @@ by you</property>
             <child>
               <placeholder/>
             </child>
+            <child>
+              <placeholder/>
+            </child>
           </widget>
           <packing>
             <property name="expand">True</property>
@@ -29123,6 +29147,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>
@@ -31046,6 +31088,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>
@@ -31627,6 +31672,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>
@@ -32006,16 +32054,6 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
                                             <property name="column_spacing">8</property>
                                             <property name="row_spacing">8</property>
                                             <child>
-                                              <widget class="GtkCheckButton" id="checkbutton_height">
-                                                <property name="label" translatable="yes">Height</property>
-                                                <property name="visible">True</property>
-                                                <property name="can_focus">True</property>
-                                                <property name="receives_default">False</property>
-                                                <property name="use_underline">True</property>
-                                                <property name="draw_indicator">True</property>
-                                              </widget>
-                                            </child>
-                                            <child>
                                               <widget class="GtkHBox" id="hbox1">
                                                 <property name="visible">True</property>
                                                 <property name="can_focus">False</property>
@@ -32087,6 +32125,9 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
                                                 <property name="bottom_attach">2</property>
                                               </packing>
                                             </child>
+                                            <child>
+                                              <placeholder/>
+                                            </child>
                                           </widget>
                                           <packing>
                                             <property name="expand">False</property>
@@ -34202,6 +34243,9 @@ show elevation as:</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                       <packing>
                         <property name="left_attach">2</property>
@@ -34409,6 +34453,9 @@ show elevation as:</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -34631,6 +34678,9 @@ show elevation as:</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index 4b7b42c..abab505 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- * Copyright (C) 2004-2014   Xavier de Blas <xaviblas gmail com> 
+ * Copyright (C) 2004-2015   Xavier de Blas <xaviblas gmail com> 
  */
 
 using System;
@@ -51,7 +51,6 @@ public class PreferencesWindow {
        [Widget] Gtk.ProgressBar pulsebar;
 
        [Widget] Gtk.ComboBox combo_decimals;
-       [Widget] Gtk.CheckButton checkbutton_height;
        [Widget] Gtk.CheckButton checkbutton_power;
        [Widget] Gtk.CheckButton checkbutton_initial_speed;
        [Widget] Gtk.CheckButton checkbutton_angle;
@@ -151,11 +150,6 @@ public class PreferencesWindow {
                PreferencesWindowBox.combo_decimals.Active = UtilGtk.ComboMakeActive(
                                decs, preferences.digitsNumber.ToString());
 
-               if(preferences.showHeight) 
-                       PreferencesWindowBox.checkbutton_height.Active = true; 
-               else 
-                       PreferencesWindowBox.checkbutton_height.Active = false; 
-               
                if(preferences.showPower) {
                        PreferencesWindowBox.checkbutton_power.Active = true; 
                        PreferencesWindowBox.button_help_power.Sensitive = true;
@@ -574,12 +568,6 @@ public class PreferencesWindow {
                        preferences.digitsNumber = Convert.ToInt32(UtilGtk.ComboGetActive(combo_decimals));
                }
                
-               
-               if( preferences.showHeight != PreferencesWindowBox.checkbutton_height.Active ) {
-                       SqlitePreferences.Update("showHeight", 
PreferencesWindowBox.checkbutton_height.Active.ToString(), true);
-                       preferences.showHeight = PreferencesWindowBox.checkbutton_height.Active;
-               }
-
                if( preferences.showPower != PreferencesWindowBox.checkbutton_power.Active ) {
                        SqlitePreferences.Update("showPower", 
PreferencesWindowBox.checkbutton_power.Active.ToString(), true);
                        preferences.showPower = PreferencesWindowBox.checkbutton_power.Active;
diff --git a/src/preferences.cs b/src/preferences.cs
index d14694d..ee0c1c4 100644
--- a/src/preferences.cs
+++ b/src/preferences.cs
@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Copyright (C) 2004-2014   Xavier de Blas <xaviblas gmail com> 
+ *  Copyright (C) 2004-2015   Xavier de Blas <xaviblas gmail com> 
  */
 
 using System;
@@ -28,7 +28,6 @@ public class Preferences
         */
 
        public int digitsNumber;
-       public bool showHeight;
        public bool showPower;
        public bool showInitialSpeed;
        public bool showAngle;
@@ -81,60 +80,7 @@ public class Preferences
                return SqlitePreferences.SelectAll();
        }
        
-       
-       /*
-       public Preferences(
-                       string databaseVersion, string chronopicPort, int digitsNumber, 
-                       bool showHeight, bool showPower, bool showInitialSpeed, bool showAngle, 
-                       bool showQIndex, bool showDjIndex, 
-                       bool simulated bool weightStatsPercent, bool askDeletion, 
-                       bool heightPreferred, bool metersSecondsPreferred, 
-                       string language, bool allowFinishRjAfterTime, 
-                       bool volumeOn, bool videoOn, bool evaluatorServerID, 
-                       string versionAvailable, bool runSpeedStartArrival, bool runISpeedStartArrival, 
-                       string machineID, Constants.MultimediaStorage multimediaStorage, 
-                       bool encoderPropulsive, double encoderSmoothCon, 
-                       int videoDeviceNum, Constants.Encoder1RMMethod encoder1RMMethod, 
-                       string CSVExportDecimalSeparator, bool RGraphsTranslate, 
-                       bool useHeightsOnJumpIndexes, Constants.EncoderAutoSaveCurve encoderAutoSaveCurve
-                       ) 
-       {
-        this.databaseVersion = databaseVersion; 
-        this.chronopicPort = chronopicPort;
-        this.digitsNumber = digitsNumber;
-        this.showHeight = showHeight;
-        this.showPower = showPower;
-        this.showInitialSpeed = showInitialSpeed;
-        this.showAngle = showAngle;
-        this.showQIndex = showQIndex;
-        this.showDjIndex = showDjIndex; 
-        this.simulated = simulated;
-        this.weightStatsPercent =  
-        this.askDeletion = askDeletion;
-        this.heightPreferred = heightPreferred;
-        this.metersSecondsPreferred = metersSeconsPreferred;
-        this.language = language;
-        this.allowFinishRjAfterTime = allowFinishRjAfterTime;
-        this.volumeOn = volumeOn;
-        this.videoOn = videoOn;
-        this.evaluatorServerID = evaluatorServerID;
-        this.versionAvailable = versionAvailable;
-        this.runSpeedStartArrival = runSpeedStartArrival;
-        this.runISpeedStartArrival = runISpeedStartArrival;
-        this.machineID = machineID;
-        this.multimediaStorage = multimediaStorage;
-        this.encoderPropulsive = encoderPropulsive;
-        this.encoderSmoothCon = encoderSmoothCon;
-        this.videoDeviceNum = videoDeviceNum;
-        this.encoder1RMMethod = encoder1RMMethod;
-        this.CSVExportDecimalSeparator = CSVExportDecimalSeparator;
-        this.RGraphsTranslate = RGraphsTranslate;
-        this.useHeightsOnJumpIndexes = useHeightsOnJumpIndexes;
-        this.encoderAutoSaveCurve = encoderAutoSaveCurve;
-       }
-       */
 
        ~Preferences() {}
           
 }
-
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index 8f16287..e16c4a0 100644
--- a/src/sqlite/main.cs
+++ b/src/sqlite/main.cs
@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- * Copyright (C) 2004-2014   Xavier de Blas <xaviblas gmail com> 
+ * Copyright (C) 2004-2015   Xavier de Blas <xaviblas gmail com> 
  */
 
 using System;
@@ -73,7 +73,7 @@ class Sqlite
        /*
         * Important, change this if there's any update to database
         */
-       static string lastChronojumpDatabaseVersion = "1.18";
+       static string lastChronojumpDatabaseVersion = "1.19";
 
        public Sqlite() {
        }
@@ -1730,6 +1730,17 @@ class Sqlite
 
                                currentVersion = "1.18";
                        }
+                       if(currentVersion == "1.18") {
+                               LogB.SQL("Preferences deleted showHeight, added showStiffness");
+                               
+                               Sqlite.Open();
+                               DeleteFromName(true, Constants.PreferencesTable, "showHeight");
+                               SqlitePreferences.Insert ("showStiffness", "True"); 
+                               SqlitePreferences.Update ("databaseVersion", "1.19", true); 
+                               Sqlite.Close();
+
+                               currentVersion = "1.19";
+                       }
        
                }
 
@@ -1874,7 +1885,8 @@ class Sqlite
                SqliteExecuteAuto.addChronojumpProfileAndBilateral();
                
                //changes [from - to - desc]
-               //1.18 - 1.18 Converted DB to 1.18 deleted Negative runInterval runs (bug from last version)
+               //1.18 - 1.19 Converted DB to 1.19 Preferences deleted showHeight, added showStiffness
+               //1.17 - 1.18 Converted DB to 1.18 deleted Negative runInterval runs (bug from last version)
                //1.16 - 1.17 Converted DB to 1.17 Deleted Max jump (we already have "Free")
                //1.15 - 1.16 Converted DB to 1.16 Cyprus moved to Europe
                //1.14 - 1.15 Converted DB to 1.15 added Chronojump profile and bilateral profile
diff --git a/src/sqlite/preferences.cs b/src/sqlite/preferences.cs
index 929fff7..8048eb7 100644
--- a/src/sqlite/preferences.cs
+++ b/src/sqlite/preferences.cs
@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- * Copyright (C) 2004-2014   Xavier de Blas <xaviblas gmail com> 
+ * Copyright (C) 2004-2015   Xavier de Blas <xaviblas gmail com> 
  */
 
 using System;
@@ -45,8 +45,8 @@ class SqlitePreferences : Sqlite
                        Insert ("chronopicPort", Constants.ChronopicDefaultPortLinux);
                
                Insert ("digitsNumber", "3");
-               Insert ("showHeight", "True");
                Insert ("showPower", "True");
+               Insert ("showStiffness", "True");
                Insert ("showInitialSpeed", "True");
                Insert ("showAngle", "False"); //for treeviewjumps
                Insert ("showQIndex", "False"); //for treeviewJumps
@@ -147,8 +147,6 @@ class SqlitePreferences : Sqlite
                        //these are sent to preferences window
                        if(reader[0].ToString() == "digitsNumber")
                                preferences.digitsNumber = Convert.ToInt32(reader[1].ToString());
-                       else if(reader[0].ToString() == "showHeight")
-                               preferences.showHeight = reader[1].ToString() == "True";
                        else if(reader[0].ToString() == "showPower")
                                preferences.showPower = reader[1].ToString() == "True";
                        else if(reader[0].ToString() == "showInitialSpeed")
diff --git a/src/treeViewJump.cs b/src/treeViewJump.cs
index eaf5432..629ce67 100644
--- a/src/treeViewJump.cs
+++ b/src/treeViewJump.cs
@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Copyright (C) 2004-2014   Xavier de Blas <xaviblas gmail com> 
+ *  Copyright (C) 2004-2015   Xavier de Blas <xaviblas gmail com> 
  */
 
 using System;
@@ -68,7 +68,9 @@ public class TreeViewJumps : TreeViewEvent
                string [] columnsStringPre = { jumperName, 
                        Catalog.GetString("TC") + "\n(s)", 
                        Catalog.GetString("TF") + "\n(s)", 
-                       weightName, fallName }; //Note: if this changes, check the '5's in obtainColumnsString
+                       weightName, fallName,
+                       heightName
+               };
 
                columnsString = obtainColumnsString(columnsStringPre);
        
@@ -84,8 +86,7 @@ public class TreeViewJumps : TreeViewEvent
 
        protected override int getColsNum() {
                int i = columnsString.Length;
-               if (preferences.showHeight)  
-                       i ++;
+               
                if (preferences.showPower)  
                        i ++;
                if (preferences.showInitialSpeed) 
@@ -100,9 +101,8 @@ public class TreeViewJumps : TreeViewEvent
        protected string [] obtainColumnsString(string [] columnsStringPre) 
        {
                //check long of new array
-               int i = 6; //columnsStringPre + uniqueID (at last)
-               if (preferences.showHeight)  
-                       i ++;
+               int i = columnsStringPre.Length + 1; //columnsStringPre + uniqueID (at last)
+               
                if (preferences.showPower)  
                        i ++;
                if (preferences.showInitialSpeed) 
@@ -114,7 +114,7 @@ public class TreeViewJumps : TreeViewEvent
 
                //create new array
                string [] columnsString = new String[i];
-               Array.Copy(columnsStringPre, columnsString, 5); //copy columnsStringPre
+               Array.Copy(columnsStringPre, columnsString, columnsStringPre.Length); //copy columnsStringPre
 
        
                if(preferences.metersSecondsPreferred)
@@ -124,9 +124,8 @@ public class TreeViewJumps : TreeViewEvent
 
 
                //fill names
-               i = 5; //start at pos five end of columnsStringPre
-               if (preferences.showHeight)  
-                       columnsString[i++] = heightName;
+               i = columnsStringPre.Length; //start at end of columnsStringPre
+               
                if (preferences.showPower)  
                        columnsString[i++] = powerName;
                if (preferences.showInitialSpeed) 
@@ -188,8 +187,7 @@ public class TreeViewJumps : TreeViewEvent
                myData[count++] = Util.TrimDecimals(newJump.Weight.ToString(), pDN);
 
                myData[count++] = Util.TrimDecimals(newJump.Fall.ToString(), pDN);
-               if (preferences.showHeight)  
-                       myData[count++] = 
Util.TrimDecimals(Util.GetHeightInCentimeters(newJump.Tv.ToString()), pDN);
+               myData[count++] = Util.TrimDecimals(Util.GetHeightInCentimeters(newJump.Tv.ToString()), pDN);
 
                
 
@@ -260,7 +258,9 @@ public class TreeViewJumpsRj : TreeViewJumps
                string [] columnsStringPre = { jumperName, 
                        Catalog.GetString("TC") + "\n(s)", 
                        Catalog.GetString("TF") + "\n(s)", 
-                       weightName, fallName };
+                       weightName, fallName,
+                       heightName
+               };
                columnsString = obtainColumnsString(columnsStringPre);
 
                eventIDColumn = columnsString.Length ; //column where the uniqueID of event will be (and will 
be hidded). 
@@ -317,8 +317,7 @@ public class TreeViewJumpsRj : TreeViewJumps
                myData[count++] = Util.TrimDecimals(newJumpRj.Weight.ToString(), pDN);
 
                myData[count++] = Util.TrimDecimals(newJumpRj.Fall.ToString(), pDN);
-               if (preferences.showHeight)  
-                       myData[count++] = "";
+               myData[count++] = ""; //height
                if (preferences.showPower)
                        myData[count++] = "";
                if (preferences.showInitialSpeed) 
@@ -359,8 +358,7 @@ public class TreeViewJumpsRj : TreeViewJumps
                myData[count++] = Util.TrimDecimals( thisTv, pDN );
                myData[count++] = ""; 
                myData[count++] = ""; 
-               if (preferences.showHeight)  
-                       myData[count++] = Util.TrimDecimals(Util.GetHeightInCentimeters(thisTv), pDN);
+               myData[count++] = Util.TrimDecimals(Util.GetHeightInCentimeters(thisTv), pDN);
                if (preferences.showPower) {
                        double myFall;
                        if(lineCount == 0)
@@ -402,8 +400,7 @@ public class TreeViewJumpsRj : TreeViewJumps
                myData[count++] = Util.TrimDecimals(Util.GetTotalTime(newJumpRj.TvString).ToString(), pDN);
                myData[count++] = ""; //weight
                myData[count++] = ""; //fall
-               if (preferences.showHeight)  
-                       myData[count++] = ""; 
+               myData[count++] = ""; //height
                if (preferences.showPower)
                        myData[count++] = "";
                if (preferences.showInitialSpeed) 
@@ -446,11 +443,10 @@ public class TreeViewJumpsRj : TreeViewJumps
 
                //this values are calculated using the AVG of the tcs or tvs, not as an avg of individual 
values
 
-               if (preferences.showHeight)  
-                       myData[count++] = Util.TrimDecimals(
-                                       Util.GetHeightInCentimeters(
-                                               tvAVGDouble.ToString())
-                                       , pDN);
+               myData[count++] = Util.TrimDecimals(
+                               Util.GetHeightInCentimeters(
+                                       tvAVGDouble.ToString())
+                               , pDN);
                if (preferences.showPower) {
                        myData[count++] = "";
 
@@ -512,9 +508,7 @@ public class TreeViewJumpsRj : TreeViewJumps
                
                myData[count++] = ""; //weight
                myData[count++] = ""; //fall
-
-               if (preferences.showHeight)  
-                       myData[count++] = "";
+               myData[count++] = ""; //height
                if (preferences.showPower)
                        myData[count++] = "";
                if (preferences.showInitialSpeed) 


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