Skip to content
Snippets Groups Projects
Commit b9cd03ee authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Add support for overwriting yes/no button labels

Fix some typos and overwrite the yes/no labels of the wizard/expert
mode yesno dialog
parent c3fe132c
No related branches found
No related tags found
No related merge requests found
...@@ -857,9 +857,9 @@ def image_creator(d, media, out): ...@@ -857,9 +857,9 @@ def image_creator(d, media, out):
"metadata": metadata} "metadata": metadata}
msg = "snf-image-creator detected a %s system on the input media. " \ msg = "snf-image-creator detected a %s system on the input media. " \
"Would you like to run a wizards to assists you through the " \ "Would you like to run a wizard to assist you through the " \
"image creation process?\n\nChoose <Yes> to run the wizard, " \ "image creation process?\n\nChoose <Wizard> to run the wizard," \
"<No> to run the snf-image-creator in expert mode or press " \ " <Expert> to run the snf-image-creator in expert mode or press " \
"ESC to quit the program." \ "ESC to quit the program." \
% (dev.ostype if dev.ostype == dev.distro else "%s (%s)" % % (dev.ostype if dev.ostype == dev.distro else "%s (%s)" %
(dev.ostype, dev.distro)) (dev.ostype, dev.distro))
...@@ -867,7 +867,8 @@ def image_creator(d, media, out): ...@@ -867,7 +867,8 @@ def image_creator(d, media, out):
update_background_title(session) update_background_title(session)
while True: while True:
code = d.yesno(msg, width=YESNO_WIDTH, height=12) code = d.yesno(msg, width=YESNO_WIDTH, height=12,
yes_label="Wizard", no_label="Expert")
if code == d.DIALOG_OK: if code == d.DIALOG_OK:
if wizard(session): if wizard(session):
break break
...@@ -918,6 +919,13 @@ def main(): ...@@ -918,6 +919,13 @@ def main():
dialog._common_args_syntax["extra_label"] = \ dialog._common_args_syntax["extra_label"] = \
lambda string: ("--extra-label", string) lambda string: ("--extra-label", string)
# Allow yes-no label overwriting
dialog._common_args_syntax["yes_label"] = \
lambda string: ("--yes-label", string)
dialog._common_args_syntax["no_label"] = \
lambda string: ("--no-label", string)
usage = "Usage: %prog [options] [<input_media>]" usage = "Usage: %prog [options] [<input_media>]"
parser = optparse.OptionParser(version=version, usage=usage) parser = optparse.OptionParser(version=version, usage=usage)
parser.add_option("-l", "--logfile", type="string", dest="logfile", parser.add_option("-l", "--logfile", type="string", dest="logfile",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment