# HG changeset patch # User Bartha Mihai # Date 1415373629 -3600 # Node ID 9a094a081c90fa3a28c35e0cc8ada9dc0a2e52cc # Parent d33edf5c27178abb558c9a84855fed06d591ffae added correction for Bug #32 diff -r d33edf5c2717 -r 9a094a081c90 OpenSecurity/bin/opensecurity_tray.pyw --- a/OpenSecurity/bin/opensecurity_tray.pyw Tue Oct 28 15:20:42 2014 +0100 +++ b/OpenSecurity/bin/opensecurity_tray.pyw Fri Nov 07 16:20:29 2014 +0100 @@ -218,20 +218,20 @@ self._icon_network = QtGui.QIcon() self._icon_network.addPixmap(QtGui.QPixmap(":/opensecurity/gfx/network-workgroup.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) - cleared = False + + self._menu_format.clear() + for m in machines: # do not insert Browsing VM if u'SecurityDVM0' in m: continue - - if not cleared: - self._menu_format.clear() - cleared = True - - a = self._menu_format.addAction(m + '\\\\' + machines[m]) - a.setIcon(self._icon_network) - a.triggered.connect(self.format_drive) + + properties = json.load(urllib2.urlopen('http://127.0.0.1:8080/sdvms/' + m)) + if 'USBAttachedUUID1' in properties and properties['USBAttachedUUID1'] != None: + a = self._menu_format.addAction(m + '\\\\' + machines[m]) + a.setIcon(self._icon_network) + a.triggered.connect(self.format_drive) except: pass