Re-post of a patch from forever ago that needed a little work. This should only require very minimal tweaking for rhel7-branch.
This tweaks the global default prompt for the new option ('b' to begin installation), so it should now be very clear to users that they are about to kick off installation. This also adds a default prompt for spokes, as many of them need to have the 'c' to continue option, and it is probably best to just have 'b' to begin installation on the summary hub anyhow.
End result looks like this: http://sbueno.fedorapeople.org/images/975793-revised.jpg
Resolves: rhbz#975793 --- pyanaconda/ui/tui/hubs/__init__.py | 2 +- pyanaconda/ui/tui/simpleline/base.py | 6 +++--- pyanaconda/ui/tui/spokes/__init__.py | 10 ++++++++-- pyanaconda/ui/tui/spokes/network.py | 3 +++ 4 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/pyanaconda/ui/tui/hubs/__init__.py b/pyanaconda/ui/tui/hubs/__init__.py index 8f219c3..be78b32 100644 --- a/pyanaconda/ui/tui/hubs/__init__.py +++ b/pyanaconda/ui/tui/hubs/__init__.py @@ -109,7 +109,7 @@ class TUIHub(TUIObject, common.Hub): # If we get a continue, check for unfinished spokes. If unfinished # don't continue # TRANSLATORS: 'c' to continue - if key == _('c'): + if key == _('b'): for spoke in self._spokes.values(): if not spoke.completed and spoke.mandatory: print(_("Please complete all spokes before continuing")) diff --git a/pyanaconda/ui/tui/simpleline/base.py b/pyanaconda/ui/tui/simpleline/base.py index 8c2424b..a02373f 100644 --- a/pyanaconda/ui/tui/simpleline/base.py +++ b/pyanaconda/ui/tui/simpleline/base.py @@ -455,8 +455,8 @@ class App(object): return True
# global close command - # TRANSLATORS: 'c' to continue - if self._screens and (key == _('c')): + # TRANSLATORS: 'b' to begin installation + if self._screens and (key == _('b')): self.close_screen() return True
@@ -582,7 +582,7 @@ class UIScreen(object): to skip further input processing :rtype: unicode|None """ - return _(u" Please make your choice from above ['q' to quit | 'c' to continue |\n 'r' to refresh]: ") + return _(u" Please make your choice from above ['q' to quit | 'b' to begin installation |\n 'r' to refresh]: ")
@property def app(self): diff --git a/pyanaconda/ui/tui/spokes/__init__.py b/pyanaconda/ui/tui/spokes/__init__.py index 087199b..075af60 100644 --- a/pyanaconda/ui/tui/spokes/__init__.py +++ b/pyanaconda/ui/tui/spokes/__init__.py @@ -84,7 +84,8 @@ class TUISpoke(TUIObject, tui.Widget, Spoke): self.draw(c)
class NormalTUISpoke(TUISpoke, NormalSpoke): - pass + def prompt(self, args=None): + return _(u" Please make your choice from above ['q' to quit | 'c' to continue] ")
EditTUISpokeEntry = namedtuple("EditTUISpokeEntry", ["title", "attribute", "aux", "visible"])
@@ -266,7 +267,12 @@ class EditTUISpoke(NormalTUISpoke): self.apply() return True except ValueError: - pass + # Translators: 'c' to continue + if key.lower() == _("c"): + self.close() + return True + else: + pass
return NormalTUISpoke.input(self, args, key)
diff --git a/pyanaconda/ui/tui/spokes/network.py b/pyanaconda/ui/tui/spokes/network.py index a432bcb..0ada2a4 100644 --- a/pyanaconda/ui/tui/spokes/network.py +++ b/pyanaconda/ui/tui/spokes/network.py @@ -178,6 +178,9 @@ class NetworkSpoke(EditTUISpoke): try: num = int(key) except ValueError: + if key.lower() == _("c"): + self.close() + return INPUT_PROCESSED return key
if num == 1:
On Fri, 2013-09-20 at 10:45 -0400, Samantha N. Bueno wrote:
Re-post of a patch from forever ago that needed a little work. This should only require very minimal tweaking for rhel7-branch.
This tweaks the global default prompt for the new option ('b' to begin installation), so it should now be very clear to users that they are about to kick off installation. This also adds a default prompt for spokes, as many of them need to have the 'c' to continue option, and it is probably best to just have 'b' to begin installation on the summary hub anyhow.
End result looks like this: http://sbueno.fedorapeople.org/images/975793-revised.jpg
Resolves: rhbz#975793
pyanaconda/ui/tui/hubs/__init__.py | 2 +- pyanaconda/ui/tui/simpleline/base.py | 6 +++--- pyanaconda/ui/tui/spokes/__init__.py | 10 ++++++++-- pyanaconda/ui/tui/spokes/network.py | 3 +++ 4 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/pyanaconda/ui/tui/hubs/__init__.py b/pyanaconda/ui/tui/hubs/__init__.py index 8f219c3..be78b32 100644 --- a/pyanaconda/ui/tui/hubs/__init__.py +++ b/pyanaconda/ui/tui/hubs/__init__.py @@ -109,7 +109,7 @@ class TUIHub(TUIObject, common.Hub): # If we get a continue, check for unfinished spokes. If unfinished # don't continue # TRANSLATORS: 'c' to continue
if key == _('c'):
if key == _('b'):
Don't forget to update the TRANSLATORS comment right above.
Otherwise this looks good to me. Could you just please remind me why we don't leave spokes and hubs in general use 'c' and 'continue' and just override the SummaryHub's prompt and input methods to use 'b' and 'begins installation'? Prompt could be overriden quite easily and the input method could replace 'b' with 'c' (or more precisely their translations). Wouldn't that work?
On Fri, Sep 20, 2013 at 11:28:37AM -0400, Vratislav Podzimek wrote:
On Fri, 2013-09-20 at 10:45 -0400, Samantha N. Bueno wrote:
Re-post of a patch from forever ago that needed a little work. This should only require very minimal tweaking for rhel7-branch.
This tweaks the global default prompt for the new option ('b' to begin installation), so it should now be very clear to users that they are about to kick off installation. This also adds a default prompt for spokes, as many of them need to have the 'c' to continue option, and it is probably best to just have 'b' to begin installation on the summary hub anyhow.
End result looks like this: http://sbueno.fedorapeople.org/images/975793-revised.jpg
Resolves: rhbz#975793
pyanaconda/ui/tui/hubs/__init__.py | 2 +- pyanaconda/ui/tui/simpleline/base.py | 6 +++--- pyanaconda/ui/tui/spokes/__init__.py | 10 ++++++++-- pyanaconda/ui/tui/spokes/network.py | 3 +++ 4 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/pyanaconda/ui/tui/hubs/__init__.py b/pyanaconda/ui/tui/hubs/__init__.py index 8f219c3..be78b32 100644 --- a/pyanaconda/ui/tui/hubs/__init__.py +++ b/pyanaconda/ui/tui/hubs/__init__.py @@ -109,7 +109,7 @@ class TUIHub(TUIObject, common.Hub): # If we get a continue, check for unfinished spokes. If unfinished # don't continue # TRANSLATORS: 'c' to continue
if key == _('c'):
if key == _('b'):Don't forget to update the TRANSLATORS comment right above.
Ah right, thanks for that.
Otherwise this looks good to me. Could you just please remind me why we don't leave spokes and hubs in general use 'c' and 'continue' and just override the SummaryHub's prompt and input methods to use 'b' and 'begins installation'? Prompt could be overriden quite easily and the input method could replace 'b' with 'c' (or more precisely their translations). Wouldn't that work?
There's no better reason logically, I just thought it was nicer to have things conform to defaults, even if it did involve adding a new default (e.g. default spoke prompt). I can re-write it to just have the custom prompt and input functions in the SummaryHub if you think that's better; I could go either way.
Samantha
On Fri, 2013-09-20 at 15:46 -0400, Samantha N. Bueno wrote:
On Fri, Sep 20, 2013 at 11:28:37AM -0400, Vratislav Podzimek wrote:
On Fri, 2013-09-20 at 10:45 -0400, Samantha N. Bueno wrote:
Re-post of a patch from forever ago that needed a little work. This should only require very minimal tweaking for rhel7-branch.
This tweaks the global default prompt for the new option ('b' to begin installation), so it should now be very clear to users that they are about to kick off installation. This also adds a default prompt for spokes, as many of them need to have the 'c' to continue option, and it is probably best to just have 'b' to begin installation on the summary hub anyhow.
End result looks like this: http://sbueno.fedorapeople.org/images/975793-revised.jpg
Resolves: rhbz#975793
pyanaconda/ui/tui/hubs/__init__.py | 2 +- pyanaconda/ui/tui/simpleline/base.py | 6 +++--- pyanaconda/ui/tui/spokes/__init__.py | 10 ++++++++-- pyanaconda/ui/tui/spokes/network.py | 3 +++ 4 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/pyanaconda/ui/tui/hubs/__init__.py b/pyanaconda/ui/tui/hubs/__init__.py index 8f219c3..be78b32 100644 --- a/pyanaconda/ui/tui/hubs/__init__.py +++ b/pyanaconda/ui/tui/hubs/__init__.py @@ -109,7 +109,7 @@ class TUIHub(TUIObject, common.Hub): # If we get a continue, check for unfinished spokes. If unfinished # don't continue # TRANSLATORS: 'c' to continue
if key == _('c'):
if key == _('b'):Don't forget to update the TRANSLATORS comment right above.
Ah right, thanks for that.
Otherwise this looks good to me. Could you just please remind me why we don't leave spokes and hubs in general use 'c' and 'continue' and just override the SummaryHub's prompt and input methods to use 'b' and 'begins installation'? Prompt could be overriden quite easily and the input method could replace 'b' with 'c' (or more precisely their translations). Wouldn't that work?
There's no better reason logically, I just thought it was nicer to have things conform to defaults, even if it did involve adding a new default (e.g. default spoke prompt). I can re-write it to just have the custom prompt and input functions in the SummaryHub if you think that's better; I could go either way.
Thinking about addons or any additional hubs we may need in the future that will probably not start the installation process, I think it would be better to have the c/continue prompt by default and overriden just in the Summary hub.
On Fri, Sep 20, 2013 at 03:58:01PM -0400, Vratislav Podzimek wrote:
On Fri, 2013-09-20 at 15:46 -0400, Samantha N. Bueno wrote:
On Fri, Sep 20, 2013 at 11:28:37AM -0400, Vratislav Podzimek wrote:
On Fri, 2013-09-20 at 10:45 -0400, Samantha N. Bueno wrote:
Re-post of a patch from forever ago that needed a little work. This should only require very minimal tweaking for rhel7-branch.
This tweaks the global default prompt for the new option ('b' to begin installation), so it should now be very clear to users that they are about to kick off installation. This also adds a default prompt for spokes, as many of them need to have the 'c' to continue option, and it is probably best to just have 'b' to begin installation on the summary hub anyhow.
End result looks like this: http://sbueno.fedorapeople.org/images/975793-revised.jpg
Resolves: rhbz#975793
pyanaconda/ui/tui/hubs/__init__.py | 2 +- pyanaconda/ui/tui/simpleline/base.py | 6 +++--- pyanaconda/ui/tui/spokes/__init__.py | 10 ++++++++-- pyanaconda/ui/tui/spokes/network.py | 3 +++ 4 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/pyanaconda/ui/tui/hubs/__init__.py b/pyanaconda/ui/tui/hubs/__init__.py index 8f219c3..be78b32 100644 --- a/pyanaconda/ui/tui/hubs/__init__.py +++ b/pyanaconda/ui/tui/hubs/__init__.py @@ -109,7 +109,7 @@ class TUIHub(TUIObject, common.Hub): # If we get a continue, check for unfinished spokes. If unfinished # don't continue # TRANSLATORS: 'c' to continue
if key == _('c'):
if key == _('b'):Don't forget to update the TRANSLATORS comment right above.
Ah right, thanks for that.
Otherwise this looks good to me. Could you just please remind me why we don't leave spokes and hubs in general use 'c' and 'continue' and just override the SummaryHub's prompt and input methods to use 'b' and 'begins installation'? Prompt could be overriden quite easily and the input method could replace 'b' with 'c' (or more precisely their translations). Wouldn't that work?
There's no better reason logically, I just thought it was nicer to have things conform to defaults, even if it did involve adding a new default (e.g. default spoke prompt). I can re-write it to just have the custom prompt and input functions in the SummaryHub if you think that's better; I could go either way.
Thinking about addons or any additional hubs we may need in the future that will probably not start the installation process, I think it would be better to have the c/continue prompt by default and overriden just in the Summary hub.
Yeah, I was just thinking about that as well. Dang it. :-/ I'll re-post an amended patch next week.
Samantha
On 09/20/2013 10:45 AM, Samantha N. Bueno wrote:
@@ -266,7 +267,12 @@ class EditTUISpoke(NormalTUISpoke): self.apply() return True except ValueError:
pass
# Translators: 'c' to continueif key.lower() == _("c"):self.close()return Trueelse:pass return NormalTUISpoke.input(self, args, key)
"TRANSLATORS:" has to be in all caps. We can switch to Translators: if we think it looks too silly in all caps, but xgettext only uses one --add-comments option, so we have to pick one.
On Fri, Sep 20, 2013 at 11:37:09AM -0400, David Shea wrote:
On 09/20/2013 10:45 AM, Samantha N. Bueno wrote:
@@ -266,7 +267,12 @@ class EditTUISpoke(NormalTUISpoke): self.apply() return True except ValueError:
pass
# Translators: 'c' to continueif key.lower() == _("c"):self.close()return Trueelse:pass return NormalTUISpoke.input(self, args, key)"TRANSLATORS:" has to be in all caps. We can switch to Translators: if we think it looks too silly in all caps, but xgettext only uses one --add-comments option, so we have to pick one.
Oops. Well, it's "TRANSLATORS:" everywhere else, so I will make this instance conform.
Samantha
anaconda-patches@lists.fedorahosted.org