limit the list of saved address to 10

This commit is contained in:
Yann Leboulanger 2005-03-27 09:19:06 +00:00
parent 2440f0145f
commit aa17bb46f4
1 changed files with 4 additions and 0 deletions

View File

@ -1629,6 +1629,8 @@ class Service_discovery_window:
if jid in self.latest_addresses:
self.latest_addresses.remove(jid)
self.latest_addresses.insert(0, jid)
if len(self.latest_addresses) > 10:
self.latest_addresses = self.latest_addresses[0:10]
self.address_comboboxentry.get_model().clear()
for j in self.latest_addresses:
self.address_comboboxentry.append_text(j)
@ -1669,6 +1671,8 @@ class Service_discovery_window:
if jid in self.latest_addresses:
self.latest_addresses.remove(jid)
self.latest_addresses.insert(0, jid)
if len(self.latest_addresses) > 10:
self.latest_addresses = self.latest_addresses[0:10]
for j in self.latest_addresses:
self.address_comboboxentry.append_text(j)
self.address_comboboxentry.child.set_text(jid)