handle nested roster group. TODO: Improve the way it's displayed in roster. Fixes #1381
This commit is contained in:
parent
e9eb73d21c
commit
2653c160f2
3 changed files with 196 additions and 65 deletions
|
@ -161,6 +161,8 @@ class CommonConnection:
|
||||||
|
|
||||||
self.awaiting_cids = {} # Used for XEP-0231
|
self.awaiting_cids = {} # Used for XEP-0231
|
||||||
|
|
||||||
|
self.nested_group_delimiter = '::'
|
||||||
|
|
||||||
self.get_config_values_or_default()
|
self.get_config_values_or_default()
|
||||||
|
|
||||||
def _compute_resource(self):
|
def _compute_resource(self):
|
||||||
|
@ -2103,6 +2105,32 @@ class Connection(CommonConnection, ConnectionHandlers):
|
||||||
iq4.setData(self.annotations[jid])
|
iq4.setData(self.annotations[jid])
|
||||||
self.connection.send(iq)
|
self.connection.send(iq)
|
||||||
|
|
||||||
|
def get_roster_delimiter(self):
|
||||||
|
"""
|
||||||
|
Get roster group delimiter from storage as described in XEP 0083
|
||||||
|
"""
|
||||||
|
if not gajim.account_is_connected(self.name):
|
||||||
|
return
|
||||||
|
iq = common.xmpp.Iq(typ='get')
|
||||||
|
iq2 = iq.addChild(name='query', namespace=common.xmpp.NS_PRIVATE)
|
||||||
|
iq2.addChild(name='roster', namespace='roster:delimiter')
|
||||||
|
id_ = self.connection.getAnID()
|
||||||
|
iq.setID(id_)
|
||||||
|
self.awaiting_answers[id_] = (DELIMITER_ARRIVED, )
|
||||||
|
self.connection.send(iq)
|
||||||
|
|
||||||
|
def set_roster_delimiter(self, delimiter='::'):
|
||||||
|
"""
|
||||||
|
Set roster group delimiter to the storage namespace
|
||||||
|
"""
|
||||||
|
if not gajim.account_is_connected(self.name):
|
||||||
|
return
|
||||||
|
iq = common.xmpp.Iq(typ='set')
|
||||||
|
iq2 = iq.addChild(name='query', namespace=common.xmpp.NS_PRIVATE)
|
||||||
|
iq3 = iq2.addChild(name='roster', namespace='roster:delimiter')
|
||||||
|
iq3.setData(delimiter)
|
||||||
|
|
||||||
|
self.connection.send(iq)
|
||||||
|
|
||||||
def get_metacontacts(self):
|
def get_metacontacts(self):
|
||||||
"""
|
"""
|
||||||
|
@ -2136,6 +2164,22 @@ class Connection(CommonConnection, ConnectionHandlers):
|
||||||
iq3.addChild(name = 'meta', attrs = dict_)
|
iq3.addChild(name = 'meta', attrs = dict_)
|
||||||
self.connection.send(iq)
|
self.connection.send(iq)
|
||||||
|
|
||||||
|
def request_roster(self):
|
||||||
|
version = None
|
||||||
|
features = self.connection.Dispatcher.Stream.features
|
||||||
|
if features and features.getTag('ver',
|
||||||
|
namespace=common.xmpp.NS_ROSTER_VER):
|
||||||
|
version = gajim.config.get_per('accounts', self.name,
|
||||||
|
'roster_version')
|
||||||
|
if version and not gajim.contacts.get_contacts_jid_list(
|
||||||
|
self.name):
|
||||||
|
gajim.config.set_per('accounts', self.name, 'roster_version',
|
||||||
|
'')
|
||||||
|
version = None
|
||||||
|
|
||||||
|
iq_id = self.connection.initRoster(version=version)
|
||||||
|
self.awaiting_answers[iq_id] = (ROSTER_ARRIVED, )
|
||||||
|
|
||||||
def send_agent_status(self, agent, ptype):
|
def send_agent_status(self, agent, ptype):
|
||||||
if not gajim.account_is_connected(self.name):
|
if not gajim.account_is_connected(self.name):
|
||||||
return
|
return
|
||||||
|
|
|
@ -84,6 +84,7 @@ VCARD_ARRIVED = 'vcard_arrived'
|
||||||
AGENT_REMOVED = 'agent_removed'
|
AGENT_REMOVED = 'agent_removed'
|
||||||
METACONTACTS_ARRIVED = 'metacontacts_arrived'
|
METACONTACTS_ARRIVED = 'metacontacts_arrived'
|
||||||
ROSTER_ARRIVED = 'roster_arrived'
|
ROSTER_ARRIVED = 'roster_arrived'
|
||||||
|
DELIMITER_ARRIVED = 'delimiter_arrived'
|
||||||
PRIVACY_ARRIVED = 'privacy_arrived'
|
PRIVACY_ARRIVED = 'privacy_arrived'
|
||||||
PEP_CONFIG = 'pep_config'
|
PEP_CONFIG = 'pep_config'
|
||||||
HAS_IDLE = True
|
HAS_IDLE = True
|
||||||
|
@ -525,21 +526,22 @@ class ConnectionVcard:
|
||||||
else:
|
else:
|
||||||
if iq_obj.getErrorCode() not in ('403', '406', '404'):
|
if iq_obj.getErrorCode() not in ('403', '406', '404'):
|
||||||
self.private_storage_supported = False
|
self.private_storage_supported = False
|
||||||
|
self.get_roster_delimiter()
|
||||||
|
elif self.awaiting_answers[id_][0] == DELIMITER_ARRIVED:
|
||||||
|
if not self.connection:
|
||||||
|
return
|
||||||
|
if iq_obj.getType() == 'result':
|
||||||
|
query = iq_obj.getTag('query')
|
||||||
|
delimiter = query.getTagData('roster')
|
||||||
|
if delimiter:
|
||||||
|
self.nested_group_delimiter = delimiter
|
||||||
|
else:
|
||||||
|
self.set_roster_delimiter('::')
|
||||||
|
else:
|
||||||
|
self.private_storage_supported = False
|
||||||
|
|
||||||
# We can now continue connection by requesting the roster
|
# We can now continue connection by requesting the roster
|
||||||
version = None
|
self.request_roster()
|
||||||
if con.Stream.features and con.Stream.features.getTag('ver',
|
|
||||||
namespace=common.xmpp.NS_ROSTER_VER):
|
|
||||||
version = gajim.config.get_per('accounts', self.name,
|
|
||||||
'roster_version')
|
|
||||||
if version and not gajim.contacts.get_contacts_jid_list(
|
|
||||||
self.name):
|
|
||||||
gajim.config.set_per('accounts', self.name,
|
|
||||||
'roster_version', '')
|
|
||||||
version = None
|
|
||||||
|
|
||||||
iq_id = self.connection.initRoster(version=version)
|
|
||||||
self.awaiting_answers[iq_id] = (ROSTER_ARRIVED, )
|
|
||||||
elif self.awaiting_answers[id_][0] == ROSTER_ARRIVED:
|
elif self.awaiting_answers[id_][0] == ROSTER_ARRIVED:
|
||||||
if iq_obj.getType() == 'result':
|
if iq_obj.getType() == 'result':
|
||||||
if not iq_obj.getTag('query'):
|
if not iq_obj.getTag('query'):
|
||||||
|
|
|
@ -284,6 +284,36 @@ class RosterWindow:
|
||||||
|
|
||||||
self.starting = False
|
self.starting = False
|
||||||
|
|
||||||
|
def _add_group_iter(self, account, group):
|
||||||
|
"""
|
||||||
|
Add a group iter in roster and return the newly created iter
|
||||||
|
"""
|
||||||
|
if self.regroup:
|
||||||
|
account_group = 'MERGED'
|
||||||
|
else:
|
||||||
|
account_group = account
|
||||||
|
delimiter = gajim.connections[account].nested_group_delimiter
|
||||||
|
group_splited = group.split(delimiter)
|
||||||
|
parent_group = delimiter.join(group_splited[:-1])
|
||||||
|
if parent_group in self._iters[account_group]['groups']:
|
||||||
|
iter_parent = self._iters[account_group]['groups'][parent_group]
|
||||||
|
elif parent_group:
|
||||||
|
iter_parent = self._add_group_iter(account, parent_group)
|
||||||
|
if parent_group not in gajim.groups[account]:
|
||||||
|
if account + parent_group in self.collapsed_rows:
|
||||||
|
is_expanded = False
|
||||||
|
else:
|
||||||
|
is_expanded = True
|
||||||
|
gajim.groups[account][parent_group] = {'expand': is_expanded}
|
||||||
|
else:
|
||||||
|
iter_parent = self._get_account_iter(account, self.model)
|
||||||
|
iter_group = self.model.append(iter_parent,
|
||||||
|
[gajim.interface.jabber_state_images['16']['closed'],
|
||||||
|
gobject.markup_escape_text(group), 'group', group, account, None,
|
||||||
|
None, None, None, None, None] + [None] * self.nb_ext_renderers)
|
||||||
|
self.draw_group(group, account)
|
||||||
|
self._iters[account_group]['groups'][group] = iter_group
|
||||||
|
return iter_group
|
||||||
|
|
||||||
def _add_entity(self, contact, account, groups=None,
|
def _add_entity(self, contact, account, groups=None,
|
||||||
big_brother_contact=None, big_brother_account=None):
|
big_brother_contact=None, big_brother_account=None):
|
||||||
|
@ -328,23 +358,12 @@ class RosterWindow:
|
||||||
# We are a normal contact. Add us to our groups.
|
# We are a normal contact. Add us to our groups.
|
||||||
if not groups:
|
if not groups:
|
||||||
groups = contact.get_shown_groups()
|
groups = contact.get_shown_groups()
|
||||||
if self.regroup:
|
|
||||||
account_group = 'MERGED'
|
|
||||||
else:
|
|
||||||
account_group = account
|
|
||||||
for group in groups:
|
for group in groups:
|
||||||
child_iterG = self._get_group_iter(group, account,
|
child_iterG = self._get_group_iter(group, account,
|
||||||
model=self.model)
|
model=self.model)
|
||||||
if not child_iterG:
|
if not child_iterG:
|
||||||
# Group is not yet in roster, add it!
|
# Group is not yet in roster, add it!
|
||||||
child_iterA = self._get_account_iter(account, self.model)
|
child_iterG = self._add_group_iter(account, group)
|
||||||
child_iterG = self.model.append(child_iterA,
|
|
||||||
[gajim.interface.jabber_state_images['16']['closed'],
|
|
||||||
gobject.markup_escape_text(group),
|
|
||||||
'group', group, account, None, None, None, None, None,
|
|
||||||
None] + [None] * self.nb_ext_renderers)
|
|
||||||
self.draw_group(group, account)
|
|
||||||
self._iters[account_group]['groups'][group] = child_iterG
|
|
||||||
|
|
||||||
if contact.is_transport():
|
if contact.is_transport():
|
||||||
typestr = 'agent'
|
typestr = 'agent'
|
||||||
|
@ -419,8 +438,10 @@ class RosterWindow:
|
||||||
"Invalidated iters of %s" % contact.jid
|
"Invalidated iters of %s" % contact.jid
|
||||||
|
|
||||||
parent_i = self.model.iter_parent(i)
|
parent_i = self.model.iter_parent(i)
|
||||||
|
parent_type = self.model[parent_i][C_TYPE]
|
||||||
|
|
||||||
if parent_type == 'group' and \
|
to_be_removed = i
|
||||||
|
while parent_type == 'group' and \
|
||||||
self.model.iter_n_children(parent_i) == 1:
|
self.model.iter_n_children(parent_i) == 1:
|
||||||
if self.regroup:
|
if self.regroup:
|
||||||
account_group = 'MERGED'
|
account_group = 'MERGED'
|
||||||
|
@ -429,10 +450,12 @@ class RosterWindow:
|
||||||
group = self.model[parent_i][C_JID].decode('utf-8')
|
group = self.model[parent_i][C_JID].decode('utf-8')
|
||||||
if group in gajim.groups[account]:
|
if group in gajim.groups[account]:
|
||||||
del gajim.groups[account][group]
|
del gajim.groups[account][group]
|
||||||
self.model.remove(parent_i)
|
to_be_removed = parent_i
|
||||||
del self._iters[account_group]['groups'][group]
|
del self._iters[account_group]['groups'][group]
|
||||||
else:
|
parent_i = self.model.iter_parent(parent_i)
|
||||||
self.model.remove(i)
|
parent_type = self.model[parent_i][C_TYPE]
|
||||||
|
self.model.remove(to_be_removed)
|
||||||
|
|
||||||
del self._iters[account]['contacts'][contact.jid]
|
del self._iters[account]['contacts'][contact.jid]
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -1248,13 +1271,19 @@ class RosterWindow:
|
||||||
if family and not is_big_brother and not self.starting:
|
if family and not is_big_brother and not self.starting:
|
||||||
self.draw_parent_contact(jid, account)
|
self.draw_parent_contact(jid, account)
|
||||||
|
|
||||||
|
delimiter = gajim.connections[account].nested_group_delimiter
|
||||||
for group in contact.get_shown_groups():
|
for group in contact.get_shown_groups():
|
||||||
# We need to make sure that _visible_func is called for
|
# We need to make sure that _visible_func is called for
|
||||||
# our groups otherwise we might not be shown
|
# our groups otherwise we might not be shown
|
||||||
iterG = self._get_group_iter(group, account, model=self.model)
|
group_splited = group.split(delimiter)
|
||||||
|
i = 1
|
||||||
|
while i < len(group_splited) + 1:
|
||||||
|
g = delimiter.join(group_splited[:i])
|
||||||
|
iterG = self._get_group_iter(g, account, model=self.model)
|
||||||
if iterG:
|
if iterG:
|
||||||
# it's not self contact
|
# it's not self contact
|
||||||
self.model[iterG][C_JID] = self.model[iterG][C_JID]
|
self.model[iterG][C_JID] = self.model[iterG][C_JID]
|
||||||
|
i += 1
|
||||||
|
|
||||||
gajim.plugin_manager.gui_extension_point('roster_draw_contact', self,
|
gajim.plugin_manager.gui_extension_point('roster_draw_contact', self,
|
||||||
jid, account, contact)
|
jid, account, contact)
|
||||||
|
@ -1446,16 +1475,21 @@ class RosterWindow:
|
||||||
"""
|
"""
|
||||||
if not self.tree.get_model():
|
if not self.tree.get_model():
|
||||||
return
|
return
|
||||||
iterG = self._get_group_iter(group, account)
|
delimiter = gajim.connections[account].nested_group_delimiter
|
||||||
|
group_splited = group.split(delimiter)
|
||||||
|
i = 1
|
||||||
|
while i < len(group_splited) + 1:
|
||||||
|
g = delimiter.join(group_splited[:i])
|
||||||
|
iterG = self._get_group_iter(g, account)
|
||||||
if not iterG:
|
if not iterG:
|
||||||
# Group not visible
|
# Group not visible
|
||||||
return
|
return
|
||||||
path = self.modelfilter.get_path(iterG)
|
path = self.modelfilter.get_path(iterG)
|
||||||
if account + group in self.collapsed_rows:
|
if account + g in self.collapsed_rows:
|
||||||
self.tree.collapse_row(path)
|
self.tree.collapse_row(path)
|
||||||
else:
|
else:
|
||||||
self.tree.expand_row(path, False)
|
self.tree.expand_row(path, False)
|
||||||
return False
|
i += 1
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
### Roster and Modelfilter handling
|
### Roster and Modelfilter handling
|
||||||
|
@ -1544,11 +1578,16 @@ class RosterWindow:
|
||||||
else:
|
else:
|
||||||
accounts = [account]
|
accounts = [account]
|
||||||
for _acc in accounts:
|
for _acc in accounts:
|
||||||
|
delimiter = gajim.connections[_acc].nested_group_delimiter
|
||||||
for contact in gajim.contacts.iter_contacts(_acc):
|
for contact in gajim.contacts.iter_contacts(_acc):
|
||||||
|
if not self.contact_is_visible(contact, _acc):
|
||||||
|
continue
|
||||||
# Is this contact in this group?
|
# Is this contact in this group?
|
||||||
if group in contact.get_shown_groups():
|
for grp in contact.get_shown_groups():
|
||||||
if self.contact_is_visible(contact, _acc):
|
while grp:
|
||||||
|
if group == grp:
|
||||||
return True
|
return True
|
||||||
|
grp = delimiter.join(grp.split(delimiter)[:-1])
|
||||||
return False
|
return False
|
||||||
if type_ == 'contact':
|
if type_ == 'contact':
|
||||||
if gajim.config.get('showoffline'):
|
if gajim.config.get('showoffline'):
|
||||||
|
@ -3384,7 +3423,7 @@ class RosterWindow:
|
||||||
if (self.tree.row_expanded(path)):
|
if (self.tree.row_expanded(path)):
|
||||||
self.tree.collapse_row(path)
|
self.tree.collapse_row(path)
|
||||||
else:
|
else:
|
||||||
self.tree.expand_row(path, False)
|
self.expand_group_row(path)
|
||||||
|
|
||||||
elif type_ == 'contact' and x > x_min and x < x_min + 27:
|
elif type_ == 'contact' and x > x_min and x < x_min + 27:
|
||||||
if (self.tree.row_expanded(path)):
|
if (self.tree.row_expanded(path)):
|
||||||
|
@ -3392,6 +3431,18 @@ class RosterWindow:
|
||||||
else:
|
else:
|
||||||
self.tree.expand_row(path, False)
|
self.tree.expand_row(path, False)
|
||||||
|
|
||||||
|
def expand_group_row(self, path):
|
||||||
|
self.tree.expand_row(path, False)
|
||||||
|
iter = self.modelfilter.get_iter(path)
|
||||||
|
child_iter = self.modelfilter.iter_children(iter)
|
||||||
|
while child_iter:
|
||||||
|
type_ = self.modelfilter[child_iter][C_TYPE]
|
||||||
|
account = self.modelfilter[child_iter][C_ACCOUNT]
|
||||||
|
group = self.modelfilter[child_iter][C_JID]
|
||||||
|
if type_ == 'group' and account + group not in self.collapsed_rows:
|
||||||
|
self.expand_group_row(self.modelfilter.get_path(child_iter))
|
||||||
|
child_iter = self.modelfilter.iter_next(child_iter)
|
||||||
|
|
||||||
def on_req_usub(self, widget, list_):
|
def on_req_usub(self, widget, list_):
|
||||||
"""
|
"""
|
||||||
Remove a contact. list_ is a list of (contact, account) tuples
|
Remove a contact. list_ is a list of (contact, account) tuples
|
||||||
|
@ -4133,7 +4184,7 @@ class RosterWindow:
|
||||||
return
|
return
|
||||||
path = list_of_paths[0]
|
path = list_of_paths[0]
|
||||||
data = ''
|
data = ''
|
||||||
if len(path) >= 3:
|
if len(path) >= 2:
|
||||||
data = model[path][C_JID]
|
data = model[path][C_JID]
|
||||||
selection.set(selection.target, 8, data)
|
selection.set(selection.target, 8, data)
|
||||||
|
|
||||||
|
@ -4306,6 +4357,12 @@ class RosterWindow:
|
||||||
context.finish(False, True)
|
context.finish(False, True)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def move_group(self, old_name, new_name, account):
|
||||||
|
for group in gajim.groups[account].keys():
|
||||||
|
if group.startswith(old_name):
|
||||||
|
self.rename_group(group, group.replace(old_name, new_name),
|
||||||
|
account)
|
||||||
|
|
||||||
def drag_data_received_data(self, treeview, context, x, y, selection, info,
|
def drag_data_received_data(self, treeview, context, x, y, selection, info,
|
||||||
etime):
|
etime):
|
||||||
treeview.stop_emission('drag_data_received')
|
treeview.stop_emission('drag_data_received')
|
||||||
|
@ -4395,26 +4452,46 @@ class RosterWindow:
|
||||||
type_source = model[iter_source][C_TYPE]
|
type_source = model[iter_source][C_TYPE]
|
||||||
account_source = model[iter_source][C_ACCOUNT].decode('utf-8')
|
account_source = model[iter_source][C_ACCOUNT].decode('utf-8')
|
||||||
|
|
||||||
# Only normal contacts can be dragged
|
|
||||||
if type_source != 'contact':
|
|
||||||
return
|
|
||||||
if gajim.config.get_per('accounts', account_source, 'is_zeroconf'):
|
if gajim.config.get_per('accounts', account_source, 'is_zeroconf'):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if type_dest == 'self_contact':
|
||||||
|
# drop on self contact row
|
||||||
|
return
|
||||||
|
|
||||||
|
if type_dest == 'groupchat':
|
||||||
|
# drop on a minimized groupchat
|
||||||
|
# TODO: Invite to groupchat if type_dest = contact
|
||||||
|
return
|
||||||
|
|
||||||
|
if type_source == 'group':
|
||||||
|
if account_source != account_dest:
|
||||||
|
# drop on another account
|
||||||
|
return
|
||||||
|
grp_source = model[iter_source][C_JID].decode('utf-8')
|
||||||
|
delimiter = gajim.connections[account_source].nested_group_delimiter
|
||||||
|
grp_source_list = grp_source.split(delimiter)
|
||||||
|
new_grp = None
|
||||||
|
if type_dest == 'account':
|
||||||
|
new_grp = grp_source_list[-1]
|
||||||
|
elif type_dest == 'group':
|
||||||
|
new_grp = model[iter_dest][C_JID].decode('utf-8') + delimiter +\
|
||||||
|
grp_source_list[-1]
|
||||||
|
if new_grp:
|
||||||
|
self.move_group(grp_source, new_grp, account_source)
|
||||||
|
|
||||||
|
# Only normal contacts and group can be dragged
|
||||||
|
if type_source != 'contact':
|
||||||
|
return
|
||||||
|
|
||||||
# A contact was dropped
|
# A contact was dropped
|
||||||
if gajim.config.get_per('accounts', account_dest, 'is_zeroconf'):
|
if gajim.config.get_per('accounts', account_dest, 'is_zeroconf'):
|
||||||
# drop on zeroconf account, adding not possible
|
# drop on zeroconf account, adding not possible
|
||||||
return
|
return
|
||||||
if type_dest == 'self_contact':
|
|
||||||
# drop on self contact row
|
|
||||||
return
|
|
||||||
if type_dest == 'account' and account_source == account_dest:
|
if type_dest == 'account' and account_source == account_dest:
|
||||||
# drop on the account it was dragged from
|
# drop on the account it was dragged from
|
||||||
return
|
return
|
||||||
if type_dest == 'groupchat':
|
|
||||||
# drop on a minimized groupchat
|
|
||||||
# TODO: Invite to groupchat
|
|
||||||
return
|
|
||||||
|
|
||||||
# Get valid source group, jid and contact
|
# Get valid source group, jid and contact
|
||||||
it = iter_source
|
it = iter_source
|
||||||
|
@ -4683,6 +4760,10 @@ class RosterWindow:
|
||||||
renderer.set_property('xalign', 0)
|
renderer.set_property('xalign', 0)
|
||||||
elif type_ == 'group':
|
elif type_ == 'group':
|
||||||
self._set_group_row_background_color(renderer)
|
self._set_group_row_background_color(renderer)
|
||||||
|
parent_iter = model.iter_parent(titer)
|
||||||
|
if model[parent_iter][C_TYPE] == 'group':
|
||||||
|
renderer.set_property('xalign', 0.4)
|
||||||
|
else:
|
||||||
renderer.set_property('xalign', 0.2)
|
renderer.set_property('xalign', 0.2)
|
||||||
elif type_:
|
elif type_:
|
||||||
# prevent type_ = None, see http://trac.gajim.org/ticket/2534
|
# prevent type_ = None, see http://trac.gajim.org/ticket/2534
|
||||||
|
@ -4696,7 +4777,7 @@ class RosterWindow:
|
||||||
if model[parent_iter][C_TYPE] == 'contact':
|
if model[parent_iter][C_TYPE] == 'contact':
|
||||||
renderer.set_property('xalign', 1)
|
renderer.set_property('xalign', 1)
|
||||||
else:
|
else:
|
||||||
renderer.set_property('xalign', 0.4)
|
renderer.set_property('xalign', 0.6)
|
||||||
renderer.set_property('width', 26)
|
renderer.set_property('width', 26)
|
||||||
|
|
||||||
def _nameCellDataFunc(self, column, renderer, model, titer, data=None):
|
def _nameCellDataFunc(self, column, renderer, model, titer, data=None):
|
||||||
|
@ -4724,6 +4805,10 @@ class RosterWindow:
|
||||||
self.set_renderer_color(renderer, gtk.STATE_PRELIGHT, False)
|
self.set_renderer_color(renderer, gtk.STATE_PRELIGHT, False)
|
||||||
renderer.set_property('font',
|
renderer.set_property('font',
|
||||||
gtkgui_helpers.get_theme_font_for_option(theme, 'groupfont'))
|
gtkgui_helpers.get_theme_font_for_option(theme, 'groupfont'))
|
||||||
|
parent_iter = model.iter_parent(titer)
|
||||||
|
if model[parent_iter][C_TYPE] == 'group':
|
||||||
|
renderer.set_property('xpad', 8)
|
||||||
|
else:
|
||||||
renderer.set_property('xpad', 4)
|
renderer.set_property('xpad', 4)
|
||||||
self._set_group_row_background_color(renderer)
|
self._set_group_row_background_color(renderer)
|
||||||
elif type_:
|
elif type_:
|
||||||
|
@ -4755,7 +4840,7 @@ class RosterWindow:
|
||||||
if model[parent_iter][C_TYPE] == 'contact':
|
if model[parent_iter][C_TYPE] == 'contact':
|
||||||
renderer.set_property('xpad', 16)
|
renderer.set_property('xpad', 16)
|
||||||
else:
|
else:
|
||||||
renderer.set_property('xpad', 8)
|
renderer.set_property('xpad', 12)
|
||||||
|
|
||||||
def _fill_pep_pixbuf_renderer(self, column, renderer, model, titer,
|
def _fill_pep_pixbuf_renderer(self, column, renderer, model, titer,
|
||||||
data=None):
|
data=None):
|
||||||
|
|
Loading…
Add table
Reference in a new issue