[chronojump] quotation marks cannot be inserted on person multiple window



commit 7fc34c55a1e2134ab4c8887c13381a5c827164ff
Author: Xavier de Blas <xaviblas gmail com>
Date:   Sun Jul 23 20:39:04 2017 +0200

    quotation marks cannot be inserted on person multiple window

 src/gui/person.cs |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/gui/person.cs b/src/gui/person.cs
index 18fe327..106a8da 100644
--- a/src/gui/person.cs
+++ b/src/gui/person.cs
@@ -1981,7 +1981,7 @@ public class PersonAddMultipleWindow {
                                        }
                                        //if headers are active do not add first row
                                        if( ! (headersActive && row == 0) ) {
-                                               PersonAddMultipleTable pamt = new 
PersonAddMultipleTable(fullname, maleOrFemale, weight);
+                                               PersonAddMultipleTable pamt = new 
PersonAddMultipleTable(Util.MakeValidSQL(fullname), maleOrFemale, weight);
                                                array.Add(pamt);
                                        }
                                        
@@ -2072,6 +2072,7 @@ public class PersonAddMultipleWindow {
                        Gtk.Entry myEntry = new Gtk.Entry();
                        table_main.Attach (myEntry, (uint) 1, (uint) 2, (uint) count, (uint) count +1, 
                                        Gtk.AttachOptions.Fill | Gtk.AttachOptions.Expand , 
Gtk.AttachOptions.Shrink, padding, padding);
+                       myEntry.Changed += on_entry_changed;
                        myEntry.Show();
                        entries.Add(myEntry);
 
@@ -2126,7 +2127,16 @@ public class PersonAddMultipleWindow {
        
                button_accept.Sensitive = true;
        }
-               
+
+       void on_entry_changed (object o, EventArgs args)
+       {
+               Gtk.Entry entry = o as Gtk.Entry;
+               if (o == null)
+                       return;
+
+               entry.Text = Util.MakeValidSQL(entry.Text);
+       }
+
        void fillTableFromCSV(ArrayList array) {
                int i = 0;
                foreach(PersonAddMultipleTable pamt in array) {


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