[chronojump] Encoder delete exercise shows sets of it (not rows: sets + reps)



commit 8e0dd337aaa8f77f6775e4f97135b85bb70fb6b9
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Sep 12 12:25:07 2019 +0200

    Encoder delete exercise shows sets of it (not rows: sets + reps)

 src/gui/encoder.cs    | 7 +++----
 src/sqlite/encoder.cs | 5 +++--
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index ace72f74..10b0f408 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -4727,13 +4727,12 @@ public partial class ChronoJumpWindow
                        return;
                }
 
-               ArrayList array = SqliteEncoder.SelectEncoderRowsOfAnExercise(false, genericWin.uniqueID); 
//dbconOpened, exerciseID
+               ArrayList array = SqliteEncoder.SelectEncoderSetsOfAnExercise(false, genericWin.uniqueID); 
//dbconOpened, exerciseID
 
                if(array.Count > 0) {
                        //there are some records of this exercise on encoder table, do not delete
                        genericWin.SetTextview(
-                                       Catalog.GetString("Sorry, this exercise cannot be deleted.") + "\n" +
-                                       Catalog.GetString("Please delete first the following repetitions:"));
+                                       Catalog.GetString("Sorry, this exercise cannot be deleted until these 
tests are deleted:"));
 
                        ArrayList nonSensitiveRows = new ArrayList();
                        for(int i=0; i < array.Count; i ++)
@@ -4742,7 +4741,7 @@ public partial class ChronoJumpWindow
                        genericWin.SetTreeview(
                                        new string [] {
                                        "count",        //not shown, unused
-                                       Catalog.GetString("Repetitions"), Catalog.GetString("Person"),
+                                       Catalog.GetString("Sets"), Catalog.GetString("Person"),
                                        Catalog.GetString("Session"), Catalog.GetString("Date") }, 
                                        false, array, nonSensitiveRows, Constants.ContextMenu.NONE, false);
 
diff --git a/src/sqlite/encoder.cs b/src/sqlite/encoder.cs
index cf566194..7ac07143 100644
--- a/src/sqlite/encoder.cs
+++ b/src/sqlite/encoder.cs
@@ -919,7 +919,7 @@ class SqliteEncoder : Sqlite
                return l;
        }
 
-       public static ArrayList SelectEncoderRowsOfAnExercise(bool dbconOpened, int exerciseID) 
+       public static ArrayList SelectEncoderSetsOfAnExercise(bool dbconOpened, int exerciseID)
        {
                if(! dbconOpened)
                        Sqlite.Open();
@@ -929,7 +929,8 @@ class SqliteEncoder : Sqlite
                        Constants.SessionTable + ".name, " + 
                        Constants.SessionTable + ".date " + 
                        " FROM " + Constants.EncoderTable + ", " + Constants.PersonTable + ", " + 
Constants.SessionTable +
-                       " WHERE exerciseID == " + exerciseID + 
+                       " WHERE exerciseID == " + exerciseID +
+                       " AND signalOrCurve = \"signal\" " +
                        " AND " + Constants.PersonTable + ".uniqueID == " + Constants.EncoderTable + 
".personID " +
                        " AND " + Constants.SessionTable + ".uniqueID == " + Constants.EncoderTable + 
".sessionID " + 
                        " GROUP BY sessionID, personID";


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