[master/rhel7-branch] Make it obvious user is going to begin installation. (#975793)

Vratislav Podzimek vpodzime at redhat.com
Tue Mar 11 07:40:29 UTC 2014


On Mon, 2014-03-10 at 20:59 -0400, Samantha N. Bueno wrote:
> [This fixes a patch for this bug that I had to revert a little while
> ago.]
> 
> This leaves the global default prompt alone and instead tweaks the
> TUI summary hub prompt to include a "'b' to begin installation"
> option instead of "'c' to continue" so that it's clear the user
> will kick off the installation process.
> 
> Resolves: rhbz#975793
> ---
>  pyanaconda/ui/tui/hubs/__init__.py | 11 ++++++++++-
>  pyanaconda/ui/tui/hubs/summary.py  |  5 ++++-
>  2 files changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/pyanaconda/ui/tui/hubs/__init__.py b/pyanaconda/ui/tui/hubs/__init__.py
> index bb28b23..905de25 100644
> --- a/pyanaconda/ui/tui/hubs/__init__.py
> +++ b/pyanaconda/ui/tui/hubs/__init__.py
> @@ -105,9 +105,18 @@ class TUIHub(TUIObject, common.Hub):
>          except (ValueError, KeyError):
>              # If we get a continue, check for unfinished spokes.  If unfinished
>              # don't continue
> -            if key == _('c'):
> +            # TRANSLATORS: 'b' to begin installation
> +            if key == _('b'):
>                  for spoke in self._spokes.values():
>                      if not spoke.completed and spoke.mandatory:
>                          print(_("Please complete all spokes before continuing"))
>                          return False
> +                if self.app._screens:
> +                    self.app.close_screen()
> +                    return True
> +            # Kind of a hack, but we want to ignore if anyone presses 'c'
> +            # which is the global TUI key to close the current screen
> +            elif key == _('c'):
> +                return False
> +
>              return key
> diff --git a/pyanaconda/ui/tui/hubs/summary.py b/pyanaconda/ui/tui/hubs/summary.py
> index 0080031..4074997 100644
> --- a/pyanaconda/ui/tui/hubs/summary.py
> +++ b/pyanaconda/ui/tui/hubs/summary.py
> @@ -73,4 +73,7 @@ class SummaryHub(TUIHub):
>          # does not automatically proceed once all spokes are complete, and a
>          # user must confirm they want to begin installation
>          flags.automatedInstall = False
> -        return TUIHub.prompt(self, args)
> +
> +        # override the default prompt since we want to offer the 'b' to begin
> +        # installation option here
> +        return _("  Please make your choice from above ['q' to quit | 'b' to begin installation |\n  'r' to refresh]: ")
Looks good to me.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list