changeset bf40c27bd2b0 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=bf40c27bd2b0
description: when changing hpaned position in a groupchat, move all hapned in all groupchats. see #5252
diffstat:
src/groupchat_control.py | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
diffs (42 lines):
diff -r 96d44adc8020 -r bf40c27bd2b0 src/groupchat_control.py
--- a/src/groupchat_control.py Fri Sep 04 21:02:55 2009 +0200
+++ b/src/groupchat_control.py Fri Sep 04 22:34:35 2009 +0200
@@ -291,9 +291,9 @@
self.event_box = self.xml.get_widget('banner_eventbox')
# set the position of the current hpaned
- self.hpaned_position = gajim.config.get('gc-hpaned-position')
+ hpaned_position = gajim.config.get('gc-hpaned-position')
self.hpaned = self.xml.get_widget('hpaned')
- self.hpaned.set_position(self.hpaned_position)
+ self.hpaned.set_position(hpaned_position)
self.list_treeview = self.xml.get_widget('list_treeview')
selection = self.list_treeview.get_selection()
@@ -434,8 +434,15 @@
def on_treeview_size_allocate(self, widget, allocation):
'''The MUC treeview has resized. Move the hpaned in all tabs to match'''
- self.hpaned_position = self.hpaned.get_position()
- self.hpaned.set_position(self.hpaned_position)
+ hpaned_position = self.hpaned.get_position()
+ for account in gajim.gc_connected:
+ for room_jid in [i for i in gajim.gc_connected[account] if \
+ gajim.gc_connected[account][i]]:
+ ctrl = gajim.interface.msg_win_mgr.get_gc_control(room_jid, account)
+ if not ctrl:
+ ctrl = gajim.interface.minimized_controls[account][room_jid]
+ if ctrl:
+ ctrl.hpaned.set_position(hpaned_position)
def iter_contact_rows(self):
'''iterate over all contact rows in the tree model'''
@@ -1878,7 +1885,7 @@
gajim.contacts.remove_room(self.account, self.room_jid)
del gajim.gc_connected[self.account][self.room_jid]
# Save hpaned position
- gajim.config.set('gc-hpaned-position', self.hpaned_position)
+ gajim.config.set('gc-hpaned-position', self.hpaned.get_position())
# remove all register handlers on wigets, created by self.xml
# to prevent circular references among objects
for i in self.handlers.keys():
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.'''