summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2013-02-27 14:53:24 -0500
committerChris Lumens <clumens@redhat.com>2013-02-28 08:46:58 -0500
commit16e7cd0cacbeeecb50b4e52b32325c0786ae2d7d (patch)
tree186a81b60190eb045b1298a7c8ac198db1e3ebb2
parentbca75af555a3bf61ce3273dff94a6b7c291b760e (diff)
downloadanaconda-16e7cd0cacbeeecb50b4e52b32325c0786ae2d7d.tar.gz
anaconda-16e7cd0cacbeeecb50b4e52b32325c0786ae2d7d.tar.xz
anaconda-16e7cd0cacbeeecb50b4e52b32325c0786ae2d7d.zip
Add a free space line under every disk in the reclaim dialog.
This is to help communicate how much total free space there is, in the case where you've got enough but choose to go into the reclaim dialog to do some other things anyway.
-rw-r--r--pyanaconda/ui/gui/spokes/lib/resize.glade2
-rw-r--r--pyanaconda/ui/gui/spokes/lib/resize.py16
2 files changed, 17 insertions, 1 deletions
diff --git a/pyanaconda/ui/gui/spokes/lib/resize.glade b/pyanaconda/ui/gui/spokes/lib/resize.glade
index 11eefcb23..3ccb00ecc 100644
--- a/pyanaconda/ui/gui/spokes/lib/resize.glade
+++ b/pyanaconda/ui/gui/spokes/lib/resize.glade
@@ -141,7 +141,7 @@
<child>
<object class="GtkCellRendererText" id="diskRenderer"/>
<attributes>
- <attribute name="text">1</attribute>
+ <attribute name="markup">1</attribute>
</attributes>
</child>
</object>
diff --git a/pyanaconda/ui/gui/spokes/lib/resize.py b/pyanaconda/ui/gui/spokes/lib/resize.py
index 1f1d990f9..4bb25cf51 100644
--- a/pyanaconda/ui/gui/spokes/lib/resize.py
+++ b/pyanaconda/ui/gui/spokes/lib/resize.py
@@ -118,6 +118,8 @@ class ResizeDialog(GUIObject):
canShrinkSomething = False
+ free_space = self.storage.getFreeSpace(disks=disks)
+
for disk in disks:
# First add the disk itself.
editable = not disk.protected
@@ -165,6 +167,20 @@ class ResizeDialog(GUIObject):
dev.size])
diskReclaimableSpace += freeSize
+ # And then add another uneditable line that lists how much space is
+ # already free in the disk.
+ diskFree = free_space[disk.name][0]
+ converted = diskFree.convertTo(spec="mb")
+ if int(converted):
+ self._diskStore.append(itr, [disk.id,
+ _("""<span foreground='grey' style='italic'>Free space</span>"""),
+ "",
+ "<span foreground='grey' style='italic'>%s</span>" % size_str(diskFree),
+ _(PRESERVE),
+ False,
+ self._get_tooltip(disk),
+ float(converted)])
+
# And then go back and fill in the total reclaimable space for the
# disk, now that we know what each partition has reclaimable.
self._diskStore[itr][RECLAIMABLE_COL] = self._diskStore[itr][RECLAIMABLE_COL] % size_str(diskReclaimableSpace)