Hi all, now i have created messages for systems that support 'go back' and conditions to deal with it. I tested the udebs installing on a kvm and i get a text mode installer with the 'go back' in the prompt.
-- Melhores cumprimentos/Best regards, Miguel Figueiredo http://www.DebianPT.org
diff --git a/debian/cdebconf-text-udeb.templates b/debian/cdebconf-text-udeb.templates index 3a960a7..9ec836b 100644 --- a/debian/cdebconf-text-udeb.templates +++ b/debian/cdebconf-text-udeb.templates @@ -36,17 +36,32 @@ _Description: No Template: debconf/text-prompt-default Type: text # :sl4: -_Description: Prompt: '%c' for help, default=%d> +_Description: Prompt: '%c': help, default: '%d'> + +Template: debconf/text-prompt-default-goback +Type: text +# :sl4: +_Description: Prompt: '%c': help, '%c': go back, default: '%d'> Template: debconf/text-prompt Type: text # :sl4: -_Description: Prompt: '%c' for help> +_Description: Prompt: '%c': help> + +Template: debconf/text-prompt-goback +Type: text +# :sl4: +_Description: Prompt: '%c': help, '%c': go back> Template: debconf/text-prompt-default-string Type: text # :sl4: -_Description: Prompt: '%c' for help, default=%s> +_Description: Prompt: '%c': help, default: '%s'> + +Template: debconf/text-prompt-default-string-goback +Type: text +# :sl4: +_Description: Prompt: '%c': help, '%c': go back, default: '%s'> Template: debconf/cont-prompt Type: text diff --git a/debian/changelog b/debian/changelog index 6f33413..f21a0e0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,9 @@ cdebconf (0.155) UNRELEASED; urgency=low + [ Miguel Figueiredo] + * Add go back to prompt on text install. Closes: #616315. + + [ Colin Watson ] * Appease compiler warnings in align_text_renderer_render. (In practice x_offset and y_offset are never uninitialised here, but knowing that requires knowing that cell_area can never be NULL.) diff --git a/src/modules/frontend/text/text.c b/src/modules/frontend/text/text.c index db4988d..918b3f2 100644 --- a/src/modules/frontend/text/text.c +++ b/src/modules/frontend/text/text.c @@ -343,11 +343,27 @@ static int text_handler_boolean(struct frontend *obj, struct question *q) printf(" %d. %s%s", 2, question_get_text(obj, "debconf/no", "No"), (2 == def ? " [*]" : "")); printf("\n"); if (def) - printf(question_get_text(obj, "debconf/text-prompt-default", - "Prompt: '%c' for help, default=%d> "), CHAR_HELP, def); + { + if (obj->methods.can_go_back (obj, q)) + printf(question_get_text(obj, "debconf/text-prompt-default-goback", + "Prompt: '%c': help, '%c': go back, default: '%d'> "), + CHAR_HELP, CHAR_GOBACK, def); + else + printf(question_get_text(obj, "debconf/text-prompt-default", + "Prompt: '%c': help, default: '%d'> "), + CHAR_HELP, def); + } else - printf(question_get_text(obj, "debconf/text-prompt", - "Prompt: '%c' for help> "), CHAR_HELP); + { + if (obj->methods.can_go_back (obj, q)) + printf(question_get_text(obj, "debconf/text-prompt-goback", + "Prompt: '%c': help, '%c': go back> "), + CHAR_HELP, CHAR_GOBACK); + else + printf(question_get_text(obj, "debconf/text-prompt", + "Prompt: '%c': help> "), + CHAR_HELP); + } get_answer(buf, sizeof(buf)); if (buf[0] == CHAR_HELP && buf[1] == 0) show_help(obj, q); @@ -430,8 +446,14 @@ static int text_handler_multiselect(struct frontend *obj, struct question *q) DISPLAY: printlist (obj, q, count, choices_translated, tindex, selected); - printf(question_get_text(obj, "debconf/text-prompt-default-string", - "Prompt: '%c' for help, default=%s> "), CHAR_HELP, defval); + if (obj->methods.can_go_back (obj, q)) + printf(question_get_text(obj, "debconf/text-prompt-default-string-goback", + "Prompt: '%c': help, '%c': go back, default: '%s'> "), + CHAR_HELP, CHAR_GOBACK, defval); + else + printf(question_get_text(obj, "debconf/text-prompt-default-string", + "Prompt: '%c': help, default: '%s'> "), + CHAR_HELP, defval); get_answer(answer, sizeof(answer)); if (answer[0] == CHAR_HELP && answer[1] == 0) { @@ -549,13 +571,27 @@ static int text_handler_select(struct frontend *obj, struct question *q) choice = -1; do { printlist (obj, q, count, choices_translated, tindex, selected); - if (def >= 0 && choices_translated[def]) { - printf(question_get_text(obj, "debconf/text-prompt-default", - "Prompt: '%c' for help, default=%d> "), + if (def >= 0 && choices_translated[def]) + { + if (obj->methods.can_go_back (obj, q)) + printf(question_get_text(obj, "debconf/text-prompt-default-goback", + "Prompt: '%c' for help, '%c' go back, default: '%d'> "), + CHAR_HELP, CHAR_GOBACK, def+1); + else + printf(question_get_text(obj, "debconf/text-prompt-default", + "Prompt: '%c' for help, default: '%d'> "), CHAR_HELP, def+1); - } else { - printf(question_get_text(obj, "debconf/text-prompt", - "Prompt: '%c' for help> "), CHAR_HELP); + } + else + { + if (obj->methods.can_go_back (obj, q)) + printf(question_get_text(obj, "debconf/text-prompt-goback", + "Prompt: '%c' for help, '%c' go back> "), + CHAR_HELP, CHAR_GOBACK); + else + printf(question_get_text(obj, "debconf/text-prompt", + "Prompt: '%c' for help> "), + CHAR_HELP); } get_answer(answer, sizeof(answer)); if (answer[0] == CHAR_HELP) @@ -687,9 +723,27 @@ static int text_handler_string(struct frontend *obj, struct question *q) const char *defval = question_getvalue(q, ""); while (1) { if (defval) - printf(question_get_text(obj, "debconf/text-prompt-default-string", "Prompt: '%c' for help, default=%s> "), CHAR_HELP, defval); - else - printf(question_get_text(obj, "debconf/text-prompt", "Prompt: '%c' for help> "), CHAR_HELP); + { + if (obj->methods.can_go_back (obj, q)) + printf(question_get_text(obj, "debconf/text-prompt-default-string-goback", + "Prompt: '%c' for help, '%c' go back, default: '%s'> "), + CHAR_HELP, CHAR_GOBACK, defval); + else + printf(question_get_text(obj, "debconf/text-prompt-default-string", + "Prompt: '%c' for help, default: '%s'> "), + CHAR_HELP, defval); + } + else + { + if (obj->methods.can_go_back (obj, q)) + printf(question_get_text(obj, "debconf/text-prompt-goback", + "Prompt: '%c' for help, '%c' go back> "), + CHAR_HELP, CHAR_GOBACK); + else + printf(question_get_text(obj, "debconf/text-prompt", + "Prompt: '%c' for help> "), + CHAR_HELP); + } fflush(stdout); get_answer(buf, sizeof(buf)); if (buf[0] == CHAR_HELP && buf[1] == 0)