@@ -569,8 +568,12 @@ class NetworkControlBox(object):
return None
def _device_is_stored(self, nm_device):
- """TODO check that device with Udi of nm_device is already in
- liststore"""
+ """Check that device with Udi of nm_device is already in
liststore"""
+ udi = nm_device.get_udi()
+ model = self.builder.get_object("liststore_devices")
+ for row in model:
+ if (udi == row[DEVICES_COLUMN_OBJECT].get_udi()):
+ return True
return False
You don't need the extra parens here. Picky, but I don't like having
them if they're not necessary.
- Chris