diff options
Diffstat (limited to 'addressbook/gui/widgets')
-rw-r--r-- | addressbook/gui/widgets/Makefile.am | 9 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-model.c | 9 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-model.h | 6 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-reflow-adapter.c | 1 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-selector.c | 6 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-table-adapter.c | 6 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-view.c | 9 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard.c | 15 | ||||
-rw-r--r-- | addressbook/gui/widgets/ea-minicard-view.c | 19 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-gui-util.c | 30 |
10 files changed, 77 insertions, 33 deletions
diff --git a/addressbook/gui/widgets/Makefile.am b/addressbook/gui/widgets/Makefile.am index 40c57650bb..546a218ff2 100644 --- a/addressbook/gui/widgets/Makefile.am +++ b/addressbook/gui/widgets/Makefile.am @@ -18,9 +18,10 @@ libeabwidgets_la_CPPFLAGS = \ -I$(top_srcdir)/addressbook/util \ -I$(top_srcdir)/widgets/misc \ -I$(top_builddir)/shell \ + $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ - $(EVOLUTION_ADDRESSBOOK_CFLAGS) \ - $(CHAMPLAIN_CFLAGS) + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) eabincludedir = $(privincludedir)/addressbook/gui/widgets @@ -71,8 +72,10 @@ libeabwidgets_la_LIBADD = \ $(top_builddir)/widgets/menus/libmenus.la \ $(top_builddir)/a11y/libevolution-a11y.la \ $(top_builddir)/e-util/libeutil.la \ + $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ - $(CHAMPLAIN_LIBS) + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) dist-hook: cd $(distdir); rm -f $(BUILT_SOURCES) diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c index 74e794bd6e..fa61c4e5e2 100644 --- a/addressbook/gui/widgets/e-addressbook-model.c +++ b/addressbook/gui/widgets/e-addressbook-model.c @@ -576,7 +576,8 @@ addressbook_model_class_init (EAddressbookModelClass *class) "EBookClient", NULL, E_TYPE_BOOK_CLIENT, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); g_object_class_install_property ( object_class, @@ -586,7 +587,8 @@ addressbook_model_class_init (EAddressbookModelClass *class) "Editable", NULL, FALSE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); g_object_class_install_property ( object_class, @@ -597,7 +599,8 @@ addressbook_model_class_init (EAddressbookModelClass *class) NULL, NULL, G_PARAM_READWRITE | - G_PARAM_CONSTRUCT)); + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); signals[WRITABLE_STATUS] = g_signal_new ("writable_status", diff --git a/addressbook/gui/widgets/e-addressbook-model.h b/addressbook/gui/widgets/e-addressbook-model.h index 13d23e92b0..680352c717 100644 --- a/addressbook/gui/widgets/e-addressbook-model.h +++ b/addressbook/gui/widgets/e-addressbook-model.h @@ -104,8 +104,10 @@ gint e_addressbook_model_find (EAddressbookModel *model, EBookClient * e_addressbook_model_get_client (EAddressbookModel *model); void e_addressbook_model_set_client (EAddressbookModel *model, EBookClient *book_client); -gboolean e_addressbook_model_get_editable (EAddressbookModel *model); -void e_addressbook_model_set_editable (EAddressbookModel *model, +gboolean e_addressbook_model_get_editable + (EAddressbookModel *model); +void e_addressbook_model_set_editable + (EAddressbookModel *model, gboolean editable); gchar * e_addressbook_model_get_query (EAddressbookModel *model); void e_addressbook_model_set_query (EAddressbookModel *model, diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c index 0d2fc85478..71e63867d6 100644 --- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c @@ -625,7 +625,6 @@ e_addressbook_reflow_adapter_new (EAddressbookModel *model) return E_REFLOW_MODEL (et); } - EContact * e_addressbook_reflow_adapter_get_contact (EAddressbookReflowAdapter *adapter, gint index) diff --git a/addressbook/gui/widgets/e-addressbook-selector.c b/addressbook/gui/widgets/e-addressbook-selector.c index b6bfa01537..30bb8899f5 100644 --- a/addressbook/gui/widgets/e-addressbook-selector.c +++ b/addressbook/gui/widgets/e-addressbook-selector.c @@ -293,7 +293,8 @@ target_client_open_ready_cb (GObject *source_object, } eab_merging_book_add_contact ( - merge_context->target_client, merge_context->current_contact, + merge_context->target_client, + merge_context->current_contact, addressbook_selector_merge_next_cb, merge_context); } @@ -335,7 +336,8 @@ addressbook_selector_data_dropped (ESourceSelector *selector, merge_context->remove_from_source = remove_from_source; merge_context->pending_adds = TRUE; - e_client_utils_open_new (destination, E_CLIENT_SOURCE_TYPE_CONTACTS, FALSE, NULL, + e_client_utils_open_new ( + destination, E_CLIENT_SOURCE_TYPE_CONTACTS, FALSE, NULL, e_client_utils_authenticate_handler, NULL, target_client_open_ready_cb, merge_context); diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c index f102b684d7..b579c43dbf 100644 --- a/addressbook/gui/widgets/e-addressbook-table-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c @@ -168,8 +168,11 @@ addressbook_set_value_at (ETableModel *etc, EAddressbookTableAdapterPrivate *priv = adapter->priv; if (e_addressbook_model_get_editable (priv->model)) { + EBookClient *book_client; EContact *contact; + book_client = e_addressbook_model_get_client (priv->model); + if (col >= COLS || row >= e_addressbook_model_contact_count (priv->model)) return; @@ -191,7 +194,7 @@ addressbook_set_value_at (ETableModel *etc, e_contact_set (contact, col, (gpointer) val); eab_merging_book_modify_contact ( - e_addressbook_model_get_client (priv->model), + book_client, contact, contact_modified_cb, etc); g_object_unref (contact); @@ -218,6 +221,7 @@ addressbook_append_row (ETableModel *etm, { EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER (etm); EAddressbookTableAdapterPrivate *priv = adapter->priv; + EBookClient *book_client; EContact *contact; EBookClient *book_client; gint col; diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 7f3a7a85b8..9bda90a280 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -1111,7 +1111,7 @@ folder_bar_message (EAddressbookView *view, { EShellView *shell_view; EShellSidebar *shell_sidebar; - const gchar *name; + const gchar *display_name; shell_view = e_addressbook_view_get_shell_view (view); shell_sidebar = e_shell_view_get_shell_sidebar (shell_view); @@ -1119,8 +1119,8 @@ folder_bar_message (EAddressbookView *view, if (view->priv->source == NULL) return; - name = e_source_peek_name (view->priv->source); - e_shell_sidebar_set_primary_text (shell_sidebar, name); + display_name = e_source_peek_name (view->priv->source); + e_shell_sidebar_set_primary_text (shell_sidebar, display_name); e_shell_sidebar_set_secondary_text (shell_sidebar, message); } @@ -1622,7 +1622,8 @@ view_transfer_contacts (EAddressbookView *view, contacts = e_addressbook_view_get_selected (view); eab_transfer_contacts ( - book_client, contacts, delete_from_source, alert_sink); + book_client, contacts, + delete_from_source, alert_sink); } } diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index 78d98e2cb2..ddfcc1a9f9 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -942,6 +942,7 @@ remodel (EMinicard *e_minicard) gint left_width = -1; gboolean is_list = FALSE; gboolean email_rendered = FALSE; + gboolean has_voice = FALSE, has_fax = FALSE; if (e_minicard->header_text) { file_as = e_contact_get (e_minicard->contact, E_CONTACT_FILE_AS); @@ -966,11 +967,14 @@ remodel (EMinicard *e_minicard) EMinicardField *minicard_field = NULL; gboolean is_email = FALSE; - if (field == E_CONTACT_FAMILY_NAME || field == E_CONTACT_GIVEN_NAME) + if (field == E_CONTACT_FAMILY_NAME || field == E_CONTACT_GIVEN_NAME || + (has_voice && field == E_CONTACT_PHONE_OTHER) || + (has_fax && field == E_CONTACT_PHONE_OTHER_FAX)) continue; if (field == E_CONTACT_FULL_NAME && is_list) continue; + if (field == E_CONTACT_EMAIL_1 || field == E_CONTACT_EMAIL_2 || field == E_CONTACT_EMAIL_3 || field == E_CONTACT_EMAIL_4) { if (email_rendered) continue; @@ -1019,6 +1023,15 @@ remodel (EMinicard *e_minicard) if (string && *string) { add_field (e_minicard, field, left_width); count++; + + has_voice = has_voice || + field == E_CONTACT_PHONE_BUSINESS || + field == E_CONTACT_PHONE_BUSINESS_2 || + field == E_CONTACT_PHONE_HOME || + field == E_CONTACT_PHONE_HOME_2; + has_fax = has_fax || + field == E_CONTACT_PHONE_BUSINESS_FAX || + field == E_CONTACT_PHONE_HOME_FAX; } g_free (string); } diff --git a/addressbook/gui/widgets/ea-minicard-view.c b/addressbook/gui/widgets/ea-minicard-view.c index 58d3a5fd2b..6772a0bf80 100644 --- a/addressbook/gui/widgets/ea-minicard-view.c +++ b/addressbook/gui/widgets/ea-minicard-view.c @@ -149,7 +149,8 @@ ea_minicard_view_get_name (AtkObject *accessible) gchar *string; EMinicardView *card_view; EBookClient *book_client = NULL; - const gchar *source_name; + ESource *source; + const gchar *display_name; g_return_val_if_fail (EA_IS_MINICARD_VIEW (accessible), NULL); @@ -163,13 +164,14 @@ ea_minicard_view_get_name (AtkObject *accessible) card_view = E_MINICARD_VIEW (reflow); g_object_get (card_view->adapter, "client", &book_client, NULL); g_return_val_if_fail (E_IS_BOOK_CLIENT (book_client), NULL); - source_name = e_source_peek_name (e_client_get_source (E_CLIENT (book_client))); - if (!source_name) - source_name=""; + source = e_client_get_source (E_CLIENT (book_client)); + display_name = e_source_peek_name (source); + if (display_name == NULL) + display_name = ""; string = g_strdup_printf (ngettext ("current address book folder %s has %d card", "current address book folder %s has %d cards", - reflow->count), source_name, reflow->count); + reflow->count), display_name, reflow->count); ATK_OBJECT_CLASS (parent_class)->set_name (accessible, string); g_free (string); @@ -372,7 +374,9 @@ static void atk_action_interface_init (AtkActionIface *iface) iface->get_name = atk_action_interface_get_name; } -static gboolean atk_action_interface_do_action (AtkAction *action, gint i) +static gboolean +atk_action_interface_do_action (AtkAction *action, + gint i) { gboolean return_value = TRUE; EMinicardView *card_view; @@ -405,7 +409,8 @@ static gboolean atk_action_interface_do_action (AtkAction *action, gint i) return return_value; } -static gint atk_action_interface_get_n_action (AtkAction *iface) +static gint +atk_action_interface_get_n_action (AtkAction *iface) { return G_N_ELEMENTS (action_name); } diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c index c951b290c7..09830a94ae 100644 --- a/addressbook/gui/widgets/eab-gui-util.c +++ b/addressbook/gui/widgets/eab-gui-util.c @@ -34,13 +34,13 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> +#include <libebook/e-destination.h> #include <libedataserver/e-data-server-util.h> #include <libedataserverui/e-client-utils.h> #include <libedataserverui/e-source-selector.h> #include <e-util/e-util.h> #include "eab-gui-util.h" #include "util/eab-book-util.h" -#include <libebook/e-destination.h> #include "e-util/e-alert-dialog.h" #include "e-util/e-html-utils.h" #include "shell/e-shell.h" @@ -319,14 +319,18 @@ eab_select_source (ESource *except_source, selector = e_source_selector_new (source_list); e_source_selector_show_selection (E_SOURCE_SELECTOR (selector), FALSE); if (except_source) - g_object_set_data (G_OBJECT (ok_button), "except-source", e_source_list_peek_source_by_uid (source_list, e_source_peek_uid (except_source))); - g_signal_connect (selector, "primary_selection_changed", - G_CALLBACK (source_selection_changed_cb), ok_button); + g_object_set_data ( + G_OBJECT (ok_button), "except-source", + e_source_list_peek_source_by_uid (source_list, e_source_peek_uid (except_source))); + g_signal_connect ( + selector, "primary_selection_changed", + G_CALLBACK (source_selection_changed_cb), ok_button); if (select_uid) { source = e_source_list_peek_source_by_uid (source_list, select_uid); if (source) - e_source_selector_set_primary_selection (E_SOURCE_SELECTOR (selector), source); + e_source_selector_set_primary_selection ( + E_SOURCE_SELECTOR (selector), source); } scrolled_window = gtk_scrolled_window_new (NULL, NULL); @@ -493,7 +497,9 @@ do_copy (gpointer data, book_client = process->destination; process->count++; - eab_merging_book_add_contact (book_client, contact, contact_added_cb, process); + eab_merging_book_add_contact ( + book_client, + contact, contact_added_cb, process); } static void @@ -533,6 +539,7 @@ eab_transfer_contacts (EBookClient *source_client, gboolean delete_from_source, EAlertSink *alert_sink) { + ESource *source; ESource *destination; static gchar *last_uid = NULL; ContactCopyProcess *process; @@ -559,9 +566,10 @@ eab_transfer_contacts (EBookClient *source_client, desc = _("Copy contacts to"); } + source = e_client_get_source (E_CLIENT (source_client)); + destination = eab_select_source ( - e_client_get_source (E_CLIENT (source_client)), - desc, NULL, last_uid, window); + source, desc, NULL, last_uid, window); if (!destination) return; @@ -655,7 +663,11 @@ get_locales (void) gchar *dot; gchar **split; +#ifdef LC_ADDRESS locale = g_strdup (setlocale (LC_ADDRESS, NULL)); +#else + locale = NULL; +#endif if (!locale) return NULL; @@ -727,7 +739,7 @@ country_to_ISO (const gchar *country) } while (fgets (buffer, length, file) != NULL) { - gchar *low; + gchar *low = NULL; pair = g_strsplit (buffer, "\t", 2); if (pair[0]) { |