SF.net SVN: geany: [1693] trunk
ntrel at users.sourceforge.net
ntrel at xxxxx
Thu Jul 12 11:56:17 UTC 2007
Revision: 1693
http://svn.sourceforge.net/geany/?rev=1693&view=rev
Author: ntrel
Date: 2007-07-12 04:56:17 -0700 (Thu, 12 Jul 2007)
Log Message:
-----------
Make Escape close the 'Grab Key' dialog.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/prefs.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2007-07-11 17:44:43 UTC (rev 1692)
+++ trunk/ChangeLog 2007-07-12 11:56:17 UTC (rev 1693)
@@ -1,3 +1,9 @@
+2007-07-12 Nick Treleaven <nick.treleaven at btinternet.com>
+
+ * src/prefs.c:
+ Make Escape close the 'Grab Key' dialog.
+
+
2007-07-11 Enrico Tröger <enrico.troeger at uvena.de>
* THANKS, configure.in, plugins/Makefile.am, scintilla/Makefile.am,
Modified: trunk/src/prefs.c
===================================================================
--- trunk/src/prefs.c 2007-07-11 17:44:43 UTC (rev 1692)
+++ trunk/src/prefs.c 2007-07-12 11:56:17 UTC (rev 1693)
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <string.h>
+#include <gdk/gdkkeysyms.h>
#include "geany.h"
@@ -893,9 +894,10 @@
GtkWidget *label;
gchar *str;
- dialog = gtk_dialog_new_with_buttons(_("Grab key"), GTK_WINDOW(app->prefs_dialog),
+ dialog = gtk_dialog_new_with_buttons(_("Grab Key"), GTK_WINDOW(app->prefs_dialog),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
- GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL);
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL);
str = g_strdup_printf(
_("Type the combination of the keys you want to use for \"%s\""), name);
@@ -910,7 +912,6 @@
g_signal_connect(G_OBJECT(dialog), "key-press-event",
G_CALLBACK(on_keytype_dialog_response), NULL);
g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(on_dialog_response), NULL);
- g_signal_connect(G_OBJECT(dialog), "close", G_CALLBACK(gtk_widget_destroy), NULL);
// copy name to global variable to hold it, will be freed in on_dialog_response()
dialog_key_name = g_strdup(name);
@@ -964,6 +965,9 @@
{
gchar *str;
+ if (event->state == 0 && event->keyval == GDK_Escape)
+ return FALSE; // close the dialog, don't allow escape when detecting keybindings.
+
// ignore numlock key, not necessary but nice
if (event->state & GDK_MOD2_MASK) event->state -= GDK_MOD2_MASK;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list