From 40211a41c731e4e7a0202a589822ac1721cb1651 Mon Sep 17 00:00:00 2001 From: Travis Shirk Date: Fri, 3 Feb 2006 07:32:44 +0000 Subject: [PATCH] ACE option to trun off having the Esc key close a control. Vi users do this by habit, and it sucks losing a well thought out message. --- src/common/config.py | 1 + src/message_window.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/config.py b/src/common/config.py index 553a52906..b346588aa 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -188,6 +188,7 @@ class Config: 'one_message_window': [opt_str, 'always', _('Controls the window where new messages are placed.\n\'always\' - All messages are sent to a single window.\n\'never\' - All messages get their own window.\n\'peracct\' - Messages for each account are sent to a specific window.\n\'pertype\' - Each message type (e.g., chats vs. groupchats) are sent to a specific window. Note, changing this option requires restarting Gajim before the changes will take effect')], 'show_avatar_in_chat': [opt_bool, True, _('If False, you will no longer see the avatar in the chat window')], + 'escape_key_closes': [opt_bool, True, _('If True, pressing the escape key closes a tab/window')], } __options_per_key = { diff --git a/src/message_window.py b/src/message_window.py index c8bae9873..4e35f8aca 100644 --- a/src/message_window.py +++ b/src/message_window.py @@ -472,7 +472,8 @@ class MessageWindow: elif event.keyval == gtk.keysyms.c: # ALT + C toggles compact view ctrl.set_compact_view(not ctrl.compact_view_current) # Close tab bindings - elif event.keyval == gtk.keysyms.Escape: # ESCAPE + elif event.keyval == gtk.keysyms.Escape and \ + gajim.config.get('escape_key_closes'): # Escape self.remove_tab(ctrl) else: # If the active control has a message_textview pass the event to it