FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 05-11-2012, 02:48 PM
Martin Sivak
 
Default Prevent the status line from getting too long for any one spoke.

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@redhat.com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list
>

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 05-11-2012, 03:08 PM
Chris Lumens
 
Default Prevent the status line from getting too long for any one spoke.

> 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. */

It makes the text a little long for URLs, but that can probably be
solved by setting the label width correctly. Otherwise, this works
really well. Go ahead and push it.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 05-11-2012, 04:08 PM
 
Default Prevent the status line from getting too long for any one spoke.

> It makes the text a little long for URLs, but that can probably be
> solved by setting the label width correctly. Otherwise, this works
> really well. Go ahead and push it.

Nevermind, I went ahead and pushed this plus another little piece to
finish it up.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 10:24 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org