empathy r2776 - in trunk: libempathy-gtk src
- From: xclaesse svn gnome org
- To: svn-commits-list gnome org
- Subject: empathy r2776 - in trunk: libempathy-gtk src
- Date: Fri, 10 Apr 2009 16:53:39 +0000 (UTC)
Author: xclaesse
Date: Fri Apr 10 16:53:39 2009
New Revision: 2776
URL: http://svn.gnome.org/viewvc/empathy?rev=2776&view=rev
Log:
Escape to cancel from status editing
From: Davyd Madeley <davyd madeley id au>
Modified:
trunk/libempathy-gtk/empathy-presence-chooser.c
trunk/src/empathy-status-icon.c
Modified: trunk/libempathy-gtk/empathy-presence-chooser.c
==============================================================================
--- trunk/libempathy-gtk/empathy-presence-chooser.c (original)
+++ trunk/libempathy-gtk/empathy-presence-chooser.c Fri Apr 10 16:53:39 2009
@@ -30,6 +30,7 @@
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include <glade/glade.h>
+#include <gdk/gdkkeysyms.h>
#include <telepathy-glib/util.h>
#include <libmissioncontrol/mc-enum-types.h>
@@ -296,6 +297,25 @@
mc_set_custom_state (self);
}
+static gboolean
+entry_key_press_event_cb (EmpathyPresenceChooser *self,
+ GdkEventKey *event,
+ GtkWidget *entry)
+{
+ EmpathyPresenceChooserPriv *priv = GET_PRIV (self);
+
+ if (priv->editing_status && event->keyval == GDK_Escape)
+ {
+ /* the user pressed Escape, undo the editing */
+ set_status_editing (self, FALSE);
+ presence_chooser_presence_changed_cb (self);
+
+ return TRUE;
+ }
+
+ return FALSE; /* send this event elsewhere */
+}
+
static void
changed_cb (GtkComboBox *self, gpointer user_data)
{
@@ -376,6 +396,9 @@
g_signal_connect_object (entry, "activate",
G_CALLBACK (entry_activate_cb), chooser,
G_CONNECT_SWAPPED);
+ g_signal_connect_object (entry, "key-press-event",
+ G_CALLBACK (entry_key_press_event_cb), chooser,
+ G_CONNECT_SWAPPED);
// FIXME - should this also happen when the user presses TAB ?
GtkCellRenderer *renderer;
Modified: trunk/src/empathy-status-icon.c
==============================================================================
--- trunk/src/empathy-status-icon.c (original)
+++ trunk/src/empathy-status-icon.c Fri Apr 10 16:53:39 2009
@@ -589,7 +589,7 @@
priv->window = g_object_ref (window);
- g_signal_connect (priv->window, "key-press-event",
+ g_signal_connect_after (priv->window, "key-press-event",
G_CALLBACK (status_icon_key_press_event_cb),
icon);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]