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:
parent
9aeb647e72
commit
f4d3b6464a
|
@ -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 ],
|
||||
|
|
|
@ -222,7 +222,10 @@ 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):
|
||||
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'))
|
||||
|
|
Loading…
Reference in New Issue