From c38f4954e131417f113a239831518d14ab5709fc Mon Sep 17 00:00:00 2001 From: Sushma Rai Date: Wed, 26 Oct 2005 09:48:19 +0000 Subject: Setting the focus to the corresponding entry field after changing dropdown menus for phone, email and im in contact editor. Fixes #229972. svn path=/trunk/; revision=30566 --- addressbook/gui/contact-editor/e-contact-editor.c | 41 +++++++++++++++++------ 1 file changed, 30 insertions(+), 11 deletions(-) (limited to 'addressbook/gui/contact-editor/e-contact-editor.c') diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 2993e4c403..535285ba6c 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -641,6 +641,12 @@ set_option_menu_history (EContactEditor *editor, GtkOptionMenu *option_menu, gin 0, 0, NULL, NULL, editor); } +static void +email_menu_changed(GtkWidget *widget, GtkWidget *next) +{ + gtk_widget_grab_focus(next); +} + static void init_email_record_location (EContactEditor *editor, gint record) { @@ -671,6 +677,7 @@ init_email_record_location (EContactEditor *editor, gint record) gtk_option_menu_set_menu (GTK_OPTION_MENU (location_option_menu), location_menu); g_signal_connect (location_option_menu, "changed", G_CALLBACK (object_changed), editor); + g_signal_connect (location_option_menu, "changed", G_CALLBACK (email_menu_changed), email_entry); g_signal_connect (email_entry, "changed", G_CALLBACK (object_changed), editor); g_signal_connect_swapped (email_entry, "activate", G_CALLBACK (entry_activated), editor); } @@ -1208,6 +1215,12 @@ extract_phone (EContactEditor *editor) free_attr_list (attr_list); } +static void +phone_menu_changed(GtkWidget *widget, GtkWidget *next) +{ + gtk_widget_grab_focus(next); +} + static void init_phone_record_type (EContactEditor *editor, gint record) { @@ -1238,6 +1251,7 @@ init_phone_record_type (EContactEditor *editor, gint record) gtk_option_menu_set_menu (GTK_OPTION_MENU (phone_type_option_menu), phone_type_menu); g_signal_connect (phone_type_option_menu, "changed", G_CALLBACK (object_changed), editor); + g_signal_connect (phone_type_option_menu, "changed", G_CALLBACK (phone_menu_changed), phone_entry); g_signal_connect (phone_entry, "changed", G_CALLBACK (object_changed), editor); g_signal_connect_swapped (phone_entry, "activate", G_CALLBACK (entry_activated), editor); } @@ -1317,19 +1331,13 @@ sensitize_phone (EContactEditor *editor) static void init_im_record_location (EContactEditor *editor, gint record) { + #ifdef ENABLE_IM_LOCATION GtkWidget *location_option_menu; GtkWidget *location_menu; gint i; -#endif - GtkWidget *name_entry; - gchar *widget_name; - - widget_name = g_strdup_printf ("entry-im-name-%d", record); - name_entry = glade_xml_get_widget (editor->gui, widget_name); - g_free (widget_name); - -#ifdef ENABLE_IM_LOCATION + gchar *widget_name; + widget_name = g_strdup_printf ("optionmenu-im-location-%d", record); location_option_menu = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); @@ -1348,9 +1356,12 @@ init_im_record_location (EContactEditor *editor, gint record) g_signal_connect (location_option_menu, "changed", G_CALLBACK (object_changed), editor); #endif +} - g_signal_connect (name_entry, "changed", G_CALLBACK (object_changed), editor); - g_signal_connect_swapped (name_entry, "activate", G_CALLBACK (entry_activated), editor); +static void +im_menu_changed(GtkWidget *widget, GtkWidget *next) +{ + gtk_widget_grab_focus(next); } static void @@ -1358,9 +1369,14 @@ init_im_record_service (EContactEditor *editor, gint record) { GtkWidget *service_option_menu; GtkWidget *service_menu; + GtkWidget *name_entry; gchar *widget_name; gint i; + widget_name = g_strdup_printf ("entry-im-name-%d", record); + name_entry = glade_xml_get_widget (editor->gui, widget_name); + g_free (widget_name); + widget_name = g_strdup_printf ("optionmenu-im-service-%d", record); service_option_menu = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); @@ -1378,6 +1394,9 @@ init_im_record_service (EContactEditor *editor, gint record) gtk_option_menu_set_menu (GTK_OPTION_MENU (service_option_menu), service_menu); g_signal_connect (service_option_menu, "changed", G_CALLBACK (object_changed), editor); + g_signal_connect (service_option_menu, "changed", G_CALLBACK (im_menu_changed), name_entry); + g_signal_connect (name_entry, "changed", G_CALLBACK (object_changed), editor); + g_signal_connect_swapped (name_entry, "activate", G_CALLBACK (entry_activated), editor); } static void -- cgit