From b8a62a8bb22f3577bc4e10442745b49c870eabab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Sat, 27 Jan 2018 08:44:11 +0100 Subject: [PATCH] Fix shortcuts in chat window Fixes #8873 --- gajim/groupchat_control.py | 1 + gajim/message_window.py | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/gajim/groupchat_control.py b/gajim/groupchat_control.py index aa91b616a..3b5616120 100644 --- a/gajim/groupchat_control.py +++ b/gajim/groupchat_control.py @@ -681,6 +681,7 @@ class GroupchatControl(ChatControlBase): app.interface.add_gc_bookmark( self.account, self.name, self.room_jid, '0', '0', password, self.nick) + self.update_actions() def _on_request_voice(self, action, param): """ diff --git a/gajim/message_window.py b/gajim/message_window.py index 6a13b57bf..80941f216 100644 --- a/gajim/message_window.py +++ b/gajim/message_window.py @@ -374,7 +374,9 @@ class MessageWindow(object): if keyval == Gdk.KEY_h: # CTRL + h if Gtk.Settings.get_default().get_property( 'gtk-key-theme-name') != 'Emacs': - control._on_history_menuitem_activate() + arg = GLib.Variant('s', 'none') + self.window.lookup_action( + 'browse-history-%s' % control.control_id).activate(arg) return True elif control.type_id == message_control.TYPE_CHAT and \ keyval == Gdk.KEY_f: # CTRL + f @@ -386,7 +388,8 @@ class MessageWindow(object): app.interface.msg_win_mgr.ONE_MSG_WINDOW_ALWAYS_WITH_ROSTER: app.interface.roster.tree.grab_focus() return False - control._on_send_file_menuitem_activate(None) + self.window.lookup_action( + 'send-file-%s' % control.control_id).activate() return True elif control.type_id == message_control.TYPE_CHAT and \ keyval == Gdk.KEY_g: # CTRL + g @@ -394,7 +397,8 @@ class MessageWindow(object): return True elif control.type_id in (message_control.TYPE_CHAT, message_control.TYPE_PM) and keyval == Gdk.KEY_i: # CTRL + i - control._on_contact_information_menuitem_activate(None) + self.window.lookup_action( + 'information-%s' % control.control_id).activate() return True elif keyval == Gdk.KEY_l or keyval == Gdk.KEY_L: # CTRL + l|L control.conv_textview.clear() @@ -408,7 +412,8 @@ class MessageWindow(object): # theme if not Gtk.Settings.get_default().get_property( 'gtk-key-theme-name') == 'Emacs': - control._on_bookmark_room_menuitem_activate(None) + self.window.lookup_action( + 'bookmark-%s' % control.control_id).activate() return True # Tab switch bindings elif keyval == Gdk.KEY_F4: # CTRL + F4 @@ -436,7 +441,8 @@ class MessageWindow(object): # CTRL + SHIFT if control.type_id == message_control.TYPE_GC and \ keyval == Gdk.KEY_n: # CTRL + SHIFT + n - control._on_change_nick_menuitem_activate(None) + self.window.lookup_action( + 'change-nick-%s' % control.control_id).activate() return True # MOD1 (ALT) mask elif modifier & Gdk.ModifierType.MOD1_MASK: @@ -461,7 +467,8 @@ class MessageWindow(object): return True elif control.type_id == message_control.TYPE_GC and \ keyval == Gdk.KEY_t: # ALT + t - control._on_change_subject_menuitem_activate(None) + self.window.lookup_action( + 'change-subject-%s' % control.control_id).activate() return True # Close tab bindings elif keyval == Gdk.KEY_Escape and \