[master/rhel7-branch] Fix the way zFCP devices are displayed in storage spoke. (#1024902)

Martin Kolman mkolman at redhat.com
Thu Sep 18 14:22:43 UTC 2014


On Thu, 2014-09-18 at 09:47 -0400, Samantha N. Bueno wrote:
> This basically makes this hideous display:
> https://sbueno.fedorapeople.org/1024902-orig.png
> 
> Look less hideous:
> https://sbueno.fedorapeople.org/1024902-centered.jpg
> 
> More broadly, disk descriptions are now center-aligned (I believe
> the prior/default alignment was justified).
> 
> Resolves: rhbz#1024902
> ---
>  pyanaconda/ui/gui/spokes/storage.py | 6 +++++-
>  widgets/src/DiskOverview.c          | 1 +
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
> index d597173..7365f28 100644
> --- a/pyanaconda/ui/gui/spokes/storage.py
> +++ b/pyanaconda/ui/gui/spokes/storage.py
> @@ -57,7 +57,7 @@ from pyanaconda.ui.gui.utils import enlightbox, gtk_call_once, gtk_action_wait,
>  from pyanaconda.kickstart import doKickstartStorage, getAvailableDiskSpace
>  from blivet import storageInitialize, arch
>  from blivet.size import Size
> -from blivet.devices import MultipathDevice
> +from blivet.devices import MultipathDevice, ZFCPDiskDevice
>  from blivet.errors import StorageError, DasdFormatError
>  from blivet.errors import SanityError
>  from blivet.errors import SanityWarning
> @@ -603,6 +603,10 @@ class StorageSpoke(NormalSpoke, StorageChecker):
>          if isinstance(disk, MultipathDevice):
>              desc = disk.wwid.split(":")
>              description = ":".join(desc[0:3]) + "..." + ":".join(desc[-4:])
> +        elif isinstance(disk, ZFCPDiskDevice):
> +            # manually mangle the desc of a zFCP device to be multi-line since
> +            # it's so long it makes the disk selection screen look odd
> +            description = _("FCP device %s\nWWPN %s\nLUN %s" % (disk.hba_id, disk.wwpn, disk.fcp_lun))
>          else:
>              description = disk.description
>  
> diff --git a/widgets/src/DiskOverview.c b/widgets/src/DiskOverview.c
> index ebb47e8..908a378 100644
> --- a/widgets/src/DiskOverview.c
> +++ b/widgets/src/DiskOverview.c
> @@ -395,6 +395,7 @@ static void anaconda_disk_overview_set_property(GObject *object, guint prop_id,
>              char *markup = g_markup_printf_escaped("<span weight='bold' size='large'>%s</span>", g_value_get_string(value));
>              gtk_label_set_markup(GTK_LABEL(priv->description_label), markup);
>              g_free(markup);
> +            gtk_label_set_justify(GTK_LABEL(priv->description_label), GTK_JUSTIFY_CENTER);
>              break;
>          }
>  
It indeed looks much nicer this way - good job! :)



More information about the anaconda-patches mailing list