Add new status & bookmarks actions

This commit is contained in:
mathieui 2012-05-10 01:07:59 +02:00
parent 089d94e6db
commit 70a724c127
2 changed files with 48 additions and 4 deletions

View file

@ -255,6 +255,14 @@ NOTE: Even if some of these actions are labelled as similar to other
keystrokes, remapping the keystrokes will not remap the actions defined here.
[horizontal]
*_bookmark*:: Bookmarks the current room.
Similar to /bookmark.
*_bookmark_local*:: Bookmarks the current room, locally.
Similar to /bookmark_local
*_close_tab*:: Closes the current tab.
This is the same as /close. The first tab (the roster) can not be closed.
@ -277,6 +285,10 @@ keystrokes, remapping the keystrokes will not remap the actions defined here.
Similar to /theme.
*_remove_bookmark*:: Removes the bookmark on the current room.
Similar to /remove_bookmark.
*_room_left*:: Goes to the room on the left.
Similar to Ctrl-p.
@ -334,6 +346,29 @@ keystrokes, remapping the keystrokes will not remap the actions defined here.
Similar to F4.
Status actions
~~~~~~~~~~~~~~
[horizontal]
*_available*:: Sets the status to _available_.
Similar to /status available.
*_away*:: Sets the status to _away_.
Similar to /status away.
*_chat*:: Sets the status to _chat_.
Similar to /status chat.
*_dnd*:: Sets the status to _dnd_.
Similar to /status dnd.
*_xa*:: Sets the status to _xa_.
Similar to /status xa.
Example
~~~~~~~

View file

@ -202,12 +202,15 @@ class Core(object):
'M-d': self.scroll_info_up,
'M-c': self.scroll_info_down,
######## actions mappings ##########
'_bookmark': self.command_bookmark,
'_bookmark_local': self.command_bookmark_local,
'_close_tab': self.close_tab,
'_disconnect': self.disconnect,
'_quit': self.command_quit,
'_reconnect': self.command_reconnect,
'_redraw_screen': self.full_screen_redraw,
'_reload_theme': self.command_theme,
'_remove_bookmark': self.command_remove_bookmark,
'_room_left': self.rotate_rooms_left,
'_room_right': self.rotate_rooms_right,
'_show_roster': self.go_to_roster,
@ -222,7 +225,13 @@ class Core(object):
'_show_plugins': self.command_plugins,
'_show_xmltab': self.command_xml_tab,
'_toggle_pane': self.toggle_left_pane,
}
###### status actions ######
'_available': lambda: self.command_status('available'),
'_away': lambda: self.command_status('away'),
'_chat': lambda: self.command_status('chat'),
'_dnd': lambda: self.command_status('dnd'),
'_xa': lambda: self.command_status('xa'),
}
# Add handlers
self.xmpp.add_event_handler('connected', self.on_connected)
@ -1889,7 +1898,7 @@ class Core(object):
return bm.nick
return self.own_nick
def command_bookmark_local(self, arg):
def command_bookmark_local(self, arg=''):
"""
/bookmark_local [room][/nick]
"""
@ -1939,7 +1948,7 @@ class Core(object):
self.information(_('Your local bookmarks are now: %s') %
[b for b in bookmark.bookmarks if b.method == 'local'], 'Info')
def command_bookmark(self, arg):
def command_bookmark(self, arg=''):
"""
/bookmark [room][/nick] [autojoin] [password]
"""
@ -2016,7 +2025,7 @@ class Core(object):
self.information(_('Your local bookmarks are: %s') %
[b for b in bookmark.bookmarks if b.method is 'local'], 'Info')
def command_remove_bookmark(self, arg):
def command_remove_bookmark(self, arg=''):
"""/remove_bookmark [jid]"""
args = common.shell_split(arg)
if not args: