[empathy: 27/28] Use context menu utility in log viewer



commit dc7080f5071a9130bbd9288b50f807b41a5f9864
Author: Danielle Madeley <danielle madeley collabora co uk>
Date:   Wed Aug 17 15:44:22 2011 +1000

    Use context menu utility in log viewer

 libempathy-gtk/empathy-log-window.c |   30 +++++++++++++++++++++++++-----
 1 files changed, 25 insertions(+), 5 deletions(-)
---
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index c4a2608..219d0cc 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -2502,13 +2502,12 @@ who_row_is_separator (GtkTreeModel *model,
   return (type == COL_TYPE_SEPARATOR);
 }
 
-static gboolean
-log_window_events_button_press_event (GtkWidget *webview,
-    GdkEventButton *event,
-    EmpathyLogWindow *self)
+static void
+log_window_find_row (EmpathyLogWindow *self,
+    GdkEventButton *event)
 {
   WebKitHitTestResult *hit = webkit_web_view_get_hit_test_result (
-      WEBKIT_WEB_VIEW (webview), event);
+      WEBKIT_WEB_VIEW (self->priv->webview), event);
   WebKitDOMNode *inner_node;
 
   tp_clear_object (&self->priv->events_contact);
@@ -2563,6 +2562,27 @@ log_window_events_button_press_event (GtkWidget *webview,
   g_object_unref (hit);
 
   log_window_update_buttons_sensitivity (self);
+}
+
+static gboolean
+log_window_events_button_press_event (GtkWidget *webview,
+    GdkEventButton *event,
+    EmpathyLogWindow *self)
+{
+  switch (event->button)
+    {
+      case 1:
+        log_window_find_row (self, event);
+        break;
+
+      case 3:
+        empathy_webkit_context_menu_for_event (
+            WEBKIT_WEB_VIEW (webview), event, 0);
+        return TRUE;
+
+      default:
+        break;
+    }
 
   return FALSE;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]