[empathy/gnome-2-34] Pressing F2 opens the Edit Contact Information window for #586257



commit 36eebcaac08dc60f64f05b883bc6a94a8468561b
Author: Kushal Das <kushal fedoraproject org>
Date:   Tue Jan 11 17:49:18 2011 +0530

    Pressing F2 opens the Edit Contact Information window for #586257

 libempathy-gtk/empathy-individual-view.c |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index 1eeaa0d..dedded0 100644
--- a/libempathy-gtk/empathy-individual-view.c
+++ b/libempathy-gtk/empathy-individual-view.c
@@ -47,6 +47,7 @@
 #include "empathy-individual-view.h"
 #include "empathy-individual-menu.h"
 #include "empathy-individual-store.h"
+#include "empathy-contact-dialogs.h"
 #include "empathy-images.h"
 #include "empathy-linking-dialog.h"
 #include "empathy-cell-renderer-expander.h"
@@ -891,6 +892,25 @@ individual_view_key_press_event_cb (EmpathyIndividualView *view,
       data->button = 0;
       data->time = event->time;
       g_idle_add (individual_view_popup_menu_idle_cb, data);
+    } else if (event->keyval == GDK_KEY_F2) {
+        FolksIndividual *individual;
+        EmpathyContact *contact;
+
+        g_return_val_if_fail (EMPATHY_IS_INDIVIDUAL_VIEW (view), FALSE);
+
+        individual = empathy_individual_view_dup_selected (view);
+        if (individual == NULL)
+            return FALSE;
+
+        contact = empathy_contact_dup_from_folks_individual (individual);
+        if (contact == NULL) {
+            g_object_unref (individual);
+            return FALSE;
+        }
+        empathy_contact_edit_dialog_show (contact, NULL);
+
+        g_object_unref (individual);
+        g_object_unref (contact);
     }
 
   return FALSE;
@@ -1314,7 +1334,8 @@ individual_view_search_key_navigation_cb (GtkWidget *search,
   GdkEventKey *eventkey = ((GdkEventKey *) event);
   gboolean ret = FALSE;
 
-  if (eventkey->keyval == GDK_Up || eventkey->keyval == GDK_Down)
+  if (eventkey->keyval == GDK_KEY_Up || eventkey->keyval == GDK_KEY_Down
+      || eventkey->keyval == GDK_KEY_F2)
     {
       GdkEvent *new_event;
 



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