[master/f20-branch] Fix spoke sorting issues in text-mode. (#929177)
Vratislav Podzimek
vpodzime at redhat.com
Fri Nov 1 17:08:56 UTC 2013
On Fri, 2013-11-01 at 12:57 -0400, Samantha N. Bueno wrote:
> On Fri, Nov 01, 2013 at 05:43:02PM +0100, Vratislav Podzimek wrote:
> > On Fri, 2013-11-01 at 12:35 -0400, Samantha N. Bueno wrote:
> > > It's not imperative, but I think it would be nice to see this in rhel7-branch
> > > as well, so I can clone the Fedora bug and would also cherry-pick a0e6d0a4 as
> > > Related, to consolidate the spoke categories. Thoughts?
> > >
> > > ====
> > >
> > > Change titles in some spokes to mirror what is shown in the GUI.
> > > Also change the method of sorting the spokes in text-mode to now
> > > sort based on spoke title--also mirroring behavior from the GUI.
> > > ---
> > > pyanaconda/ui/tui/hubs/__init__.py | 2 +-
> > > pyanaconda/ui/tui/hubs/summary.py | 2 +-
> > > pyanaconda/ui/tui/spokes/network.py | 2 +-
> > > pyanaconda/ui/tui/spokes/password.py | 4 ++--
> > > pyanaconda/ui/tui/spokes/storage.py | 2 +-
> > > pyanaconda/ui/tui/spokes/user.py | 4 ++--
> > > 6 files changed, 8 insertions(+), 8 deletions(-)
> > >
> > > diff --git a/pyanaconda/ui/tui/hubs/__init__.py b/pyanaconda/ui/tui/hubs/__init__.py
> > > index 59a7f2c..7055434 100644
> > > --- a/pyanaconda/ui/tui/hubs/__init__.py
> > > +++ b/pyanaconda/ui/tui/hubs/__init__.py
> > > @@ -55,7 +55,7 @@ class TUIHub(TUIObject, common.Hub):
> > > spokes = collect_spokes(self.paths["spokes"], c)
> > >
> > > # sort them according to their priority
> > > - for s in sorted(spokes, key = lambda s: s.priority):
> > > + for s in sorted(spokes, key = lambda s: s.title):
> > > # Check if this spoke is to be shown in anaconda
> > > if not s.should_run(environment, self.data):
> > > continue
> > > diff --git a/pyanaconda/ui/tui/hubs/summary.py b/pyanaconda/ui/tui/hubs/summary.py
> > > index 1318c3c..6265608 100644
> > > --- a/pyanaconda/ui/tui/hubs/summary.py
> > > +++ b/pyanaconda/ui/tui/hubs/summary.py
> > > @@ -29,7 +29,7 @@ import time
> > > class SummaryHub(TUIHub):
> > > title = _("Installation")
> > > ## FIXME: this should be pulling data from somewhere, not just a static list
> > > - categories = ["localization", "password", "software", "system"]
> > > + categories = ["localization", "software", "system", "user"]
> > >
> > > def setup(self, environment="anaconda"):
> > > should_schedule = TUIHub.setup(self, environment=environment)
> > > diff --git a/pyanaconda/ui/tui/spokes/network.py b/pyanaconda/ui/tui/spokes/network.py
> > > index f4b99dc..d9422b1 100644
> > > --- a/pyanaconda/ui/tui/spokes/network.py
> > > +++ b/pyanaconda/ui/tui/spokes/network.py
> > > @@ -39,7 +39,7 @@ __all__ = ["NetworkSpoke"]
> > >
> > > class NetworkSpoke(EditTUISpoke):
> > > """ Spoke used to configure network settings. """
> > > - title = _("Network settings")
> > > + title = _("Network configuration")
> > > category = "system"
> > >
> > > def __init__(self, app, data, storage, payload, instclass):
> > > diff --git a/pyanaconda/ui/tui/spokes/password.py b/pyanaconda/ui/tui/spokes/password.py
> > > index 89bc7a7..97fa5ed 100644
> > > --- a/pyanaconda/ui/tui/spokes/password.py
> > > +++ b/pyanaconda/ui/tui/spokes/password.py
> > > @@ -26,8 +26,8 @@ from pyanaconda.ui.tui.simpleline import TextWidget
> > > from pyanaconda.i18n import _
> > >
> > > class PasswordSpoke(FirstbootSpokeMixIn, EditTUIDialog):
> > > - title = _("Set root password")
> > > - category = "password"
> > > + title = _("Root password")
> > > + category = "user"
> > >
> > > def __init__(self, app, data, storage, payload, instclass):
> > > EditTUIDialog.__init__(self, app, data, storage, payload, instclass)
> > > diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py
> > > index 96b467d..adb1a9e 100644
> > > --- a/pyanaconda/ui/tui/spokes/storage.py
> > > +++ b/pyanaconda/ui/tui/spokes/storage.py
> > > @@ -59,7 +59,7 @@ class StorageSpoke(NormalTUISpoke):
> > > Storage spoke where users proceed to customize storage features such
> > > as disk selection, partitioning, and fs type.
> > > """
> > > - title = _("Install Destination")
> > > + title = _("Installation Destination")
> > > category = "system"
> > >
> > > def __init__(self, app, data, storage, payload, instclass):
> > > diff --git a/pyanaconda/ui/tui/spokes/user.py b/pyanaconda/ui/tui/spokes/user.py
> > > index c2ff4dd..31bf17e 100644
> > > --- a/pyanaconda/ui/tui/spokes/user.py
> > > +++ b/pyanaconda/ui/tui/spokes/user.py
> > > @@ -31,8 +31,8 @@ from pyanaconda.regexes import GECOS_VALID, USERNAME_VALID, GROUPLIST_SIMPLE_VAL
> > > __all__ = ["UserSpoke"]
> > >
> > > class UserSpoke(FirstbootSpokeMixIn, EditTUISpoke):
> > > - title = _("Create user")
> > > - category = "password"
> > > + title = _("User creation")
> > > + category = "user"
> > >
> > > edit_fields = [
> > > Entry("Create user", "_create", EditTUISpoke.CHECK, True),
> > This looks good to me. Could we get rid of the 'priority' property of
> > the spokes entirely?
>
> From NormalSpoke in pyanaconda.ui.common, yes I think so, I'll go ahead
> and make the change locally. Priority is also set in StandaloneSpoke in
> pyanaconda.ui.common, but it is used in four places--that one should
> probably be left in.
Sounds good.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list