[chronojump] Unable to insert quotations on textview_encoder_signal_comment



commit 8bc17c4d38537c7ecb16d23eb27699e9842da6f6
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Jul 24 13:22:02 2017 +0200

    Unable to insert quotations on textview_encoder_signal_comment

 src/gui/encoder.cs |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index cbe8b3c..125bde4 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -302,6 +302,7 @@ public partial class ChronoJumpWindow
        private EncoderAnalyzeInstant eai;
 
        private ArrayList array1RM;
+       private bool textviewEncoderSignalCommentChanging = false;
 
        //private static double [] encoderReaded;               //data coming from encoder and converted (can 
be double)
        //private static int [] encoderReaded;          //data coming from encoder and converted
@@ -1157,7 +1158,20 @@ public partial class ChronoJumpWindow
                encoderCalculeCurves(encoderActions.CURVES);
        }
 
-       void on_textview_encoder_signal_comment_key_press_event (object o, EventArgs args) {
+       void on_textview_encoder_signal_comment_key_press_event (object o, EventArgs args)
+       {
+               //1 manage ' " on textview avoiding circular calls
+               if(textviewEncoderSignalCommentChanging)
+                       return;
+
+               textviewEncoderSignalCommentChanging = true;
+
+               textview_encoder_signal_comment.Buffer.Text =
+                       Util.MakeValidSQL(textview_encoder_signal_comment.Buffer.Text);
+
+               textviewEncoderSignalCommentChanging = false;
+
+               //2 button label and sensitiveness
                button_encoder_signal_save_comment.Label = Catalog.GetString("Save comment");
                button_encoder_signal_save_comment.Sensitive = true;
        }


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