From 8a072ffc7c0ddcde472877a51ace0bb14f86fb0a Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 24 Apr 2009 11:45:21 +0200 Subject: GN-bug #572348 - Removed deprecated Gtk+ symbols Some still left, because those gone in kill-bonobo branch. --- addressbook/ChangeLog | 27 + addressbook/conduit/address-conduit.c | 24 +- addressbook/gui/component/addressbook-config.c | 80 +- addressbook/gui/component/ldap-config.glade | 1731 +------------------- addressbook/gui/contact-editor/Makefile.am | 6 - .../gui/contact-editor/contact-editor.glade | 979 +++-------- .../gui/contact-editor/e-contact-editor-fullname.c | 36 +- addressbook/gui/contact-editor/e-contact-editor.c | 370 +++-- addressbook/gui/contact-editor/fullname.glade | 485 +----- addressbook/printing/Makefile.am | 14 +- 10 files changed, 705 insertions(+), 3047 deletions(-) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 78b54abb78..55337e64a7 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,30 @@ +2009-04-24 Milan Crha + + ** Fix for bug #572348 + + * gui/component/ldap-config.glade: + * gui/contact-editor/fullname.glade: + * gui/contact-editor/contact-editor.glade: + * gui/contact-editor/e-contact-editor.c: + * gui/contact-editor/e-contact-editor-fullname.c: + * gui/component/addressbook-config.c: + * conduit/address-conduit.c: + Remove deprecated Gtk+ symbols. + + * gui/contact-editor/Makefile.am: + * gui/contact-editor/im.glade: + * gui/contact-editor/e-contact-editor-im.h: + * gui/contact-editor/e-contact-editor-im.c: + * gui/contact-editor/fulladdr.glade: + * gui/contact-editor/e-contact-editor-address.h: + * gui/contact-editor/e-contact-editor-address.c: + * printing/Makefile.am: + * printing/e-contact-print.glade: + * printing/e-contact-print-style-editor.h: + * printing/e-contact-print-style-editor.c: + * printing/test-contact-print-style-editor.c: + Remove death files. + 2009-02-26 Matthew Barnes ** Fixes part of bug #572950 diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c index e80d1c346e..4cf0c126d7 100644 --- a/addressbook/conduit/address-conduit.c +++ b/addressbook/conduit/address-conduit.c @@ -475,7 +475,7 @@ static EAddrConduitGui * e_addr_gui_new (EPilotSettings *ps) { EAddrConduitGui *gui; - GtkWidget *lbl, *menu; + GtkWidget *lbl; gint rows, i; static const char *items[] = {"Business", "Home", "Other", NULL}; @@ -490,18 +490,10 @@ e_addr_gui_new (EPilotSettings *ps) rows = E_PILOT_SETTINGS_TABLE_ROWS; lbl = gtk_label_new (_("Default Sync Address:")); gtk_misc_set_alignment (GTK_MISC (lbl), 0.0, 0.5); - gui->default_address = gtk_option_menu_new (); - menu = gtk_menu_new (); + gui->default_address = gtk_combo_box_new_text (); for (i = 0; items[i] != NULL; i++) { - GtkWidget *item; - - item = gtk_menu_item_new_with_label (items[i]); - gtk_widget_show (item); - - gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + gtk_combo_box_append_text (GTK_COMBO_BOX (gui->default_address), items[i]); } - gtk_widget_show (menu); - gtk_option_menu_set_menu (GTK_OPTION_MENU (gui->default_address), menu); gtk_table_attach_defaults (GTK_TABLE (ps), lbl, 0, 1, rows, rows + 1); gtk_table_attach_defaults (GTK_TABLE (ps), gui->default_address, 1, 2, rows, rows + 1); gtk_widget_show (lbl); @@ -523,9 +515,9 @@ e_addr_gui_fill_widgets (EAddrConduitGui *gui, EAddrConduitCfg *cfg) g_return_if_fail (gui != NULL); g_return_if_fail (cfg != NULL); - e_dialog_option_menu_set (gui->default_address, - cfg->default_address, - default_address_map); + e_dialog_combo_box_set (gui->default_address, + cfg->default_address, + default_address_map); } static void @@ -534,8 +526,8 @@ e_addr_gui_fill_config (EAddrConduitGui *gui, EAddrConduitCfg *cfg) g_return_if_fail (gui != NULL); g_return_if_fail (cfg != NULL); - cfg->default_address = e_dialog_option_menu_get (gui->default_address, - default_address_map); + cfg->default_address = e_dialog_combo_box_get (gui->default_address, + default_address_map); } static void diff --git a/addressbook/gui/component/addressbook-config.c b/addressbook/gui/component/addressbook-config.c index bfa91cea47..1f0fa57847 100644 --- a/addressbook/gui/component/addressbook-config.c +++ b/addressbook/gui/component/addressbook-config.c @@ -99,7 +99,6 @@ struct _AddressbookSourceDialog { /* Source selection (druid only) */ ESourceList *source_list; GSList *menu_source_groups; - GtkWidget *group_optionmenu; /* ESource we're currently editing */ ESource *source; @@ -111,19 +110,19 @@ struct _AddressbookSourceDialog { /* info page fields */ GtkWidget *host; - GtkWidget *auth_optionmenu; + GtkWidget *auth_combobox; AddressbookLDAPAuthType auth; GtkWidget *auth_principal; /* connecting page fields */ - GtkWidget *port_combo; - GtkWidget *ssl_optionmenu; + GtkWidget *port_comboentry; + GtkWidget *ssl_combobox; AddressbookLDAPSSLType ssl; /* searching page fields */ GtkWidget *rootdn; AddressbookLDAPScopeType scope; - GtkWidget *scope_optionmenu; + GtkWidget *scope_combobox; GtkWidget *search_filter; GtkWidget *timeout_scale; GtkWidget *limit_spinbutton; @@ -210,6 +209,21 @@ ldap_parse_ssl (const char *ssl) return ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE; } +static const char * +ldap_get_ssl_tooltip (AddressbookLDAPSSLType ssl_type) +{ + switch (ssl_type) { + case ADDRESSBOOK_LDAP_SSL_ALWAYS: + return _("Selecting this option means that Evolution will only connect to your LDAP server if your LDAP server supports SSL."); + case ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE: + return _("Selecting this option means that Evolution will only connect to your LDAP server if your LDAP server supports TLS."); + case ADDRESSBOOK_LDAP_SSL_NEVER: + return _("Selecting this option means that your server does not support either SSL or TLS. This means that your connection will be insecure, and that you will be vulnerable to security exploits."); + } + + return NULL; +} + static gboolean source_to_uri_parts (ESource *source, gchar **host, gchar **rootdn, AddressbookLDAPScopeType *scope, gchar **search_filter, gint *port) { @@ -669,7 +683,7 @@ url_changed(AddressbookSourceDialog *sdialog) search_filter = form_ldap_search_filter (sdialog->search_filter); str = g_strdup_printf ("%s:%s/%s?" /* trigraph prevention */ "?%s?%s", gtk_entry_get_text (GTK_ENTRY (sdialog->host)), - gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (sdialog->port_combo)->entry)), + gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (sdialog->port_comboentry)))), gtk_entry_get_text (GTK_ENTRY (sdialog->rootdn)), ldap_unparse_scope (sdialog->scope), search_filter); @@ -691,20 +705,22 @@ port_entry_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) if (!strcmp (port, LDAPS_PORT_STRING)) { sdialog->ssl = ADDRESSBOOK_LDAP_SSL_ALWAYS; - gtk_option_menu_set_history (GTK_OPTION_MENU(sdialog->ssl_optionmenu), sdialog->ssl); - gtk_widget_set_sensitive (sdialog->ssl_optionmenu, FALSE); + gtk_combo_box_set_active (GTK_COMBO_BOX (sdialog->ssl_combobox), sdialog->ssl); + gtk_widget_set_sensitive (sdialog->ssl_combobox, FALSE); } else { - gtk_widget_set_sensitive (sdialog->ssl_optionmenu, TRUE); + gtk_widget_set_sensitive (sdialog->ssl_combobox, TRUE); } url_changed(sdialog); } static void -ssl_optionmenu_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) +ssl_combobox_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) { - sdialog->ssl = gtk_option_menu_get_history((GtkOptionMenu *)w); + sdialog->ssl = gtk_combo_box_get_active (GTK_COMBO_BOX (w)); e_source_set_property (sdialog->source, "ssl", ldap_unparse_ssl (sdialog->ssl)); + + gtk_widget_set_tooltip_text (sdialog->ssl_combobox, ldap_get_ssl_tooltip (sdialog->ssl)); } @@ -740,20 +756,24 @@ eabc_general_host(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, str gtk_entry_set_text((GtkEntry *)sdialog->host, lud && lud->lud_host ? lud->lud_host : ""); g_signal_connect (sdialog->host, "changed", G_CALLBACK (host_changed_cb), sdialog); - sdialog->port_combo = glade_xml_get_widget (gui, "port-combo"); + sdialog->port_comboentry = glade_xml_get_widget (gui, "port-comboentry"); + gtk_widget_set_has_tooltip (sdialog->port_comboentry, TRUE); + gtk_widget_set_tooltip_text (sdialog->port_comboentry, _("This is the port on the LDAP server that Evolution will try to connect to. A list of standard ports has been provided. Ask your system administrator what port you should specify.")); sprintf(port, "%u", lud && lud->lud_port? lud->lud_port : LDAP_PORT); - gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (sdialog->port_combo)->entry), port); - g_signal_connect (GTK_COMBO(sdialog->port_combo)->entry, "changed", G_CALLBACK (port_entry_changed_cb), sdialog); + gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (sdialog->port_comboentry))), port); + g_signal_connect (gtk_bin_get_child (GTK_BIN (sdialog->port_comboentry)), "changed", G_CALLBACK (port_entry_changed_cb), sdialog); if (lud) ldap_free_urldesc (lud); - sdialog->ssl_optionmenu = glade_xml_get_widget (gui, "ssl-optionmenu"); + sdialog->ssl_combobox = glade_xml_get_widget (gui, "ssl-combobox"); + gtk_widget_set_has_tooltip (sdialog->ssl_combobox, TRUE); tmp = e_source_get_property (sdialog->source, "ssl"); sdialog->ssl = tmp ? ldap_parse_ssl (tmp) : ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE; - gtk_option_menu_set_history (GTK_OPTION_MENU(sdialog->ssl_optionmenu), sdialog->ssl); - gtk_widget_set_sensitive (sdialog->ssl_optionmenu, strcmp (port, LDAPS_PORT_STRING) != 0); - g_signal_connect(sdialog->ssl_optionmenu, "changed", G_CALLBACK(ssl_optionmenu_changed_cb), sdialog); + gtk_combo_box_set_active (GTK_COMBO_BOX (sdialog->ssl_combobox), sdialog->ssl); + gtk_widget_set_tooltip_text (sdialog->ssl_combobox, ldap_get_ssl_tooltip (sdialog->ssl)); + gtk_widget_set_sensitive (sdialog->ssl_combobox, strcmp (port, LDAPS_PORT_STRING) != 0); + g_signal_connect (sdialog->ssl_combobox, "changed", G_CALLBACK (ssl_combobox_changed_cb), sdialog); g_object_unref(gui); @@ -784,9 +804,9 @@ auth_entry_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) } static void -auth_optionmenu_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) +auth_combobox_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) { - sdialog->auth = gtk_option_menu_get_history((GtkOptionMenu *)w); + sdialog->auth = gtk_combo_box_get_active (GTK_COMBO_BOX (w)); e_source_set_property (sdialog->source, "auth", ldap_unparse_auth (sdialog->auth)); /* make sure the right property is set for the auth - ugh, funny api */ @@ -814,11 +834,13 @@ eabc_general_auth(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, str w = glade_xml_get_widget(gui, item->label); gtk_box_pack_start((GtkBox *)parent, w, FALSE, FALSE, 0); - sdialog->auth_optionmenu = glade_xml_get_widget (gui, "auth-optionmenu"); + sdialog->auth_combobox = glade_xml_get_widget (gui, "auth-combobox"); + gtk_widget_set_has_tooltip (sdialog->auth_combobox, TRUE); + gtk_widget_set_tooltip_text (sdialog->auth_combobox, _("This is the method Evolution will use to authenticate you. Note that setting this to \"Email Address\" requires anonymous access to your LDAP server.")); tmp = e_source_get_property(sdialog->source, "auth"); sdialog->auth = tmp ? ldap_parse_auth(tmp) : ADDRESSBOOK_LDAP_AUTH_NONE; - gtk_option_menu_set_history (GTK_OPTION_MENU(sdialog->auth_optionmenu), sdialog->auth); - g_signal_connect(sdialog->auth_optionmenu, "changed", G_CALLBACK(auth_optionmenu_changed_cb), sdialog); + gtk_combo_box_set_active (GTK_COMBO_BOX (sdialog->auth_combobox), sdialog->auth); + g_signal_connect (sdialog->auth_combobox, "changed", G_CALLBACK(auth_combobox_changed_cb), sdialog); sdialog->auth_principal = glade_xml_get_widget (gui, "auth-entry"); switch (sdialog->auth) { @@ -854,9 +876,9 @@ search_filter_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog) } static void -scope_optionmenu_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) +scope_combobox_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) { - sdialog->scope = gtk_option_menu_get_history((GtkOptionMenu *)w); + sdialog->scope = gtk_combo_box_get_active (GTK_COMBO_BOX (w)); url_changed(sdialog); } @@ -891,7 +913,9 @@ eabc_details_search(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, s gtk_entry_set_text((GtkEntry *)sdialog->rootdn, lud && lud->lud_dn ? lud->lud_dn : ""); g_signal_connect (sdialog->rootdn, "changed", G_CALLBACK (rootdn_changed_cb), sdialog); - sdialog->scope_optionmenu = glade_xml_get_widget (gui, "scope-optionmenu"); + sdialog->scope_combobox = glade_xml_get_widget (gui, "scope-combobox"); + gtk_widget_set_has_tooltip (sdialog->scope_combobox, TRUE); + gtk_widget_set_tooltip_text (sdialog->scope_combobox, _("The search scope defines how deep you would like the search to extend down the directory tree. A search scope of \"sub\" will include all entries below your search base. A search scope of \"one\" will only include the entries one level beneath your base.")); if (lud) { switch (lud->lud_scope) { case LDAP_SCOPE_BASE: @@ -906,8 +930,8 @@ eabc_details_search(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, s break; } } - gtk_option_menu_set_history (GTK_OPTION_MENU(sdialog->scope_optionmenu), sdialog->scope); - g_signal_connect(sdialog->scope_optionmenu, "changed", G_CALLBACK(scope_optionmenu_changed_cb), sdialog); + gtk_combo_box_set_active (GTK_COMBO_BOX (sdialog->scope_combobox), sdialog->scope); + g_signal_connect (sdialog->scope_combobox, "changed", G_CALLBACK(scope_combobox_changed_cb), sdialog); sdialog->search_filter = glade_xml_get_widget (gui, "search-filter-entry"); gtk_entry_set_text((GtkEntry *)sdialog->search_filter, lud && lud->lud_filter ? lud->lud_filter : ""); diff --git a/addressbook/gui/component/ldap-config.glade b/addressbook/gui/component/ldap-config.glade index 2cf886b914..cc1fbd0174 100644 --- a/addressbook/gui/component/ldap-config.glade +++ b/addressbook/gui/component/ldap-config.glade @@ -17,6 +17,7 @@ GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True + False False @@ -85,7 +86,7 @@ True - Display + Display False True GTK_JUSTIFY_LEFT @@ -199,7 +200,7 @@ True - Server Information + Server Information False True GTK_JUSTIFY_LEFT @@ -274,7 +275,6 @@ 0.5 0 0 - entry27 PANGO_ELLIPSIZE_NONE -1 False @@ -338,7 +338,7 @@ 0.5 0 0 - ssl-optionmenu + ssl-combobox PANGO_ELLIPSIZE_NONE -1 False @@ -352,43 +352,13 @@ - + True - True - 0 - - - - True - - - - True - Selecting this option means that Evolution will only connect to your LDAP server if your LDAP server supports SSL. - SSL encryption - True - - - - - - True - Selecting this option means that Evolution will only connect to your LDAP server if your LDAP server supports TLS. - TLS encryption - True - - - - - - True - Selecting this option means that your server does not support either SSL or TLS. This means that your connection will be insecure, and that you will be vulnerable to security exploits. - No encryption - True - - - - + SSL encryption +TLS encryption +No encryption + False + True 0 @@ -407,71 +377,6 @@ - - - True - False - True - False - True - False - - - - True - This is the port on the LDAP server that Evolution will try to connect to. A list of standard ports has been provided. Ask your system administrator what port you should specify. - True - True - True - True - 0 - - True - * - False - - - - - - True - GTK_SELECTION_BROWSE - - - - True - True - 389 - - - - - - True - True - 636 - - - - - - True - True - 3268 - - - - - - - 1 - 2 - 1 - 2 - - - - True @@ -494,6 +399,26 @@ + + + + True + 389 +636 +3268 + False + True + True + + + 1 + 2 + 1 + 2 + fill + fill + + 0 @@ -587,7 +512,6 @@ 0.5 0 0 - auth-optionmenu PANGO_ELLIPSIZE_NONE -1 False @@ -632,53 +556,6 @@ - - - True - This is the method Evolution will use to authenticate you. Note that setting this to "Email Address" requires anonymous access to your LDAP server. - True - 0 - - - - True - - - - True - Anonymously - True - - - - - - True - Using email address - True - - - - - - True - Using distinguished name (DN) - True - - - - - - - 1 - 2 - 0 - 1 - expand|shrink|fill - shrink - - - True @@ -700,6 +577,25 @@ + + + + True + Anonymously +Using email address +Using distinguished name (DN) + False + True + + + 1 + 2 + 0 + 1 + shrink|fill + shrink|fill + + 0 @@ -892,7 +788,6 @@ 0.5 0 0 - scope-optionmenu PANGO_ELLIPSIZE_NONE -1 False @@ -908,44 +803,6 @@ - - - True - The search scope defines how deep you would like the search to extend down the directory tree. A search scope of "sub" will include all entries below your search base. A search scope of "one" will only include the entries one level beneath your base. - True - 0 - - - - - - - True - One - True - - - - - - True - Sub - True - - - - - - - 1 - 3 - 2 - 3 - expand|shrink|fill - shrink|fill - - - True @@ -1105,6 +962,24 @@ shrink|fill + + + + True + One +Sub + False + True + + + 1 + 3 + 2 + 3 + shrink|fill + shrink|fill + + 0 @@ -1496,6 +1371,7 @@ GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True + False False @@ -1575,1475 +1451,4 @@ - - True - Add Address Book - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - True - True - GTK_RELIEF_NORMAL - True - 0 - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-add - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Add Address Book - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - - - 0 - False - True - GTK_PACK_END - - - - - - 12 - True - True - True - True - GTK_POS_TOP - False - False - - - - 12 - True - False - 12 - - - - 6 - True - False - 6 - - - - True - <b>Type:</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - -1 - - - - - - - - 0 - False - False - - - - - 0 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - 12 - True - 1 - 2 - False - 6 - 6 - - - - True - True - True - True - 0 - - True - * - False - - - 1 - 2 - 0 - 1 - - - - - - - True - _Name: - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - display-name-entry - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - - - True - Display - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - 12 - True - 3 - 2 - False - 6 - 6 - - - - True - True - True - True - 0 - - True - * - False - - - 1 - 2 - 0 - 1 - - - - - - - True - _Port: - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - port-entry - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - False - True - False - True - False - - - - True - True - True - True - 0 - - True - * - False - - - - - - True - GTK_SELECTION_BROWSE - - - - True - True - 389 - - - - - - True - True - 636 - - - - - - True - True - 3268 - - - - - - - 1 - 2 - 1 - 2 - - - - - - - True - False - 6 - - - - True - _Use secure connection: - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - ssl-optionmenu - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - 0 - - - - - - - True - Always - True - - - - - - - True - Whenever Possible - True - - - - - - - True - Never - True - - - - - - - - 0 - False - False - - - - - 0 - 2 - 2 - 3 - fill - - - - - - True - _Server: - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - server-name-entry - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - - - True - Server Information - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - 12 - True - 2 - 2 - False - 6 - 6 - - - - True - _Login method: - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - auth-optionmenu - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Lo_gin: - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - auth-entry - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - True - True - True - 0 - - True - * - False - - - 1 - 2 - 1 - 2 - - - - - - - True - True - 0 - - - - - - - True - Anonymously - True - - - - - - - True - Email address - True - - - - - - - True - Distinguished name - True - - - - - - - - 1 - 2 - 0 - 1 - fill - - - - - - - - - True - <b>Authentication</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - False - True - - - - - - True - Basic - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 12 - True - False - 12 - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - 12 - True - 4 - 3 - False - 6 - 6 - - - - True - Search _base: - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - rootdn-entry - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - _Search scope: - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - scope-optionmenu - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - True - True - True - 0 - - True - * - False - - - 1 - 3 - 0 - 1 - - - - - - - True - True - GTK_RELIEF_NORMAL - True - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-find - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - Find Possible Search Bases - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - 1 - 2 - 1 - 2 - fill - - - - - - - True - True - 0 - - - - - - - True - One - True - - - - - - True - Sub - True - - - - - - - 1 - 3 - 2 - 3 - fill - - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 1 - 2 - fill - - - - - - - True - Search _filter: - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - entry30 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 3 - 4 - expand|shrink|fill - shrink|fill - - - - - - True - True - True - True - 0 - - True - * - False - - Search filter - Search filter is the type of the objects searched for, while performing the search. If this is not modified, by default search will be performed on objectclass of the type "person". - - - - 1 - 3 - 3 - 4 - expand|shrink|fill - shrink|fill - - - - - - - - True - <b>Searching</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - False - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - 12 - True - 3 - 3 - False - 6 - 6 - - - - True - _Timeout: - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - timeout-scale - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - minutes - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 0 - 1 - fill - - - - - - - True - False - 6 - - - - True - 1 - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - False - GTK_POS_TOP - 1 - GTK_UPDATE_CONTINUOUS - False - 3 1 5 0.5 1 0 - - - 0 - True - True - - - - - - True - 5 - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 1 - 2 - 0 - 1 - fill - - - - - - True - _Download limit: - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - download-limit-spinbutton - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - cards - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 1 - 2 - fill - - - - - - - True - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 1000 1 10 0 - - - 1 - 2 - 1 - 2 - - - - - - - True - True - B_rowse this book until limit reached - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - 3 - 2 - 3 - fill - - - - - - - - - True - <b>Downloading</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - False - True - - - - - - True - Details - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - 0 - True - True - - - - - - diff --git a/addressbook/gui/contact-editor/Makefile.am b/addressbook/gui/contact-editor/Makefile.am index 32d5531859..0b2ec028f5 100644 --- a/addressbook/gui/contact-editor/Makefile.am +++ b/addressbook/gui/contact-editor/Makefile.am @@ -20,10 +20,6 @@ privsolib_LTLIBRARIES = \ libecontacteditor_la_SOURCES = \ eab-editor.c \ eab-editor.h \ - e-contact-editor-im.c \ - e-contact-editor-im.h \ - e-contact-editor-address.c \ - e-contact-editor-address.h \ e-contact-editor-fullname.c \ e-contact-editor-fullname.h \ e-contact-editor.c \ @@ -40,9 +36,7 @@ libecontacteditor_la_LIBADD = \ $(EVOLUTION_ADDRESSBOOK_LIBS) glade_DATA = \ - im.glade \ contact-editor.glade \ - fulladdr.glade \ fullname.glade EXTRA_DIST= $(glade_DATA) diff --git a/addressbook/gui/contact-editor/contact-editor.glade b/addressbook/gui/contact-editor/contact-editor.glade index 1f3af8d208..c840cf679b 100644 --- a/addressbook/gui/contact-editor/contact-editor.glade +++ b/addressbook/gui/contact-editor/contact-editor.glade @@ -205,7 +205,7 @@ 0.5 0 0 - entry-file-as + combo-file-as PANGO_ELLIPSIZE_NONE -1 False @@ -313,48 +313,6 @@ - - - True - False - True - False - True - False - - - - - - - True - True - True - True - 0 - - True - * - False - - - - - - True - GTK_SELECTION_BROWSE - - - - - 1 - 2 - 1 - 2 - - - - True @@ -391,6 +349,26 @@ + + + + True + a +b +c + False + True + True + + + 1 + 2 + 1 + 2 + fill + fill + + 0 @@ -440,84 +418,6 @@ 6 6 - - - True - True - 0 - - - - - - - True - Work - True - - - - - - - True - Personal - True - - - - - - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - True - 0 - - - - - - - True - Work - True - - - - - - - True - Personal - True - - - - - - - - 0 - 1 - 1 - 2 - fill - - - - True @@ -529,9 +429,6 @@ True * False - - - 1 @@ -542,84 +439,6 @@ - - - True - True - 0 - - - - - - - True - Work - True - - - - - - - True - Personal - True - - - - - - - - 2 - 3 - 0 - 1 - fill - - - - - - - True - True - 0 - - - - - - - True - Work - True - - - - - - - True - Personal - True - - - - - - - - 2 - 3 - 1 - 2 - fill - - - - True @@ -631,9 +450,6 @@ True * False - - - 1 @@ -655,9 +471,6 @@ True * False - - - 3 @@ -679,9 +492,6 @@ True * False - - - 3 @@ -713,6 +523,78 @@ + + + + True + Work +Personal + False + True + + + 0 + 1 + 0 + 1 + fill + fill + + + + + + True + Work +Personal + False + True + + + 0 + 1 + 1 + 2 + fill + fill + + + + + + True + Work +Personal + False + True + + + 2 + 3 + 0 + 1 + fill + fill + + + + + + True + Work +Personal + False + True + + + 2 + 3 + 1 + 2 + fill + fill + + @@ -786,9 +668,6 @@ True * False - - - 1 @@ -810,9 +689,6 @@ True * False - - - 1 @@ -834,9 +710,6 @@ True * False - - - 3 @@ -858,9 +731,6 @@ True * False - - - 3 @@ -872,33 +742,11 @@ - + True - True - 0 - - - - - - - True - Work - True - - - - - - - True - Personal - True - - - - - + + False + True 0 @@ -906,38 +754,16 @@ 0 1 fill - + fill - + True - True - 0 - - - - - - - True - Work - True - - - - - - - True - Personal - True - - - - - + + False + True 0 @@ -945,38 +771,16 @@ 1 2 fill - + fill - + True - True - 0 - - - - - - - True - Work - True - - - - - - - True - Personal - True - - - - - + + False + True 2 @@ -984,38 +788,16 @@ 0 1 fill - + fill - + True - True - 0 - - - - - - - True - Work - True - - - - - - - True - Personal - True - - - - - + + False + True 2 @@ -1023,7 +805,7 @@ 1 2 fill - + fill @@ -1043,85 +825,49 @@ 6 - + True True - 0 - - - - - - - True - Work - True - - - - - - - True - Personal - True - - - - - + True + True + 0 + + True + * + False - 0 - 1 + 1 + 2 0 1 - fill - + True True - 0 - - - - - - - True - Work - True - - - - - - - True - Personal - True - - - - - + True + True + 0 + + True + * + False - 0 - 1 + 1 + 2 1 2 - fill - + True True True @@ -1131,13 +877,10 @@ True * False - - - - 1 - 2 + 3 + 4 0 1 @@ -1145,7 +888,7 @@ - + True True True @@ -1155,13 +898,10 @@ True * False - - - - 1 - 2 + 3 + 4 1 2 @@ -1169,128 +909,70 @@ - + True - True - 0 - - - - - - - True - Work - True - - - - - - - True - Personal - True - - - - - + + False + True - 2 - 3 + 0 + 1 0 1 fill - + fill - + True - True - 0 - - - - - - - True - Work - True - - - - - - - True - Personal - True - - - - - + + False + True - 2 - 3 + 0 + 1 1 2 fill - + fill - + True - True - True - True - 0 - - True - * - False - - - + + False + True - 3 - 4 + 2 + 3 0 1 - + fill + fill - + True - True - True - True - 0 - - True - * - False - - - + + False + True - 3 - 4 + 2 + 3 1 2 - + fill + fill @@ -1401,54 +1083,6 @@ 6 6 - - - True - True - 0 - - - - - - - True - AIM - True - - - - - - - True - Novell GroupWise - True - - - - - - - True - MSN Messenger - True - - - - - - - - 0 - 1 - 0 - 1 - fill - - - - True @@ -1460,9 +1094,6 @@ True * False - - - 1 @@ -1473,54 +1104,6 @@ - - - True - True - 0 - - - - - - - True - AIM - True - - - - - - - True - Novell GroupWise - True - - - - - - - True - MSN Messenger - True - - - - - - - - 0 - 1 - 1 - 2 - fill - - - - True @@ -1532,9 +1115,6 @@ True * False - - - 1 @@ -1546,55 +1126,28 @@ - + True True - 0 - - - - - - - True - AIM - True - - - - - - - True - Novell GroupWise - True - - - - - - - True - MSN Messenger - True - - - - - + True + True + 0 + + True + * + False - 2 - 3 + 3 + 4 0 1 - fill - + True True True @@ -1604,88 +1157,81 @@ True * False - - - 3 4 - 0 - 1 + 1 + 2 - + True - True - 0 - - - - - - - True - AIM - True - - - + + False + True + + + 0 + 1 + 0 + 1 + fill + fill + + - - - True - Novell GroupWise - True - - - + + + True + + False + True + + + 0 + 1 + 1 + 2 + fill + fill + + - - - True - MSN Messenger - True - - - - - + + + True + + False + True 2 3 - 1 - 2 + 0 + 1 fill - + fill - + True - True - True - True - 0 - - True - * - False - - - + + False + True - 3 - 4 + 2 + 3 1 2 - + fill + fill @@ -2785,9 +2331,9 @@ 6 True 0.5 - 0.15 + 0.15000000596 1 - 0.70 + 0.699999988079 0 0 19 @@ -3033,7 +2579,7 @@ GTK_JUSTIFY_LEFT False False - 1.0 + 1 0.5 0 4 @@ -3084,7 +2630,7 @@ GTK_JUSTIFY_LEFT False False - 1.0 + 1 0.5 0 0 @@ -3113,7 +2659,7 @@ GTK_JUSTIFY_LEFT False False - 1.0 + 1 0.5 0 0 @@ -3132,15 +2678,12 @@ - - - - - - - - + + 0 + True + True + @@ -3156,7 +2699,7 @@ GTK_JUSTIFY_LEFT False False - 0.42 + 0.419999986887 0.5 0 0 @@ -3190,9 +2733,9 @@ 6 True 0.5 - 0.15 + 0.15000000596 1 - 0.70 + 0.699999988079 0 0 19 @@ -3224,6 +2767,7 @@ GTK_POLICY_AUTOMATIC GTK_SHADOW_IN GTK_CORNER_TOP_LEFT + 25 @@ -3314,7 +2858,7 @@ GTK_JUSTIFY_LEFT False False - 1.0 + 1 0.5 0 0 @@ -3466,7 +3010,7 @@ GTK_JUSTIFY_LEFT False False - 1.0 + 1 0.5 0 4 @@ -3517,7 +3061,7 @@ GTK_JUSTIFY_LEFT False False - 1.0 + 1 0.5 0 0 @@ -3536,17 +3080,16 @@ - + + 0 + True + True + - - 8 - True - False - @@ -3558,7 +3101,7 @@ GTK_JUSTIFY_LEFT False False - 0.42 + 0.419999986887 0.5 0 0 @@ -3592,9 +3135,9 @@ 6 True 0.5 - 0.15 + 0.15000000596 1 - 0.70 + 0.699999988079 0 0 19 @@ -3675,7 +3218,7 @@ GTK_JUSTIFY_LEFT False False - 1.0 + 1 0.5 0 0 @@ -3827,7 +3370,7 @@ GTK_JUSTIFY_LEFT False False - 1.0 + 1 0.5 0 4 @@ -3878,7 +3421,7 @@ GTK_JUSTIFY_LEFT False False - 1.0 + 1 0.5 0 0 @@ -3908,6 +3451,7 @@ GTK_POLICY_AUTOMATIC GTK_SHADOW_IN GTK_CORNER_TOP_LEFT + 25 @@ -3948,11 +3492,6 @@ - - 8 - True - False - @@ -3964,7 +3503,7 @@ GTK_JUSTIFY_LEFT False False - 0.42 + 0.419999986887 0.5 0 0 diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c index 3eeaa9d6ed..bbe9ece7ba 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c +++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c @@ -191,8 +191,8 @@ e_contact_editor_fullname_set_property (GObject *object, guint prop_id, case PROP_EDITABLE: { int i; char *widget_names[] = { - "combo-title", - "combo-suffix", + "comboentry-title", + "comboentry-suffix", "entry-first", "entry-middle", "entry-last", @@ -210,10 +210,10 @@ e_contact_editor_fullname_set_property (GObject *object, guint prop_id, gtk_editable_set_editable (GTK_EDITABLE (w), e_contact_editor_fullname->editable); } - else if (GTK_IS_COMBO (w)) { - gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (w)->entry), + else if (GTK_IS_COMBO_BOX_ENTRY (w)) { + gtk_editable_set_editable (GTK_EDITABLE (gtk_bin_get_child (GTK_BIN (w))), e_contact_editor_fullname->editable); - gtk_widget_set_sensitive (GTK_COMBO (w)->button, e_contact_editor_fullname->editable); + gtk_widget_set_sensitive (w, e_contact_editor_fullname->editable); } else if (GTK_IS_LABEL (w)) { gtk_widget_set_sensitive (w, e_contact_editor_fullname->editable); @@ -252,7 +252,14 @@ e_contact_editor_fullname_get_property (GObject *object, guint prop_id, static void fill_in_field(EContactEditorFullname *editor, char *field, char *string) { - GtkEntry *entry = GTK_ENTRY(glade_xml_get_widget(editor->gui, field)); + GtkWidget *widget = glade_xml_get_widget (editor->gui, field); + GtkEntry *entry = NULL; + + if (GTK_IS_ENTRY (widget)) + entry = GTK_ENTRY (widget); + else if (GTK_IS_COMBO_BOX_ENTRY (widget)) + entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (widget))); + if (entry) { if (string) gtk_entry_set_text(entry, string); @@ -266,18 +273,25 @@ fill_in_info(EContactEditorFullname *editor) { EContactName *name = editor->name; if (name) { - fill_in_field(editor, "entry-title", name->prefixes); + fill_in_field(editor, "comboentry-title", name->prefixes); fill_in_field(editor, "entry-first", name->given); fill_in_field(editor, "entry-middle", name->additional); fill_in_field(editor, "entry-last", name->family); - fill_in_field(editor, "entry-suffix", name->suffixes); + fill_in_field(editor, "comboentry-suffix", name->suffixes); } } static char * extract_field(EContactEditorFullname *editor, char *field) { - GtkEntry *entry = GTK_ENTRY(glade_xml_get_widget(editor->gui, field)); + GtkWidget *widget = glade_xml_get_widget(editor->gui, field); + GtkEntry *entry = NULL; + + if (GTK_IS_ENTRY (widget)) + entry = GTK_ENTRY (widget); + else if (GTK_IS_COMBO_BOX_ENTRY (widget)) + entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (widget))); + if (entry) return g_strdup (gtk_entry_get_text(entry)); else @@ -293,9 +307,9 @@ extract_info(EContactEditorFullname *editor) editor->name = name; } - name->prefixes = extract_field(editor, "entry-title" ); + name->prefixes = extract_field(editor, "comboentry-title" ); name->given = extract_field(editor, "entry-first" ); name->additional = extract_field(editor, "entry-middle"); name->family = extract_field(editor, "entry-last" ); - name->suffixes = extract_field(editor, "entry-suffix"); + name->suffixes = extract_field(editor, "comboentry-suffix"); } diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index ac4f663ffc..c3a73fbcd5 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -56,8 +56,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 @@ -450,7 +448,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; @@ -483,23 +481,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; @@ -511,16 +506,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); } } @@ -543,9 +544,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; @@ -598,7 +599,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)); @@ -656,26 +657,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; @@ -684,24 +678,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); } @@ -718,19 +706,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 : ""); } @@ -738,12 +726,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); @@ -751,7 +739,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 * @@ -1009,19 +997,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); } @@ -1044,6 +1032,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) @@ -1104,19 +1115,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 : ""); @@ -1128,12 +1139,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); @@ -1141,7 +1152,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 @@ -1239,43 +1250,39 @@ 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) { - 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); } @@ -1292,49 +1299,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 @@ -1357,42 +1365,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; @@ -1401,24 +1405,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); } @@ -1437,20 +1443,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 @@ -1459,10 +1465,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 : ""); } @@ -1507,20 +1513,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 @@ -1529,9 +1535,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 @@ -1602,47 +1608,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 @@ -1650,12 +1657,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 @@ -2103,8 +2110,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 }, }; @@ -2117,6 +2123,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))); } @@ -2155,6 +2165,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); @@ -2220,6 +2235,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; @@ -2368,8 +2390,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); } @@ -2991,7 +3013,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)); diff --git a/addressbook/gui/contact-editor/fullname.glade b/addressbook/gui/contact-editor/fullname.glade index 2271304017..6520dfa472 100644 --- a/addressbook/gui/contact-editor/fullname.glade +++ b/addressbook/gui/contact-editor/fullname.glade @@ -15,6 +15,8 @@ False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST + True + False False @@ -72,420 +74,6 @@ 6 6 - - - True - False - True - False - True - False - - - - - - - True - True - True - True - 0 - - True - * - False - - - - - - True - GTK_SELECTION_BROWSE - - - - True - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - True - - - - True - Mr. - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - True - - - - True - Mrs. - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - True - - - - True - Ms. - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - True - - - - True - Miss - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - True - - - - True - Dr. - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - True - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - - 1 - 2 - 0 - 1 - - - - - - - True - False - True - False - True - False - - - - - - - True - True - True - True - 0 - - True - * - False - - - - - - True - GTK_SELECTION_BROWSE - - - - True - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - True - - - - True - Sr. - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - True - - - - True - Jr. - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - True - - - - True - I - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - True - - - - True - II - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - True - - - - True - III - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - True - - - - True - Esq. - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - True - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - - 1 - 2 - 4 - 5 - - - - True @@ -563,6 +151,10 @@ 0 0 entry-first + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -587,7 +179,10 @@ 0.5 0 0 - entry-title + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -613,6 +208,10 @@ 0 0 entry-middle + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -638,6 +237,10 @@ 0 0 entry-last + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -662,7 +265,10 @@ 0.5 0 0 - entry-suffix + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -673,6 +279,53 @@ fill + + + + True + +Mr. +Mrs. +Ms. +Miss +Dr. + False + True + True + + + 1 + 2 + 0 + 1 + fill + fill + + + + + + True + +Sr. +Jr. +I +II +III +Esq. + False + True + True + + + 1 + 2 + 4 + 5 + fill + fill + + 0 diff --git a/addressbook/printing/Makefile.am b/addressbook/printing/Makefile.am index 12be8759d4..8db1e7d889 100644 --- a/addressbook/printing/Makefile.am +++ b/addressbook/printing/Makefile.am @@ -4,9 +4,6 @@ ecps_DATA = \ medbook.ecps \ phonelist.ecps -glade_DATA = \ - e-contact-print.glade - INCLUDES = \ -DG_LOG_DOMAIN=\"addressbook-printing\" \ -I$(top_srcdir)/addressbook \ @@ -21,8 +18,6 @@ noinst_LTLIBRARIES = \ libecontactprint.la libecontactprint_la_SOURCES = \ - e-contact-print-style-editor.c \ - e-contact-print-style-editor.h \ e-contact-print-types.h \ e-contact-print.c \ e-contact-print.h @@ -32,8 +27,7 @@ libecontactprint_la_LIBADD = \ $(top_builddir)/widgets/misc/libemiscwidgets.la noinst_PROGRAMS = \ - contact-print-test \ - contact-print-style-editor-test + contact-print-test contact_print_test_SOURCES = \ test-print.c @@ -44,17 +38,11 @@ contact_print_test_LDADD = \ $(top_builddir)/e-util/libeutil.la \ $(EVOLUTION_ADDRESSBOOK_LIBS) -contact_print_style_editor_test_SOURCES = \ - test-contact-print-style-editor.c - contact_print_style_editor_test_LDADD = \ libecontactprint.la \ $(top_builddir)/addressbook/util/libeabutil.la \ $(top_builddir)/e-util/libeutil.la \ $(EVOLUTION_ADDRESSBOOK_LIBS) - - EXTRA_DIST = \ - $(glade_DATA) \ $(ecps_DATA) -- cgit