diff options
author | Hiroyuki Ikezoe <hiikezoe@src.gnome.org> | 2007-07-06 14:43:47 +0800 |
---|---|---|
committer | Hiroyuki Ikezoe <hiikezoe@src.gnome.org> | 2007-07-06 14:43:47 +0800 |
commit | 8ee43fc1fb4c9f792116c5502da61cd00d112610 (patch) | |
tree | 9b6b76b876c7db76822e87e5bce856048735ed18 /addressbook/gui/widgets | |
parent | 450a9524ef6b39088b80715aad626ade1ecffb7b (diff) | |
download | gsoc2013-evolution-8ee43fc1fb4c9f792116c5502da61cd00d112610.tar.gz gsoc2013-evolution-8ee43fc1fb4c9f792116c5502da61cd00d112610.tar.zst gsoc2013-evolution-8ee43fc1fb4c9f792116c5502da61cd00d112610.zip |
** Fix for bug #337787
* gui/widgets/e-address-view.c: (contact_display_has_selection),
(eab_view_copy): Copy selection string in contact preview if the
preview widget has selection string.
svn path=/trunk/; revision=33761
Diffstat (limited to 'addressbook/gui/widgets')
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-view.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 33042013c3..19d12ab455 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -2085,12 +2085,37 @@ eab_view_cut (EABView *view) eab_view_delete_selection (view, FALSE); } +static gboolean +contact_display_has_selection (EABContactDisplay *display) +{ + gchar *string; + gint selection_length; + gboolean has_selection; + + string = gtk_html_get_selection_html (GTK_HTML (display), &selection_length); + + has_selection = string ? TRUE : FALSE; + + if (string) + g_free (string); + + return has_selection; +} + void eab_view_copy (EABView *view) { - view->clipboard_contacts = get_selected_contacts (view); + if (GTK_WIDGET_HAS_FOCUS (view->contact_display) && + contact_display_has_selection (EAB_CONTACT_DISPLAY (view->contact_display))) + { + gtk_html_copy (GTK_HTML (view->contact_display)); + } + else + { + view->clipboard_contacts = get_selected_contacts (view); - gtk_selection_owner_set (view->invisible, clipboard_atom, GDK_CURRENT_TIME); + gtk_selection_owner_set (view->invisible, clipboard_atom, GDK_CURRENT_TIME); + } } void |