--- a/discovery.py Tue Jun 09 10:10:34 2009 +0200
+++ b/discovery.py Mon Jul 06 11:27:06 2009 -0600
@@ -23,7 +23,7 @@
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import wx.lib.mixins.listctrl as listmix
@@ -77,11 +77,11 @@
btsizer.AddGrowableCol(3)
b = wx.Button(self, wx.ID_CANCEL, "Cancel")
- #self.Bind(wx.EVT_BUTTON, self.OnClose, b)
+ self.Bind(wx.EVT_BUTTON, self.OnCancel, b) b = wx.Button(self, wx.ID_OK, "OK")
- #self.Bind(wx.EVT_BUTTON, self.OnConnect, b)
+ self.Bind(wx.EVT_BUTTON, self.OnOk, b) @@ -94,6 +94,8 @@
self.zConfInstance = Zeroconf()
+ self.Bind(wx.EVT_CLOSE, self.OnClose) type = "_PYRO._tcp.local."
self.browser = ServiceBrowser(self.zConfInstance, type, self)
@@ -103,6 +105,18 @@
+ def OnClose(self, event): + self.zConfInstance.close() + def OnCancel(self, event): + self.zConfInstance.close() + self.zConfInstance.close() # Used by the ColumnSorterMixin, see wx/lib/mixins/listctrl.py
@@ -143,11 +157,11 @@
- def removeService(self, zeroconf, type, name):
+ def removeService(self, zeroconf, type, name):
def addService(self, zeroconf, type, name):
- info = self.zConfInstance.getServiceInfo(type, name)
+ info = self.zConfInstance.getServiceInfo(type, name) typename = type.split(".")[0][1:]
num_items = self.list.GetItemCount()
self.list.InsertStringItem(num_items, name.split(".")[0])