From 36d90739a4c2a3babf0497c0e474e2383d639a5d Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Mon, 10 Feb 2003 20:51:10 +0000 Subject: [ fixes bug #33066 ] new function (set_entry_changed_signals): call 2003-02-10 Chris Toshok [ fixes bug #33066 ] * gui/contact-editor/e-contact-editor.c (set_urlentry_changed_signal_field): new function (set_entry_changed_signals): call set_urlentry_changed_signal_field for entry-web, entry-caluri, and entry-fburl. (fill_in_field): add handling for EUrlEntry's. (extract_field): same. (enable_widget): same. (e_contact_editor_create_date): show the widget. (e_contact_editor_create_web): same, create a url entry. (set_urlentry_changed_signal_field): new function * gui/contact-editor/contact-editor.glade: entry-web, entry-caluri, and entry-fburl are all custom widgets now. svn path=/trunk/; revision=19879 --- .../gui/contact-editor/contact-editor.glade | 72 ++++++++++------------ addressbook/gui/contact-editor/e-contact-editor.c | 48 +++++++++++++-- 2 files changed, 74 insertions(+), 46 deletions(-) (limited to 'addressbook/gui/contact-editor') diff --git a/addressbook/gui/contact-editor/contact-editor.glade b/addressbook/gui/contact-editor/contact-editor.glade index c574310f2b..7f9f83a970 100644 --- a/addressbook/gui/contact-editor/contact-editor.glade +++ b/addressbook/gui/contact-editor/contact-editor.glade @@ -684,27 +684,6 @@ - - - True - True - True - True - 0 - - True - * - False - - - 3 - 4 - 8 - 9 - - - - True @@ -1435,6 +1414,24 @@ fill + + + + True + e_contact_editor_create_web + 0 + 0 + Sat, 08 Feb 2003 09:14:46 GMT + + + 3 + 4 + 8 + 9 + fill + fill + + False @@ -2179,44 +2176,37 @@ of that information here. - + True - True - True - True - 0 - - True - * - False + e_contact_editor_create_web + 0 + 0 + Mon, 10 Feb 2003 20:37:57 GMT 1 2 0 1 - + fill - + True - True - True - True - 0 - - True - * - False + e_contact_editor_create_web + 0 + 0 + Mon, 10 Feb 2003 20:38:00 GMT 1 2 1 2 - + fill + fill diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 1b726c04e3..038ca7825d 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -52,6 +52,7 @@ #include "addressbook/gui/widgets/e-addressbook-util.h" #include "e-util/e-gui-utils.h" #include "widgets/misc/e-dateedit.h" +#include "widgets/misc/e-url-entry.h" #include "shell/evolution-shell-component-utils.h" #include "e-card-merging.h" @@ -643,6 +644,17 @@ set_entry_changed_signal_field(EContactEditor *editor, char *id) G_CALLBACK (field_changed), editor); } +static void +set_urlentry_changed_signal_field (EContactEditor *editor, char *id) +{ + GtkWidget *widget = glade_xml_get_widget(editor->gui, id); + if (widget && E_IS_URL_ENTRY(widget)) { + GtkWidget *entry = e_url_entry_get_entry (E_URL_ENTRY (widget)); + g_signal_connect (entry, "changed", + G_CALLBACK (field_changed), editor); + } +} + static void set_entry_changed_signals(EContactEditor *editor) { @@ -673,7 +685,10 @@ set_entry_changed_signals(EContactEditor *editor) G_CALLBACK (company_entry_changed), editor); } - set_entry_changed_signal_field(editor, "entry-web"); + set_urlentry_changed_signal_field (editor, "entry-web"); + set_urlentry_changed_signal_field (editor, "entry-caluri"); + set_urlentry_changed_signal_field (editor, "entry-fburl"); + set_entry_changed_signal_field(editor, "entry-categories"); set_entry_changed_signal_field(editor, "entry-jobtitle"); set_entry_changed_signal_field(editor, "entry-file-as"); @@ -701,10 +716,6 @@ set_entry_changed_signals(EContactEditor *editor) g_signal_connect (widget, "changed", G_CALLBACK (widget_changed), editor); } - - set_entry_changed_signal_field(editor, "entry-caluri"); - set_entry_changed_signal_field(editor, "entry-fburl"); - } static void @@ -2131,6 +2142,10 @@ static void fill_in_field(EContactEditor *editor, char *id, char *value) { GtkWidget *widget = glade_xml_get_widget(editor->gui, id); + + if (widget && E_IS_URL_ENTRY (widget)) + widget = e_url_entry_get_entry (E_URL_ENTRY (widget)); + if (widget && GTK_IS_EDITABLE(widget)) { int position = 0; GtkEditable *editable = GTK_EDITABLE(widget); @@ -2498,6 +2513,9 @@ extract_field(EContactEditor *editor, ECard *card, char *editable_id, char *key) { GtkWidget *widget = glade_xml_get_widget(editor->gui, editable_id); + if (widget && E_IS_URL_ENTRY (widget)) + widget = e_url_entry_get_entry (E_URL_ENTRY (widget)); + if (widget && GTK_IS_EDITABLE (widget)) { GtkEditable *editable = GTK_EDITABLE(widget); char *string = gtk_editable_get_chars(editable, 0, -1); @@ -2650,6 +2668,22 @@ e_contact_editor_create_date(gchar *name, TRUE); e_date_edit_set_show_time (E_DATE_EDIT (widget), FALSE); e_date_edit_set_time (E_DATE_EDIT (widget), -1); + gtk_widget_show (widget); + return widget; +} + +GtkWidget * +e_contact_editor_create_web(gchar *name, + gchar *string1, gchar *string2, + gint int1, gint int2); + +GtkWidget * +e_contact_editor_create_web(gchar *name, + gchar *string1, gchar *string2, + gint int1, gint int2) +{ + GtkWidget *widget = e_url_entry_new (); + gtk_widget_show (widget); return widget; } @@ -2667,6 +2701,10 @@ enable_widget (GtkWidget *widget, gboolean enabled) enabled); gtk_widget_set_sensitive (GTK_COMBO (widget)->button, enabled); } + else if (E_IS_URL_ENTRY (widget)) { + GtkWidget *e = e_url_entry_get_entry (E_URL_ENTRY (widget)); + gtk_editable_set_editable (GTK_EDITABLE (e), enabled); + } else if (E_IS_DATE_EDIT (widget)) { e_date_edit_set_editable (E_DATE_EDIT (widget), enabled); } -- cgit v1.2.3