On Fri, 2015-07-03 at 14:32 +0200, Vratislav Podzimek wrote:
On Fri, 2015-07-03 at 13:38 +0200, Martin Kolman wrote:
> Otherwise it is not readily apparent that the user needs to press
> 1 to enter the single visible spoke.
>
> This is currently most relevant for Initial Setup which shows only
> the EULA spoke if user has already been created during the
> installation.
>
> Resolves: rhbz#1199234
> Signed-off-by: Martin Kolman <mkolman(a)redhat.com>
> ---
> pyanaconda/ui/tui/hubs/__init__.py | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/pyanaconda/ui/tui/hubs/__init__.py
> b/pyanaconda/ui/tui/hubs/__init__.py
> index e89bf71..525b68e 100644
> --- a/pyanaconda/ui/tui/hubs/__init__.py
> +++ b/pyanaconda/ui/tui/hubs/__init__.py
> @@ -114,3 +114,22 @@ class TUIHub(TUIObject, common.Hub):
> print(_("Please complete all spokes before
> continuing"))
> return False
> return key
> +
> + def prompt(self, args=None):
> + """Show an alternative prompt if the hub contains only one
> spoke.
> + Otherwise it is not readily apparent that the user needs
> to press
> + 1 to enter the single visible spoke.
> +
> + :param args: optional argument passed from switch_screen
> calls
> + :type args: anything
> +
> + :return: returns text to be shown next to the prompt for
> input or None
> + to skip further input processing
> + :rtype: str|None
> + """
> + if self._spoke_count == 1:
> + single_spoke_title = self._spokes.values()[0].title
> + return _(u" Please make your choice from [ '1' to
> enter the %s spoke | 'q' to quit |\n"
> + " 'c' to continue | 'r' to refresh]:
" %
> single_spoke_title)
The translation needs to happen before the pattern replacement.
Gah! Of course,
fixing locally. :)
Looks good to me otherwise.
BTW, forgot to mention:
Thanks to Jiří for helping me figure out where the change should
actually go in the TUI jungle! :)