[chronojump] Encoder predefined exercises can now be deleted



commit 3a00549491624b744e5f0fa49f66a1cd7acd8aa1
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Oct 4 15:47:24 2019 +0200

    Encoder predefined exercises can now be deleted

 src/encoder.cs     | 3 +++
 src/gui/encoder.cs | 8 --------
 2 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/src/encoder.cs b/src/encoder.cs
index af5e502b..173ea95d 100644
--- a/src/encoder.cs
+++ b/src/encoder.cs
@@ -1016,6 +1016,8 @@ public class EncoderExercise
                this.speed1RM = speed1RM;
        }
 
+       /*
+        * unused, on 1.9.1 all encoder exercises can be deleted
        public bool IsPredefined() {
                if(
                                name == "Bench press" ||
@@ -1028,6 +1030,7 @@ public class EncoderExercise
                else 
                        return false;
        }
+       */
 
        public override string ToString()
        {
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 5dbbce92..03cda5d6 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -4535,9 +4535,6 @@ public partial class ChronoJumpWindow
                ArrayList a5 = new ArrayList();
 
                string exerciseName = ex.name;
-               if(ex.IsPredefined())
-                       exerciseName = Catalog.GetString(ex.name);
-
                //0 is the widgget to show; 1 is the editable; 2 id default value
 
                //name cannot be changed because we have to detect if new name already exists, check problems 
with translations,
@@ -4728,11 +4725,6 @@ public partial class ChronoJumpWindow
                EncoderExercise ex = (EncoderExercise) SqliteEncoder.SelectEncoderExercises(
                                false, getExerciseIDFromEncoderCombo(exerciseCombos.CAPTURE), false)[0];
 
-               if(ex.IsPredefined()) {
-                       new DialogMessage(Constants.MessageTypes.WARNING, Catalog.GetString("Sorry, 
predefined exercises cannot be deleted."));
-                       return;
-               }
-
                ArrayList array = SqliteEncoder.SelectEncoderSetsOfAnExercise(false, ex.UniqueID); 
//dbconOpened, exerciseID
 
                if(array.Count > 0)


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