parent
4f6687e868
commit
52b2b17c7c
|
@ -351,6 +351,7 @@ class MessageWindow(object):
|
|||
if modifier & gtk.gdk.CONTROL_MASK:
|
||||
if keyval == gtk.keysyms.h: # CTRL + h
|
||||
control._on_history_menuitem_activate()
|
||||
return True
|
||||
elif control.type_id == message_control.TYPE_CHAT and \
|
||||
keyval == gtk.keysyms.f: # CTRL + f
|
||||
# CTRL + f moves cursor one char forward when user uses Emacs
|
||||
|
@ -358,28 +359,36 @@ class MessageWindow(object):
|
|||
if not gtk.settings_get_default().get_property(
|
||||
'gtk-key-theme-name') == 'Emacs':
|
||||
control._on_send_file_menuitem_activate(None)
|
||||
return True
|
||||
elif control.type_id == message_control.TYPE_CHAT and \
|
||||
keyval == gtk.keysyms.g: # CTRL + g
|
||||
control._on_convert_to_gc_menuitem_activate(None)
|
||||
return True
|
||||
elif control.type_id in (message_control.TYPE_CHAT,
|
||||
message_control.TYPE_PM) and keyval == gtk.keysyms.i: # CTRL + i
|
||||
control._on_contact_information_menuitem_activate(None)
|
||||
return True
|
||||
elif keyval == gtk.keysyms.l or keyval == gtk.keysyms.L: # CTRL + l|L
|
||||
control.conv_textview.clear()
|
||||
return True
|
||||
elif keyval == gtk.keysyms.u: # CTRL + u: emacs style clear line
|
||||
control.clear(control.msg_textview)
|
||||
return True
|
||||
elif control.type_id == message_control.TYPE_GC and \
|
||||
keyval == gtk.keysyms.b: # CTRL + b
|
||||
control._on_bookmark_room_menuitem_activate(None)
|
||||
return True
|
||||
# Tab switch bindings
|
||||
elif keyval == gtk.keysyms.F4: # CTRL + F4
|
||||
self.remove_tab(control, self.CLOSE_CTRL_KEY)
|
||||
return True
|
||||
elif keyval == gtk.keysyms.w: # CTRL + w
|
||||
# CTRL + w removes latest word before sursor when User uses emacs
|
||||
# theme
|
||||
if not gtk.settings_get_default().get_property(
|
||||
'gtk-key-theme-name') == 'Emacs':
|
||||
self.remove_tab(control, self.CLOSE_CTRL_KEY)
|
||||
return True
|
||||
elif keyval in (gtk.keysyms.Page_Up, gtk.keysyms.Page_Down):
|
||||
# CTRL + PageUp | PageDown
|
||||
# Create event and send it to notebook
|
||||
|
@ -389,12 +398,14 @@ class MessageWindow(object):
|
|||
event.state = gtk.gdk.CONTROL_MASK
|
||||
event.keyval = int(keyval)
|
||||
self.notebook.emit('key_press_event', event)
|
||||
return True
|
||||
|
||||
if modifier & gtk.gdk.SHIFT_MASK:
|
||||
# CTRL + SHIFT
|
||||
if control.type_id == message_control.TYPE_GC and \
|
||||
keyval == gtk.keysyms.n: # CTRL + SHIFT + n
|
||||
control._on_change_nick_menuitem_activate(None)
|
||||
return True
|
||||
# MOD1 (ALT) mask
|
||||
elif modifier & gtk.gdk.MOD1_MASK:
|
||||
# Tab switch bindings
|
||||
|
@ -403,26 +414,34 @@ class MessageWindow(object):
|
|||
if new >= self.notebook.get_n_pages():
|
||||
new = 0
|
||||
self.notebook.set_current_page(new)
|
||||
return True
|
||||
elif keyval == gtk.keysyms.Left: # ALT + LEFT
|
||||
new = self.notebook.get_current_page() - 1
|
||||
if new < 0:
|
||||
new = self.notebook.get_n_pages() - 1
|
||||
self.notebook.set_current_page(new)
|
||||
return True
|
||||
elif chr(keyval) in st: # ALT + 1,2,3..
|
||||
self.notebook.set_current_page(st.index(chr(keyval)))
|
||||
return True
|
||||
elif keyval == gtk.keysyms.c: # ALT + C toggles chat buttons
|
||||
control.chat_buttons_set_visible(not control.hide_chat_buttons)
|
||||
return True
|
||||
elif keyval == gtk.keysyms.m: # ALT + M show emoticons menu
|
||||
control.show_emoticons_menu()
|
||||
return True
|
||||
elif keyval == gtk.keysyms.d: # ALT + D show actions menu
|
||||
control.on_actions_button_clicked(control.actions_button)
|
||||
return True
|
||||
elif control.type_id == message_control.TYPE_GC and \
|
||||
keyval == gtk.keysyms.t: # ALT + t
|
||||
control._on_change_subject_menuitem_activate(None)
|
||||
return True
|
||||
# Close tab bindings
|
||||
elif keyval == gtk.keysyms.Escape and \
|
||||
gajim.config.get('escape_key_closes'): # Escape
|
||||
self.remove_tab(control, self.CLOSE_ESC)
|
||||
return True
|
||||
|
||||
def _on_close_button_clicked(self, button, control):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue