Re: [PATCH 26/30] Add Slice size to the bar view

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Looks fine.

On Wed, 16 Sep 2009, Joel Granados Moreno wrote:

---
iw/partition_gui.py |   15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/iw/partition_gui.py b/iw/partition_gui.py
index e55d986..a9547f2 100644
--- a/iw/partition_gui.py
+++ b/iw/partition_gui.py
@@ -344,12 +344,12 @@ class DiskStripeGraph(StripeGraph):
                continue

            if part.type == parted.PARTITION_LOGICAL:
-                partstr = part.path
+                partstr = "%s\n%s MB" % (part.path, part.getSize())
                stype = Slice.SUBSLICE
                unsel_col = self.part_type_colors["unsel_logical"]
                sel_col = self.part_type_colors["sel_logical"]
            elif part.type == parted.PARTITION_FREESPACE:
-                partstr = _("Free")
+                partstr = "%s\n%s MB" % (_("Free"), part.getSize())
                stype = Slice.SLICE
                unsel_col = self.part_type_colors["unsel_freespace"]
                sel_col = self.part_type_colors["sel_freespace"]
@@ -359,7 +359,7 @@ class DiskStripeGraph(StripeGraph):
                unsel_col = self.part_type_colors["unsel_extended"]
                sel_col = self.part_type_colors["sel_extended"]
            elif part.type == parted.PARTITION_NORMAL:
-                partstr = part.path
+                partstr = "%s\n%s MB" % (part.path, part.getSize())
                stype = Slice.SLICE
                unsel_col = self.part_type_colors["unsel_normal"]
                sel_col = self.part_type_colors["sel_normal"]
@@ -413,7 +413,7 @@ class LVMStripeGraph(StripeGraph):
        # put all the LVs next to each other and put the free space at the end.
        curr_offset = float(0)
        for lv in vg.lvs:
-            lvstr = lv.name
+            lvstr = "%s\n%s MB" % (lv.name, lv.size)
            stype = Slice.SLICE
            sel_col = self.part_type_colors["sel_lv"]
            unsel_col = self.part_type_colors["unsel_lv"]
@@ -434,7 +434,7 @@ class LVMStripeGraph(StripeGraph):

        # We add the free space if there is any space left.
        if curr_offset < 1:
-            freestr = _("Free")
+            #freestr = _("Free")
            stype = Slice.SLICE
            sel_col = self.part_type_colors["sel_freespace"]
            unsel_col = self.part_type_colors["unsel_freespace"]
@@ -442,6 +442,9 @@ class LVMStripeGraph(StripeGraph):
            xoffset = curr_offset
            xlength = float(1 - curr_offset)

+            # with the xlength we give an approximate size
+            freestr = "%s\n%s MB" % (_("Free"), vg.size*xlength)
+
            # We append no object.
            slice = Slice(stripe, freestr, stype, xoffset, xlength,
                    sel_col = sel_col, unsel_col = unsel_col)
@@ -465,7 +468,7 @@ class MDRaidArrayStripeGraph(StripeGraph):

        # Since we can't really create subslices with md devices we will only
        # show the md device size in the bar.
-        mdstr = md.path
+        mdstr = "%s\n%s MB" % (md.path, md.size)
        stype = Slice.SLICE
        sel_col = self.part_type_colors["sel_md"]
        unsel_col = self.part_type_colors["unsel_md"]


- -- David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkq9WZMACgkQ5hsjjIy1VklPZwCdF/mBaJ0l2at6Qju8X8mABUwM
3KkAmwbotx1XH90FJQeYwjKyL+Cj6ti7
=n7qi
-----END PGP SIGNATURE-----

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux