def refresh(self, subject=None, newvol=None): allvols = self.watchdrives.get_volumes() get_relevant = db.get_volumes(allvols) # decide if we should show or not for c in self.box.get_children(): c.destroy() if get_relevant: self.box.add(self.icon) else: self.box.add(self.idle_icon) self.box.show_all()
def refresh(self, subject=None, newvol=None): # empty grid for c in self.maingrid.get_children(): c.destroy() # lookup usb drives allvols = self.watchdrives.get_volumes() get_relevant = db.get_volumes(allvols) # decide if we should show or not for c in self.box.get_children(): c.destroy() if get_relevant: self.box.add(self.icon) self.fill_grid(get_relevant, newvol) else: self.box.add(self.idle_icon) self.box.show_all()