aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog8
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c29
2 files changed, 35 insertions, 2 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 27d77d494b..8f183d9a48 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,11 @@
+2007-07-06 Hiroyuki Ikezoe <poincare@ikezoe.net>
+
+ ** 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.
+
2007-06-20 Laszlo (Laca) Peter <laca@sun.com>
** Fix for bug #433732
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