changeset a5fd24bad0eb in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=a5fd24bad0eb description: ability to set priority via gajim-remote. see #3345
diffstat:
src/gajim-remote.py | 10 ++++++++++ src/remote_control.py | 25 +++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 0 deletions(-)
diffs (55 lines):
diff -r 97730a80abb9 -r a5fd24bad0eb src/gajim-remote.py --- a/src/gajim-remote.py Thu Sep 03 22:38:40 2009 +0200 +++ b/src/gajim-remote.py Thu Sep 03 23:18:49 2009 +0200 @@ -114,6 +114,16 @@ '"sync with global status" option set'), False) ] ], + 'set_priority': [ + _('Changes the priority of account or accounts'), + [ + (_('priority'), _('priority you want to give to the account'), + True), + (_('account'), _('change the priority of the given account. ' + 'If not specified, change status of all accounts that have' + ' "sync with global status" option set'), False) + ] + ], 'open_chat': [ _('Shows the chat dialog so that you can send messages to a contact'), [ diff -r 97730a80abb9 -r a5fd24bad0eb src/remote_control.py --- a/src/remote_control.py Thu Sep 03 22:38:40 2009 +0200 +++ b/src/remote_control.py Thu Sep 03 23:18:49 2009 +0200 @@ -401,6 +401,31 @@ status, message) return DBUS_BOOLEAN(False)
+ @dbus.service.method(INTERFACE, in_signature='ss', out_signature='') + def set_priority(self, prio, account): + ''' set_priority(prio, account). account is optional - + if not specified priority is changed for all accounts. that are synced + with global status''' + if account: + gajim.config.set_per('accounts', account, 'priority', prio) + show = gajim.SHOW_LIST[gajim.connections[account].connected] + status = gajim.connections[account].status + gobject.idle_add(gajim.connections[account].change_status, show, + status) + else: + # account not specified, so change prio of all accounts + for acc in gajim.contacts.get_accounts(): + if not gajim.account_is_connected(acc): + continue + if not gajim.config.get_per('accounts', acc, + 'sync_with_global_status'): + continue + gajim.config.set_per('accounts', acc, 'priority', prio) + show = gajim.SHOW_LIST[gajim.connections[acc].connected] + status = gajim.connections[acc].status + gobject.idle_add(gajim.connections[acc].change_status, show, + status) + @dbus.service.method(INTERFACE, in_signature='', out_signature='') def show_next_pending_event(self): '''Show the window(s) with next pending event in tabbed/group chats.'''