diff --git a/src/chat.py b/src/chat.py index ccc5e91ee..c2191302c 100644 --- a/src/chat.py +++ b/src/chat.py @@ -62,7 +62,6 @@ class Chat: self.names = {} # what is printed in the tab (eg. user.name) self.childs = {} # holds the contents for every tab (VBox) self.popup_is_shown = False # is a context menu shown or not? - self.how_many_switch_to = 0 # how many switch to menuitems we have added # the following vars are used to keep history of user's messages self.sent_history = {} @@ -232,8 +231,13 @@ class Chat: else: childs[5].hide() childs[5].set_no_show_all(True) + + start_removing_from = 6 # this is from the seperator and after + + else: + start_removing_from = 7 # # this is from the seperator and after - for child in childs[6:]: # start looping after Add to roster + for child in childs[start_removing_from:]: menu.remove(child) return menu @@ -279,7 +283,6 @@ class Chat: item.connect('activate', lambda obj, jid:self.set_active_tab( jid), jid) menu.append(item) - self.how_many_switch_to += 1 # show the menu menu.popup(None, None, None, event.button, event.time)