From f5fff3e4e6bb81dccea11aeae24c81d7be80113e Mon Sep 17 00:00:00 2001 From: Alexander Cherniuk Date: Sat, 28 Nov 2009 14:53:31 +0200 Subject: [PATCH] Refactored CTRL+J --- src/roster_window.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/roster_window.py b/src/roster_window.py index 91f69141b..e485a6590 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -5657,11 +5657,6 @@ class RosterWindow: item.set_image(icon) item.connect('activate', self.on_join_gc_activate, account) - # Setting CTRL+J to be the shortcut for the fast joining to a conference. - ag = gtk.accel_groups_from_object(self.window)[0] - item.add_accelerator('activate', ag, gtk.keysyms.j, gtk.gdk.CONTROL_MASK, - gtk.ACCEL_VISIBLE) - gc_sub_menu.append(item) # User has at least one bookmark. @@ -5719,6 +5714,15 @@ class RosterWindow: return True + def on_ctrl_j(self, accel_group, acceleratable, keyval, modifier): + """ + Bring up the conference join dialog, when CTRL+J accelerator is being + activated + """ + account = gajim.connections.keys()[0] + self.on_join_gc_activate(None, account) + return True + ################################################################################ ### ################################################################################ @@ -5972,4 +5976,10 @@ class RosterWindow: from common.zeroconf import connection_zeroconf connection_zeroconf.ConnectionZeroconf(gajim.ZEROCONF_ACC_NAME) + # Setting CTRL+J to be the shortcut for bringing up the dialog to join a + # conference. + accel_group = gtk.accel_groups_from_object(self.window)[0] + accel_group.connect_group(gtk.keysyms.j, gtk.gdk.CONTROL_MASK, + gtk.ACCEL_VISIBLE, self.on_ctrl_j) + # vim: se ts=3: