summaryrefslogtreecommitdiffstats
path: root/iw/partition_gui.py
diff options
context:
space:
mode:
authorJoel Granados Moreno <jgranado@redhat.com>2009-09-04 11:12:28 +0200
committerJoel Granados Moreno <jgranado@redhat.com>2009-10-01 16:57:17 +0200
commit1099ed1d10ad3cc12ab817943c27d3ca1cd9fabf (patch)
treec349a41bac08417bd190b91bb3d6b22b3c70a452 /iw/partition_gui.py
parente7bbd939f302378718accb91902940558a8e07ee (diff)
downloadanaconda-1099ed1d10ad3cc12ab817943c27d3ca1cd9fabf.tar.gz
anaconda-1099ed1d10ad3cc12ab817943c27d3ca1cd9fabf.tar.xz
anaconda-1099ed1d10ad3cc12ab817943c27d3ca1cd9fabf.zip
Display the device path with a smaller font and different color.
* iw/partition_gui.py (__init__): For the "Device" cell renderer, use 'markup' instead of just text. (populate): Use pango markup to chaqnge the size and color of the device paths for 'normal' devices and raid devices.
Diffstat (limited to 'iw/partition_gui.py')
-rw-r--r--iw/partition_gui.py30
1 files changed, 20 insertions, 10 deletions
diff --git a/iw/partition_gui.py b/iw/partition_gui.py
index 7c7a2a68c..d230a33c7 100644
--- a/iw/partition_gui.py
+++ b/iw/partition_gui.py
@@ -388,7 +388,7 @@ class DiskTreeModel(gtk.TreeStore):
elif (kind == gobject.TYPE_STRING or
kind == gobject.TYPE_INT):
renderer = gtk.CellRendererText()
- propertyMapping = {'text': i}
+ propertyMapping = {'markup': i}
# wire in the cells that we want only visible on leaf nodes to
# the special leaf node column.
@@ -772,11 +772,12 @@ class PartitionWindow(InstallWindow):
ptype = _("Unknown")
self.tree[iter]['IsFormattable'] = False
- if array.minor is not None:
- device = "%s" % array.path
- else:
- device = "Auto"
-
+ if array.minor is not None:
+ device = "%s <span size=\"small\" color=\"gray\">(%s)</span>" \
+ % (array.name, array.path)
+ else:
+ device = "Auto"
+
self.tree[iter]['IsLeaf'] = True
self.tree[iter]['Device'] = device
if array.format.exists and getattr(format, "label", None):
@@ -797,7 +798,16 @@ class PartitionWindow(InstallWindow):
# add a parent node to the tree
parent = self.tree.append(drvparent)
- self.tree[parent]['Device'] = "%s" % disk.path
+
+ # Insert a '\n' when device string is too long. Usually when it
+ # contains '/dev/mapper'. First column should be around 20 chars.
+ if len(disk.name) + len(disk.path) > 20:
+ separator = "\n"
+ else:
+ separator= " "
+ self.tree[parent]['Device'] = \
+ "%s%s<span size=\"small\" color=\"gray\">(%s)</span>" \
+ % (disk.name, separator, disk.path)
self.tree[parent]['PyObject'] = disk
part = disk.format.firstPartition
@@ -916,11 +926,11 @@ class PartitionWindow(InstallWindow):
else:
ptype = _("Unknown")
if part.type & parted.PARTITION_FREESPACE:
- devname = _("Free")
+ devstring = _("Free")
ptype = ""
else:
- devname = "%s" % device.path
- self.tree[iter]['Device'] = devname
+ devstring = device.name
+ self.tree[iter]['Device'] = devstring
if format and format.exists and \
getattr(format, "label", None):
self.tree[iter]['Label'] = "%s" % format.label