Re: [PATCH 17/30] Display the device path with a smaller font and different color.

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

 



On Fri, Sep 25, 2009 at 01:34:29PM -1000, David Cantrell wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> So long as color is not the only indicator, I'm ok with this patch.
>
> http://www.stcsig.org/usability/newsletter/9910-color-blindness.html

its also smaller, so the color blind are also aware of the difference.
:)

>
> On Wed, 16 Sep 2009, Joel Granados Moreno wrote:
>
>> * 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.
>> ---
>> iw/partition_gui.py |   30 ++++++++++++++++++++----------
>> 1 files changed, 20 insertions(+), 10 deletions(-)
>>
>> diff --git a/iw/partition_gui.py b/iw/partition_gui.py
>> index 1d70ba5..f718f7a 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,10 +926,10 @@ class PartitionWindow(InstallWindow):
>>                     else:
>>                         ptype = _("Unknown")
>>                 if part.type & parted.PARTITION_FREESPACE:
>> -                    devname = _("Free")
>> +                    devstring = _("Free")
>>                 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
>>
>
> - -- David Cantrell <dcantrell@xxxxxxxxxx>
> Red Hat / Honolulu, HI
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkq9U4UACgkQ5hsjjIy1Vkl8MQCgkdLZp9tXjp6TG1MeQYFTY2Ld
> tDsAmgK3Lmh6koOqupvuyZ+yHjK6mmin
> =dlrg
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

-- 
Joel Andres Granados
Brno, Czech Republic, Red Hat.

Attachment: pgprNpYDx5m8p.pgp
Description: 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