Re: [PATCH newui] Prevent the status line from getting too long for any one spoke.

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

 



I do not have the environment to build it at hand (I have to reinstall it first), but I think this might be nicer:

diff --git a/widgets/src/SpokeSelector.c b/widgets/src/SpokeSelector.c
index e90bc0d..9be3d59 100644
--- a/widgets/src/SpokeSelector.c
+++ b/widgets/src/SpokeSelector.c
@@ -185,6 +185,7 @@ static void anaconda_spoke_selector_init(AnacondaSpokeSelector *spoke) {
     markup = g_markup_printf_escaped("<span style='italic' size='large'>%s</span>", _(DEFAULT_STATUS));
     gtk_label_set_markup(GTK_LABEL(spoke->priv->status_label), markup);
     gtk_misc_set_alignment(GTK_MISC(spoke->priv->status_label), 0, 0);
+    gtk_label_set_ellipsize(GTK_LABEL(spoke->priv->status_label), PANGO_ELLIPSIZE_MIDDLE);
     g_free(markup);
 
     /* Add everything to the grid, add the grid to the widget. */

Martin


----- Original Message -----
> Note that this does not change the text of the status property
> itself, so
> it can still be used for string comparisons.  There are certain
> keyboard
> layout names that are the pathological case.
> ---
>  pyanaconda/ui/gui/hubs/__init__.py |    6 +++++-
>  pyanaconda/ui/gui/spokes/source.py |    5 +----
>  2 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/pyanaconda/ui/gui/hubs/__init__.py
> b/pyanaconda/ui/gui/hubs/__init__.py
> index 498f6dc..e73f8af 100644
> --- a/pyanaconda/ui/gui/hubs/__init__.py
> +++ b/pyanaconda/ui/gui/hubs/__init__.py
> @@ -182,8 +182,12 @@ class Hub(UIObject):
>          setViewportBackground(viewport)
>  
>      def _updateCompleteness(self, spoke):
> +        status = spoke.status
> +        if len(status) > 42:
> +            status = status[:30] + "..." + status[-12:]
> +
>          spoke.selector.set_sensitive(spoke.ready)
> -        spoke.selector.set_property("status", spoke.status)
> +        spoke.selector.set_property("status", status)
>          spoke.selector.set_incomplete(not spoke.completed)
>          self._handleCompleteness(spoke)
>  
> diff --git a/pyanaconda/ui/gui/spokes/source.py
> b/pyanaconda/ui/gui/spokes/source.py
> index 2dd9cc1..f607cdc 100644
> --- a/pyanaconda/ui/gui/spokes/source.py
> +++ b/pyanaconda/ui/gui/spokes/source.py
> @@ -344,10 +344,7 @@ class SourceSpoke(NormalSpoke):
>      @property
>      def status(self):
>          if self.data.method.method == "url":
> -            if len(self.data.method.url) > 42:
> -                return self.data.method.url[:30] + "..." +
> self.data.method.url[-12:]
> -            else:
> -                return self.data.method.url
> +            return self.data.method.url
>          elif self.data.method.method == "nfs":
>              return _("NFS server %s") % self.data.method.server
>          elif self.data.method.method == "cdrom":
> --
> 1.7.8.4
> 
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list
> 

_______________________________________________
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