Fix bug slave information panel not refreshed when slave type changed
authorLaurent Bessard
Mon, 25 Jun 2012 12:12:51 +0200
changeset 2067 04cc0295e2c4
parent 2066 de4817ce8b50
child 2068 05a267b1a362
Fix bug slave information panel not refreshed when slave type changed
etherlab/ConfigEditor.py
etherlab/etherlab.py
--- a/etherlab/ConfigEditor.py	Tue Jun 19 20:28:05 2012 +0200
+++ b/etherlab/ConfigEditor.py	Mon Jun 25 12:12:51 2012 +0200
@@ -168,7 +168,10 @@
         
     def RefreshView(self):
         ConfTreeNodeEditor.RefreshView(self)
-        
+    
+        self.RefreshSlaveInfos()
+        
+    def RefreshSlaveInfos(self):
         slave_infos = self.Controler.GetSlaveInfos()
         if slave_infos is not None:
             self.Vendor.SetValue(slave_infos["vendor"])
--- a/etherlab/etherlab.py	Tue Jun 19 20:28:05 2012 +0200
+++ b/etherlab/etherlab.py	Mon Jun 25 12:12:51 2012 +0200
@@ -128,6 +128,8 @@
             self.CTNParent.SetSlaveType(position, value)
             slave_type = self.CTNParent.GetSlaveType(self.GetSlavePos())
             value = (slave_type["device_type"], slave_type)
+            if self._View is not None:
+                wx.CallAfter(self._View.RefreshSlaveInfos)
             return value, True
         elif path == "SlaveParams.Alias":
             self.CTNParent.SetSlaveAlias(position, value)