i = 0
for key, connection in vpn.connections.items():
- if self.list.ItemCount <= i:
+ if self.list.GetItemCount() <= i:
self.list.InsertStringItem(i, connection.name)
else:
self.list.SetStringItem(i, 0, connection.name)
self.list.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.OnContext)
i += 1
- while self.list.ItemCount > i:
- self.list.DeleteItem(self.list.ItemCount - 1)
+ while self.list.GetItemCount() > i:
+ self.list.DeleteItem(self.list.GetItemCount() - 1)
class NodesPage(wx.Panel):
i = 0
for key, node in vpn.nodes.items():
- if self.list.ItemCount <= i:
+ if self.list.GetItemCount() <= i:
self.list.InsertStringItem(i, node.name)
else:
self.list.SetStringItem(i, 0, node.name)
self.list.SetItemData(i, i)
i += 1
- while self.list.ItemCount > i:
- self.list.DeleteItem(self.list.ItemCount - 1)
+ while self.list.GetItemCount() > i:
+ self.list.DeleteItem(self.list.GetItemCount() - 1)
class EdgesPage(wx.Panel):
def __init__(self, parent, id):
i = 0
for key, edge in vpn.edges.items():
- if self.list.ItemCount <= i:
+ if self.list.GetItemCount() <= i:
self.list.InsertStringItem(i, edge.fr)
else:
self.list.SetStringItem(i, 0, edge.fr)
self.list.itemDataMap[i] = (edge.fr, edge.to, edge.address, edge.port, edge.options, edge.weight)
i += 1
- while self.list.ItemCount > i:
- self.list.DeleteItem(self.list.ItemCount - 1)
+ while self.list.GetItemCount() > i:
+ self.list.DeleteItem(self.list.GetItemCount() - 1)
class SubnetsPage(wx.Panel):
def __init__(self, parent, id):
i = 0
for key, subnet in vpn.subnets.items():
- if self.list.ItemCount <= i:
+ if self.list.GetItemCount() <= i:
self.list.InsertStringItem(i, subnet.address + '/' + subnet.prefixlen)
else:
self.list.SetStringItem(i, 0, subnet.address + '/' + subnet.prefixlen)
self.list.itemDataMap[i] = (subnet.address + '/' + subnet.prefixlen, subnet.weight, subnet.owner)
i = i + 1
- while self.list.ItemCount > i:
- self.list.DeleteItem(self.list.ItemCount - 1)
+ while self.list.GetItemCount() > i:
+ self.list.DeleteItem(self.list.GetItemCount() - 1)
class StatusPage(wx.Panel):
def __init__(self, parent, id):