[empathy] chat-text-view: override GtkTextView copy_clipboard
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [empathy] chat-text-view: override GtkTextView copy_clipboard
- Date: Thu, 26 Nov 2009 14:39:09 +0000 (UTC)
commit 2473550861afe14de48efe174e44073405a195c4
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Thu Nov 26 11:38:07 2009 +0000
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 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 a46f6a4..4f38865 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",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]