From ace402d9173fe24b4f9a753f7c155fa0605ed866 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Wed, 18 Dec 2002 22:11:28 +0000 Subject: drop use of "font" arg. (get_left_width): use pango to calculate this 2002-12-18 Chris Toshok * gui/widgets/e-minicard.c (e_minicard_realize): drop use of "font" arg. (get_left_width): use pango to calculate this instead of a GdkFont. * gui/widgets/e-minicard-view.c: drop include of e-unicode.h. * gui/widgets/e-minicard-label.c (e_minicard_label_construct): don't need to create the font anymore. * gui/search/Makefile.am (INCLUDES): add -D*_DISABLE_DEPRECATED. * gui/search/e-addressbook-search-dialog.c (e_addressbook_search_dialog_new): use g_object_new instead of gtk_type_new. * gui/merging/Makefile.am (INCLUDES): add -D*_DISABLE_DEPRECATED. * gui/contact-list-editor/Makefile.am (INCLUDES): add -D*_DISABLE_DEPRECATED. * gui/contact-list-editor/e-contact-list-editor.c (is_named): strdup (or not, if we don't need to save the value) instead of using the e_utf8 functions. (fill_in_info): same. * gui/contact-editor/Makefile.am (INCLUDES): add -D*_DISABLE_DEPRECATED. * gui/contact-editor/e-contact-save-as.c (e_contact_save_as): strdup (or not, if we don't need to save the value) instead of using the e_utf8 functions. (e_contact_list_save_as): same. * gui/contact-editor/e-contact-quick-add.c (clicked_cb): strdup (or not, if we don't need to save the value) instead of using the e_utf8 functions. (build_quick_add_dialog): same. * gui/contact-editor/e-contact-editor.c (phone_entry_changed): strdup (or not, if we don't need to save the value) instead of using the e_utf8 functions. (file_as_set_style): same. (name_entry_changed): same. (full_name_clicked): same. (categories_clicked): same. (set_field): same. (fill_in_field): same. (fill_in_single_field): same. (extract_field): same. (extract_single_field): same. * gui/contact-editor/e-contact-editor-fullname.c (extract_field): just strdup, it's already utf8. * gui/contact-editor/e-contact-editor-address.c (extract_field): they're all entries, use GTK_ENTRY foo here. * gui/component/select-names/Makefile.am (INCLUDES): add -D*_DISABLE_DEPRECATED. * gui/component/select-names/e-select-names.c (e_select_names_add_section): remove the extra utf8_from_locale_string stuff. * gui/component/select-names/e-select-names-popup.c (set_uiinfo_label): gtk_container_children -> gtk_container_get_children, and remove the extra utf8 stuff. * gui/component/Makefile.am (INCLUDES): add -D*_DISABLE_DEPRECATED. * gui/component/addressbook-storage.c (addressbook_storage_init_source_uri): g_string_sprintfa -> g_string_append_printf. * gui/component/addressbook-config.c (focus_help): gtk_notebook_set_page -> gtk_notebook_set_current_page. (addressbook_source_dialog_set_source): same. (auth_optionmenu_activated): gtk_container_children -> gtk_container_get_children. (ssl_optionmenu_activated): same. (ssl_optionmenu_selected): same, and gtk_notebook_set_page -> gtk_notebook_set_current_page. (scope_optionmenu_activated): same. (set_advanced_button_state): same. (addressbook_ldap_init): hook "response" to gtk_widget_destroy to make the dialog go away when clicked. (addressbook_ldap_auth): same. (addressbook_root_dse_query): same. (do_ldap_root_dse_query): same. (addressbook_config_control_new): fix return type and cast. (main): remove call to gtk_widget_push_visual. * gui/component/addressbook-config.h: addressbook_config_control_new returns a BonoboObject, not a BonoboControl. * gui/component/addressbook.c: remove e-unicode.h include. * backend/pas/Makefile.am (INCLUDES): Add -DLIBGNOME_DISABLE_DEPRECATED. * backend/ebook/Makefile.am (INCLUDES): Add -DLIBGNOME_DISABLE_DEPRECATED. * backend/ebook/e-card.c (e_card_get_property): remove misleading comment. svn path=/trunk/; revision=19160 --- addressbook/ChangeLog | 110 +++++++++++++++++++++ addressbook/backend/ebook/Makefile.am | 1 + addressbook/backend/ebook/e-card.c | 2 +- addressbook/backend/pas/Makefile.am | 1 + addressbook/gui/component/Makefile.am | 4 + addressbook/gui/component/addressbook-config.c | 37 +++---- addressbook/gui/component/addressbook-config.h | 2 +- addressbook/gui/component/addressbook-storage.c | 13 ++- addressbook/gui/component/addressbook.c | 1 - addressbook/gui/component/select-names/Makefile.am | 4 + .../component/select-names/e-select-names-popup.c | 8 +- .../gui/component/select-names/e-select-names.c | 3 +- addressbook/gui/contact-editor/Makefile.am | 4 + .../gui/contact-editor/e-contact-editor-address.c | 9 +- .../gui/contact-editor/e-contact-editor-fullname.c | 5 +- addressbook/gui/contact-editor/e-contact-editor.c | 65 ++++++------ .../gui/contact-editor/e-contact-quick-add.c | 21 ++-- addressbook/gui/contact-editor/e-contact-save-as.c | 12 +-- addressbook/gui/contact-list-editor/Makefile.am | 4 + .../contact-list-editor/e-contact-list-editor.c | 9 +- addressbook/gui/merging/Makefile.am | 4 + addressbook/gui/search/Makefile.am | 4 + .../gui/search/e-addressbook-search-dialog.c | 2 +- addressbook/gui/widgets/e-minicard-label.c | 3 - addressbook/gui/widgets/e-minicard-view.c | 1 - addressbook/gui/widgets/e-minicard.c | 19 ++-- 26 files changed, 227 insertions(+), 121 deletions(-) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index d0a67d130c..d8a22bb040 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,113 @@ +2002-12-18 Chris Toshok + + * gui/widgets/e-minicard.c (e_minicard_realize): drop use of + "font" arg. + (get_left_width): use pango to calculate this instead of a GdkFont. + + * gui/widgets/e-minicard-view.c: drop include of e-unicode.h. + + * gui/widgets/e-minicard-label.c (e_minicard_label_construct): + don't need to create the font anymore. + + * gui/search/Makefile.am (INCLUDES): add -D*_DISABLE_DEPRECATED. + + * gui/search/e-addressbook-search-dialog.c + (e_addressbook_search_dialog_new): use g_object_new instead of + gtk_type_new. + + * gui/merging/Makefile.am (INCLUDES): add -D*_DISABLE_DEPRECATED. + + * gui/contact-list-editor/Makefile.am (INCLUDES): add + -D*_DISABLE_DEPRECATED. + + * gui/contact-list-editor/e-contact-list-editor.c (is_named): + strdup (or not, if we don't need to save the value) instead of + using the e_utf8 functions. + (fill_in_info): same. + + * gui/contact-editor/Makefile.am (INCLUDES): add + -D*_DISABLE_DEPRECATED. + + * gui/contact-editor/e-contact-save-as.c (e_contact_save_as): + strdup (or not, if we don't need to save the value) instead of + using the e_utf8 functions. + (e_contact_list_save_as): same. + + * gui/contact-editor/e-contact-quick-add.c (clicked_cb): strdup + (or not, if we don't need to save the value) instead of using the + e_utf8 functions. + (build_quick_add_dialog): same. + + * gui/contact-editor/e-contact-editor.c (phone_entry_changed): + strdup (or not, if we don't need to save the value) instead of + using the e_utf8 functions. + (file_as_set_style): same. + (name_entry_changed): same. + (full_name_clicked): same. + (categories_clicked): same. + (set_field): same. + (fill_in_field): same. + (fill_in_single_field): same. + (extract_field): same. + (extract_single_field): same. + + * gui/contact-editor/e-contact-editor-fullname.c (extract_field): + just strdup, it's already utf8. + + * gui/contact-editor/e-contact-editor-address.c (extract_field): + they're all entries, use GTK_ENTRY foo here. + + * gui/component/select-names/Makefile.am (INCLUDES): add + -D*_DISABLE_DEPRECATED. + + * gui/component/select-names/e-select-names.c + (e_select_names_add_section): remove the extra + utf8_from_locale_string stuff. + + * gui/component/select-names/e-select-names-popup.c + (set_uiinfo_label): gtk_container_children -> + gtk_container_get_children, and remove the extra utf8 stuff. + + * gui/component/Makefile.am (INCLUDES): add + -D*_DISABLE_DEPRECATED. + + * gui/component/addressbook-storage.c + (addressbook_storage_init_source_uri): g_string_sprintfa -> + g_string_append_printf. + + * gui/component/addressbook-config.c (focus_help): + gtk_notebook_set_page -> gtk_notebook_set_current_page. + (addressbook_source_dialog_set_source): same. + (auth_optionmenu_activated): gtk_container_children -> + gtk_container_get_children. + (ssl_optionmenu_activated): same. + (ssl_optionmenu_selected): same, and gtk_notebook_set_page -> + gtk_notebook_set_current_page. + (scope_optionmenu_activated): same. + (set_advanced_button_state): same. + (addressbook_ldap_init): hook "response" to gtk_widget_destroy to + make the dialog go away when clicked. + (addressbook_ldap_auth): same. + (addressbook_root_dse_query): same. + (do_ldap_root_dse_query): same. + (addressbook_config_control_new): fix return type and cast. + (main): remove call to gtk_widget_push_visual. + + * gui/component/addressbook-config.h: + addressbook_config_control_new returns a BonoboObject, not a + BonoboControl. + + * gui/component/addressbook.c: remove e-unicode.h include. + + * backend/pas/Makefile.am (INCLUDES): Add + -DLIBGNOME_DISABLE_DEPRECATED. + + * backend/ebook/Makefile.am (INCLUDES): Add + -DLIBGNOME_DISABLE_DEPRECATED. + + * backend/ebook/e-card.c (e_card_get_property): remove misleading + comment. + 2002-12-17 Chris Toshok * backend/pas/pas-backend-ldap.c (build_card_from_entry): diff --git a/addressbook/backend/ebook/Makefile.am b/addressbook/backend/ebook/Makefile.am index ceecdae451..3c8f4186fe 100644 --- a/addressbook/backend/ebook/Makefile.am +++ b/addressbook/backend/ebook/Makefile.am @@ -35,6 +35,7 @@ INCLUDES = \ -I$(top_builddir)/shell \ -I$(top_srcdir)/shell \ -DG_DISABLE_DEPRECATED \ + -DLIBGNOME_DISABLE_DEPRECATED \ $(EVOLUTION_ADDRESSBOOK_CFLAGS) privlib_LTLIBRARIES = libebook.la libebook-static.la diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c index 67787a20f9..99a8672111 100644 --- a/addressbook/backend/ebook/e-card.c +++ b/addressbook/backend/ebook/e-card.c @@ -2294,7 +2294,7 @@ e_card_get_property (GObject *object, strs[i] = (char *)e_iterator_get(iterator); } strs[i] = 0; - g_value_set_string(value, g_strjoinv(", ", strs)); /* XXX leak here? */ + g_value_set_string(value, g_strjoinv(", ", strs)); g_free(strs); } break; diff --git a/addressbook/backend/pas/Makefile.am b/addressbook/backend/pas/Makefile.am index a26e133171..2b311e8234 100644 --- a/addressbook/backend/pas/Makefile.am +++ b/addressbook/backend/pas/Makefile.am @@ -22,6 +22,7 @@ INCLUDES = \ -I$(top_srcdir)/addressbook/backend \ -I$(top_builddir)/addressbook/backend \ -DG_DISABLE_DEPRECATED \ + -DLIBGNOME_DISABLE_DEPRECATED \ $(EVOLUTION_ADDRESSBOOK_CFLAGS) LDAP_SCHEMA = \ diff --git a/addressbook/gui/component/Makefile.am b/addressbook/gui/component/Makefile.am index 8d4fcb2471..f9e9863713 100644 --- a/addressbook/gui/component/Makefile.am +++ b/addressbook/gui/component/Makefile.am @@ -25,6 +25,10 @@ INCLUDES = \ -DCAMEL_PROVIDERDIR=\""$(providerdir)"\" \ -DEVOLUTION_IMAGESDIR=\""$(datadir)"/images/evolution\" \ $(LDAP_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DGTK_DISABLE_DEPRECATED \ + -DLIBGNOME_DISABLE_DEPRECATED \ + -DLIBGNOMEUI_DISABLE_DEPRECATED \ $(EVOLUTION_ADDRESSBOOK_CFLAGS) componentdir = $(COMPONENT_DIR) diff --git a/addressbook/gui/component/addressbook-config.c b/addressbook/gui/component/addressbook-config.c index df65eb72d3..0aa0dc62c3 100644 --- a/addressbook/gui/component/addressbook-config.c +++ b/addressbook/gui/component/addressbook-config.c @@ -33,7 +33,6 @@ #include "evolution-config-control.h" #include -#include #include #include @@ -80,7 +79,7 @@ typedef struct { static void focus_help (GtkWidget *w, GdkEventFocus *event, FocusHelpClosure *closure) { - gtk_notebook_set_page (GTK_NOTEBOOK(closure->notebook), closure->page_num); + gtk_notebook_set_current_page (GTK_NOTEBOOK(closure->notebook), closure->page_num); } static void @@ -204,7 +203,7 @@ addressbook_ldap_init (GtkWidget *window, AddressbookSource *source) GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _("Failed to connect to LDAP server")); - + g_signal_connect (dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL); gtk_widget_show (dialog); return NULL; @@ -229,6 +228,7 @@ addressbook_ldap_auth (GtkWidget *window, AddressbookSource *source, LDAP *ldap) GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _("Failed to authenticate with LDAP server")); + g_signal_connect (dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL); gtk_widget_show (dialog); } return ldap_error; @@ -256,6 +256,7 @@ addressbook_root_dse_query (GtkWindow *window, AddressbookSource *source, LDAP * GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _("Could not perform query on Root DSE")); + g_signal_connect (dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL); gtk_widget_show (dialog); } @@ -302,8 +303,8 @@ addressbook_source_dialog_set_source (AddressbookSourceDialog *dialog, Addressbo dialog->auth = source ? source->auth : ADDRESSBOOK_LDAP_AUTH_NONE; gtk_option_menu_set_history (GTK_OPTION_MENU(dialog->auth_optionmenu), dialog->auth); if (dialog->auth != ADDRESSBOOK_LDAP_AUTH_NONE) { - gtk_notebook_set_page (GTK_NOTEBOOK(dialog->auth_label_notebook), dialog->auth - 1); - gtk_notebook_set_page (GTK_NOTEBOOK(dialog->auth_entry_notebook), dialog->auth - 1); + gtk_notebook_set_current_page (GTK_NOTEBOOK(dialog->auth_label_notebook), dialog->auth - 1); + gtk_notebook_set_current_page (GTK_NOTEBOOK(dialog->auth_entry_notebook), dialog->auth - 1); } gtk_widget_set_sensitive (dialog->auth_label_notebook, dialog->auth != ADDRESSBOOK_LDAP_AUTH_NONE); gtk_widget_set_sensitive (dialog->auth_entry_notebook, dialog->auth != ADDRESSBOOK_LDAP_AUTH_NONE); @@ -398,8 +399,8 @@ reparent_to_vbox (AddressbookSourceDialog *dialog, char *vbox_name, char *widget static void auth_optionmenu_activated (GtkWidget *item, AddressbookSourceDialog *dialog) { - dialog->auth = g_list_index (gtk_container_children (GTK_CONTAINER (item->parent)), - item); + dialog->auth = g_list_index (gtk_container_get_children (GTK_CONTAINER (item->parent)), + item); dialog->general_modify_func (item, dialog); @@ -410,8 +411,8 @@ auth_optionmenu_activated (GtkWidget *item, AddressbookSourceDialog *dialog) else { gtk_widget_set_sensitive (dialog->auth_label_notebook, TRUE); gtk_widget_set_sensitive (dialog->auth_entry_notebook, TRUE); - gtk_notebook_set_page (GTK_NOTEBOOK(dialog->auth_label_notebook), dialog->auth - 1); - gtk_notebook_set_page (GTK_NOTEBOOK(dialog->auth_entry_notebook), dialog->auth - 1); + gtk_notebook_set_current_page (GTK_NOTEBOOK(dialog->auth_label_notebook), dialog->auth - 1); + gtk_notebook_set_current_page (GTK_NOTEBOOK(dialog->auth_entry_notebook), dialog->auth - 1); } } @@ -501,7 +502,7 @@ druid_info_page_prepare (GnomeDruidPage *dpage, GtkWidget *gdruid, AddressbookSo static void ssl_optionmenu_activated (GtkWidget *item, AddressbookSourceDialog *dialog) { - dialog->ssl = g_list_index (gtk_container_children (GTK_CONTAINER (item->parent)), + dialog->ssl = g_list_index (gtk_container_get_children (GTK_CONTAINER (item->parent)), item); dialog->connecting_modify_func (item, dialog); @@ -511,12 +512,12 @@ static void ssl_optionmenu_selected (GtkWidget *item, AddressbookSourceDialog *dialog) { GtkWidget *connecting_tab_help; - int ssl_type = g_list_index (gtk_container_children (GTK_CONTAINER (item->parent)), + int ssl_type = g_list_index (gtk_container_get_children (GTK_CONTAINER (item->parent)), item); connecting_tab_help = glade_xml_get_widget (dialog->gui, "connecting-tab-help"); - gtk_notebook_set_page (GTK_NOTEBOOK(connecting_tab_help), ssl_type + 1); + gtk_notebook_set_current_page (GTK_NOTEBOOK(connecting_tab_help), ssl_type + 1); } static void @@ -667,6 +668,7 @@ do_ldap_root_dse_query (GtkWidget *dialog, ETableModel *model, AddressbookSource GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _("The server responded with no supported search bases")); + g_signal_connect (error_dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL); gtk_widget_show (error_dialog); goto fail; } @@ -744,7 +746,7 @@ query_for_supported_bases (GtkWidget *button, AddressbookSourceDialog *sdialog) static void scope_optionmenu_activated (GtkWidget *item, AddressbookSourceDialog *dialog) { - dialog->scope = g_list_index (gtk_container_children (GTK_CONTAINER (item->parent)), + dialog->scope = g_list_index (gtk_container_get_children (GTK_CONTAINER (item->parent)), item); if (dialog->searching_modify_func) @@ -1117,7 +1119,7 @@ static void set_advanced_button_state (AddressbookSourceDialog *dialog) { if (dialog->advanced) { - gtk_notebook_set_page (GTK_NOTEBOOK(dialog->advanced_button_notebook), 0); + gtk_notebook_set_current_page (GTK_NOTEBOOK(dialog->advanced_button_notebook), 0); #ifdef NEW_ADVANCED_UI gtk_notebook_append_page (GTK_NOTEBOOK(dialog->notebook), dialog->objectclasses_tab, dialog->objectclasses_label); gtk_notebook_append_page (GTK_NOTEBOOK(dialog->notebook), dialog->mappings_tab, dialog->mappings_label); @@ -1125,7 +1127,7 @@ set_advanced_button_state (AddressbookSourceDialog *dialog) #endif } else { - gtk_notebook_set_page (GTK_NOTEBOOK(dialog->advanced_button_notebook), 1); + gtk_notebook_set_current_page (GTK_NOTEBOOK(dialog->advanced_button_notebook), 1); /* hide the advanced tabs of the main notebook */ gtk_notebook_remove_page (GTK_NOTEBOOK(dialog->notebook), 5); @@ -1672,7 +1674,7 @@ ldap_config_control_new (GNOME_Evolution_Shell shell) } -BonoboControl * +BonoboObject * addressbook_config_control_new (void) { GNOME_Evolution_Shell shell; @@ -1681,7 +1683,7 @@ addressbook_config_control_new (void) if (! shell) return NULL; - return BONOBO_CONTROL (ldap_config_control_new (shell)); + return BONOBO_OBJECT (ldap_config_control_new (shell)); } void @@ -1731,7 +1733,6 @@ main(int argc, char **argv) g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); #endif - gtk_widget_push_visual (gdk_rgb_get_visual ()); gtk_widget_push_colormap (gdk_rgb_get_cmap ()); dialog = ldap_dialog_new (NULL); diff --git a/addressbook/gui/component/addressbook-config.h b/addressbook/gui/component/addressbook-config.h index 89d3a411a0..2f95a8cbbe 100644 --- a/addressbook/gui/component/addressbook-config.h +++ b/addressbook/gui/component/addressbook-config.h @@ -27,7 +27,7 @@ #include "addressbook-storage.h" -BonoboControl *addressbook_config_control_new (void); +BonoboObject *addressbook_config_control_new (void); void addressbook_config_create_new_source (const char *new_source, GtkWidget *parent); diff --git a/addressbook/gui/component/addressbook-storage.c b/addressbook/gui/component/addressbook-storage.c index 4cf66bca00..9b73b93b54 100644 --- a/addressbook/gui/component/addressbook-storage.c +++ b/addressbook/gui/component/addressbook-storage.c @@ -371,15 +371,18 @@ addressbook_storage_init_source_uri (AddressbookSource *source) str = g_string_new ("ldap://"); - g_string_sprintfa (str, "%s:%s/%s?"/*trigraph prevention*/"?%s", - source->host, source->port, source->rootdn, ldap_unparse_scope (source->scope)); + g_string_append_printf (str, "%s:%s/%s?"/*trigraph prevention*/"?%s", + source->host, + source->port, + source->rootdn, + ldap_unparse_scope (source->scope)); - g_string_sprintfa (str, ";limit=%d", source->limit); + g_string_append_printf (str, ";limit=%d", source->limit); - g_string_sprintfa (str, ";ssl=%s", ldap_unparse_ssl (source->ssl)); + g_string_append_printf (str, ";ssl=%s", ldap_unparse_ssl (source->ssl)); #if 0 - g_string_sprintfa (str, ";timeout=%d", source->timeout); + g_string_append_printf (str, ";timeout=%d", source->timeout); #endif source->uri = str->str; diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index 86644aaf8d..1fb5520454 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -37,7 +37,6 @@ #include #include #include -#include #include "e-util/e-categories-master-list-wombat.h" #include "e-util/e-sexp.h" diff --git a/addressbook/gui/component/select-names/Makefile.am b/addressbook/gui/component/select-names/Makefile.am index deee27fca0..3b1c816ad6 100644 --- a/addressbook/gui/component/select-names/Makefile.am +++ b/addressbook/gui/component/select-names/Makefile.am @@ -44,6 +44,10 @@ INCLUDES = \ -DEVOLUTION_ICONSDIR=\""$(iconsdir)"\" \ -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \ -DCAMEL_PROVIDERDIR=\""$(providerdir)"\" \ + -DG_DISABLE_DEPRECATED \ + -DGTK_DISABLE_DEPRECATED \ + -DLIBGNOME_DISABLE_DEPRECATED \ + -DLIBGNOMEUI_DISABLE_DEPRECATED \ $(EVOLUTION_ADDRESSBOOK_CFLAGS) lib_LTLIBRARIES = libeselectnames.la diff --git a/addressbook/gui/component/select-names/e-select-names-popup.c b/addressbook/gui/component/select-names/e-select-names-popup.c index 3c18638298..33afa13b2e 100644 --- a/addressbook/gui/component/select-names/e-select-names-popup.c +++ b/addressbook/gui/component/select-names/e-select-names-popup.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include @@ -215,15 +214,12 @@ static void set_uiinfo_label (GnomeUIInfo *uiinfo, const gchar *str) { GtkWidget *label; - gchar *label_txt; GList *item_children; - label_txt = e_utf8_to_locale_string (str); - item_children = gtk_container_children (GTK_CONTAINER (uiinfo->widget)); + item_children = gtk_container_get_children (GTK_CONTAINER (uiinfo->widget)); label = item_children->data; g_list_free (item_children); - gtk_label_set_text (GTK_LABEL (label), label_txt); - g_free (label_txt); + gtk_label_set_text (GTK_LABEL (label), str); } #define ARBITRARY_UIINFO_LIMIT 64 diff --git a/addressbook/gui/component/select-names/e-select-names.c b/addressbook/gui/component/select-names/e-select-names.c index bed94290ae..8b0531093b 100644 --- a/addressbook/gui/component/select-names/e-select-names.c +++ b/addressbook/gui/component/select-names/e-select-names.c @@ -43,7 +43,6 @@ #include #include "e-select-names-text-model.h" #include -#include #include #include @@ -724,7 +723,7 @@ e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id, E child = g_new(ESelectNamesChild, 1); child->names = e_select_names; - child->title = e_utf8_from_locale_string(_(name)); + child->title = g_strdup (_(name)); child->text_model = (ESelectNamesTextModel *) e_select_names_text_model_new (source); e_select_names_text_model_set_separator (child->text_model, "\n"); diff --git a/addressbook/gui/contact-editor/Makefile.am b/addressbook/gui/contact-editor/Makefile.am index dbbd0350a7..308972b207 100644 --- a/addressbook/gui/contact-editor/Makefile.am +++ b/addressbook/gui/contact-editor/Makefile.am @@ -12,6 +12,10 @@ INCLUDES = \ -DEVOLUTION_ICONSDIR=\""$(iconsdir)"\" \ -DEVOLUTIONDIR=\""$(evolutiondir)"\" \ -DG_LOG_DOMAIN=\"contact-editor\" \ + -DG_DISABLE_DEPRECATED \ + -DGTK_DISABLE_DEPRECATED \ + -DLIBGNOME_DISABLE_DEPRECATED \ + -DLIBGNOMEUI_DISABLE_DEPRECATED \ $(EVOLUTION_ADDRESSBOOK_CFLAGS) noinst_LIBRARIES = \ diff --git a/addressbook/gui/contact-editor/e-contact-editor-address.c b/addressbook/gui/contact-editor/e-contact-editor-address.c index 954be85928..8bb5a075f8 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-address.c +++ b/addressbook/gui/contact-editor/e-contact-editor-address.c @@ -27,10 +27,11 @@ #include #include #include -#include #include #include +#include #include +#include #include #include #include @@ -577,9 +578,9 @@ fill_in_info(EContactEditorAddress *editor) static char * extract_field(EContactEditorAddress *editor, char *field) { - GtkEditable *editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, field)); - if (editable) - return e_utf8_gtk_editable_get_text(editable); + GtkEntry *entry = GTK_ENTRY(glade_xml_get_widget(editor->gui, field)); + if (entry) + return g_strdup (gtk_entry_get_text(entry)); else return NULL; } diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c index bd51c71605..aa06e66eae 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c +++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c @@ -20,13 +20,14 @@ */ #include -#include #include "e-contact-editor-fullname.h" #include #include #include #include #include +#include +#include static void e_contact_editor_fullname_init (EContactEditorFullname *card); static void e_contact_editor_fullname_class_init (EContactEditorFullnameClass *klass); @@ -261,7 +262,7 @@ extract_field(EContactEditorFullname *editor, char *field) { GtkEntry *entry = GTK_ENTRY(glade_xml_get_widget(editor->gui, field)); if (entry) - return e_utf8_gtk_entry_get_text(entry); + return g_strdup (gtk_entry_get_text(entry)); else return NULL; } diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 23b5dc5dd6..0837fe6bd9 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -30,6 +30,8 @@ #include #include #include +#include +#include #include #include #include @@ -40,7 +42,6 @@ #include #include #include -#include #include #include @@ -294,7 +295,7 @@ phone_entry_changed (GtkWidget *widget, EContactEditor *editor) } else return; phone = e_card_phone_new(); - phone->number = e_utf8_gtk_entry_get_text(entry); + phone->number = g_strdup (gtk_entry_get_text(entry)); e_card_simple_set_phone(editor->simple, editor->phone_choice[which - 1], phone); e_card_phone_unref(phone); set_fields(editor); @@ -508,7 +509,7 @@ file_as_get_style (EContactEditor *editor) if (!(file_as && GTK_IS_ENTRY(file_as))) return -1; - filestring = e_utf8_gtk_entry_get_text(file_as); + filestring = g_strdup (gtk_entry_get_text(file_as)); style = -1; for (i = 0; i < 5; i++) { @@ -538,7 +539,7 @@ file_as_set_style(EContactEditor *editor, int style) return; if (style == -1) { - string = e_utf8_gtk_entry_get_text(file_as); + string = g_strdup (gtk_entry_get_text(file_as)); strings = g_list_append(strings, string); } @@ -548,9 +549,7 @@ file_as_set_style(EContactEditor *editor, int style) if (style_makes_sense(editor->name, editor->company, i)) { char *u; u = name_to_style(editor->name, editor->company, i); - string = e_utf8_to_gtk_string (widget, u); - g_free (u); - if (string) strings = g_list_append(strings, string); + if (u) strings = g_list_append(strings, u); } } @@ -563,7 +562,7 @@ file_as_set_style(EContactEditor *editor, int style) if (style != -1) { string = name_to_style(editor->name, editor->company, style); - e_utf8_gtk_entry_set_text(file_as, string); + gtk_entry_set_text(file_as, string); g_free(string); } } @@ -572,15 +571,14 @@ static void name_entry_changed (GtkWidget *widget, EContactEditor *editor) { int style = 0; - char *string; + const char *string; style = file_as_get_style(editor); e_card_name_unref(editor->name); - string = e_utf8_gtk_entry_get_text (GTK_ENTRY(widget)); + string = gtk_entry_get_text (GTK_ENTRY(widget)); editor->name = e_card_name_from_string(string); - g_free (string); file_as_set_style(editor, style); @@ -596,7 +594,7 @@ company_entry_changed (GtkWidget *widget, EContactEditor *editor) g_free(editor->company); - editor->company = e_utf8_gtk_entry_get_text(GTK_ENTRY(widget)); + editor->company = g_strdup (gtk_entry_get_text(GTK_ENTRY(widget))); file_as_set_style(editor, style); @@ -779,7 +777,7 @@ full_name_clicked(GtkWidget *button, EContactEditor *editor) fname_widget = glade_xml_get_widget(editor->gui, "entry-fullname"); if (fname_widget && GTK_IS_ENTRY(fname_widget)) { char *full_name = e_card_name_to_string(name); - e_utf8_gtk_entry_set_text(GTK_ENTRY(fname_widget), full_name); + gtk_entry_set_text(GTK_ENTRY(fname_widget), full_name); g_free(full_name); } @@ -856,7 +854,7 @@ categories_clicked(GtkWidget *button, EContactEditor *editor) GtkWidget *entry = glade_xml_get_widget(editor->gui, "entry-categories"); ECategoriesMasterList *ecml; if (entry && GTK_IS_ENTRY(entry)) - categories = e_utf8_gtk_entry_get_text(GTK_ENTRY(entry)); + categories = g_strdup (gtk_entry_get_text(GTK_ENTRY(entry))); else if (editor->card) g_object_get (editor->card, "categories", &categories, @@ -869,6 +867,7 @@ categories_clicked(GtkWidget *button, EContactEditor *editor) GTK_RESPONSE_OK, _("Category editor not available."), NULL); + g_free (categories); gtk_widget_show (uh_oh); return; } @@ -887,7 +886,7 @@ categories_clicked(GtkWidget *button, EContactEditor *editor) "categories", &categories, NULL); if (entry && GTK_IS_ENTRY(entry)) - e_utf8_gtk_entry_set_text(GTK_ENTRY(entry), categories); + gtk_entry_set_text(GTK_ENTRY(entry), categories); else g_object_set (editor->card, "categories", categories, @@ -2061,12 +2060,11 @@ find_address_mailing (EContactEditor *editor) static void set_field(GtkEntry *entry, const char *string) { - char *oldstring = e_utf8_gtk_entry_get_text(entry); + const char *oldstring = gtk_entry_get_text(entry); if (!string) string = ""; if (strcmp(string, oldstring)) - e_utf8_gtk_entry_set_text(entry, string); - g_free (oldstring); + gtk_entry_set_text(entry, string); } static void @@ -2242,11 +2240,8 @@ fill_in_field(EContactEditor *editor, char *id, char *value) int position = 0; GtkEditable *editable = GTK_EDITABLE(widget); gtk_editable_delete_text(editable, 0, -1); - if (value) { - gchar *u = e_utf8_to_gtk_string ((GtkWidget *) editable, value); - gtk_editable_insert_text(editable, u, strlen(u), &position); - g_free (u); - } + if (value) + gtk_editable_insert_text(editable, value, strlen(value), &position); } } @@ -2273,11 +2268,8 @@ fill_in_single_field(EContactEditor *editor, char *name) gtk_editable_delete_text(editable, 0, -1); arbitrary = e_card_simple_get_arbitrary(simple, name); - if (arbitrary && arbitrary->value) { - gchar *u = e_utf8_to_gtk_string ((GtkWidget *) editable, arbitrary->value); - gtk_editable_insert_text(editable, u, strlen(u), &position); - g_free (u); - } + if (arbitrary && arbitrary->value) + gtk_editable_insert_text(editable, arbitrary->value, strlen(arbitrary->value), &position); } } @@ -2616,18 +2608,19 @@ static void extract_field(EContactEditor *editor, ECard *card, char *editable_id, char *key) { GtkWidget *widget = glade_xml_get_widget(editor->gui, editable_id); - if (widget && GTK_IS_EDITABLE(widget)) { + + if (widget && GTK_IS_EDITABLE (widget)) { GtkEditable *editable = GTK_EDITABLE(widget); - char *string = e_utf8_gtk_editable_get_chars(editable, 0, -1); + char *string = gtk_editable_get_chars(editable, 0, -1); if (string && *string) g_object_set (card, - key, string, - NULL); + key, string, + NULL); else g_object_set (card, - key, NULL, - NULL); + key, NULL, + NULL); if (string) g_free(string); } @@ -2640,7 +2633,7 @@ extract_single_field(EContactEditor *editor, char *name) ECardSimple *simple = editor->simple; if (widget && GTK_IS_EDITABLE(widget)) { GtkEditable *editable = GTK_EDITABLE(widget); - char *string = e_utf8_gtk_editable_get_chars(editable, 0, -1); + char *string = gtk_editable_get_chars(editable, 0, -1); if (string && *string) e_card_simple_set_arbitrary(simple, @@ -2670,7 +2663,7 @@ extract_info(EContactEditor *editor) widget = glade_xml_get_widget(editor->gui, "entry-file-as"); if (widget && GTK_IS_EDITABLE(widget)) { GtkEditable *editable = GTK_EDITABLE(widget); - char *string = e_utf8_gtk_editable_get_chars(editable, 0, -1); + char *string = gtk_editable_get_chars(editable, 0, -1); if (string && *string) g_object_set (card, diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index e06390b2a5..69af7802b2 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -253,15 +252,13 @@ clicked_cb (GtkWidget *w, gint button, gpointer closure) if (qa->name_entry) { gchar *tmp; tmp = gtk_editable_get_chars (GTK_EDITABLE (qa->name_entry), 0, -1); - name = e_utf8_from_gtk_string (qa->name_entry, tmp); - g_free (tmp); + name = tmp; } if (qa->email_entry) { gchar *tmp; tmp = gtk_editable_get_chars (GTK_EDITABLE (qa->email_entry), 0, -1); - email = e_utf8_from_gtk_string (qa->email_entry, tmp); - g_free (tmp); + email = tmp; } quick_add_set_name (qa, name); @@ -311,19 +308,13 @@ build_quick_add_dialog (QuickAdd *qa) G_CALLBACK (clicked_cb), qa); qa->name_entry = gtk_entry_new (); - if (qa->name) { - gchar *str = e_utf8_to_gtk_string (qa->name_entry, qa->name); - gtk_entry_set_text (GTK_ENTRY (qa->name_entry), str); - g_free (str); - } + if (qa->name) + gtk_entry_set_text (GTK_ENTRY (qa->name_entry), qa->name); qa->email_entry = gtk_entry_new (); - if (qa->email) { - gchar *str = e_utf8_to_gtk_string (qa->email_entry, qa->email); - gtk_entry_set_text (GTK_ENTRY (qa->email_entry), str); - g_free (str); - } + if (qa->email) + gtk_entry_set_text (GTK_ENTRY (qa->email_entry), qa->email); table = GTK_TABLE (gtk_table_new (2, 2, FALSE)); diff --git a/addressbook/gui/contact-editor/e-contact-save-as.c b/addressbook/gui/contact-editor/e-contact-save-as.c index 73651b9f21..f281b1925f 100644 --- a/addressbook/gui/contact-editor/e-contact-save-as.c +++ b/addressbook/gui/contact-editor/e-contact-save-as.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -126,7 +125,6 @@ e_contact_save_as(char *title, ECard *card, GtkWindow *parent_window) GtkFileSelection *filesel; char *file; char *name; - char *locale_name; SaveAsInfo *info = g_new(SaveAsInfo, 1); filesel = GTK_FILE_SELECTION(gtk_file_selection_new(title)); @@ -134,11 +132,9 @@ e_contact_save_as(char *title, ECard *card, GtkWindow *parent_window) g_object_get (card, "file_as", &name, NULL); - locale_name = e_utf8_to_locale_string (name); - file = make_safe_filename (g_get_home_dir(), locale_name); + file = make_safe_filename (g_get_home_dir(), name); gtk_file_selection_set_filename (filesel, file); g_free (file); - g_free (locale_name); info->filesel = filesel; info->vcard = e_card_get_vcard(card); @@ -169,15 +165,13 @@ e_contact_list_save_as(char *title, GList *list, GtkWindow *parent_window) /* This is a filename. Translators take note. */ if (list && list->data && list->next == NULL) { - char *name, *locale_name, *file; + char *name, *file; g_object_get (list->data, "file_as", &name, NULL); - locale_name = e_utf8_to_locale_string (name); - file = make_safe_filename (g_get_home_dir(), locale_name); + file = make_safe_filename (g_get_home_dir(), name); gtk_file_selection_set_filename (filesel, file); g_free (file); - g_free (locale_name); } else { char *file; file = make_safe_filename (g_get_home_dir(), _("list")); diff --git a/addressbook/gui/contact-list-editor/Makefile.am b/addressbook/gui/contact-list-editor/Makefile.am index b469b2a330..3822d8f551 100644 --- a/addressbook/gui/contact-list-editor/Makefile.am +++ b/addressbook/gui/contact-list-editor/Makefile.am @@ -13,6 +13,10 @@ INCLUDES = \ -DEVOLUTION_ICONSDIR=\""$(iconsdir)"\" \ -DEVOLUTIONDIR=\""$(evolutiondir)"\" \ -DG_LOG_DOMAIN=\"contact-list-editor\" \ + -DG_DISABLE_DEPRECATED \ + -DGTK_DISABLE_DEPRECATED \ + -DLIBGNOME_DISABLE_DEPRECATED \ + -DLIBGNOMEUI_DISABLE_DEPRECATED \ $(EVOLUTION_ADDRESSBOOK_CFLAGS) noinst_LIBRARIES = \ diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c index b9d0726136..36ccfe13d1 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -29,7 +29,6 @@ #include #include #include -#include #include "shell/evolution-shell-component-utils.h" #include "addressbook/gui/widgets/e-addressbook-util.h" @@ -397,7 +396,7 @@ save_card (EContactListEditor *cle, gboolean should_close) static gboolean is_named (EContactListEditor *editor) { - char *string = e_utf8_gtk_editable_get_chars(GTK_EDITABLE (editor->list_name_entry), 0, -1); + char *string = gtk_editable_get_chars(GTK_EDITABLE (editor->list_name_entry), 0, -1); gboolean named = FALSE; if (string && *string) { @@ -924,7 +923,7 @@ extract_info(EContactListEditor *editor) int i; EList *email_list; EIterator *email_iter; - char *string = e_utf8_gtk_editable_get_chars(GTK_EDITABLE (editor->list_name_entry), 0, -1); + char *string = gtk_editable_get_chars(GTK_EDITABLE (editor->list_name_entry), 0, -1); if (string && *string) g_object_set (card, @@ -985,9 +984,7 @@ fill_in_info(EContactListEditor *editor) gtk_editable_delete_text (GTK_EDITABLE (editor->list_name_entry), 0, -1); if (file_as) { int position = 0; - gchar *u = e_utf8_to_gtk_string (editor->list_name_entry, file_as); - gtk_editable_insert_text (GTK_EDITABLE (editor->list_name_entry), u, strlen (u), &position); - g_free (u); + gtk_editable_insert_text (GTK_EDITABLE (editor->list_name_entry), file_as, strlen (file_as), &position); } gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(editor->visible_addrs_checkbutton), !show_addresses); diff --git a/addressbook/gui/merging/Makefile.am b/addressbook/gui/merging/Makefile.am index a063f17819..27d3b202e9 100644 --- a/addressbook/gui/merging/Makefile.am +++ b/addressbook/gui/merging/Makefile.am @@ -5,6 +5,10 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_srcdir)/addressbook/backend \ -I$(top_builddir)/addressbook/backend \ + -DG_DISABLE_DEPRECATED \ + -DGTK_DISABLE_DEPRECATED \ + -DLIBGNOME_DISABLE_DEPRECATED \ + -DLIBGNOMEUI_DISABLE_DEPRECATED \ $(EVOLUTION_ADDRESSBOOK_CFLAGS) noinst_LIBRARIES = \ diff --git a/addressbook/gui/search/Makefile.am b/addressbook/gui/search/Makefile.am index db4117c785..35ed1a6e49 100644 --- a/addressbook/gui/search/Makefile.am +++ b/addressbook/gui/search/Makefile.am @@ -13,6 +13,10 @@ INCLUDES = \ -I$(top_srcdir)/widgets/misc \ -I$(top_builddir)/shell \ -DSEARCH_RULE_DIR=\"$(ruledir)\" \ + -DG_DISABLE_DEPRECATED \ + -DGTK_DISABLE_DEPRECATED \ + -DLIBGNOME_DISABLE_DEPRECATED \ + -DLIBGNOMEUI_DISABLE_DEPRECATED \ $(EVOLUTION_ADDRESSBOOK_CFLAGS) noinst_LIBRARIES = \ diff --git a/addressbook/gui/search/e-addressbook-search-dialog.c b/addressbook/gui/search/e-addressbook-search-dialog.c index 7a4f9d7f0b..157d22cbad 100644 --- a/addressbook/gui/search/e-addressbook-search-dialog.c +++ b/addressbook/gui/search/e-addressbook-search-dialog.c @@ -134,7 +134,7 @@ e_addressbook_search_dialog_init (EAddressbookSearchDialog *view) GtkWidget * e_addressbook_search_dialog_new (EAddressbookView *addr_view) { - EAddressbookSearchDialog *view = gtk_type_new (e_addressbook_search_dialog_get_type ()); + EAddressbookSearchDialog *view = g_object_new (E_ADDRESSBOOK_SEARCH_DIALOG_TYPE, NULL); view->view = addr_view; return GTK_WIDGET(view); } diff --git a/addressbook/gui/widgets/e-minicard-label.c b/addressbook/gui/widgets/e-minicard-label.c index 33016067fa..21ace85c60 100644 --- a/addressbook/gui/widgets/e-minicard-label.c +++ b/addressbook/gui/widgets/e-minicard-label.c @@ -273,9 +273,6 @@ e_minicard_label_construct (GnomeCanvasItem *item) { EMinicardLabel *e_minicard_label; GnomeCanvasGroup *group; - GdkFont *font; - - font = gtk_style_get_font (gtk_widget_get_style (GTK_WIDGET (item->canvas))); e_minicard_label = E_MINICARD_LABEL (item); group = GNOME_CANVAS_GROUP( item ); diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c index e4c8db0bd1..25d43fdd84 100644 --- a/addressbook/gui/widgets/e-minicard-view.c +++ b/addressbook/gui/widgets/e-minicard-view.c @@ -29,7 +29,6 @@ #include #include #include -#include #include static void e_minicard_view_drag_data_get(GtkWidget *widget, diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index 4cd5bd67f9..a63f7604b5 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -468,9 +468,6 @@ e_minicard_realize (GnomeCanvasItem *item) "width", (double) MAX( e_minicard->width - 12, 0 ), "clip", TRUE, "use_ellipsis", TRUE, -#if 0 - "font", "fixed-bold-10", -#endif "fill_color_gdk", &canvas->style->fg[GTK_STATE_NORMAL], "text", "", "draw_background", FALSE, @@ -811,24 +808,26 @@ add_field (EMinicard *e_minicard, ECardSimpleField field, gdouble left_width) g_free(string); } -static gdouble +static int get_left_width(EMinicard *e_minicard) { gchar *name; ECardSimpleField field; - gdouble width = -1; + int width = -1; GdkFont *font; + PangoLayout *layout; - font = gtk_style_get_font (gtk_widget_get_style ((GtkWidget *) ((GnomeCanvasItem *) e_minicard)->canvas)); - + layout = gtk_widget_create_pango_layout (GTK_WIDGET (GNOME_CANVAS_ITEM (e_minicard)->canvas), ""); for(field = E_CARD_SIMPLE_FIELD_FULL_NAME; field != E_CARD_SIMPLE_FIELD_LAST; field++) { - gdouble this_width; + int this_width; name = g_strdup_printf("%s:", e_card_simple_get_name(e_minicard->simple, field)); - this_width = gdk_text_width(font, name, strlen(name)); + pango_layout_set_text (layout, name, -1); + pango_layout_get_pixel_size (layout, &this_width, NULL); if (width < this_width) width = this_width; g_free(name); } + g_object_unref (layout); return width; } @@ -842,7 +841,7 @@ remodel( EMinicard *e_minicard ) ECardSimpleField field; GList *list; char *file_as; - gdouble left_width = -1; + int left_width = -1; if (e_minicard->header_text) { file_as = e_card_simple_get(e_minicard->simple, E_CARD_SIMPLE_FIELD_FILE_AS); -- cgit