cCB -- call back function used when the user clicks on a slice. This function
is passed a device object when its executed.
dcCB -- call back function used when the user double clicks on a slice.
- md -- RAID device to display.
+ md -- md device to display.
"""
- def __init__(self, storage, md=None, cCB=lambda x:None, dcCB=lambda:None):
+ def __init__(self, storage, device=None, cCB=lambda x:None, dcCB=lambda:None):
StripeGraph.__init__(self)
self.storage = storage
self.cCB = cCB
self.dcCB = dcCB
self.part_type_colors =
{"sel_md": "cornsilk1", "unsel_md": "white"}
- if md:
- self.setDisplayed(md)
+ if device:
+ self.setDisplayed(device)
+
+ def _get_text(self, md):
+ return (_("%(desc)s %(mdPath)s (%(mdSize)-0.f MB)")
+ % {"mdPath": md.path, "mdSize": md.size, "desc": self.desc})
+ # XXX can this move up one level?
+ if isinstance(device, BTRFSVolumeDevice):
+ # list subvolumes as children of the main volume
+ for s in device.subvolumes:
+ log.debug("%r" % s.format)
+ isleaf = False
+ if s.format.exists:
+ sub_format_icon = None
+ else:
+ sub_format_icon = self.checkmark_pixbuf
+ subvol_iter = self.tree.append(treeiter)
+ self.tree[subvol_iter]['Device'] = s.name
+ self.tree[subvol_iter]['PyObject'] = s
+ self.tree[subvol_iter]['IsFormattable'] = True
+ self.tree[subvol_iter]['Format'] = sub_format_icon
+ self.tree[subvol_iter]['Mount Point'] = s.format.mountpoint
+ self.tree[subvol_iter]['Type'] = s.type
+ self.tree[subvol_iter]['IsLeaf'] = True
+
+
def populate(self, initial = 0):
self.tree.resetSelection()
@@ -985,6 +1027,15 @@ class PartitionWindow(InstallWindow):
(array.name, array.path)
self.tree[iter]['Device'] = name
+ # BTRFS volumes
+ btrfs_devs = self.storage.btrfsVolumes
+ if btrfs_devs:
+ btrfsparent = self.tree.append(None)
+ self.tree[btrfsparent]['Device'] = _("BTRFS Volumes")
+ for dev in btrfs_devs:
+ iter = self.tree.append(btrfsparent)
+ self.addDevice(dev, iter)
+
# now normal partitions
disks = self.storage.partitioned
# also include unpartitioned disks that aren't mpath or biosraid
@@ -1262,13 +1313,26 @@ class PartitionWindow(InstallWindow):
if not isinstance(self.stripeGraph, MDRaidArrayStripeGraph):
self.stripeGraph.shutDown()
self.stripeGraph = MDRaidArrayStripeGraph(self.storage,
- md = device,
+ device = device,
cCB = self.tree.selectRowFromObj,
dcCB = self.barviewActivateCB)
self.stripeGraph.setDisplayed(device)
self.deleteButton.set_sensitive(True)
self.editButton.set_sensitive(True)
+ elif isinstance(device, storage.BTRFSDevice):
+ # BTRFSDevice can be edited but not explicitly deleted. It is
+ # deleted when its last member device is removed.
+ if not isinstance(self.stripeGraph, BTRFSStripeGraph):
+ self.stripeGraph.shutDown()
+ self.stripeGraph = BTRFSStripeGraph(self.storage,
+ device = device,
+ cCB = self.tree.selectRowFromObj,
+ dcCB = self.barviewActivateCB)
+ self.stripeGraph.setDisplayed(device)
+ self.deleteButton.set_sensitive(False)
+ self.editButton.set_sensitive(True)
+
else:
# This means that the user selected something that is not showable
# in the bar view. Just show the information message.
--
1.7.3.4
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list