[chronojump] At encoder, fixed some glitches with RepsActive and RepsAll



commit 9d4db447150391811dbf328f9f636b3ad4be8ba3
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Jul 15 16:24:23 2016 +0200

    At encoder, fixed some glitches with RepsActive and RepsAll

 src/gui/encoderSelectRepetitions.cs |   21 ++++++++++-----------
 src/gui/genericWindow.cs            |    8 ++++----
 2 files changed, 14 insertions(+), 15 deletions(-)
---
diff --git a/src/gui/encoderSelectRepetitions.cs b/src/gui/encoderSelectRepetitions.cs
index 20f642c..3ef3e21 100644
--- a/src/gui/encoderSelectRepetitions.cs
+++ b/src/gui/encoderSelectRepetitions.cs
@@ -94,7 +94,6 @@ public class EncoderSelectRepetitions
                askDeletion = askDel;
        }
        
-       //public GenericWindow Do() {
        public GenericWindow Do() {
                getData();
                createBigArray();
@@ -105,12 +104,9 @@ public class EncoderSelectRepetitions
        }
 
        //used when click on "Select" button
-       public void Show() {
-               RepsActive = 0;
-               RepsAll = 0;
-
+       public void Show() 
+       {
                activateCallbacks();
-               
                genericWin.ShowNow();
        }
 
@@ -132,6 +128,8 @@ public class EncoderSelectRepetitions
        protected void updateEncoderCompareInterAndReps() 
        {
                EncoderCompareInter = new ArrayList ();
+               RepsActive = 0;
+               RepsAll = 0;
        
                //find RepsActive
                string [] selectedID = genericWin.GetColumn(0,true); //only active
@@ -368,15 +366,16 @@ public class EncoderSelectRepetitionsIndividualCurrentSession : EncoderSelectRep
                LogB.Information("row delete at show curves");
 
                int uniqueID = genericWin.TreeviewSelectedUniqueID;
-               string status = genericWin.GetCheckboxStatus(uniqueID);
+               bool status = genericWin.GetCheckboxStatus(uniqueID);
+               
+               if(status) //active
+                       RepsActive --;
+               RepsAll --;
+               
 
                DeleteCurveID = uniqueID;
                FakeButtonDeleteCurve.Click();
 
-               if(status == "active")
-                       RepsActive --;
-               RepsAll --;
-
                genericWin.Delete_row_accepted();
                FakeButtonDone.Click();         
        }
diff --git a/src/gui/genericWindow.cs b/src/gui/genericWindow.cs
index 15c39cb..8fc58fa 100644
--- a/src/gui/genericWindow.cs
+++ b/src/gui/genericWindow.cs
@@ -629,17 +629,17 @@ public class GenericWindow
 
                return 0;
        }
-       public string GetCheckboxStatus(int uniqueID) {
+       public bool GetCheckboxStatus(int uniqueID) {
                Gtk.TreeIter iter;
                bool okIter = store.GetIterFirst(out iter);
                if(okIter) {
                        do {
                                if( ((string) store.GetValue (iter, 0)) == uniqueID.ToString())
-                                       return store.GetValue (iter, 1).ToString();
+                                       return (bool) store.GetValue (iter, 1);
                        } while ( store.IterNext(ref iter) );
                }
-               //if error, return
-               return "inactive";
+               //if error, return false
+               return false;
        }
        //if column == 1 returns checkboxes column. If is 2 returns column 2...
        //Attention: Used on checkboxes treeviews


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