Changeset 9598
- Timestamp:
- 05/08/08 23:53:26 (3 months ago)
- Files:
-
- trunk/src/roster_window.py (modified) (60 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/roster_window.py
r9597 r9598 166 166 167 167 if jid == gajim.get_jid_from_account(account): 168 iter = self._get_self_contact_iter(jid, account, model)169 if iter:170 return [ iter]168 contact_iter = self._get_self_contact_iter(jid, account, model) 169 if contact_iter: 170 return [contact_iter] 171 171 else: 172 172 return [] … … 215 215 216 216 217 def _iter_is_separator(self, model, iter):217 def _iter_is_separator(self, model, titer): 218 218 ''' Return True if the given iter is a separator. 219 219 … … 222 222 iter -- the gtk.TreeIter to test 223 223 ''' 224 if model[ iter][0] == 'SEPARATOR':224 if model[titer][0] == 'SEPARATOR': 225 225 return True 226 226 return False … … 418 418 all_iters = iters[:] 419 419 group_iters = [self._get_group_iter(group, account) for group in groups] 420 iters = [ iter foriter in all_iters421 if self.model.iter_parent( iter) in group_iters]420 iters = [titer for titer in all_iters 421 if self.model.iter_parent(titer) in group_iters] 422 422 423 423 iter_children = self.model.iter_children(iters[0]) … … 1063 1063 if iters and self.modelfilter.iter_has_child(iters[0]): 1064 1064 # We are big brother contact and visible in the roster 1065 iter = iters[0]1066 path = self.modelfilter.get_path( iter)1065 titer = iters[0] 1066 path = self.modelfilter.get_path(titer) 1067 1067 1068 1068 if not self.tree.row_expanded(path) and \ 1069 1069 icon_name not in ('event', 'muc_active', 'muc_inactive'): 1070 1070 1071 iterC = self.modelfilter.iter_children( iter)1071 iterC = self.modelfilter.iter_children(titer) 1072 1072 if icon_name in ('error', 'offline'): 1073 1073 # get the icon from the first child as they are sorted by show … … 1230 1230 ############################################################################## 1231 1231 1232 def _search_roster_func(self, model, column, key, iter):1233 if model[ iter][C_NAME].decode('utf-8').lower().startswith(1232 def _search_roster_func(self, model, column, key, titer): 1233 if model[titer][C_NAME].decode('utf-8').lower().startswith( 1234 1234 gobject.markup_escape_text(key.lower())): 1235 1235 return False … … 1262 1262 return True 1263 1263 1264 def _visible_func(self, model, iter):1264 def _visible_func(self, model, titer): 1265 1265 '''Determine whether iter should be visible in the treeview''' 1266 type_ = model[ iter][C_TYPE]1266 type_ = model[titer][C_TYPE] 1267 1267 if not type_: 1268 1268 return False … … 1271 1271 return True 1272 1272 1273 account = model[ iter][C_ACCOUNT]1273 account = model[titer][C_ACCOUNT] 1274 1274 if not account: 1275 1275 return False 1276 1276 1277 1277 account = account.decode('utf-8') 1278 jid = model[ iter][C_JID]1278 jid = model[titer][C_JID] 1279 1279 if not jid: 1280 1280 return False … … 2287 2287 if props: 2288 2288 [row, col, x, y] = props 2289 iter = None2289 titer = None 2290 2290 try: 2291 iter = model.get_iter(row)2291 titer = model.get_iter(row) 2292 2292 except: 2293 2293 self.tooltip.hide_tooltip() 2294 2294 return 2295 if model[ iter][C_TYPE] in ('contact', 'self_contact'):2295 if model[titer][C_TYPE] in ('contact', 'self_contact'): 2296 2296 # we're on a contact entry in the roster 2297 account = model[ iter][C_ACCOUNT].decode('utf-8')2298 jid = model[ iter][C_JID].decode('utf-8')2297 account = model[titer][C_ACCOUNT].decode('utf-8') 2298 jid = model[titer][C_JID].decode('utf-8') 2299 2299 if self.tooltip.timeout == 0 or self.tooltip.id != props[0]: 2300 2300 self.tooltip.id = row … … 2310 2310 self.tooltip.timeout = gobject.timeout_add(500, 2311 2311 self.show_tooltip, connected_contacts) 2312 elif model[ iter][C_TYPE] == 'groupchat':2313 account = model[ iter][C_ACCOUNT].decode('utf-8')2314 jid = model[ iter][C_JID].decode('utf-8')2312 elif model[titer][C_TYPE] == 'groupchat': 2313 account = model[titer][C_ACCOUNT].decode('utf-8') 2314 jid = model[titer][C_JID].decode('utf-8') 2315 2315 if self.tooltip.timeout == 0 or self.tooltip.id != props[0]: 2316 2316 self.tooltip.id = row … … 2319 2319 self.tooltip.timeout = gobject.timeout_add(500, 2320 2320 self.show_tooltip, contact) 2321 elif model[ iter][C_TYPE] == 'account':2321 elif model[titer][C_TYPE] == 'account': 2322 2322 # we're on an account entry in the roster 2323 account = model[ iter][C_ACCOUNT].decode('utf-8')2323 account = model[titer][C_ACCOUNT].decode('utf-8') 2324 2324 if account == 'all': 2325 2325 if self.tooltip.timeout == 0 or self.tooltip.id != props[0]: … … 2439 2439 on_response_ok = (remove, list_)) 2440 2440 2441 def on_block(self, widget, iter, group_list):2441 def on_block(self, widget, titer, group_list): 2442 2442 ''' When clicked on the 'block' button in context menu. ''' 2443 2443 model = self.modelfilter … … 2445 2445 msg = self.get_status_message('offline') 2446 2446 if group_list is None: 2447 jid = model[ iter][C_JID].decode('utf-8')2448 account = model[ iter][C_ACCOUNT].decode('utf-8')2447 jid = model[titer][C_JID].decode('utf-8') 2448 account = model[titer][C_ACCOUNT].decode('utf-8') 2449 2449 accounts.append(account) 2450 2450 self.send_status(account, 'offline', msg, to = jid) … … 2456 2456 self.draw_contact(jid, account) 2457 2457 else: 2458 if iter is None:2458 if titer is None: 2459 2459 for (contact, account) in group_list: 2460 2460 if account not in accounts: … … 2471 2471 self.draw_contact(contact.jid, account) 2472 2472 else: 2473 group = model[ iter][C_JID].decode('utf-8')2473 group = model[titer][C_JID].decode('utf-8') 2474 2474 for (contact, account) in group_list: 2475 2475 if account not in accounts: … … 2493 2493 gajim.connections[account].get_privacy_list('block') 2494 2494 2495 def on_unblock(self, widget, iter, group_list):2495 def on_unblock(self, widget, titer, group_list): 2496 2496 ''' When clicked on the 'unblock' button in context menu. ''' 2497 2497 model = self.modelfilter 2498 2498 accounts = [] 2499 2499 if group_list is None: 2500 jid = model[ iter][C_JID].decode('utf-8')2501 jid_account = model[ iter][C_ACCOUNT].decode('utf-8')2500 jid = model[titer][C_JID].decode('utf-8') 2501 jid_account = model[titer][C_ACCOUNT].decode('utf-8') 2502 2502 accounts.append(jid_account) 2503 2503 gajim.connections[jid_account].new_blocked_list = [] … … 2511 2511 self.draw_contact(jid, jid_account) 2512 2512 else: 2513 if iter is None:2513 if titer is None: 2514 2514 for (contact, account) in group_list: 2515 2515 if account not in accounts: … … 2532 2532 gajim.connections[account].new_blocked_list.append(rule) 2533 2533 else: 2534 group = model[ iter][C_JID].decode('utf-8')2534 group = model[titer][C_JID].decode('utf-8') 2535 2535 for (contact, account) in group_list: 2536 2536 if account not in accounts: … … 2585 2585 gajim.connections[account].status, to=contact.jid) 2586 2586 2587 def on_rename(self, widget, iter, path):2587 def on_rename(self, widget, titer, path): 2588 2588 # this function is called either by F2 or by Rename menuitem 2589 2589 if gajim.interface.instances.has_key('rename'): … … 2592 2592 model = self.modelfilter 2593 2593 2594 row_type = model[ iter][C_TYPE]2595 jid = model[ iter][C_JID].decode('utf-8')2596 account = model[ iter][C_ACCOUNT].decode('utf-8')2594 row_type = model[titer][C_TYPE] 2595 jid = model[titer][C_JID].decode('utf-8') 2596 account = model[titer][C_ACCOUNT].decode('utf-8') 2597 2597 # account is offline, don't allow to rename 2598 2598 if gajim.connections[account].connected < 2: … … 2607 2607 if jid in helpers.special_groups + (_('General'),): 2608 2608 return 2609 old_text = model[ iter][C_JID].decode('utf-8')2609 old_text = model[titer][C_JID].decode('utf-8') 2610 2610 title = _('Rename Group') 2611 2611 message = _('Enter a new name for group %s') % old_text … … 2915 2915 type_ = model[path][C_TYPE] 2916 2916 if type_ in ('contact', 'group', 'agent'): 2917 iter = model.get_iter(path)2918 self.on_rename(widget, iter, path)2917 titer = model.get_iter(path) 2918 self.on_rename(widget, titer, path) 2919 2919 2920 2920 elif event.keyval == gtk.keysyms.Delete: … … 3021 3021 not event.state & gtk.gdk.CONTROL_MASK: 3022 3022 # Don't handle dubble click if we press icon of a metacontact 3023 iter = model.get_iter(path)3023 titer = model.get_iter(path) 3024 3024 if x > x_min and x < x_min + 27 and type_ == 'contact' and \ 3025 model.iter_has_child( iter):3025 model.iter_has_child(titer): 3026 3026 # FIXME: Expand all meta contacts or only the current one? 3027 3027 #account = model[path][C_ACCOUNT].decode('utf-8') … … 3029 3029 # first cell in 1st column (the arrow SINGLE clicked) 3030 3030 #iters = self._get_contact_iter(jid, account) 3031 #for iter in iters:3032 # path = model.get_path( iter)3031 #for titer in iters: 3032 # path = model.get_path(titer) 3033 3033 if (self.tree.row_expanded(path)): 3034 3034 self.tree.collapse_row(path) … … 3054 3054 # first cell in 1st column (the arrow SINGLE clicked) 3055 3055 #iters = self._get_contact_iter(jid, account) 3056 #for iter in iters:3057 # path = model.get_path( iter)3056 #for titer in iters: 3057 # path = model.get_path(titer) 3058 3058 if (self.tree.row_expanded(path)): 3059 3059 self.tree.collapse_row(path) … … 3360 3360 resource = None 3361 3361 contact = None 3362 iter = model.get_iter(path)3362 titer = model.get_iter(path) 3363 3363 if type_ in ('group', 'account'): 3364 3364 if self.tree.row_expanded(path): … … 3378 3378 resource = c.resource 3379 3379 break 3380 if not first_ev and model.iter_has_child( iter):3381 child_iter = model.iter_children( iter)3380 if not first_ev and model.iter_has_child(titer): 3381 child_iter = model.iter_children(titer) 3382 3382 while not first_ev and child_iter: 3383 3383 child_jid = model[child_iter][C_JID].decode('utf-8') … … 3411 3411 self.on_row_activated(widget, path) 3412 3412 3413 def on_roster_treeview_row_expanded(self, widget, iter, path):3413 def on_roster_treeview_row_expanded(self, widget, titer, path): 3414 3414 '''When a row is expanded change the icon of the arrow''' 3415 3415 self._toggeling_row = True 3416 3416 model = widget.get_model() 3417 3417 child_model = model.get_model() 3418 child_iter = model.convert_iter_to_child_iter( iter)3418 child_iter = model.convert_iter_to_child_iter(titer) 3419 3419 3420 3420 if self.regroup: # merged accounts 3421 3421 accounts = gajim.connections.keys() 3422 3422 else: 3423 accounts = [model[ iter][C_ACCOUNT].decode('utf-8')]3423 accounts = [model[titer][C_ACCOUNT].decode('utf-8')] 3424 3424 3425 type_ = model[ iter][C_TYPE]3425 type_ = model[titer][C_TYPE] 3426 3426 if type_ == 'group': 3427 3427 child_model[child_iter][C_IMG] = gajim.interface.jabber_state_images[ 3428 3428 '16']['opened'] 3429 group = model[ iter][C_JID].decode('utf-8')3429 group = model[titer][C_JID].decode('utf-8') 3430 3430 for account in accounts: 3431 3431 if group in gajim.groups[account]: # This account has this group … … 3441 3441 for group in gajim.groups[account]: 3442 3442 if gajim.groups[account][group]['expand']: 3443 iter = self._get_group_iter(group, account)3444 if iter:3445 path = model.get_path( iter)3443 titer = self._get_group_iter(group, account) 3444 if titer: 3445 path = model.get_path(titer) 3446 3446 self.tree.expand_row(path, False) 3447 3447 elif type_ == 'contact': 3448 3448 # Metacontact got toggled, update icon 3449 jid = model[ iter][C_JID].decode('utf-8')3450 account = model[ iter][C_ACCOUNT].decode('utf-8')3449 jid = model[titer][C_JID].decode('utf-8') 3450 account = model[titer][C_ACCOUNT].decode('utf-8') 3451 3451 self.draw_contact(jid, account) 3452 3452 3453 3453 self._toggeling_row = False 3454 3454 3455 def on_roster_treeview_row_collapsed(self, widget, iter, path):3455 def on_roster_treeview_row_collapsed(self, widget, titer, path): 3456 3456 '''When a row is collapsed change the icon of the arrow''' 3457 3457 self._toggeling_row = True 3458 3458 model = widget.get_model() 3459 3459 child_model = model.get_model() 3460 child_iter = model.convert_iter_to_child_iter( iter)3460 child_iter = model.convert_iter_to_child_iter(titer) 3461 3461 3462 3462 if self.regroup: # merged accounts 3463 3463 accounts = gajim.connections.keys() 3464 3464 else: 3465 accounts = [model[ iter][C_ACCOUNT].decode('utf-8')]3465 accounts = [model[titer][C_ACCOUNT].decode('utf-8')] 3466 3466 3467 type_ = model[ iter][C_TYPE]3467 type_ = model[titer][C_TYPE] 3468 3468 if type_ == 'group': 3469 3469 child_model[child_iter][C_IMG] = gajim.interface.jabber_state_images[ 3470 3470 '16']['closed'] 3471 group = model[ iter][C_JID].decode('utf-8')3471 group = model[titer][C_JID].decode('utf-8') 3472 3472 for account in accounts: 3473 3473 if group in gajim.groups[account]: # This account has this group … … 3482 3482 elif type_ == 'contact': 3483 3483 # Metacontact got toggled, update icon 3484 jid = model[ iter][C_JID].decode('utf-8')3485 account = model[ iter][C_ACCOUNT].decode('utf-8')3484 jid = model[titer][C_JID].decode('utf-8') 3485 account = model[titer][C_ACCOUNT].decode('utf-8') 3486 3486 self.draw_contact(jid, account) 3487 3487 3488 3488 self._toggeling_row = False 3489 3489 3490 def on_model_row_has_child_toggled(self, model, path, iter):3490 def on_model_row_has_child_toggled(self, model, path, titer): 3491 3491 '''Called when a row has gotten the first or lost its last child row. 3492 3492 … … 3497 3497 return 3498 3498 3499 type_ = model[ iter][C_TYPE]3500 account = model[ iter][C_ACCOUNT]3499 type_ = model[titer][C_TYPE] 3500 account = model[titer][C_ACCOUNT] 3501 3501 if not account: 3502 3502 return … … 3505 3505 3506 3506 if type_ == 'contact': 3507 child_iter = model.convert_iter_to_child_iter( iter)3507 child_iter = model.convert_iter_to_child_iter(titer) 3508 3508 if self.model.iter_has_child(child_iter): 3509 3509 # we are a bigbrother metacontact … … 3511 3511 if self.filtering: 3512 3512 # Prevent endless loops 3513 jid = model[ iter][C_JID].decode('utf-8')3513 jid = model[titer][C_JID].decode('utf-8') 3514 3514 gobject.idle_add(self.draw_contact, jid, account) 3515 3515 elif type_ == 'group': 3516 group = model[ iter][C_JID].decode('utf-8')3516 group = model[titer][C_JID].decode('utf-8') 3517 3517 self._adjust_group_expand_collapse_state(group, account) 3518 3518 elif type_ == 'account': … … 3955 3955 # Update the status combobox 3956 3956 model = self.status_combobox.get_model() 3957 iter = model.get_iter_root()3958 while iter:3959 if model[ iter][2] != '':3957 titer = model.get_iter_root() 3958 while titer: 3959 if model[titer][2] != '': 3960 3960 # If it's not change status message iter 3961 3961 # eg. if it has show parameter not '' 3962 model[ iter][1] = gajim.interface.jabber_state_images['16'][model[iter][2]]3963 iter = model.iter_next(iter)3962 model[titer][1] = gajim.interface.jabber_state_images['16'][model[titer][2]] 3963 titer = model.iter_next(titer) 3964 3964 # Update the systray 3965 3965 if gajim.interface.systray_enabled: … … 4020 4020 gtkgui_helpers.set_unset_urgency_hint(self.window, nb_unread) 4021 4021 4022 def _change_style(self, model, path, iter, option):4023 if option is None or model[ iter][C_TYPE] == option:4022 def _change_style(self, model, path, titer, option): 4023 if option is None or model[titer][C_TYPE] == option: 4024 4024 # We changed style for this type of row 4025 model[ iter][C_NAME] = model[iter][C_NAME]4025 model[titer][C_NAME] = model[titer][C_NAME] 4026 4026 4027 4027 def change_roster_style(self, option): … … 4067 4067 renderer.set_property('foreground-gdk', fgcolor) 4068 4068 4069 def _iconCellDataFunc(self, column, renderer, model, iter, data = None):4069 def _iconCellDataFunc(self, column, renderer, model, titer, data = None): 4070 4070 '''When a row is added, set properties for icon renderer''' 4071 4071 theme = gajim.config.get('roster_theme') 4072 type_ = model[ iter][C_TYPE]4072 type_ = model[titer][C_TYPE] 4073 4073 if type_ == 'account': 4074 4074 color = gajim.config.get_per('themes', theme, 'accountbgcolor') … … 4086 4086 renderer.set_property('xalign', 0.2) 4087 4087 elif type_: # prevent type_ = None, see http://trac.gajim.org/ticket/2534 4088 if not model[ iter][C_JID] or not model[iter][C_ACCOUNT]:4088 if not model[titer][C_JID] or not model[titer][C_ACCOUNT]: 4089 4089 # This can append when at the moment we add the row 4090 4090 return 4091 jid = model[ iter][C_JID].decode('utf-8')4092 account = model[ iter][C_ACCOUNT].decode('utf-8')4091 jid = model[titer][C_JID].decode('utf-8') 4092 account = model[titer][C_ACCOUNT].decode('utf-8') 4093 4093 if jid in gajim.newly_added[account]: 4094 4094 renderer.set_property('cell-background', gajim.config.get( … … 4103 4103 else: 4104 4104 renderer.set_property('cell-background', None) 4105 parent_iter = model.iter_parent( iter)4105 parent_iter = model.iter_parent(titer) 4106 4106 if model[parent_iter][C_TYPE] == 'contact': 4107 4107 renderer.set_property('xalign', 1) … … 4110 4110 renderer.set_property('width', 26) 4111 4111 4112 def _nameCellDataFunc(self, column, renderer, model, iter, data = None):4112 def _nameCellDataFunc(self, column, renderer, model, titer, data = None): 4113 4113 '''When a row is added, set properties for name renderer''' 4114 4114 theme = gajim.config.get('roster_theme') 4115 type_ = model[ iter][C_TYPE]4115 type_ = model[titer][C_TYPE] 4116 4116 if type_ == 'account': 4117 4117 color = gajim.config.get_per('themes', theme, 'accounttextcolor') … … 4144 4144 renderer.set_property('xpad', 4) 4145 4145 elif type_: # prevent type_ = None, see http://trac.gajim.org/ticket/2534 4146 if not model[ iter][C_JID] or not model[iter][C_ACCOUNT]:4146 if not model[titer][C_JID] or not model[titer][C_ACCOUNT]: 4147 4147 # This can append when at the moment we add the row 4148 4148 return 4149 jid = model[ iter][C_JID].decode('utf-8')4150 account = model[ iter][C_ACCOUNT].decode('utf-8')4149 jid = model[titer][C_JID].decode('utf-8') 4150 account = model[titer][C_ACCOUNT].decode('utf-8') 4151 4151 color = gajim.config.get_per('themes', theme, 'contacttextcolor') 4152 4152 if color: … … 4168 4168 renderer.set_property('font', 4169 4169 gtkgui_helpers.get_theme_font_for_option(theme, 'contactfont')) 4170 parent_iter = model.iter_parent( iter)4170 parent_iter = model.iter_parent(titer) 4171 4171 if model[parent_iter][C_TYPE] == 'contact': 4172 4172 renderer.set_property('xpad', 16) … … 4174 4174 renderer.set_property('xpad', 8) 4175 4175 4176 def _fill_avatar_pixbuf_rederer(self, column, renderer, model, iter,4176 def _fill_avatar_pixbuf_rederer(self, column, renderer, model, titer, 4177 4177 data = None): 4178 4178 '''When a row is added, set properties for avatar renderer''' 4179 4179 theme = gajim.config.get('roster_theme') 4180 type_ = model[ iter][C_TYPE]4180 type_ = model[titer][C_TYPE] 4181 4181 if type_ in ('group', 'account'): 4182 4182 renderer.set_property('visible', False) … … 4184 4184 4185 4185 # allocate space for the icon only if needed 4186 if model[ iter][C_AVATAR_PIXBUF] or \4186 if model[titer][C_AVATAR_PIXBUF] or \ 4187 4187 gajim.config.get('avatar_position_in_roster') == 'left': 4188 4188 renderer.set_property('visible', True) … … 4190 4190 renderer.set_property('visible', False) 4191 4191 if type_: # prevent type_ = None, see http://trac.gajim.org/ticket/2534 4192 if not model[ iter][C_JID] or not model[iter][C_ACCOUNT]:4192 if not model[titer][C_JID] or not model[titer][C_ACCOUNT]: 4193 4193 # This can append at the moment we add the row 4194 4194 return 4195 jid = model[ iter][C_JID].decode('utf-8')4196 account = model[ iter][C_ACCOUNT].decode('utf-8')4195 jid = model[titer][C_JID].decode('utf-8') 4196 account = model[titer][C_ACCOUNT].decode('utf-8') 4197 4197 if jid in gajim.newly_added[account]: 4198 4198 renderer.set_property('cell-background', gajim.config.get( … … 4213 4213 renderer.set_property('xalign', 1) # align pixbuf to the right 4214 4214 4215 def _fill_padlock_pixbuf_rederer(self, column, renderer, model, iter,4215 def _fill_padlock_pixbuf_rederer(self, column, renderer, model, titer, 4216 4216 data = None): 4217 4217 '''When a row is added, set properties for padlock renderer''' 4218 4218 theme = gajim.config.get('roster_theme') 4219 type_ = model[ iter][C_TYPE]4219 type_ = model[titer][C_TYPE] 4220 4220 # allocate space for the icon only if needed 4221 if type_ == 'account' and model[ iter][C_PADLOCK_PIXBUF]:4221 if type_ == 'account' and model[titer][C_PADLOCK_PIXBUF]: 4222 4222 renderer.set_property('visible', True) 4223 4223 color = gajim.config.get_per('themes', theme, 'accountbgcolor') … … 4685 4685 return account_context_menu 4686 4686 4687 def make_account_menu(self, event, iter):4687 def make_account_menu(self, event, titer): 4688 4688 '''Make account's popup menu''' 4689 4689 model = self.modelfilter 4690 account = model[ iter][C_ACCOUNT].decode('utf-8')4690 account = model[titer][C_ACCOUNT].decode('utf-8') 4691 4691 4692 4692 if account != 'all': # not in merged mode … … 4717 4717 menu.popup(None, None, None, event_button, event.time) 4718 4718 4719 def make_group_menu(self, event, iter):4719 def make_group_menu(self, event, titer): 4720 4720 '''Make group's popup menu''' 4721 4721 model = self.modelfilter 4722 path = model.get_path( iter)4723 group = model[ iter][C_JID].decode('utf-8')4724 account = model[ iter][C_ACCOUNT].decode('utf-8')4722 path = model.get_path(titer) 4723 group = model[titer][C_JID].decode('utf-8') 4724 account = model[titer][C_ACCOUNT].decode('utf-8') 4725 4725 4726 4726 list_ = [] # list of (jid, account) tuples 4727 4727 list_online = [] # list of (jid, account) tuples 4728 4728 4729 group = model[ iter][C_JID]4729 group = model[titer][C_JID] 4730 4730 for jid in gajim.contacts.get_jid_list(account): 4731 4731 contact = gajim.contacts.get_contact_with_highest_priority(account, … … 4819 4819 rename_item.set_image(img) 4820 4820 menu.append(rename_item) 4821 rename_item.connect('activate', self.on_rename, iter, path)4821 rename_item.connect('activate', self.on_rename, titer, path) 4822 4822 4823 4823 # Block group … … 4835 4835 icon = gtk.image_new_from_stock(gtk.STOCK_STOP, gtk.ICON_SIZE_MENU) 4836 4836 unblock_menuitem.set_image(icon) 4837 unblock_menuitem.connect('activate', self.on_unblock, iter, list_)4837 unblock_menuitem.connect('activate', self.on_unblock, titer, list_) 4838 4838 menu.append(unblock_menuitem) 4839 4839 else: … … 4841 4841 icon = gtk.image_new_from_stock(gtk.STOCK_STOP, gtk.ICON_SIZE_MENU) 4842 4842 block_menuitem.set_image(icon) 4843 block_menuitem.connect('activate', self.on_block, iter, list_)4843 block_menuitem.connect('activate', self.on_block, titer, list_) 4844 4844 menu.append(block_menuitem) 4845 4845 if not gajim.connections[account].privacy_rules_supported: … … 4871 4871 menu.popup(None, None, None, event_button, event.time) 4872 4872 4873 def make_contact_menu(self, event, iter):4873 def make_contact_menu(self, event, titer): 4874 4874 '''Make contact\'s popup menu''' 4875 4875 model = self.modelfilter 4876 jid = model[ iter][C_JID].decode('utf-8')4877 tree_path = model.get_path( iter)4878 account = model[ iter][C_ACCOUNT].decode('utf-8')4876 jid = model[titer][C_JID].decode('utf-8') 4877 tree_path = model.get_path(titer) 4878 account = model[titer][C_ACCOUNT].decode('utf-8') 4879 4879 our_jid = jid == gajim.get_jid_from_account(account) 4880 4880 contact = gajim.contacts.get_contact_with_highest_priority(account, jid) … … 4940 4940 send_file_menuitem.set_sensitive(False) 4941 4941 4942 rename_menuitem.connect('activate', self.on_rename, iter, tree_path)4942 rename_menuitem.connect('activate', self.on_rename, titer, tree_path) 4943 4943 if contact.show in ('offline', 'error'): 4944 4944 information_menuitem.set_sensitive(False) … … 5112 5112 self.on_send_single_message_menuitem_activate, account, contact) 5113 5113 5114 rename_menuitem.connect('activate', self.on_rename, iter, tree_path)5114 rename_menuitem.connect('activate', self.on_rename, titer, tree_path) 5115 5115 remove_from_roster_menuitem.connect('activate', self.on_req_usub, 5116 5116 [(contact, account)]) … … 5180 5180 if jid in gajim.connections[account].blocked_contacts: 5181 5181 block_menuitem.set_no_show_all(True) 5182 unblock_menuitem.connect('activate', self.on_unblock, iter, None)5182 unblock_menuitem.connect('activate', self.on_unblock, titer, None) 5183 5183 block_menuitem.hide() 5184 5184 else: 5185 5185 unblock_menuitem.set_no_show_all(True) 5186 block_menuitem.connect('activate', self.on_block, iter, None)5186 block_menuitem.connect('activate', self.on_block, titer, None) 5187 5187 unblock_menuitem.hide() 5188 5188 else: … … 5206 5206 one_account_offline = False 5207 5207 is_blocked = True 5208 for iter in iters:5209 jid = model[ iter][C_JID].decode('utf-8')5210 account = model[ iter][C_ACCOUNT].decode('utf-8')5208 for titer in iters: 5209 jid = model[titer][C_JID].decode('utf-8') 5210 account = model[titer][C_ACCOUNT].decode('utf-8') 5211 5211 if gajim.connections[account].connected < 2: 5212 5212 one_account_offline = True … … 5297 5297 menu.popup(None, None, None, event_button, event.time) 5298 5298 5299 def make_transport_menu(self, event, iter):5299 def make_transport_menu(self, event, titer): 5300 5300 '''Make transport\'s popup menu''' 5301 5301 model = self.modelfilter 5302 jid = model[ iter][C_JID].decode('utf-8')5303 path = model.get_path( iter)5304 account = model[ iter][C_ACCOUNT].decode('utf-8')5302 jid = model[titer][C_JID].decode('utf-8') 5303 path = model.get_path(titer) 5304 account = model[titer][C_ACCOUNT].decode('utf-8') 5305 5305 contact = gajim.contacts.get_contact_with_highest_priority(account, jid) 5306 5306 menu = gtk.Menu() … … 5387 5387 item.set_image(img) 5388 5388 manage_transport_submenu.append(item) 5389 item.connect('activate', self.on_rename, iter, path)5389 item.connect('activate', self.on_rename, titer, path) 5390 5390 if gajim.account_is_disconnected(account): 5391 5391 item.set_sensitive(False) … … 5397 5397 if blocked: 5398 5398 item = gtk.ImageMenuItem(_('_Unblock')) 5399 item.connect('activate', self.on_unblock, iter, None)5399 item.connect('activate', self.on_unblock, titer, None) 5400 5400 else: 5401 5401 item = gtk.ImageMenuItem(_('_Block')) 5402 item.connect('activate', self.on_block, iter, None)5402 item.connect('activate', self.on_block, titer, None) 5403 5403 5404 5404 icon = gtk.image_new_from_stock(gtk.STOCK_STOP, gtk.ICON_SIZE_MENU) … … 5435 5435 menu.popup(None, None, None, event_button, event.time) 5436 5436 5437 def make_groupchat_menu(self, event, iter):5437 def make_groupchat_menu(self, event, titer): 5438 5438 model = self.modelfilter 5439 5439 5440 path = model.get_path( iter)5441 jid = model[ iter][C_JID].decode('utf-8')5442 account = model[ iter][C_ACCOUNT].decode('utf-8')5440 path = model.get_path(titer) 5441 jid = model[titer][C_JID].decode('utf-8') 5442 account = model[titer][C_ACCOUNT].decode
