aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-11-26 19:38:07 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-11-26 22:38:53 +0800
commit2473550861afe14de48efe174e44073405a195c4 (patch)
tree287edc905f7f2f3c070fed8b431e1f28b6ae5c93
parent6b90cf0b018fa420e46ce23f17b2dfca3168b44b (diff)
downloadgsoc2013-empathy-2473550861afe14de48efe174e44073405a195c4.tar
gsoc2013-empathy-2473550861afe14de48efe174e44073405a195c4.tar.gz
gsoc2013-empathy-2473550861afe14de48efe174e44073405a195c4.tar.bz2
gsoc2013-empathy-2473550861afe14de48efe174e44073405a195c4.tar.lz
gsoc2013-empathy-2473550861afe14de48efe174e44073405a195c4.tar.xz
gsoc2013-empathy-2473550861afe14de48efe174e44073405a195c4.tar.zst
gsoc2013-empathy-2473550861afe14de48efe174e44073405a195c4.zip
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).
-rw-r--r--libempathy-gtk/empathy-chat-text-view.c11
1 files changed, 11 insertions, 0 deletions
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,
@@ -580,10 +582,17 @@ chat_text_view_finalize (GObject *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",