2 ===================================================================
3 RCS file: /cvs/gpe/base/gpe-contacts/editing.c,v
4 retrieving revision 1.59
5 diff -u -r1.59 editing.c
6 --- editing.c 20 Oct 2004 14:00:36 -0000 1.59
7 +++ editing.c 24 Oct 2004 22:32:43 -0000
9 void on_name_clicked (GtkButton *button, gpointer user_data);
13 /* this is the filter for phone number edits */
15 -phone_key_press_event (GtkWidget *widget, GdkEventKey *k, gpointer p)
17 +on_phone_insert_text(GtkEditable *editable, gchar *new_text,
18 + gint new_text_length, gint *position,
21 - if (!strstr(" +0123456789-/()", k->string)
22 - && !(k->state & GDK_CONTROL_MASK))
28 + gboolean isok = TRUE;
30 + for (i = 0; i < new_text_length; i++)
31 + if (!strchr(" +0123456789-/()", new_text[i]))
37 + gtk_signal_emit_stop_by_name(GTK_OBJECT(editable), "insert-text");
42 || strstr(e->tag,".MOBILE")
43 || strstr(e->tag,".FAX"))
45 - g_signal_connect (G_OBJECT (w), "key_press_event",
46 - G_CALLBACK (phone_key_press_event), NULL);
47 + g_signal_connect (G_OBJECT (w), "insert-text",
48 + G_CALLBACK (on_phone_insert_text), NULL);
50 if (strcasecmp(e->tag, "NAME")) /* the name field on a button */