[chronojump] DB to 2.20 Inserted into preferences: runsEvolutionOnlyBestInSession



commit 518543bc8b42bc70665c5a920414bc8f62ec0b23
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Apr 21 07:39:23 2021 +0200

    DB to 2.20 Inserted into preferences: runsEvolutionOnlyBestInSession

 src/preferences.cs        |  3 +++
 src/sqlite/main.cs        | 11 ++++++++++-
 src/sqlite/preferences.cs |  6 ++++++
 3 files changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/src/preferences.cs b/src/preferences.cs
index dcd2644e..6c940060 100644
--- a/src/preferences.cs
+++ b/src/preferences.cs
@@ -208,6 +208,9 @@ public class Preferences
        public bool jumpsFVProfileShowFullGraph;
        public bool jumpsEvolutionOnlyBestInSession;
 
+       //runs
+       public bool runsEvolutionOnlyBestInSession;
+
        //encoder
        public Constants.EncoderAutoSaveCurve encoderAutoSaveCurve;
        public int encoderAutoSaveCurveBestNValue;
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index f54e2a7e..b80bdc92 100644
--- a/src/sqlite/main.cs
+++ b/src/sqlite/main.cs
@@ -129,7 +129,7 @@ class Sqlite
        /*
         * Important, change this if there's any update to database
         */
-       static string lastChronojumpDatabaseVersion = "2.19";
+       static string lastChronojumpDatabaseVersion = "2.20";
 
        public Sqlite()
        {
@@ -2982,6 +2982,14 @@ class Sqlite
 
                                currentVersion = updateVersion("2.19");
                        }
+                       if(currentVersion == "2.19")
+                       {
+                               LogB.SQL("Inserted into preferences: runsEvolutionOnlyBestInSession");
+
+                               SqlitePreferences.Insert (SqlitePreferences.RunsEvolutionOnlyBestInSession, 
"False");
+
+                               currentVersion = updateVersion("2.20");
+                       }
 
 
 
@@ -3204,6 +3212,7 @@ class Sqlite
 //just testing: 1.79 - 1.80 Converted DB to 1.80 Created table ForceSensorElasticBandGlue and moved 
stiffnessString records there
 
 
+               //2.19 - 2.20 Converted DB to 2.20 Inserted into preferences: runsEvolutionOnlyBestInSession
                //2.18 - 2.19 Converted DB to 2.19 Doing alter table encoderExercise ADD COLUMN type TEXT ...
                //2.17 - 2.18 Converted DB to 2.18 Person77 ALTER TABLE added field: linkServerImage (for 
networks)
                //2.16 - 2.17 Converted DB to 2.17 Created table lastJumpRjTypeParams
diff --git a/src/sqlite/preferences.cs b/src/sqlite/preferences.cs
index fc22aa99..6cdd0436 100644
--- a/src/sqlite/preferences.cs
+++ b/src/sqlite/preferences.cs
@@ -48,6 +48,7 @@ class SqlitePreferences : Sqlite
        public const string JumpsFVProfileOnlyBestInWeight = "jumpsFVProfileOnlyBestInWeight";
        public const string JumpsFVProfileShowFullGraph = "jumpsFVProfileShowFullGraph";
        public const string JumpsEvolutionOnlyBestInSession = "jumpsEvolutionOnlyBestInSession";
+       public const string RunsEvolutionOnlyBestInSession = "runsEvolutionOnlyBestInSession";
 
        //encoder
        public const string EncoderCaptureInfinite = "encoderCaptureInfinite";
@@ -217,6 +218,9 @@ class SqlitePreferences : Sqlite
                                SqlitePreferences.Insert (JumpsFVProfileShowFullGraph, "True", dbcmdTr);
                                SqlitePreferences.Insert (JumpsEvolutionOnlyBestInSession, "False", dbcmdTr);
 
+                               //runs
+                               SqlitePreferences.Insert (RunsEvolutionOnlyBestInSession, "False", dbcmdTr);
+
                                //encoder
                                Insert ("encoderCaptureTime", "60", dbcmdTr);
                                Insert ("encoderCaptureInactivityEndTime", "3", dbcmdTr);
@@ -518,6 +522,8 @@ class SqlitePreferences : Sqlite
                                preferences.jumpsFVProfileShowFullGraph = reader[1].ToString() == "True";
                        else if(reader[0].ToString() == JumpsEvolutionOnlyBestInSession)
                                preferences.jumpsEvolutionOnlyBestInSession = reader[1].ToString() == "True";
+                       else if(reader[0].ToString() == RunsEvolutionOnlyBestInSession)
+                               preferences.runsEvolutionOnlyBestInSession = reader[1].ToString() == "True";
                        //encoder capture
                        else if(reader[0].ToString() == "encoderCaptureTime")
                                preferences.encoderCaptureTime = Convert.ToInt32(reader[1].ToString());


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