diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-04-25 22:07:44 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-04-25 22:07:44 +0800 |
commit | 86fdd3a1cba7c156cfa127322e258f5636b45a99 (patch) | |
tree | e49802fd9008a59587fca1cafb1801b8b3bf0db6 /addressbook/gui/contact-editor/e-contact-editor.c | |
parent | c2119e513bc7482fc0150287af8502a5ff67191a (diff) | |
parent | 23df769955ea54f756a579c19964df87ae6fd5c8 (diff) | |
download | gsoc2013-evolution-86fdd3a1cba7c156cfa127322e258f5636b45a99.tar gsoc2013-evolution-86fdd3a1cba7c156cfa127322e258f5636b45a99.tar.gz gsoc2013-evolution-86fdd3a1cba7c156cfa127322e258f5636b45a99.tar.bz2 gsoc2013-evolution-86fdd3a1cba7c156cfa127322e258f5636b45a99.tar.lz gsoc2013-evolution-86fdd3a1cba7c156cfa127322e258f5636b45a99.tar.xz gsoc2013-evolution-86fdd3a1cba7c156cfa127322e258f5636b45a99.tar.zst gsoc2013-evolution-86fdd3a1cba7c156cfa127322e258f5636b45a99.zip |
Merge branch 'master' into kill-bonobo
This was a particularly messy merge. Watch out for regressions!
Conflicts:
ChangeLog
NEWS
a11y/ChangeLog
a11y/widgets/ea-combo-button.c
a11y/widgets/ea-combo-button.h
a11y/widgets/ea-widgets.c
addressbook/ChangeLog
addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in
addressbook/gui/component/addressbook-component.c
addressbook/gui/component/addressbook-component.h
addressbook/gui/component/addressbook-config.c
addressbook/gui/component/addressbook-migrate.h
addressbook/gui/component/addressbook-view.c
addressbook/gui/component/addressbook-view.h
addressbook/gui/component/addressbook.h
addressbook/gui/component/autocompletion-config.c
addressbook/gui/component/autocompletion-config.h
addressbook/gui/component/component-factory.c
addressbook/gui/component/e-book-shell-module-migrate.c
addressbook/gui/component/ldap-config.glade
addressbook/gui/contact-editor/Makefile.am
addressbook/gui/contact-editor/contact-editor.glade
addressbook/gui/contact-editor/e-contact-editor-address.c
addressbook/gui/contact-editor/e-contact-editor-address.h
addressbook/gui/contact-editor/e-contact-editor-im.c
addressbook/gui/contact-editor/e-contact-editor-im.h
addressbook/gui/contact-editor/e-contact-editor.c
addressbook/gui/contact-editor/e-contact-editor.h
addressbook/gui/contact-editor/eab-editor.c
addressbook/gui/contact-editor/eab-editor.h
addressbook/gui/contact-editor/test-editor.c
addressbook/gui/contact-list-editor/Makefile.am
addressbook/gui/widgets/Makefile.am
addressbook/gui/widgets/e-addressbook-model.c
addressbook/gui/widgets/e-addressbook-model.h
addressbook/gui/widgets/e-addressbook-reflow-adapter.c
addressbook/gui/widgets/e-addressbook-view.c
addressbook/gui/widgets/e-addressbook-view.h
addressbook/gui/widgets/e-minicard-view.c
addressbook/gui/widgets/eab-contact-display.c
addressbook/gui/widgets/eab-gui-util.c
addressbook/gui/widgets/eab-menu.c
addressbook/gui/widgets/eab-menu.h
addressbook/gui/widgets/eab-popup-control.c
addressbook/gui/widgets/eab-popup-control.h
addressbook/gui/widgets/eab-popup.c
addressbook/gui/widgets/eab-popup.h
addressbook/gui/widgets/eab-vcard-control.c
addressbook/gui/widgets/eab-vcard-control.h
addressbook/gui/widgets/gal-view-minicard.c
addressbook/gui/widgets/gal-view-minicard.h
addressbook/printing/e-contact-print-style-editor.c
addressbook/printing/e-contact-print-style-editor.h
addressbook/printing/e-contact-print.glade
addressbook/printing/test-contact-print-style-editor.c
addressbook/tools/evolution-addressbook-export.c
addressbook/util/Makefile.am
calendar/ChangeLog
calendar/gui/Makefile.am
calendar/gui/apps_evolution_calendar.schemas.in
calendar/gui/calendar-component.c
calendar/gui/calendar-component.h
calendar/gui/calendar-config.c
calendar/gui/comp-editor-factory.c
calendar/gui/comp-editor-factory.h
calendar/gui/comp-util.c
calendar/gui/comp-util.h
calendar/gui/control-factory.c
calendar/gui/control-factory.h
calendar/gui/dialogs/alarm-dialog.c
calendar/gui/dialogs/cal-prefs-dialog.c
calendar/gui/dialogs/cal-prefs-dialog.glade
calendar/gui/dialogs/cal-prefs-dialog.h
calendar/gui/dialogs/comp-editor.c
calendar/gui/dialogs/comp-editor.h
calendar/gui/dialogs/event-editor.c
calendar/gui/dialogs/event-page.c
calendar/gui/dialogs/memo-editor.c
calendar/gui/dialogs/memo-page.c
calendar/gui/dialogs/recurrence-page.c
calendar/gui/dialogs/task-details-page.c
calendar/gui/dialogs/task-details-page.glade
calendar/gui/dialogs/task-editor.c
calendar/gui/dialogs/task-page.c
calendar/gui/e-cal-component-memo-preview.c
calendar/gui/e-cal-component-memo-preview.h
calendar/gui/e-cal-component-preview.c
calendar/gui/e-cal-component-preview.h
calendar/gui/e-cal-event.h
calendar/gui/e-cal-model.c
calendar/gui/e-cal-popup.c
calendar/gui/e-calendar-table.c
calendar/gui/e-calendar-view.c
calendar/gui/e-day-view.c
calendar/gui/e-itip-control.c
calendar/gui/e-memo-table.c
calendar/gui/e-memos.c
calendar/gui/e-memos.h
calendar/gui/e-tasks.c
calendar/gui/e-tasks.h
calendar/gui/e-week-view.c
calendar/gui/gnome-cal.c
calendar/gui/goto.c
calendar/gui/itip-bonobo-control.c
calendar/gui/itip-bonobo-control.h
calendar/gui/itip-utils.c
calendar/gui/itip-utils.h
calendar/gui/main.c
calendar/gui/memos-component.c
calendar/gui/memos-control.c
calendar/gui/memos-control.h
calendar/gui/migration.c
calendar/gui/migration.h
calendar/gui/tasks-component.c
calendar/gui/tasks-control.c
calendar/importers/main.c
composer/ChangeLog
composer/e-composer-actions.c
composer/e-composer-private.c
composer/e-msg-composer.c
composer/e-msg-composer.h
composer/evolution-composer.ui
configure.in
doc/reference/shell/eshell-overrides.txt
e-util/ChangeLog
e-util/Makefile.am
e-util/e-corba-utils.c
e-util/e-corba-utils.h
e-util/e-gui-utils.c
e-util/e-gui-utils.h
e-util/e-logger.c
e-util/e-non-intrusive-error-dialog.c
e-util/e-non-intrusive-error-dialog.h
e-util/e-plugin-ui.c
e-util/e-util-labels.c
e-util/e-util-labels.h
e-util/e-util.c
e-util/e-util.h
filter/ChangeLog
filter/filter-option.c
help/C/evolution.xml
help/ChangeLog
help/Makefile.am
help/cs/cs.po
help/de/de.po
help/es/es.po
help/eu/figures/Screenshot-Free-Busy.png
help/eu/figures/evo_blink.png
help/eu/figures/evo_dialog-info.png
help/eu/figures/evo_dialog-warning.png
help/eu/figures/evo_email_a.png
help/eu/figures/evo_flag_follow_up_a.png
help/eu/figures/evo_proxyadd_a.png
help/eu/figures/evo_shd_memo_a.png
help/eu/figures/exchange-delegation.png
help/eu/figures/exchange-identity.png
help/eu/figures/exchange-receive-options.png
help/eu/figures/exchange-receive.png
help/eu/figures/exchg-identity.png
help/eu/figures/exchng-identity.png
help/eu/figures/exchng-rec-mail.png
help/eu/figures/exchng-rec-option.png
help/eu/figures/exchng-rec-options.png
help/eu/figures/free_busy.png
help/eu/figures/full-1.png
help/eu/figures/full-2.png
help/eu/figures/full-3.png
help/eu/figures/full-4.png
help/eu/figures/full-5.png
help/eu/figures/full-6.png
help/eu/figures/full-7.png
help/eu/figures/mail-druid-pic.png
help/eu/figures/mail-inbox.png
help/eu/figures/mail-threaded.png
help/eu/figures/mainwindow-pic.png
help/eu/figures/minus.png
help/eu/figures/plus.png
help/eu/figures/proxy-cal.png
help/eu/figures/proxy-login.png
help/eu/figures/schedule.png
help/eu/figures/stock_search.png
help/eu/figures/sub-others-folder.png
help/eu/figures/sub-pub-fold.png
help/eu/figures/vfolder-createrule-fig.png
help/quickref/Makefile.am
mail/ChangeLog
mail/Makefile.am
mail/default/Makefile.am
mail/e-mail-shell-module-migrate.c
mail/e-searching-tokenizer.c
mail/em-account-editor.c
mail/em-account-prefs.h
mail/em-composer-prefs.c
mail/em-composer-prefs.h
mail/em-composer-utils.c
mail/em-filter-folder-element.c
mail/em-folder-browser.c
mail/em-folder-selection-button.h
mail/em-folder-selector.c
mail/em-folder-tree-model.c
mail/em-folder-tree-model.h
mail/em-folder-tree.c
mail/em-folder-tree.h
mail/em-folder-utils.c
mail/em-folder-utils.h
mail/em-folder-view.c
mail/em-format-html-display.c
mail/em-format-html-print.c
mail/em-format-html-print.h
mail/em-format-html.c
mail/em-format-quote.h
mail/em-format.c
mail/em-format.h
mail/em-html-stream.h
mail/em-mailer-prefs.c
mail/em-mailer-prefs.h
mail/em-message-browser.c
mail/em-message-browser.h
mail/em-migrate.h
mail/em-network-prefs.h
mail/em-popup.c
mail/em-search-context.h
mail/em-subscribe-editor.c
mail/em-utils.c
mail/em-utils.h
mail/filtertypes.xml
mail/mail-component-factory.c
mail/mail-component.c
mail/mail-config-factory.c
mail/mail-config-factory.h
mail/mail-config.c
mail/mail-config.glade
mail/mail-crypto.c
mail/mail-crypto.h
mail/mail-dialogs.glade
mail/mail-folder-cache.c
mail/mail-mt.c
mail/mail-send-recv.c
mail/mail-send-recv.h
mail/mail-session.c
mail/mail-session.h
mail/mail-types.h
mail/mail-vfolder.c
mail/message-list.c
mail/message-tag-followup.c
mail/searchtypes.xml
mail/vfoldertypes.xml
plugins/attachment-reminder/Makefile.am
plugins/audio-inline/org-gnome-audio-inline.eplug.xml
plugins/caldav/ChangeLog
plugins/caldav/caldav-source.c
plugins/calendar-http/ChangeLog
plugins/calendar-weather/ChangeLog
plugins/calendar-weather/calendar-weather.c
plugins/email-custom-header/ChangeLog
plugins/email-custom-header/email-custom-header.c
plugins/exchange-operations/ChangeLog
plugins/google-account-setup/ChangeLog
plugins/google-account-setup/Makefile.am
plugins/google-account-setup/google-contacts-source.c
plugins/google-account-setup/google-source.c
plugins/import-ics-attachments/ChangeLog
plugins/import-ics-attachments/Makefile.am
plugins/import-ics-attachments/icsimporter.c
plugins/itip-formatter/ChangeLog
plugins/itip-formatter/itip-view.c
plugins/mail-account-disable/ChangeLog
plugins/mail-account-disable/mail-account-disable.c
plugins/mail-notification/ChangeLog
plugins/mail-notification/mail-notification.c
plugins/mail-to-meeting/ChangeLog
plugins/mail-to-task/ChangeLog
plugins/mark-all-read/mark-all-read.c
plugins/publish-calendar/ChangeLog
plugins/publish-calendar/publish-format-fb.c
plugins/publish-calendar/publish-format-ical.c
plugins/save-attachments/ChangeLog
plugins/save-attachments/Makefile.am
plugins/save-attachments/save-attachments.c
plugins/select-one-source/ChangeLog
plugins/select-one-source/Makefile.am
plugins/select-one-source/select-one-source.c
plugins/startup-wizard/ChangeLog
plugins/startup-wizard/startup-wizard.c
plugins/webdav-account-setup/ChangeLog
plugins/webdav-account-setup/Makefile.am
plugins/webdav-account-setup/webdav-contacts-source.c
po/ChangeLog
po/POTFILES.in
po/ar.po
po/bg.po
po/bn_IN.po
po/ca.po
po/cs.po
po/da.po
po/de.po
po/el.po
po/en_GB.po
po/es.po
po/et.po
po/fr.po
po/gl.po
po/gu.po
po/hi.po
po/hu.po
po/it.po
po/ja.po
po/kn.po
po/ko.po
po/lt.po
po/ml.po
po/mr.po
po/nb.po
po/nl.po
po/pa.po
po/pl.po
po/pt.po
po/ru.po
po/sl.po
po/sr.po
po/sr@latin.po
po/sv.po
po/ta.po
po/te.po
po/th.po
po/tr.po
po/zh_HK.po
po/zh_TW.po
shell/ChangeLog
shell/Evolution-Component.idl
shell/Makefile.am
shell/apps_evolution_shell.schemas.in
shell/e-component-registry.c
shell/e-component-registry.h
shell/e-component-view.c
shell/e-component-view.h
shell/e-corba-config-page.c
shell/e-corba-config-page.h
shell/e-shell-constants.h
shell/e-shell-importer.c
shell/e-shell-importer.h
shell/e-shell-nm.c
shell/e-shell-settings-dialog.c
shell/e-shell-settings-dialog.h
shell/e-shell-view.c
shell/e-shell-view.h
shell/e-shell-window-commands.c
shell/e-shell-window-commands.h
shell/e-shell-window.c
shell/e-shell-window.h
shell/e-shell.c
shell/e-shell.h
shell/e-sidebar.c
shell/e-sidebar.h
shell/e-user-creatable-items-handler.c
shell/e-user-creatable-items-handler.h
shell/es-menu.c
shell/es-menu.h
shell/evolution-component.c
shell/evolution-component.h
shell/evolution-config-control.c
shell/evolution-config-control.h
shell/evolution-listener.c
shell/evolution-listener.h
shell/evolution-shell-component-utils.c
shell/evolution-shell-component-utils.h
shell/importer/evolution-importer-client.c
shell/importer/evolution-importer-client.h
shell/importer/evolution-importer-listener.c
shell/importer/evolution-importer-listener.h
shell/importer/evolution-importer.c
shell/importer/evolution-importer.h
shell/importer/evolution-intelligent-importer.c
shell/importer/evolution-intelligent-importer.h
shell/importer/import.glade
shell/importer/intelligent.c
shell/importer/intelligent.h
shell/main.c
shell/shell.error.xml
shell/test/evolution-test-component.c
shell/test/evolution-test-component.h
smime/ChangeLog
smime/lib/Makefile.am
ui/Makefile.am
ui/evolution-addressbook.xml
ui/evolution-calendar.xml
widgets/ChangeLog
widgets/menus/gal-view-menus.c
widgets/menus/gal-view-menus.h
widgets/misc/ChangeLog
widgets/misc/Makefile.am
widgets/misc/e-activity-handler.c
widgets/misc/e-activity-handler.h
widgets/misc/e-attachment-bar.c
widgets/misc/e-attachment-bar.h
widgets/misc/e-attachment.c
widgets/misc/e-attachment.h
widgets/misc/e-calendar-item.c
widgets/misc/e-charset-picker.c
widgets/misc/e-combo-button.c
widgets/misc/e-combo-button.h
widgets/misc/e-config-page.c
widgets/misc/e-config-page.h
widgets/misc/e-dropdown-button.c
widgets/misc/e-dropdown-button.h
widgets/misc/e-filter-bar.h
widgets/misc/e-info-label.c
widgets/misc/e-info-label.h
widgets/misc/e-multi-config-dialog.c
widgets/misc/e-multi-config-dialog.h
widgets/misc/e-online-button.c
widgets/misc/e-search-bar.c
widgets/misc/e-search-bar.h
widgets/misc/e-signature-combo-box.c
widgets/misc/e-signature-combo-box.h
widgets/misc/e-signature-editor.c
widgets/misc/e-signature-editor.h
widgets/misc/e-task-bar.c
widgets/misc/e-task-bar.h
widgets/misc/e-task-widget.c
widgets/misc/e-task-widget.h
widgets/misc/test-dropdown-button.c
widgets/misc/test-info-label.c
widgets/misc/test-multi-config-dialog.c
widgets/table/ChangeLog
widgets/table/e-cell-date.c
widgets/table/e-table-group-container.c
widgets/table/e-table-group-leaf.c
widgets/table/e-table-group.c
widgets/table/e-table-group.h
widgets/table/e-table.c
widgets/table/e-table.h
Diffstat (limited to 'addressbook/gui/contact-editor/e-contact-editor.c')
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor.c | 370 |
1 files changed, 196 insertions, 174 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 24b807cf3a..e4447b9075 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -54,8 +54,6 @@ #include "eab-contact-merging.h" -#include "e-contact-editor-address.h" -#include "e-contact-editor-im.h" #include "e-contact-editor-fullname.h" #define EMAIL_SLOTS 4 @@ -500,7 +498,7 @@ name_to_style (const EContactName *name, const gchar *company, int style) static int file_as_get_style (EContactEditor *editor) { - GtkEntry *file_as = GTK_ENTRY(glade_xml_get_widget(editor->gui, "entry-file-as")); + GtkEntry *file_as = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (glade_xml_get_widget(editor->gui, "combo-file-as")))); GtkEntry *company_w = GTK_ENTRY (glade_xml_get_widget (editor->gui, "entry-company")); char *filestring; char *trystring; @@ -533,23 +531,20 @@ file_as_set_style (EContactEditor *editor, int style) char *string; int i; GList *strings = NULL; - GtkEntry *file_as = GTK_ENTRY (glade_xml_get_widget (editor->gui, "entry-file-as")); + GtkComboBox *combo_file_as = GTK_COMBO_BOX (glade_xml_get_widget (editor->gui, "combo-file-as")); GtkEntry *company_w = GTK_ENTRY (glade_xml_get_widget (editor->gui, "entry-company")); - GtkWidget *widget; const gchar *company; - if (!(file_as && GTK_IS_ENTRY (file_as))) + if (!(combo_file_as && GTK_IS_COMBO_BOX_ENTRY (combo_file_as))) return; company = gtk_entry_get_text (GTK_ENTRY (company_w)); if (style == -1) { - string = g_strdup (gtk_entry_get_text(file_as)); + string = gtk_combo_box_get_active_text (combo_file_as); strings = g_list_append (strings, string); } - widget = glade_xml_get_widget (editor->gui, "combo-file-as"); - for (i = 0; i < 6; i++) { if (style_makes_sense (editor->name, company, i)) { char *u; @@ -561,16 +556,22 @@ file_as_set_style (EContactEditor *editor, int style) } } - if (widget && GTK_IS_COMBO (widget)) { - GtkCombo *combo = GTK_COMBO (widget); - gtk_combo_set_popdown_strings (combo, strings); - g_list_foreach (strings, (GFunc) g_free, NULL); - g_list_free (strings); + if (combo_file_as) { + GList *l; + + gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (combo_file_as))); + + for (l = strings; l; l = l->next) { + gtk_combo_box_append_text (combo_file_as, l->data); + } } + g_list_foreach (strings, (GFunc) g_free, NULL); + g_list_free (strings); + if (style != -1) { string = name_to_style (editor->name, company, style); - set_entry_text (editor, file_as, string); + set_entry_text (editor, GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo_file_as))), string); g_free (string); } } @@ -593,9 +594,9 @@ name_entry_changed (GtkWidget *widget, EContactEditor *editor) } static void -file_as_entry_changed (GtkWidget *widget, EContactEditor *editor) +file_as_combo_changed (GtkWidget *widget, EContactEditor *editor) { - char *string = gtk_editable_get_chars (GTK_EDITABLE (widget), 0, -1); + char *string = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget)); if (string && *string) { gchar *title; @@ -648,7 +649,7 @@ sensitize_ok (EContactEditor *ce) GtkWidget *widget; gboolean allow_save; GtkWidget *entry_fullname = glade_xml_get_widget (ce->gui, "entry-fullname" ); - GtkWidget *entry_file_as = glade_xml_get_widget (ce->gui, "entry-file-as"); + GtkWidget *entry_file_as = gtk_bin_get_child (GTK_BIN (glade_xml_get_widget (ce->gui, "combo-file-as"))); GtkWidget *company_name = glade_xml_get_widget (ce->gui, "entry-company"); const char *name_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_fullname)); const char *file_as_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_file_as)); @@ -706,26 +707,19 @@ set_entry_text (EContactEditor *editor, GtkEntry *entry, const gchar *string) } static void -set_option_menu_history (EContactEditor *editor, GtkOptionMenu *option_menu, gint history) +set_combo_box_active (EContactEditor *editor, GtkComboBox *combo_box, gint active) { - g_signal_handlers_block_matched (option_menu, G_SIGNAL_MATCH_DATA, + g_signal_handlers_block_matched (combo_box, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, editor); - gtk_option_menu_set_history (option_menu, history); - g_signal_handlers_unblock_matched (option_menu, G_SIGNAL_MATCH_DATA, + gtk_combo_box_set_active (combo_box, active); + g_signal_handlers_unblock_matched (combo_box, G_SIGNAL_MATCH_DATA, 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) { - GtkWidget *location_option_menu; - GtkWidget *location_menu; + GtkComboBox *location_combo_box; GtkWidget *email_entry; gchar *widget_name; gint i; @@ -734,24 +728,18 @@ init_email_record_location (EContactEditor *editor, gint record) email_entry = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); - widget_name = g_strdup_printf ("optionmenu-email-%d", record); - location_option_menu = glade_xml_get_widget (editor->gui, widget_name); + widget_name = g_strdup_printf ("combobox-email-%d", record); + location_combo_box = GTK_COMBO_BOX (glade_xml_get_widget (editor->gui, widget_name)); g_free (widget_name); - location_menu = gtk_menu_new (); + gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (location_combo_box))); for (i = 0; i < G_N_ELEMENTS (common_location); i++) { - GtkWidget *item; - - item = gtk_menu_item_new_with_label (_(common_location [i].pretty_name)); - gtk_menu_shell_append (GTK_MENU_SHELL (location_menu), item); -+ g_signal_connect (item, "activate", G_CALLBACK (email_menu_changed), email_entry); + gtk_combo_box_append_text (location_combo_box, _(common_location [i].pretty_name)); } - gtk_widget_show_all (location_menu); - 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_swapped (location_combo_box, "changed", G_CALLBACK (gtk_widget_grab_focus), email_entry); + g_signal_connect (location_combo_box, "changed", G_CALLBACK (object_changed), editor); g_signal_connect (email_entry, "changed", G_CALLBACK (object_changed), editor); g_signal_connect_swapped (email_entry, "activate", G_CALLBACK (entry_activated), editor); } @@ -768,19 +756,19 @@ init_email (EContactEditor *editor) static void fill_in_email_record (EContactEditor *editor, gint record, const gchar *address, gint location) { - GtkWidget *location_option_menu; + GtkWidget *location_combo_box; GtkWidget *email_entry; gchar *widget_name; - widget_name = g_strdup_printf ("optionmenu-email-%d", record); - location_option_menu = glade_xml_get_widget (editor->gui, widget_name); + widget_name = g_strdup_printf ("combobox-email-%d", record); + location_combo_box = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); widget_name = g_strdup_printf ("entry-email-%d", record); email_entry = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); - set_option_menu_history (editor, GTK_OPTION_MENU (location_option_menu), + set_combo_box_active (editor, GTK_COMBO_BOX (location_combo_box), location >= 0 ? location : email_default [2]); set_entry_text (editor, GTK_ENTRY (email_entry), address ? address : ""); } @@ -788,12 +776,12 @@ fill_in_email_record (EContactEditor *editor, gint record, const gchar *address, static void extract_email_record (EContactEditor *editor, gint record, gchar **address, gint *location) { - GtkWidget *location_option_menu; + GtkWidget *location_combo_box; GtkWidget *email_entry; gchar *widget_name; - widget_name = g_strdup_printf ("optionmenu-email-%d", record); - location_option_menu = glade_xml_get_widget (editor->gui, widget_name); + widget_name = g_strdup_printf ("combobox-email-%d", record); + location_combo_box = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); widget_name = g_strdup_printf ("entry-email-%d", record); @@ -801,7 +789,7 @@ extract_email_record (EContactEditor *editor, gint record, gchar **address, gint g_free (widget_name); *address = g_strdup (gtk_entry_get_text (GTK_ENTRY (email_entry))); - *location = gtk_option_menu_get_history (GTK_OPTION_MENU (location_option_menu)); + *location = gtk_combo_box_get_active (GTK_COMBO_BOX (location_combo_box)); } static const gchar * @@ -1059,19 +1047,19 @@ extract_email (EContactEditor *editor) static void sensitize_email_record (EContactEditor *editor, gint record, gboolean enabled) { - GtkWidget *location_option_menu; + GtkWidget *location_combo_box; GtkWidget *email_entry; gchar *widget_name; - widget_name = g_strdup_printf ("optionmenu-email-%d", record); - location_option_menu = glade_xml_get_widget (editor->gui, widget_name); + widget_name = g_strdup_printf ("combobox-email-%d", record); + location_combo_box = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); widget_name = g_strdup_printf ("entry-email-%d", record); email_entry = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); - gtk_widget_set_sensitive (location_option_menu, enabled); + gtk_widget_set_sensitive (location_combo_box, enabled); gtk_editable_set_editable (GTK_EDITABLE (email_entry), enabled); } @@ -1094,6 +1082,29 @@ sensitize_email (EContactEditor *editor) } } +static void +init_item_sensitiveable_combo_box (GtkComboBox *combo) +{ + GtkCellRenderer *cell; + GtkListStore *store; + + g_return_if_fail (combo != NULL); + g_return_if_fail (GTK_IS_COMBO_BOX (combo)); + + store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_BOOLEAN); + gtk_combo_box_set_model (combo, GTK_TREE_MODEL (store)); + g_object_unref (store); + + gtk_cell_layout_clear (GTK_CELL_LAYOUT (combo)); + + cell = gtk_cell_renderer_text_new (); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, TRUE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), cell, + "text", 0, + "sensitive", 1, + NULL); +} + /* EContact can get attributes by field ID only, and there is none for TEL, so we need this */ static GList * get_attributes_named (EVCard *vcard, const gchar *attr_name) @@ -1154,19 +1165,19 @@ expand_phone (EContactEditor *editor, gboolean expanded) static void fill_in_phone_record (EContactEditor *editor, gint record, const gchar *phone, gint phone_type) { - GtkWidget *phone_type_option_menu; + GtkWidget *phone_type_combo_box; GtkWidget *phone_entry; gchar *widget_name; - widget_name = g_strdup_printf ("optionmenu-phone-%d", record); - phone_type_option_menu = glade_xml_get_widget (editor->gui, widget_name); + widget_name = g_strdup_printf ("combobox-phone-%d", record); + phone_type_combo_box = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); widget_name = g_strdup_printf ("entry-phone-%d", record); phone_entry = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); - set_option_menu_history (editor, GTK_OPTION_MENU (phone_type_option_menu), + set_combo_box_active (editor, GTK_COMBO_BOX (phone_type_combo_box), phone_type >= 0 ? phone_type : phones_default [record - 1]); set_entry_text (editor, GTK_ENTRY (phone_entry), phone ? phone : ""); @@ -1178,12 +1189,12 @@ fill_in_phone_record (EContactEditor *editor, gint record, const gchar *phone, g static void extract_phone_record (EContactEditor *editor, gint record, gchar **phone, gint *phone_type) { - GtkWidget *phone_type_option_menu; + GtkWidget *phone_type_combo_box; GtkWidget *phone_entry; gchar *widget_name; - widget_name = g_strdup_printf ("optionmenu-phone-%d", record); - phone_type_option_menu = glade_xml_get_widget (editor->gui, widget_name); + widget_name = g_strdup_printf ("combobox-phone-%d", record); + phone_type_combo_box = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); widget_name = g_strdup_printf ("entry-phone-%d", record); @@ -1191,7 +1202,7 @@ extract_phone_record (EContactEditor *editor, gint record, gchar **phone, gint * g_free (widget_name); *phone = g_strdup (gtk_entry_get_text (GTK_ENTRY (phone_entry))); - *phone_type = gtk_option_menu_get_history (GTK_OPTION_MENU (phone_type_option_menu)); + *phone_type = gtk_combo_box_get_active (GTK_COMBO_BOX (phone_type_combo_box)); } static void @@ -1290,42 +1301,38 @@ extract_phone (EContactEditor *editor) } static void -phone_menu_changed(GtkWidget *widget, GtkWidget *next) -{ - gtk_widget_grab_focus(next); -} - -static void init_phone_record_type (EContactEditor *editor, gint record) { - GtkWidget *phone_type_option_menu; - GtkWidget *phone_type_menu; + GtkWidget *phone_type_combo_box; GtkWidget *phone_entry; gchar *widget_name; gint i; + GtkListStore *store; widget_name = g_strdup_printf ("entry-phone-%d", record); phone_entry = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); - widget_name = g_strdup_printf ("optionmenu-phone-%d", record); - phone_type_option_menu = glade_xml_get_widget (editor->gui, widget_name); + widget_name = g_strdup_printf ("combobox-phone-%d", record); + phone_type_combo_box = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); - phone_type_menu = gtk_menu_new (); + init_item_sensitiveable_combo_box (GTK_COMBO_BOX (phone_type_combo_box)); + store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (phone_type_combo_box))); for (i = 0; i < G_N_ELEMENTS (phones); i++) { - GtkWidget *item; + GtkTreeIter iter; - item = gtk_menu_item_new_with_label (e_contact_pretty_name (phones [i].field_id)); - gtk_menu_shell_append (GTK_MENU_SHELL (phone_type_menu), item); - g_signal_connect (item, "activate", G_CALLBACK (phone_menu_changed), phone_entry); + gtk_list_store_append (store, &iter); + gtk_list_store_set ( + store, &iter, + 0, e_contact_pretty_name (phones [i].field_id), + 1, TRUE, + -1); } - gtk_widget_show_all (phone_type_menu); - 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_swapped (phone_type_combo_box, "changed", G_CALLBACK (gtk_widget_grab_focus), phone_entry); + g_signal_connect (phone_type_combo_box, "changed", G_CALLBACK (object_changed), editor); g_signal_connect (phone_entry, "changed", G_CALLBACK (object_changed), editor); g_signal_connect_swapped (phone_entry, "activate", G_CALLBACK (entry_activated), editor); } @@ -1342,49 +1349,50 @@ init_phone (EContactEditor *editor) } static void -sensitize_phone_types (EContactEditor *editor, GtkWidget *option_menu) +sensitize_phone_types (EContactEditor *editor, GtkWidget *combo_box) { - GtkWidget *menu; - GList *l; - gint i; + GtkTreeModel *model; + GtkTreeIter iter; + gint i; + gboolean valid; - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (option_menu)); - l = gtk_container_get_children (GTK_CONTAINER (menu)); + model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo_box)); + valid = gtk_tree_model_get_iter_first (model, &iter); for (i = 0; i < G_N_ELEMENTS (phones); i++) { - GtkWidget *widget; - - if (!l) { - g_warning (G_STRLOC ": Unexpected end of phone items in option menu"); + if (!valid) { + g_warning (G_STRLOC ": Unexpected end of phone items in combo box"); return; } - widget = l->data; - gtk_widget_set_sensitive (widget, is_field_supported (editor, phones [i].field_id)); + gtk_list_store_set ( + GTK_LIST_STORE (model), &iter, + 1, is_field_supported (editor, phones [i].field_id), + -1); - l = g_list_next (l); + valid = gtk_tree_model_iter_next (model, &iter); } } static void sensitize_phone_record (EContactEditor *editor, gint record, gboolean enabled) { - GtkWidget *phone_type_option_menu; + GtkWidget *phone_type_combo_box; GtkWidget *phone_entry; gchar *widget_name; - widget_name = g_strdup_printf ("optionmenu-phone-%d", record); - phone_type_option_menu = glade_xml_get_widget (editor->gui, widget_name); + widget_name = g_strdup_printf ("combobox-phone-%d", record); + phone_type_combo_box = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); widget_name = g_strdup_printf ("entry-phone-%d", record); phone_entry = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); - gtk_widget_set_sensitive (phone_type_option_menu, enabled); + gtk_widget_set_sensitive (phone_type_combo_box, enabled); gtk_editable_set_editable (GTK_EDITABLE (phone_entry), enabled); - sensitize_phone_types (editor, phone_type_option_menu); + sensitize_phone_types (editor, phone_type_combo_box); } static void @@ -1407,42 +1415,38 @@ init_im_record_location (EContactEditor *editor, gint record) { #ifdef ENABLE_IM_LOCATION - GtkWidget *location_option_menu; - GtkWidget *location_menu; - gint i; + GtkWidget *location_combo_box; + GtkListStore *store; + gint i; gchar *widget_name; - widget_name = g_strdup_printf ("optionmenu-im-location-%d", record); - location_option_menu = glade_xml_get_widget (editor->gui, widget_name); + widget_name = g_strdup_printf ("combobox-im-location-%d", record); + location_combo_box = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); - location_menu = gtk_menu_new (); + init_item_sensitiveable_combo_box (GTK_COMBO_BOX (location_combo_box)); + store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (location_combo_box))); for (i = 0; i < G_N_ELEMENTS (common_location); i++) { - GtkWidget *item; + GtkTreeIter iter; - item = gtk_menu_item_new_with_label (_(common_location [i].pretty_name)); - gtk_menu_shell_append (GTK_MENU_SHELL (location_menu), item); + gtk_list_store_append (store, &iter); + gtk_list_store_set ( + store, &iter, + 0, _(common_location [i].pretty_name), + 1, TRUE, + -1); } - gtk_widget_show_all (location_menu); - 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_combo_box, "changed", G_CALLBACK (object_changed), editor); #endif } static void -im_menu_changed(GtkWidget *widget, GtkWidget *next) -{ - gtk_widget_grab_focus(next); -} - -static void init_im_record_service (EContactEditor *editor, gint record) { - GtkWidget *service_option_menu; - GtkWidget *service_menu; + GtkWidget *service_combo_box; + GtkListStore *store; GtkWidget *name_entry; gchar *widget_name; gint i; @@ -1451,24 +1455,26 @@ init_im_record_service (EContactEditor *editor, gint 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); + widget_name = g_strdup_printf ("combobox-im-service-%d", record); + service_combo_box = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); - service_menu = gtk_menu_new (); + init_item_sensitiveable_combo_box (GTK_COMBO_BOX (service_combo_box)); + store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (service_combo_box))); for (i = 0; i < G_N_ELEMENTS (im_service); i++) { - GtkWidget *item; + GtkTreeIter iter; - item = gtk_menu_item_new_with_label (im_service [i].pretty_name); - gtk_menu_shell_append (GTK_MENU_SHELL (service_menu), item); - g_signal_connect (item, "activate", G_CALLBACK (im_menu_changed), name_entry); + gtk_list_store_append (store, &iter); + gtk_list_store_set ( + store, &iter, + 0, im_service [i].pretty_name, + 1, TRUE, + -1); } - gtk_widget_show_all (service_menu); - 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_swapped (service_combo_box, "changed", G_CALLBACK (gtk_widget_grab_focus), name_entry); + g_signal_connect (service_combo_box, "changed", G_CALLBACK (object_changed), editor); g_signal_connect (name_entry, "changed", G_CALLBACK (object_changed), editor); g_signal_connect_swapped (name_entry, "activate", G_CALLBACK (entry_activated), editor); } @@ -1487,20 +1493,20 @@ init_im (EContactEditor *editor) static void fill_in_im_record (EContactEditor *editor, gint record, gint service, const gchar *name, gint location) { - GtkWidget *service_option_menu; + GtkWidget *service_combo_box; #ifdef ENABLE_IM_LOCATION - GtkWidget *location_option_menu; + GtkWidget *location_combo_box; #endif GtkWidget *name_entry; gchar *widget_name; - widget_name = g_strdup_printf ("optionmenu-im-service-%d", record); - service_option_menu = glade_xml_get_widget (editor->gui, widget_name); + widget_name = g_strdup_printf ("combobox-im-service-%d", record); + service_combo_box = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); #ifdef ENABLE_IM_LOCATION - widget_name = g_strdup_printf ("optionmenu-im-location-%d", record); - location_option_menu = glade_xml_get_widget (editor->gui, widget_name); + widget_name = g_strdup_printf ("combobox-im-location-%d", record); + location_combo_box = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); #endif @@ -1509,10 +1515,10 @@ fill_in_im_record (EContactEditor *editor, gint record, gint service, const gcha g_free (widget_name); #ifdef ENABLE_IM_LOCATION - set_option_menu_history (editor, GTK_OPTION_MENU (location_option_menu), + set_combo_box_active (editor, GTK_COMBO_BOX (location_combo_box), location >= 0 ? location : 0); #endif - set_option_menu_history (editor, GTK_OPTION_MENU (service_option_menu), + set_combo_box_active (editor, GTK_COMBO_BOX (service_combo_box), service >= 0 ? service : im_service_default [record - 1]); set_entry_text (editor, GTK_ENTRY (name_entry), name ? name : ""); } @@ -1557,20 +1563,20 @@ fill_in_im (EContactEditor *editor) static void extract_im_record (EContactEditor *editor, gint record, gint *service, gchar **name, gint *location) { - GtkWidget *service_option_menu; + GtkWidget *service_combo_box; #ifdef ENABLE_IM_LOCATION - GtkWidget *location_option_menu; + GtkWidget *location_combo_box; #endif GtkWidget *name_entry; gchar *widget_name; - widget_name = g_strdup_printf ("optionmenu-im-service-%d", record); - service_option_menu = glade_xml_get_widget (editor->gui, widget_name); + widget_name = g_strdup_printf ("combobox-im-service-%d", record); + service_combo_box = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); #ifdef ENABLE_IM_LOCATION - widget_name = g_strdup_printf ("optionmenu-im-location-%d", record); - location_option_menu = glade_xml_get_widget (editor->gui, widget_name); + widget_name = g_strdup_printf ("combobox-im-location-%d", record); + location_combo_box = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); #endif @@ -1579,9 +1585,9 @@ extract_im_record (EContactEditor *editor, gint record, gint *service, gchar **n g_free (widget_name); *name = g_strdup (gtk_entry_get_text (GTK_ENTRY (name_entry))); - *service = gtk_option_menu_get_history (GTK_OPTION_MENU (service_option_menu)); + *service = gtk_combo_box_get_active (GTK_COMBO_BOX (service_combo_box)); #ifdef ENABLE_IM_LOCATION - *location = gtk_option_menu_get_history (GTK_OPTION_MENU (location_option_menu)); + *location = gtk_combo_box_get_active (GTK_COMBO_BOX (location_combo_box)); #else *location = 1; /* set everything to HOME */ #endif @@ -1652,47 +1658,48 @@ extract_im (EContactEditor *editor) g_free (service_attr_list); } static void -sensitize_im_types (EContactEditor *editor, GtkWidget *option_menu) +sensitize_im_types (EContactEditor *editor, GtkWidget *combo_box) { - GtkWidget *menu; - GList *l; - gint i; + GtkTreeModel *model; + GtkTreeIter iter; + gint i; + gboolean valid; - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (option_menu)); - l = gtk_container_get_children (GTK_CONTAINER (menu)); + model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo_box)); + valid = gtk_tree_model_get_iter_first (model, &iter); for (i = 0; i < G_N_ELEMENTS (im_service); i++) { - GtkWidget *widget; - - if (!l) { - g_warning (G_STRLOC ": Unexpected end of im items in option menu"); + if (!valid) { + g_warning (G_STRLOC ": Unexpected end of im items in combo box"); return; } - widget = l->data; - gtk_widget_set_sensitive (widget, is_field_supported (editor, im_service [i].field)); + gtk_list_store_set ( + GTK_LIST_STORE (model), &iter, + 1, is_field_supported (editor, im_service [i].field), + -1); - l = g_list_next (l); + valid = gtk_tree_model_iter_next (model, &iter); } } static void sensitize_im_record (EContactEditor *editor, gint record, gboolean enabled) { - GtkWidget *service_option_menu; + GtkWidget *service_combo_box; #ifdef ENABLE_IM_LOCATION - GtkWidget *location_option_menu; + GtkWidget *location_combo_box; #endif GtkWidget *name_entry; gchar *widget_name; - widget_name = g_strdup_printf ("optionmenu-im-service-%d", record); - service_option_menu = glade_xml_get_widget (editor->gui, widget_name); + widget_name = g_strdup_printf ("combobox-im-service-%d", record); + service_combo_box = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); #ifdef ENABLE_IM_LOCATION - widget_name = g_strdup_printf ("optionmenu-im-location-%d", record); - location_option_menu = glade_xml_get_widget (editor->gui, widget_name); + widget_name = g_strdup_printf ("combobox-im-location-%d", record); + location_combo_box = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); #endif @@ -1700,12 +1707,12 @@ sensitize_im_record (EContactEditor *editor, gint record, gboolean enabled) name_entry = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); - gtk_widget_set_sensitive (service_option_menu, enabled); + gtk_widget_set_sensitive (service_combo_box, enabled); #ifdef ENABLE_IM_LOCATION - gtk_widget_set_sensitive (location_option_menu, enabled); + gtk_widget_set_sensitive (location_combo_box, enabled); #endif gtk_editable_set_editable (GTK_EDITABLE (name_entry), enabled); - sensitize_im_types (editor, service_option_menu); + sensitize_im_types (editor, service_combo_box); } static void @@ -2153,8 +2160,7 @@ static FieldMapping simple_field_map [] = { { "image-chooser", E_CONTACT_PHOTO, TRUE, TRUE }, { "button-image", E_CONTACT_PHOTO, FALSE, TRUE }, - { "combo-file-as", E_CONTACT_FILE_AS, FALSE, TRUE }, - { "entry-file-as", E_CONTACT_FILE_AS, TRUE, TRUE }, + { "combo-file-as", E_CONTACT_FILE_AS, TRUE, TRUE }, { "accellabel-fileas", E_CONTACT_FILE_AS, FALSE, TRUE }, }; @@ -2167,6 +2173,10 @@ init_simple_field (EContactEditor *editor, GtkWidget *widget) changed_object = G_OBJECT (widget); g_signal_connect_swapped (widget, "activate", G_CALLBACK (entry_activated), editor); } + else if (GTK_IS_COMBO_BOX_ENTRY (widget)) { + changed_object = G_OBJECT (/*gtk_bin_get_child (GTK_BIN*/ (widget)/*)*/); + g_signal_connect_swapped (gtk_bin_get_child (GTK_BIN (widget)), "activate", G_CALLBACK (entry_activated), editor); + } else if (GTK_IS_TEXT_VIEW (widget)) { changed_object = G_OBJECT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget))); } @@ -2205,6 +2215,11 @@ fill_in_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) gtk_entry_set_text (GTK_ENTRY (widget), STRING_MAKE_NON_NULL (text)); g_free (text); } + else if (GTK_IS_COMBO_BOX_ENTRY (widget)) { + gchar *text = e_contact_get (contact, field_id); + gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (widget))), STRING_MAKE_NON_NULL (text)); + g_free (text); + } else if (GTK_IS_TEXT_VIEW (widget)) { GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget)); gchar *text = e_contact_get (contact, field_id); @@ -2270,6 +2285,13 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) const gchar *text = gtk_entry_get_text (GTK_ENTRY (widget)); e_contact_set (contact, field_id, (gchar *) text); } + else if (GTK_IS_COMBO_BOX_ENTRY (widget)) { + char *text = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget)); + + e_contact_set (contact, field_id, text); + + g_free (text); + } else if (GTK_IS_TEXT_VIEW (widget)) { GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget)); GtkTextIter start, end; @@ -2418,8 +2440,8 @@ init_simple (EContactEditor *editor) widget = glade_xml_get_widget (editor->gui, "entry-fullname"); g_signal_connect (widget, "changed", G_CALLBACK (name_entry_changed), editor); - widget = glade_xml_get_widget (editor->gui, "entry-file-as"); - g_signal_connect (widget, "changed", G_CALLBACK (file_as_entry_changed), editor); + widget = glade_xml_get_widget (editor->gui, "combo-file-as"); + g_signal_connect (widget, "changed", G_CALLBACK (file_as_combo_changed), editor); widget = glade_xml_get_widget (editor->gui, "entry-company"); g_signal_connect (widget, "changed", G_CALLBACK (company_entry_changed), editor); } @@ -3041,7 +3063,7 @@ save_contact (EContactEditor *ce, gboolean should_close) } entry_fullname = glade_xml_get_widget (ce->gui, "entry-fullname" ); - entry_file_as = glade_xml_get_widget (ce->gui, "entry-file-as"); + entry_file_as = gtk_bin_get_child (GTK_BIN (glade_xml_get_widget (ce->gui, "combo-file-as"))); company_name = glade_xml_get_widget (ce->gui, "entry-company"); name_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_fullname)); file_as_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_file_as)); |