[chronojump] Merged preferences: jumpsDjGraphHeights with heightPreferred



commit bc38b507a8c28adafbf22f9e169744b37b231f60
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Aug 18 12:17:08 2020 +0100

    Merged preferences: jumpsDjGraphHeights with heightPreferred

 glade/preferences_win.glade | 71 +++++----------------------------------------
 howto_new_version.txt       |  3 ++
 src/execute/jump.cs         |  8 ++---
 src/execute/run.cs          |  2 +-
 src/gui/app1/chronojump.cs  |  2 +-
 src/gui/app1/jump.cs        |  2 +-
 src/gui/preferences.cs      | 32 ++++++--------------
 src/preferences.cs          |  1 -
 src/sqlite/main.cs          |  5 ++--
 src/sqlite/preferences.cs   |  4 ---
 10 files changed, 30 insertions(+), 100 deletions(-)
---
diff --git a/glade/preferences_win.glade b/glade/preferences_win.glade
index dd113024..36a01c29 100644
--- a/glade/preferences_win.glade
+++ b/glade/preferences_win.glade
@@ -583,6 +583,9 @@
                             <child>
                               <placeholder/>
                             </child>
+                            <child>
+                              <placeholder/>
+                            </child>
                           </widget>
                         </child>
                       </widget>
@@ -981,7 +984,7 @@
                                                 <property name="visible">True</property>
                                                 <property name="can_focus">False</property>
                                                 <property name="xalign">0</property>
-                                                <property name="label" translatable="yes">Variables to show 
at capture graphs of reactive jumps:</property>
+                                                <property name="label" translatable="yes">Variables to show 
at reactive jumps:</property>
                                               </widget>
                                               <packing>
                                                 <property name="expand">True</property>
@@ -995,7 +998,7 @@
                                                 <property name="can_focus">False</property>
                                                 <property name="spacing">10</property>
                                                 <child>
-                                                  <widget class="GtkRadioButton" 
id="radio_jumps_dj_capture_show_heights">
+                                                  <widget class="GtkRadioButton" id="radio_jumps_dj_heights">
                                                     <property name="label" translatable="yes">Heights: fall 
height, jump height</property>
                                                     <property name="visible">True</property>
                                                     <property name="can_focus">True</property>
@@ -1011,14 +1014,14 @@
                                                   </packing>
                                                 </child>
                                                 <child>
-                                                  <widget class="GtkRadioButton" 
id="radio_jumps_dj_capture_show_times">
+                                                  <widget class="GtkRadioButton" id="radio_jumps_dj_times">
                                                     <property name="label" translatable="yes">Times: contact 
time, flight time</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>
-                                                    <property 
name="group">radio_jumps_dj_capture_show_heights</property>
+                                                    <property name="group">radio_jumps_dj_heights</property>
                                                   </widget>
                                                   <packing>
                                                     <property name="expand">True</property>
@@ -1040,64 +1043,6 @@
                                             <property name="position">1</property>
                                           </packing>
                                         </child>
-                                        <child>
-                                          <widget class="GtkHBox" id="hbox54">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <child>
-                                              <widget class="GtkLabel" id="label3">
-                                                <property name="visible">True</property>
-                                                <property name="can_focus">False</property>
-                                                <property name="xalign">0</property>
-                                                <property name="label" translatable="yes">On statistics show 
elevation as:</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="radio_elevation_height">
-                                                <property name="label" translatable="yes">Height 
(cm)</property>
-                                                <property name="visible">True</property>
-                                                <property name="can_focus">True</property>
-                                                <property name="receives_default">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="padding">20</property>
-                                                <property name="position">1</property>
-                                              </packing>
-                                            </child>
-                                            <child>
-                                              <widget class="GtkRadioButton" id="radio_elevation_tf">
-                                                <property name="label">TF (s)</property>
-                                                <property name="visible">True</property>
-                                                <property name="can_focus">True</property>
-                                                <property name="receives_default">False</property>
-                                                <property name="xalign">0</property>
-                                                <property name="active">True</property>
-                                                <property name="draw_indicator">True</property>
-                                                <property name="group">radio_elevation_height</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">True</property>
-                                            <property name="fill">True</property>
-                                            <property name="position">2</property>
-                                          </packing>
-                                        </child>
                                         <child>
                                           <widget class="GtkHBox" id="hbox52">
                                             <property name="visible">True</property>
@@ -1153,7 +1098,7 @@
                                           <packing>
                                             <property name="expand">True</property>
                                             <property name="fill">True</property>
-                                            <property name="position">3</property>
+                                            <property name="position">2</property>
                                           </packing>
                                         </child>
                                       </widget>
diff --git a/howto_new_version.txt b/howto_new_version.txt
index 1a8f9a59..7b8f2674 100644
--- a/howto_new_version.txt
+++ b/howto_new_version.txt
@@ -1,3 +1,6 @@
+----
+Check that on windows we can compile (for the length of the compile order on cygwin, see: how_to_compile.txt)
+----
 
 1) copy manual PDFs from chronojump-docs repository, because in chronojump repository PDFs are not updated
 check is "updated to last version"
diff --git a/src/execute/jump.cs b/src/execute/jump.cs
index 8e3c767c..bedf21bb 100644
--- a/src/execute/jump.cs
+++ b/src/execute/jump.cs
@@ -49,7 +49,7 @@ public class JumpExecute : EventExecute
 
        private int angle = -1;
        private bool avoidGraph;
-       private bool jumpsDjGraphHeights;
+       private bool heightPreferred;
        
        public JumpExecute() {
        }
@@ -60,7 +60,7 @@ public class JumpExecute : EventExecute
                        bool volumeOn, Preferences.GstreamerTypes gstreamer,
                        double progressbarLimit, ExecutingGraphData egd, string description,
                        bool avoidGraph, //on configChronojump.Exhibition do not show graph because it gets 
too slow with big database
-                       bool jumpsDjGraphHeights, int graphLimit, bool graphAllTypes, bool graphAllPersons
+                       bool heightPreferred, int graphLimit, bool graphAllTypes, bool graphAllPersons
                        )
        {
                this.personID = personID;
@@ -80,7 +80,7 @@ public class JumpExecute : EventExecute
                this.egd = egd;
                this.description = description;
                this.avoidGraph = avoidGraph;
-               this.jumpsDjGraphHeights = jumpsDjGraphHeights;
+               this.heightPreferred = heightPreferred;
                this.graphLimit = graphLimit;
                this.graphAllTypes = graphAllTypes;
                this.graphAllPersons = graphAllPersons;
@@ -489,7 +489,7 @@ public class JumpExecute : EventExecute
                        PrepareEventGraphJumpSimpleObject = new PrepareEventGraphJumpSimple(
                                        tv, tc, sessionID,
                                        personID, graphAllPersons, graphLimit,
-                                       table, type, jumpsDjGraphHeights);
+                                       table, type, heightPreferred);
 
                        needUpdateGraphType = eventType.JUMP;
                        needUpdateGraph = true;
diff --git a/src/execute/run.cs b/src/execute/run.cs
index ad8a86c9..6c4f12fd 100644
--- a/src/execute/run.cs
+++ b/src/execute/run.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-2017   Xavier de Blas <xaviblas gmail com> 
+ * Copyright (C) 2004-2020   Xavier de Blas <xaviblas gmail com>
  */
 
 using System;
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index fad8556a..21adc257 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -4123,7 +4123,7 @@ public partial class ChronoJumpWindow
                                cp2016.CP, app1, preferences.digitsNumber,
                                preferences.volumeOn, preferences.gstreamer,
                                progressbarLimit, egd, description, configChronojump.Exhibition,
-                               preferences.jumpsDjGraphHeights,
+                               preferences.heightPreferred,
                                Convert.ToInt32(spin_contacts_graph_last_limit.Value),
                                radio_contacts_graph_allTests.Active, radio_contacts_graph_allPersons.Active);
 
diff --git a/src/gui/app1/jump.cs b/src/gui/app1/jump.cs
index 718c5f43..c5c7d353 100644
--- a/src/gui/app1/jump.cs
+++ b/src/gui/app1/jump.cs
@@ -277,7 +277,7 @@ public partial class ChronoJumpWindow
                                tv, tc, currentSession.UniqueID,
                                currentPerson.UniqueID, radio_contacts_graph_allPersons.Active,
                                Convert.ToInt32(spin_contacts_graph_last_limit.Value),
-                               Constants.JumpTable, typeTemp, preferences.jumpsDjGraphHeights);
+                               Constants.JumpTable, typeTemp, preferences.heightPreferred);
                
                if(eventGraph.personMAXAtSQLAllSessions > 0 || eventGraph.jumpsAtSQL.Count > 0)
                        PrepareJumpSimpleGraph(eventGraph, false); //don't animate
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index b2ae3669..e74b8cfd 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -86,10 +86,8 @@ public class PreferencesWindow
        [Widget] Gtk.Box hbox_indexes;
        [Widget] Gtk.RadioButton radiobutton_show_q_index;
        [Widget] Gtk.RadioButton radiobutton_show_dj_index;
-       [Widget] Gtk.RadioButton radio_jumps_dj_capture_show_heights;
-       [Widget] Gtk.RadioButton radio_jumps_dj_capture_show_times;
-       [Widget] Gtk.RadioButton radio_elevation_height;
-       [Widget] Gtk.RadioButton radio_elevation_tf;
+       [Widget] Gtk.RadioButton radio_jumps_dj_heights;
+       [Widget] Gtk.RadioButton radio_jumps_dj_times;
        [Widget] Gtk.RadioButton radio_weight_percent;
        [Widget] Gtk.RadioButton radio_weight_kg;
        [Widget] Gtk.RadioButton radio_use_heights_on_jump_indexes;
@@ -496,10 +494,10 @@ public class PreferencesWindow
                        PreferencesWindowBox.hbox_indexes.Hide();
                }
 
-               if(preferences.jumpsDjGraphHeights)
-                       PreferencesWindowBox.radio_jumps_dj_capture_show_heights.Active = true;
+               if(preferences.heightPreferred)
+                       PreferencesWindowBox.radio_jumps_dj_heights.Active = true;
                else
-                       PreferencesWindowBox.radio_jumps_dj_capture_show_times.Active = true;
+                       PreferencesWindowBox.radio_jumps_dj_times.Active = true;
 
                if(preferences.askDeletion)
                        PreferencesWindowBox.checkbutton_ask_deletion.Active = true; 
@@ -515,13 +513,6 @@ public class PreferencesWindow
                        PreferencesWindowBox.radio_weight_percent.Active = true; 
                else 
                        PreferencesWindowBox.radio_weight_kg.Active = true; 
-               
-
-               if(preferences.heightPreferred)  
-                       PreferencesWindowBox.radio_elevation_height.Active = true; 
-               else 
-                       PreferencesWindowBox.radio_elevation_tf.Active = true; 
-               
 
                if(preferences.metersSecondsPreferred)  
                        PreferencesWindowBox.radio_speed_ms.Active = true; 
@@ -1707,10 +1698,10 @@ public class PreferencesWindow
                                        "showDjIndex", preferences.showDjIndex, false);
                }
 
-               preferences.jumpsDjGraphHeights = Preferences.PreferencesChange(
-                               SqlitePreferences.JumpsDjGraphHeights,
-                               preferences.jumpsDjGraphHeights,
-                               radio_jumps_dj_capture_show_heights.Active);
+               preferences.heightPreferred = Preferences.PreferencesChange(
+                               "heightPreferred",
+                               preferences.heightPreferred,
+                               radio_jumps_dj_heights.Active);
 
                
                if( preferences.askDeletion != PreferencesWindowBox.checkbutton_ask_deletion.Active ) {
@@ -1731,11 +1722,6 @@ public class PreferencesWindow
                        preferences.weightStatsPercent = PreferencesWindowBox.radio_weight_percent.Active;
                }
 
-               if( preferences.heightPreferred != PreferencesWindowBox.radio_elevation_height.Active ) {
-                       SqlitePreferences.Update("heightPreferred", 
PreferencesWindowBox.radio_elevation_height.Active.ToString(), true);
-                       preferences.heightPreferred = PreferencesWindowBox.radio_elevation_height.Active;
-               }
-
                if( preferences.metersSecondsPreferred != PreferencesWindowBox.radio_speed_ms.Active ) {
                        SqlitePreferences.Update("metersSecondsPreferred", 
PreferencesWindowBox.radio_speed_ms.Active.ToString(), true);
                        preferences.metersSecondsPreferred = PreferencesWindowBox.radio_speed_ms.Active;
diff --git a/src/preferences.cs b/src/preferences.cs
index 1ecf6512..942c8d98 100644
--- a/src/preferences.cs
+++ b/src/preferences.cs
@@ -59,7 +59,6 @@ public class Preferences
        public bool showAngle;
        public bool showQIndex;
        public bool showDjIndex;
-       public bool jumpsDjGraphHeights;
        public bool weightStatsPercent;         //AKA weightPercentPreferred
        public bool heightPreferred;
        public bool metersSecondsPreferred;
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index 958001af..ab4673d4 100644
--- a/src/sqlite/main.cs
+++ b/src/sqlite/main.cs
@@ -2492,9 +2492,10 @@ class Sqlite
                        }
                        if(currentVersion == "1.72")
                        {
-                               LogB.SQL("Inserted into preferences: jumpsDjGraphHeights");
+                               //LogB.SQL("Inserted into preferences: jumpsDjGraphHeights");
 
-                               SqlitePreferences.Insert (SqlitePreferences.JumpsDjGraphHeights, "True");
+                               //SqlitePreferences.Insert (SqlitePreferences.JumpsDjGraphHeights, "True");
+                               //unused, now using heightPreferred
 
                                currentVersion = updateVersion("1.73");
                        }
diff --git a/src/sqlite/preferences.cs b/src/sqlite/preferences.cs
index c1204559..75bbf80c 100644
--- a/src/sqlite/preferences.cs
+++ b/src/sqlite/preferences.cs
@@ -33,7 +33,6 @@ class SqlitePreferences : Sqlite
        public const string LogoAnimatedShow = "logoAnimatedShow";
 
        //contacts
-       public const string JumpsDjGraphHeights = "jumpsDjGraphHeights";
        public const string JumpsFVProfileOnlyBestInWeight = "jumpsFVProfileOnlyBestInWeight";
        public const string JumpsFVProfileShowFullGraph = "jumpsFVProfileShowFullGraph";
        public const string JumpsEvolutionOnlyBestInSession = "jumpsEvolutionOnlyBestInSession";
@@ -185,7 +184,6 @@ class SqlitePreferences : Sqlite
                                Insert ("multimediaStorage", 
Constants.MultimediaStorage.BYSESSION.ToString(), dbcmdTr);
 
                                //jumps
-                               Insert (JumpsDjGraphHeights, "True", dbcmdTr);
                                SqlitePreferences.Insert (JumpsFVProfileOnlyBestInWeight, "True", dbcmdTr);
                                SqlitePreferences.Insert (JumpsFVProfileShowFullGraph, "True", dbcmdTr);
                                SqlitePreferences.Insert (JumpsEvolutionOnlyBestInSession, "False", dbcmdTr);
@@ -445,8 +443,6 @@ class SqlitePreferences : Sqlite
                        else if(reader[0].ToString() == "metersSecondsPreferred")
                                preferences.metersSecondsPreferred = reader[1].ToString() == "True";
                        //jumps
-                       else if(reader[0].ToString() == JumpsDjGraphHeights)
-                               preferences.jumpsDjGraphHeights = reader[1].ToString() == "True";
                        else if(reader[0].ToString() == JumpsFVProfileOnlyBestInWeight)
                                preferences.jumpsFVProfileOnlyBestInWeight = reader[1].ToString() == "True";
                        else if(reader[0].ToString() == JumpsFVProfileShowFullGraph)


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