changeset 7719b4c17326 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=7719b4c17326 description: add ctrl+s shortcut to change status message.
diffstat:
src/roster_window.py | 32 ++++++++++++++++++++++++++++++-- 1 files changed, 30 insertions(+), 2 deletions(-)
diffs (56 lines):
diff -r e9d7e4a394ea -r 7719b4c17326 src/roster_window.py --- a/src/roster_window.py Fri Aug 24 12:54:27 2012 +0200 +++ b/src/roster_window.py Fri Aug 24 13:33:27 2012 +0200 @@ -3540,6 +3540,27 @@ self.on_row_activated(widget, path) self.clicked_path = None
+ def accel_group_func(self, accel_group, acceleratable, keyval, modifier): + # CTRL mask + if modifier & gtk.gdk.CONTROL_MASK: + if keyval == gtk.keysyms.s: # CTRL + s + model = self.status_combobox.get_model() + accounts = gajim.connections.keys() + status = model[self.previous_status_combobox_active][2].decode( + 'utf-8') + def on_response(message, pep_dict): + if message is not None: # None if user pressed Cancel + for account in accounts: + if not gajim.config.get_per('accounts', account, + 'sync_with_global_status'): + continue + current_show = gajim.SHOW_LIST[ + gajim.connections[account].connected] + self.send_status(account, current_show, message) + self.send_pep(account, pep_dict) + dialogs.ChangeStatusMessageDialog(on_response, status) + return + def on_roster_treeview_button_press_event(self, widget, event): # hide tooltip, no matter the button is pressed self.tooltip.hide_tooltip() @@ -6359,8 +6380,8 @@ # activity_pixbuf, tune_pixbuf, location_pixbuf, avatar_pixbuf, # padlock_pixbuf] self.columns = [gtk.Image, str, str, str, str, - gtk.gdk.Pixbuf, gtk.gdk.Pixbuf, gtk.gdk.Pixbuf, - gtk.gdk.Pixbuf, gtk.gdk.Pixbuf, gtk.gdk.Pixbuf] + gtk.gdk.Pixbuf, gtk.gdk.Pixbuf, gtk.gdk.Pixbuf, gtk.gdk.Pixbuf, + gtk.gdk.Pixbuf, gtk.gdk.Pixbuf] self.xml = gtkgui_helpers.get_gtk_builder('roster_window.ui') self.window = self.xml.get_object('roster_window') self.hpaned = self.xml.get_object('roster_hpaned') @@ -6630,6 +6651,13 @@ new_chat_menuitem.add_accelerator('activate', accel_group, gtk.keysyms.n, gtk.gdk.CONTROL_MASK, gtk.ACCEL_VISIBLE)
+ # Setting CTRL+S to be the shortcut to change status message + accel_group = gtk.AccelGroup() + keyval, mod = gtk.accelerator_parse('<Control>s') + accel_group.connect_group(keyval, mod, gtk.ACCEL_VISIBLE, + self.accel_group_func) + self.window.add_accel_group(accel_group) + # Setting the search stuff self.rfilter_entry = self.xml.get_object('rfilter_entry') self.rfilter_string = ''