From 26afa6081c3d9826dbae78236dd712fad8b7c340 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 1 Nov 2010 14:44:23 -0400 Subject: Utilize the new ESourceSelector:primary-selection property. --- modules/addressbook/e-book-shell-view-actions.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/addressbook/e-book-shell-view-actions.c') diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index 9c13e599a7..7dec37968d 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -65,7 +65,7 @@ action_address_book_delete_cb (GtkAction *action, book_shell_sidebar = book_shell_view->priv->book_shell_sidebar; selector = e_book_shell_sidebar_get_selector (book_shell_sidebar); - source = e_source_selector_peek_primary_selection (selector); + source = e_source_selector_get_primary_selection (selector); g_return_if_fail (source != NULL); response = e_alert_run_dialog_for_args ( @@ -179,7 +179,7 @@ action_address_book_properties_cb (GtkAction *action, book_shell_sidebar = book_shell_view->priv->book_shell_sidebar; selector = e_book_shell_sidebar_get_selector (book_shell_sidebar); - source = e_source_selector_peek_primary_selection (selector); + source = e_source_selector_get_primary_selection (selector); g_return_if_fail (source != NULL); uid = e_source_peek_uid (source); -- cgit v1.2.3 From 333ccc8abf033453996e4a7e16712f2fc3b9e05a Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 18 Feb 2011 15:13:06 +0100 Subject: Bug #639483 - Category list includes weather information --- modules/addressbook/e-book-shell-view-actions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/addressbook/e-book-shell-view-actions.c') diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index 7dec37968d..b2c63b872a 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -1124,7 +1124,7 @@ e_book_shell_view_update_search_filter (EBookShellView *book_shell_view) /* Build the category actions. */ - list = e_categories_get_list (); + list = e_util_get_searchable_categories (); for (iter = list, ii = 0; iter != NULL; iter = iter->next, ii++) { const gchar *category_name = iter->data; const gchar *filename; -- cgit v1.2.3 From 392973975c3e4a4e8fe17731b5e397ae10a91517 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 27 Mar 2011 15:16:39 -0400 Subject: Restore lockdown integration. With lockdown settings available through GSettings, widgets can handle lockdown integration themselves without having to use EShellSettings. Also fixed a few places where printing or save-to-disk actions were either not properly wired up or not responding to lockdown settings, but much more work needs done. Attachments, for example, are not honoring the disable-save-to-disk setting at all. This too requires the recently-added gsettings-desktop-schemas dependency. --- modules/addressbook/e-book-shell-view-actions.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'modules/addressbook/e-book-shell-view-actions.c') diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index b2c63b872a..fc7c841fad 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -717,13 +717,6 @@ static GtkActionEntry contact_entries[] = { N_("Rename the selected address book"), G_CALLBACK (action_address_book_rename_cb) }, - { "address-book-save-as", - GTK_STOCK_SAVE_AS, - N_("S_ave Address Book as vCard"), - NULL, - N_("Save the contacts of the selected address book as a vCard"), - G_CALLBACK (action_address_book_save_as_cb) }, - { "address-book-stop", GTK_STOCK_STOP, NULL, @@ -825,11 +818,6 @@ static EPopupActionEntry contact_popup_entries[] = { NULL, "address-book-rename" }, - { "address-book-popup-save-as", - /* Translators: This is an action label */ - N_("_Save as vCard..."), - "address-book-save-as" }, - { "contact-popup-copy", NULL, "contact-copy" }, @@ -970,6 +958,13 @@ static EPopupActionEntry lockdown_printing_popup_entries[] = { static GtkActionEntry lockdown_save_to_disk_entries[] = { + { "address-book-save-as", + GTK_STOCK_SAVE_AS, + N_("S_ave Address Book as vCard"), + NULL, + N_("Save the contacts of the selected address book as a vCard"), + G_CALLBACK (action_address_book_save_as_cb) }, + { "contact-save-as", GTK_STOCK_SAVE_AS, /* Translators: This is an action label */ @@ -981,6 +976,11 @@ static GtkActionEntry lockdown_save_to_disk_entries[] = { static EPopupActionEntry lockdown_save_to_disk_popup_entries[] = { + { "address-book-popup-save-as", + /* Translators: This is an action label */ + N_("_Save as vCard..."), + "address-book-save-as" }, + { "contact-popup-save-as", NULL, "contact-save-as" } -- cgit v1.2.3 From c24038c4f62f37b89d1bda9542ca5ccc843d4ea0 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 27 May 2011 15:23:07 +0200 Subject: Bug #646109 - Fix use of include to make sure translations work --- modules/addressbook/e-book-shell-view-actions.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/addressbook/e-book-shell-view-actions.c') diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index fc7c841fad..b8e6c4f21c 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -19,6 +19,10 @@ * */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "e-book-shell-view-private.h" #include -- cgit v1.2.3 From 3ce496063229de02670df0b87b2fabef91bae2b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Vr=C3=A1til?= Date: Thu, 2 Jun 2011 16:57:23 +0200 Subject: Bug #642557 - Display maps in contact preview --- modules/addressbook/e-book-shell-view-actions.c | 164 +++++++++++++++++++++++- 1 file changed, 163 insertions(+), 1 deletion(-) (limited to 'modules/addressbook/e-book-shell-view-actions.c') diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index b8e6c4f21c..5116232161 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -29,6 +29,10 @@ #include #include +#ifdef WITH_CONTACT_MAPS +#include +#endif + #include static void @@ -211,6 +215,118 @@ action_address_book_properties_cb (GtkAction *action, gtk_window_present (GTK_WINDOW (closure->editor)); } +#ifdef WITH_CONTACT_MAPS +static void +contact_editor_contact_modified_cb (EABEditor *editor, + const GError *error, + EContact *contact, + gpointer user_data) +{ + EContactMapWindow *window = user_data; + EContactMap *map; + const gchar *contact_uid; + + if (error) { + g_warning ("Error modifying contact: %s", error->message); + return; + } + + map = e_contact_map_window_get_map (window); + + contact_uid = e_contact_get_const (contact, E_CONTACT_UID); + + e_contact_map_remove_contact (map, contact_uid); + e_contact_map_add_contact (map, contact); +} + +static void +map_window_show_contact_editor_cb (EContactMapWindow *window, + const gchar *contact_uid, + gpointer user_data) +{ + EShell *shell = e_shell_get_default(); + EBookShellView *book_shell_view = user_data; + EBookShellSidebar *book_shell_sidebar; + ESource *source; + ESourceSelector *selector; + EBook *book; + EContact *contact; + EABEditor *editor; + GError *error = NULL; + + book_shell_sidebar = book_shell_view->priv->book_shell_sidebar; + selector = e_book_shell_sidebar_get_selector (book_shell_sidebar); + source = e_source_selector_get_primary_selection (selector); + + g_return_if_fail (source != NULL); + book = e_book_new (source, &error); + if (error) { + g_warning ("Error loading addressbook: %s", error->message); + g_error_free (error); + g_object_unref (book); + return; + } + + e_book_get_contact (book, contact_uid, &contact, &error); + if (error) { + g_warning ("Error getting contact from addressbook: %s", error->message); + g_error_free (error); + g_object_unref (book); + return; + } + + editor = e_contact_editor_new (shell, book, contact, FALSE, TRUE); + + g_signal_connect (editor, "contact-modified", + G_CALLBACK (contact_editor_contact_modified_cb), window); + g_signal_connect_swapped (editor, "editor-closed", + G_CALLBACK (g_object_unref), editor); + + eab_editor_show (editor); + g_object_unref (book); +} +#endif + +/* We need this function to he defined all the time. */ +static void +action_address_book_map_cb (GtkAction *action, + EBookShellView *book_shell_view) +{ +#ifdef WITH_CONTACT_MAPS + EContactMapWindow *map_window; + EBookShellSidebar *book_shell_sidebar; + ESource *source; + ESourceSelector *selector; + EBook *book; + GError *error = NULL; + + book_shell_sidebar = book_shell_view->priv->book_shell_sidebar; + selector = e_book_shell_sidebar_get_selector (book_shell_sidebar); + source = e_source_selector_get_primary_selection (selector); + + g_return_if_fail (source != NULL); + book = e_book_new (source, &error); + if (error != NULL) { + g_warning ("Error loading addressbook: %s", error->message); + g_error_free (error); + return; + } + + map_window = e_contact_map_window_new (); + e_contact_map_window_load_addressbook (map_window, book); + + /* Free the map_window automatically when it is closed */ + g_signal_connect_swapped (GTK_WIDGET (map_window), "hide", + G_CALLBACK (gtk_widget_destroy), GTK_WIDGET (map_window)); + g_signal_connect (map_window, "show-contact-editor", + G_CALLBACK (map_window_show_contact_editor_cb), book_shell_view); + + gtk_widget_show_all (GTK_WIDGET (map_window)); + + g_object_unref (book); +#endif +} + static void action_address_book_rename_cb (GtkAction *action, EBookShellView *book_shell_view) @@ -502,6 +618,18 @@ action_contact_preview_cb (GtkToggleAction *action, e_book_shell_content_set_preview_visible (book_shell_content, visible); } +static void +action_contact_preview_show_maps_cb (GtkToggleAction *action, + EBookShellView *book_shell_view) +{ + EBookShellContent *book_shell_content; + gboolean show_maps; + + book_shell_content = book_shell_view->priv->book_shell_content; + show_maps = gtk_toggle_action_get_active (action); + e_book_shell_content_set_preview_show_maps (book_shell_content, show_maps); +} + static void action_contact_print_cb (GtkAction *action, EBookShellView *book_shell_view) @@ -714,6 +842,13 @@ static GtkActionEntry contact_entries[] = { N_("Show properties of the selected address book"), G_CALLBACK (action_address_book_properties_cb) }, + { "address-book-map", + NULL, + N_("Address Book _Map"), + NULL, + N_("Show map with all contacts from selected address book"), + G_CALLBACK (action_address_book_map_cb) }, + { "address-book-rename", NULL, N_("_Rename..."), @@ -818,6 +953,10 @@ static EPopupActionEntry contact_popup_entries[] = { N_("_Properties"), "address-book-properties" }, + { "address-book-popup-map", + N_("Addressbook Map"), + "address-book-map" }, + { "address-book-popup-rename", NULL, "address-book-rename" }, @@ -851,7 +990,15 @@ static GtkToggleActionEntry contact_toggle_entries[] = { "m", N_("Show contact preview window"), G_CALLBACK (action_contact_preview_cb), - TRUE } + TRUE }, + + { "contact-preview-show-maps", + NULL, + N_("Show _Maps"), + NULL, + N_("Show maps in contact preview window"), + G_CALLBACK (action_contact_preview_show_maps_cb), + FALSE } }; static GtkRadioActionEntry contact_view_entries[] = { @@ -1071,6 +1218,10 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view) key = "/apps/evolution/addressbook/display/layout"; gconf_bridge_bind_property (bridge, key, object, "current-value"); + object = G_OBJECT (ACTION (CONTACT_PREVIEW_SHOW_MAPS)); + key = "/apps/evolution/addressbook/display/preview_show_maps"; + gconf_bridge_bind_property (bridge, key, object, "active"); + /* Fine tuning. */ g_signal_connect ( @@ -1087,9 +1238,20 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view) ACTION (CONTACT_VIEW_VERTICAL), "sensitive", G_BINDING_SYNC_CREATE); + g_object_bind_property ( + ACTION (CONTACT_PREVIEW), "active", + ACTION (CONTACT_PREVIEW_SHOW_MAPS), "sensitive", + G_BINDING_SYNC_CREATE); + e_web_view_set_open_proxy (web_view, ACTION (CONTACT_OPEN)); e_web_view_set_print_proxy (web_view, ACTION (CONTACT_PRINT)); e_web_view_set_save_as_proxy (web_view, ACTION (CONTACT_SAVE_AS)); + +#ifndef WITH_CONTACT_MAPS + gtk_action_set_visible (ACTION (CONTACT_PREVIEW_SHOW_MAPS), FALSE); + gtk_action_set_visible (ACTION (ADDRESS_BOOK_MAP), FALSE); + gtk_action_set_visible (ACTION (ADDRESS_BOOK_POPUP_MAP), FALSE); +#endif } void -- cgit v1.2.3 From f36331f1a7d99b83f13010e35f604bd6857b6019 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 2 Jun 2011 18:32:51 +0200 Subject: Little text typo fix --- modules/addressbook/e-book-shell-view-actions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/addressbook/e-book-shell-view-actions.c') diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index 5116232161..c558fff131 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -954,7 +954,7 @@ static EPopupActionEntry contact_popup_entries[] = { "address-book-properties" }, { "address-book-popup-map", - N_("Addressbook Map"), + N_("Address Book Map"), "address-book-map" }, { "address-book-popup-rename", -- cgit v1.2.3 From d4b54737d3df8c01039815212e6f269f16b4e2bc Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 13 Jun 2011 10:27:22 -0400 Subject: Coding style and whitespace cleanups. --- modules/addressbook/e-book-shell-view-actions.c | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'modules/addressbook/e-book-shell-view-actions.c') diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index c558fff131..029bdd783d 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -242,9 +242,9 @@ contact_editor_contact_modified_cb (EABEditor *editor, static void map_window_show_contact_editor_cb (EContactMapWindow *window, const gchar *contact_uid, - gpointer user_data) + gpointer user_data) { - EShell *shell = e_shell_get_default(); + EShell *shell = e_shell_get_default (); EBookShellView *book_shell_view = user_data; EBookShellSidebar *book_shell_sidebar; ESource *source; @@ -294,21 +294,21 @@ action_address_book_map_cb (GtkAction *action, { #ifdef WITH_CONTACT_MAPS EContactMapWindow *map_window; - EBookShellSidebar *book_shell_sidebar; - ESource *source; - ESourceSelector *selector; - EBook *book; - GError *error = NULL; - - book_shell_sidebar = book_shell_view->priv->book_shell_sidebar; - selector = e_book_shell_sidebar_get_selector (book_shell_sidebar); - source = e_source_selector_get_primary_selection (selector); - - g_return_if_fail (source != NULL); - book = e_book_new (source, &error); - if (error != NULL) { + EBookShellSidebar *book_shell_sidebar; + ESource *source; + ESourceSelector *selector; + EBook *book; + GError *error = NULL; + + book_shell_sidebar = book_shell_view->priv->book_shell_sidebar; + selector = e_book_shell_sidebar_get_selector (book_shell_sidebar); + source = e_source_selector_get_primary_selection (selector); + + g_return_if_fail (source != NULL); + book = e_book_new (source, &error); + if (error != NULL) { g_warning ("Error loading addressbook: %s", error->message); - g_error_free (error); + g_error_free (error); return; } -- cgit v1.2.3 From 84339b3be5a771406fcd5898bbd21dc1c5b98c82 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 14 Jun 2011 08:54:20 +0200 Subject: Do not use deprecated EBook/ECal API --- modules/addressbook/e-book-shell-view-actions.c | 68 ++++++++++++------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'modules/addressbook/e-book-shell-view-actions.c') diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index 029bdd783d..52d8243ead 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -61,7 +61,7 @@ action_address_book_delete_cb (GtkAction *action, ESourceSelector *selector; ESourceGroup *source_group; ESourceList *source_list; - EBook *book; + EBookClient *book; gint response; GError *error = NULL; @@ -84,14 +84,14 @@ action_address_book_delete_cb (GtkAction *action, if (response != GTK_RESPONSE_YES) return; - book = e_book_new (source, &error); + book = e_book_client_new (source, &error); if (error != NULL) { g_warning ("Error removing addressbook: %s", error->message); g_error_free (error); return; } - if (!e_book_remove (book, NULL)) { + if (!e_client_remove_sync (E_CLIENT (book), NULL, NULL)) { e_alert_run_dialog_for_args ( GTK_WINDOW (shell_window), "addressbook:remove-addressbook", NULL); @@ -249,7 +249,7 @@ map_window_show_contact_editor_cb (EContactMapWindow *window, EBookShellSidebar *book_shell_sidebar; ESource *source; ESourceSelector *selector; - EBook *book; + EBookClient *book_client; EContact *contact; EABEditor *editor; GError *error = NULL; @@ -259,23 +259,24 @@ map_window_show_contact_editor_cb (EContactMapWindow *window, source = e_source_selector_get_primary_selection (selector); g_return_if_fail (source != NULL); - book = e_book_new (source, &error); + book_client = e_book_client_new (source, &error); if (error) { g_warning ("Error loading addressbook: %s", error->message); g_error_free (error); - g_object_unref (book); + if (book_client) + g_object_unref (book_client); return; } - e_book_get_contact (book, contact_uid, &contact, &error); + e_book_client_get_contact_sync (book_client, contact_uid, &contact, NULL, &error); if (error) { g_warning ("Error getting contact from addressbook: %s", error->message); g_error_free (error); - g_object_unref (book); + g_object_unref (book_client); return; } - editor = e_contact_editor_new (shell, book, contact, FALSE, TRUE); + editor = e_contact_editor_new (shell, book_client, contact, FALSE, TRUE); g_signal_connect (editor, "contact-modified", G_CALLBACK (contact_editor_contact_modified_cb), window); @@ -283,7 +284,7 @@ map_window_show_contact_editor_cb (EContactMapWindow *window, G_CALLBACK (g_object_unref), editor); eab_editor_show (editor); - g_object_unref (book); + g_object_unref (book_client); } #endif @@ -297,7 +298,7 @@ action_address_book_map_cb (GtkAction *action, EBookShellSidebar *book_shell_sidebar; ESource *source; ESourceSelector *selector; - EBook *book; + EBookClient *book_client; GError *error = NULL; book_shell_sidebar = book_shell_view->priv->book_shell_sidebar; @@ -305,7 +306,7 @@ action_address_book_map_cb (GtkAction *action, source = e_source_selector_get_primary_selection (selector); g_return_if_fail (source != NULL); - book = e_book_new (source, &error); + book_client = e_book_client_new (source, &error); if (error != NULL) { g_warning ("Error loading addressbook: %s", error->message); g_error_free (error); @@ -313,7 +314,7 @@ action_address_book_map_cb (GtkAction *action, } map_window = e_contact_map_window_new (); - e_contact_map_window_load_addressbook (map_window, book); + e_contact_map_window_load_addressbook (map_window, book_client); /* Free the map_window automatically when it is closed */ g_signal_connect_swapped (GTK_WIDGET (map_window), "hide", @@ -323,7 +324,7 @@ action_address_book_map_cb (GtkAction *action, gtk_widget_show_all (GTK_WIDGET (map_window)); - g_object_unref (book); + g_object_unref (book_client); #endif } @@ -353,8 +354,8 @@ action_address_book_save_as_cb (GtkAction *action, EAddressbookView *view; EActivity *activity; EBookQuery *query; - EBook *book; - GList *list = NULL; + EBookClient *book; + GSList *list = NULL; GFile *file; gchar *string; @@ -368,12 +369,15 @@ action_address_book_save_as_cb (GtkAction *action, g_return_if_fail (view != NULL); model = e_addressbook_view_get_model (view); - book = e_addressbook_model_get_book (model); + book = e_addressbook_model_get_client (model); query = e_book_query_any_field_contains (""); - e_book_get_contacts (book, query, &list, NULL); + string = e_book_query_to_string (query); e_book_query_unref (query); + e_book_client_get_contacts_sync (book, string, &list, NULL, NULL); + g_free (string); + if (list == NULL) goto exit; @@ -415,8 +419,7 @@ action_address_book_save_as_cb (GtkAction *action, g_object_unref (file); exit: - g_list_foreach (list, (GFunc) g_object_unref, NULL); - g_list_free (list); + e_client_util_free_object_slist (list); } static void @@ -483,7 +486,7 @@ action_contact_forward_cb (GtkAction *action, EShellWindow *shell_window; EBookShellContent *book_shell_content; EAddressbookView *view; - GList *list, *iter; + GSList *list, *iter; shell_view = E_SHELL_VIEW (book_shell_view); shell_window = e_shell_view_get_shell_window (shell_view); @@ -510,8 +513,7 @@ action_contact_forward_cb (GtkAction *action, eab_send_as_attachment (shell, list); - g_list_foreach (list, (GFunc) g_object_unref, NULL); - g_list_free (list); + e_client_util_free_object_slist (list); } static void @@ -540,7 +542,7 @@ action_contact_new_cb (GtkAction *action, EAddressbookModel *model; EContact *contact; EABEditor *editor; - EBook *book; + EBookClient *book; shell_view = E_SHELL_VIEW (book_shell_view); shell_window = e_shell_view_get_shell_window (shell_view); @@ -551,7 +553,7 @@ action_contact_new_cb (GtkAction *action, g_return_if_fail (view != NULL); model = e_addressbook_view_get_model (view); - book = e_addressbook_model_get_book (model); + book = e_addressbook_model_get_client (model); g_return_if_fail (book != NULL); contact = e_contact_new (); @@ -572,7 +574,7 @@ action_contact_new_list_cb (GtkAction *action, EAddressbookModel *model; EContact *contact; EABEditor *editor; - EBook *book; + EBookClient *book; shell_view = E_SHELL_VIEW (book_shell_view); shell_window = e_shell_view_get_shell_window (shell_view); @@ -583,7 +585,7 @@ action_contact_new_list_cb (GtkAction *action, g_return_if_fail (view != NULL); model = e_addressbook_view_get_model (view); - book = e_addressbook_model_get_book (model); + book = e_addressbook_model_get_client (model); g_return_if_fail (book != NULL); contact = e_contact_new (); @@ -657,7 +659,7 @@ action_contact_save_as_cb (GtkAction *action, EBookShellContent *book_shell_content; EAddressbookView *view; EActivity *activity; - GList *list; + GSList *list; GFile *file; gchar *string; @@ -712,9 +714,8 @@ action_contact_save_as_cb (GtkAction *action, g_object_unref (file); -exit: - g_list_foreach (list, (GFunc) g_object_unref, NULL); - g_list_free (list); + exit: + e_client_util_free_object_slist (list); } static void @@ -726,7 +727,7 @@ action_contact_send_message_cb (GtkAction *action, EShellWindow *shell_window; EBookShellContent *book_shell_content; EAddressbookView *view; - GList *list, *iter; + GSList *list, *iter; shell_view = E_SHELL_VIEW (book_shell_view); shell_window = e_shell_view_get_shell_window (shell_view); @@ -753,8 +754,7 @@ action_contact_send_message_cb (GtkAction *action, eab_send_as_to (shell, list); - g_list_foreach (list, (GFunc) g_object_unref, NULL); - g_list_free (list); + e_client_util_free_object_slist (list); } static void -- cgit v1.2.3 From 777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 16 Aug 2011 11:25:56 -0400 Subject: Coding style and whitespace cleanup. --- modules/addressbook/e-book-shell-view-actions.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'modules/addressbook/e-book-shell-view-actions.c') diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index 52d8243ead..a6aebe08a2 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -218,9 +218,9 @@ action_address_book_properties_cb (GtkAction *action, #ifdef WITH_CONTACT_MAPS static void contact_editor_contact_modified_cb (EABEditor *editor, - const GError *error, - EContact *contact, - gpointer user_data) + const GError *error, + EContact *contact, + gpointer user_data) { EContactMapWindow *window = user_data; EContactMap *map; @@ -241,8 +241,8 @@ contact_editor_contact_modified_cb (EABEditor *editor, static void map_window_show_contact_editor_cb (EContactMapWindow *window, - const gchar *contact_uid, - gpointer user_data) + const gchar *contact_uid, + gpointer user_data) { EShell *shell = e_shell_get_default (); EBookShellView *book_shell_view = user_data; @@ -291,7 +291,7 @@ map_window_show_contact_editor_cb (EContactMapWindow *window, /* We need this function to he defined all the time. */ static void action_address_book_map_cb (GtkAction *action, - EBookShellView *book_shell_view) + EBookShellView *book_shell_view) { #ifdef WITH_CONTACT_MAPS EContactMapWindow *map_window; -- cgit v1.2.3 From 80937eb544e24b51244f3ade02e69fb7a3157920 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Tue, 1 Nov 2011 17:40:16 +0100 Subject: Addressbook module GSettings migration --- modules/addressbook/e-book-shell-view-actions.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'modules/addressbook/e-book-shell-view-actions.c') diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index a6aebe08a2..e967b1141b 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -1147,7 +1147,7 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view) EPreviewPane *preview_pane; EWebView *web_view; GtkActionGroup *action_group; - GConfBridge *bridge; + GSettings *settings; GtkAction *action; GObject *object; const gchar *key; @@ -1206,21 +1206,20 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view) action_group, lockdown_save_to_disk_popup_entries, G_N_ELEMENTS (lockdown_save_to_disk_popup_entries)); - /* Bind GObject properties to GConf keys. */ + /* Bind GObject properties to GSettings keys. */ - bridge = gconf_bridge_get (); + settings = g_settings_new ("org.gnome.evolution.addressbook"); object = G_OBJECT (ACTION (CONTACT_PREVIEW)); - key = "/apps/evolution/addressbook/display/show_preview"; - gconf_bridge_bind_property (bridge, key, object, "active"); + g_settings_bind (settings, "show-preview", object, "active", G_SETTINGS_BIND_DEFAULT); object = G_OBJECT (ACTION (CONTACT_VIEW_VERTICAL)); - key = "/apps/evolution/addressbook/display/layout"; - gconf_bridge_bind_property (bridge, key, object, "current-value"); + g_settings_bind (settings, "layout", object, "current-value", G_SETTINGS_BIND_DEFAULT); object = G_OBJECT (ACTION (CONTACT_PREVIEW_SHOW_MAPS)); - key = "/apps/evolution/addressbook/display/preview_show_maps"; - gconf_bridge_bind_property (bridge, key, object, "active"); + g_settings_bind (settings, "preview-show-maps", object, "active", G_SETTINGS_BIND_DEFAULT); + + g_object_unref (settings); /* Fine tuning. */ -- cgit v1.2.3 From c75f58d01bb7bbe139cd73a85894dc5f50185816 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 18 Nov 2011 09:58:44 -0500 Subject: Fix compiler warnings. --- modules/addressbook/e-book-shell-view-actions.c | 1 - 1 file changed, 1 deletion(-) (limited to 'modules/addressbook/e-book-shell-view-actions.c') diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index e967b1141b..73736052ff 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -1150,7 +1150,6 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view) GSettings *settings; GtkAction *action; GObject *object; - const gchar *key; shell_view = E_SHELL_VIEW (book_shell_view); shell_window = e_shell_view_get_shell_window (shell_view); -- cgit v1.2.3