From 2473550861afe14de48efe174e44073405a195c4 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 26 Nov 2009 11:38:07 +0000 Subject: chat-text-view: override GtkTextView copy_clipboard This allow us to hook our copy_clipboard function as so have pretty pasting when copying using the text view context menu (#603031). --- libempathy-gtk/empathy-chat-text-view.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-chat-text-view.c b/libempathy-gtk/empathy-chat-text-view.c index a46f6a4c5..4f38865f6 100644 --- a/libempathy-gtk/empathy-chat-text-view.c +++ b/libempathy-gtk/empathy-chat-text-view.c @@ -73,6 +73,8 @@ typedef struct { static void chat_text_view_iface_init (EmpathyChatViewIface *iface); +static void chat_text_view_copy_clipboard (EmpathyChatView *view); + G_DEFINE_TYPE_WITH_CODE (EmpathyChatTextView, empathy_chat_text_view, GTK_TYPE_TEXT_VIEW, G_IMPLEMENT_INTERFACE (EMPATHY_TYPE_CHAT_VIEW, @@ -579,11 +581,18 @@ chat_text_view_finalize (GObject *object) G_OBJECT_CLASS (empathy_chat_text_view_parent_class)->finalize (object); } +static void +text_view_copy_clipboard (GtkTextView *text_view) +{ + chat_text_view_copy_clipboard (EMPATHY_CHAT_VIEW (text_view)); +} + static void empathy_chat_text_view_class_init (EmpathyChatTextViewClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + GtkTextViewClass *text_view_class = GTK_TEXT_VIEW_CLASS (klass); object_class->finalize = chat_text_view_finalize; object_class->get_property = chat_text_view_get_property; @@ -592,6 +601,8 @@ empathy_chat_text_view_class_init (EmpathyChatTextViewClass *klass) widget_class->size_allocate = chat_text_view_size_allocate; widget_class->drag_motion = chat_text_view_drag_motion; + text_view_class->copy_clipboard = text_view_copy_clipboard; + g_object_class_install_property (object_class, PROP_LAST_CONTACT, g_param_spec_object ("last-contact", -- cgit v1.2.3