patch to allow to send on Ctrl+Enter and Enter to make newline. Thanks Dennis Craven [NOTE: we dont default to this. only accesible via expert]

This commit is contained in:
Nikos Kouremenos 2005-06-05 20:34:17 +00:00
parent 9aeb647e72
commit f4d3b6464a
2 changed files with 6 additions and 2 deletions

View File

@ -35,6 +35,7 @@ class Config:
__options = {
# name: [ type, value ]
'send_on_ctrl_enter': [opt_bool, False], # #Send on CTRL-Enter (Enter alone for newline)
'verbose': [ opt_bool, False ],
'delauth': [ opt_bool, True ],
'delroster': [ opt_bool, True ],

View File

@ -222,8 +222,11 @@ class Tabbed_chat_window(chat.Chat):
conversation_textview.emit('key_press_event', event)
elif event.keyval == gtk.keysyms.Return or \
event.keyval == gtk.keysyms.KP_Enter: # ENTER
if (event.state & gtk.gdk.SHIFT_MASK):
return False
if gajim.config.get('send_on_ctrl_enter'):
if not (event.state & gtk.gdk.CONTROL_MASK):
return False
elif (event.state & gtk.gdk.SHIFT_MASK):
return False
if gajim.connections[self.account].connected < 2: #we are not connected
dialogs.Error_dialog(_('You are not connected, so you cannot send a message'))
return True