added correction for Bug #32
authorBartha Mihai <mihai.bartha@ait.ac.at>
Fri, 07 Nov 2014 16:20:29 +0100
changeset 2449a094a081c90
parent 238 d33edf5c2717
child 246 49efb610d200
added correction for Bug #32
OpenSecurity/bin/opensecurity_tray.pyw
     1.1 --- a/OpenSecurity/bin/opensecurity_tray.pyw	Tue Oct 28 15:20:42 2014 +0100
     1.2 +++ b/OpenSecurity/bin/opensecurity_tray.pyw	Fri Nov 07 16:20:29 2014 +0100
     1.3 @@ -218,20 +218,20 @@
     1.4              self._icon_network = QtGui.QIcon()
     1.5              self._icon_network.addPixmap(QtGui.QPixmap(":/opensecurity/gfx/network-workgroup.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
     1.6  
     1.7 -            cleared = False
     1.8 +            
     1.9 +            self._menu_format.clear()
    1.10 +                                
    1.11              for m in machines:
    1.12  
    1.13                  # do not insert Browsing VM
    1.14                  if u'SecurityDVM0' in m:
    1.15                      continue
    1.16 -
    1.17 -                if not cleared:
    1.18 -                    self._menu_format.clear()
    1.19 -                    cleared = True
    1.20 -
    1.21 -                a = self._menu_format.addAction(m + '\\\\' + machines[m])
    1.22 -                a.setIcon(self._icon_network)
    1.23 -                a.triggered.connect(self.format_drive)
    1.24 +                
    1.25 +                properties = json.load(urllib2.urlopen('http://127.0.0.1:8080/sdvms/' + m))
    1.26 +                if 'USBAttachedUUID1' in properties and properties['USBAttachedUUID1'] != None: 
    1.27 +                    a = self._menu_format.addAction(m + '\\\\' + machines[m])
    1.28 +                    a.setIcon(self._icon_network)
    1.29 +                    a.triggered.connect(self.format_drive)
    1.30  
    1.31          except:
    1.32              pass