# HG changeset patch # User Bartha Mihai # Date 1415373850 -3600 # Node ID 727367d7f395d79f316b59b378b42d3f7705b431 # Parent 5e4303a2a3bed6ff1b6cc86c48d76fc1639ca9e2 fix for Bug #33 diff -r 5e4303a2a3be -r 727367d7f395 OpenSecurity/bin/opensecurity_tray.pyw --- a/OpenSecurity/bin/opensecurity_tray.pyw Mon Nov 03 19:13:54 2014 +0100 +++ b/OpenSecurity/bin/opensecurity_tray.pyw Fri Nov 07 16:24:10 2014 +0100 @@ -227,20 +227,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 + + 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) - 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) except: pass