Bug#525209: Layout messed up in daily images
tags 525209 pending thanks On Thu, Apr 23, 2009 at 08:23:29AM +0200, bubu...@debian.org wrote: Quoting Nicolas François (nicolas.franc...@centraliens.net): If somebody knows how to test it in a daily image, please do (I don't know how to do this). [...] That should give you a mini.iso image in build/dest Thanks. I could test the patch on a virtualbox and committed an updated version. With the patch committed, I could make a complete install without noticing any glitches in the installer screen. Best Regards, -- Nekral -- To UNSUBSCRIBE, email to debian-boot-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#525209: Layout messed up in daily images
On Thu, Apr 23, 2009 at 12:32:28AM +0200, elen...@planet.nl wrote: This is almost certainly a result of the cdebconf changes committed by Nicolas François (CCed). Yes. It looks like I assumed there were no Go Back button in those case. Here is a patch. I tested it just a little bit. It seems to solve the issue without re-introducing the previous issue. If somebody knows how to test it in a daily image, please do (I don't know how to do this). If urgent, somebody can commit it and upload. Otherwise, I will try to test it more this week-end. Best Regards, -- Nekral Index: src/modules/frontend/newt/newt.c === --- src/modules/frontend/newt/newt.c (révision 58334) +++ src/modules/frontend/newt/newt.c (copie de travail) @@ -777,13 +777,15 @@ t_height = newtTextboxGetNumLines(textbox); newtTextboxSetHeight(textbox, t_height); newtFormAddComponent(form, textbox); -b_height = 0; // A Go Back button is not necessary select_list_top = 1+t_height+1; } else { t_height = 0; -b_height = 1; select_list_top = 1; // No description. Only insert a blank line. } +if (obj-methods.can_go_back(obj, q)) +b_height = 1; +else +b_height = 0; free(full_description); win_height = t_height + sel_height + b_height; //3 == First blank line + blanks before and after select
Bug#508042: newt frontent have inefficient use of screen real estate (multiselect)
tags 508042 patch thanks On Sun, Feb 22, 2009 at 06:29:35PM +0200, Oded Naveh wrote: It appears that this bug report actually describes two separate bugs. # 1. The ... three blank lines between the question text and the question itself... # 2. The ... the multiselect part of the question... displayed out of bounds. Here are two patches to fix these bugs. # 1. cdebconf_loadtemplate.patch # 2. cdebconf_newt_need_separate_window.patch Please find the comments on these patches in the patches themselves. There is probably still some space that could be saved for select (not multiselect) because 2 lines are reserved for a button, which is not displayed if the text and select fits on one window. (i.e. when show_select_window(obj, q, 1) is called the Continue button is not displayed, but some place is reserved for it, as when show_select_window(obj, q, 0) is called) I also include the test templates and config I used to test this. testlong.templates and testlong.config could be dropped in src/test. When compiled --with-textwrap, debconf produces the expected result for terminal height from 25 to 40. Best Regards, -- Nekral If a description ends with a verbatim block (asis == 1), remove_newlines adds a newline instead of removing the trailing newline. This causes the debconf frontend(s?) to display 3 blank lines instead of one between the long description and the short description. The end of string must be tested before asis. * src/template.c (remove_newlines): Fix the removal of trailing newline for descriptions ending with a verbatim block. diff -aruN ../orig/cdebconf-0.139/src/template.c ./cdebconf-0.139/src/template.c --- ../orig/cdebconf-0.139/src/template.c 2008-12-26 14:46:33.0 +0100 +++ ./cdebconf-0.139/src/template.c 2009-02-26 10:31:41.214635082 +0100 @@ -619,17 +619,14 @@ in+=2; asis=0; } + else if (*(in+1) == 0) +*out = 0; else if (*(in+1) == ' ') asis=1; else if (asis) asis=0; else - { -if (*(in+1) != 0) - *out = ' '; -else - *out = 0; - } +*out = ' '; } out++; } This fix the computation and usage of the window's height. If the height is not computed correctly, the newt frontend may decide to put the input box and the explanatory text on the same window, but the text will overlap on the input box, which render the input impossible. #508042 is an example for a multiselect, although I think it could appear with a select window (not for string and password windows because I think the input field is always forced to be on the same window). * src/modules/frontend/newt/newt.c (min_window_height): Document the computation of the window's height. * src/modules/frontend/newt/newt.c (min_window_height): Use the full description instead of the extended description when possible. This should make min_window_height() more independent from the get_full_description() internals. * src/modules/frontend/newt/newt.c (min_window_height): The height of the text needs to be added to the original size (decoration buttons). * src/modules/frontend/newt/newt.c (need_separate_window): Document why we subtract 5 for the comparison of the window's height. * src/modules/frontend/newt/newt.c (need_separate_window): Do not use an extra window if the text fits exactly (min_window_height() == height-5) diff -aruN ../orig/cdebconf-0.139/src/modules/frontend/newt/newt.c ./cdebconf-0.139/src/modules/frontend/newt/newt.c --- ../orig/cdebconf-0.139/src/modules/frontend/newt/newt.c 2009-02-13 17:43:37.0 +0100 +++ ./cdebconf-0.139/src/modules/frontend/newt/newt.c 2009-02-26 11:27:44.318953124 +0100 @@ -118,6 +118,7 @@ typedef int (newt_handler)(struct frontend *obj, struct question *q); static void newt_progress_stop(struct frontend *obj); +static char *get_full_description(struct frontend *obj, struct question *q); #include cdebconf_newt.h @@ -275,15 +276,20 @@ static int min_window_height(struct frontend *obj, struct question *q, int win_width) { +// start with a blank or description (note and error) +// End with Continue/bolean buttons + blank int height = 3; char *type = q-template-type; -char *q_ext_text; +char *q_text; -q_ext_text = q_get_extended_description(obj, q); -if (q_ext_text != NULL) -height = cdebconf_newt_get_text_height(q_ext_text, win_width) + 1; +if (strcmp(q-template-type, note) == 0 || strcmp(q-template-type, error) == 0) +q_text = q_get_extended_description(obj, q); +else +q_text = get_full_description(obj, q); +if (q_text != NULL) +height += cdebconf_newt_get_text_height(q_text, win_width) + 1; if (strcmp(type, multiselect) == 0 || strcmp(type, select) == 0) -height += 4; // at least three lines for choices + blank line +height += 4; // x lines for choices + blank line else if (strcmp(type, string) == 0 || strcmp(type, password) == 0) height += 2; // input line +
Bug#508042: newt frontent have inefficient use of screen real estate (multiselect)
Hello, I had a look at other cdebconf newt frontend bugs in the BTS and it looks like the second issue (cdebconf_newt_need_separate_window.patch) is the same as: http://bugs.debian.org/507372 http://bugs.debian.org/343119 Jérémy provided a patch in 507372, based on the same idea of using get_full_description(). It was mentioned by Frans that it is incomplete, but fortunately the other bytes in cdebconf_newt_need_separate_window.patch fix the issue completely. (At least I cannot reproduce the bug after trying many different window height) Also, as Jérémy, I forgot to free the result of get_full_description() in my first patch. So here is an updated version, which free the result and document that the result of get_full_description shall be freed by the caller. Best Regards, -- Nekral This fix the computation and usage of the window's height. If the height is not computed correctly, the newt frontend may decide to put the input box and the explanatory text on the same window, but the text will overlap on the input box, which render the input impossible. #508042 is an example for a multiselect, although I think it could appear with a select window (not for string and password windows because I think the input field is always forced to be on the same window). * src/modules/frontend/newt/newt.c (min_window_height): Document the computation of the window's height. * src/modules/frontend/newt/newt.c (min_window_height): Use the full description instead of the extended description when possible. This should make min_window_height() more independent from the get_full_description() internals. * src/modules/frontend/newt/newt.c (min_window_height): The height of the text needs to be added to the original size (decoration buttons). * src/modules/frontend/newt/newt.c (need_separate_window): Document why we subtract 5 for the comparison of the window's height. * src/modules/frontend/newt/newt.c (need_separate_window): Do not use an extra window if the text fits exactly (min_window_height() == height-5) diff -aruN ../orig/cdebconf-0.139/src/template.c ./cdebconf-0.139/src/template.c --- ../orig/cdebconf-0.139/src/template.c 2008-12-26 14:46:33.0 +0100 +++ ./cdebconf-0.139/src/template.c 2009-02-26 10:31:41.214635082 +0100 @@ -619,17 +619,14 @@ in+=2; asis=0; } + else if (*(in+1) == 0) +*out = 0; else if (*(in+1) == ' ') asis=1; else if (asis) asis=0; else - { -if (*(in+1) != 0) - *out = ' '; -else - *out = 0; - } +*out = ' '; } out++; } diff -aruN ../orig/cdebconf-0.139/src/modules/frontend/newt/newt.c ./cdebconf-0.139/src/modules/frontend/newt/newt.c --- ../orig/cdebconf-0.139/src/modules/frontend/newt/newt.c 2009-02-13 17:43:37.0 +0100 +++ ./cdebconf-0.139/src/modules/frontend/newt/newt.c 2009-02-26 16:17:12.907008645 +0100 @@ -119,6 +119,9 @@ static void newt_progress_stop(struct frontend *obj); +/* Result must be freed by the caller */ +static char *get_full_description(struct frontend *obj, struct question *q); + #include cdebconf_newt.h /* Padding of title width, allows for leading [!!] before title @@ -275,15 +278,22 @@ static int min_window_height(struct frontend *obj, struct question *q, int win_width) { +// start with a blank or description (note and error) +// End with Continue/boolean buttons + blank int height = 3; char *type = q-template-type; -char *q_ext_text; +char *q_text; -q_ext_text = q_get_extended_description(obj, q); -if (q_ext_text != NULL) -height = cdebconf_newt_get_text_height(q_ext_text, win_width) + 1; +if (strcmp(q-template-type, note) == 0 || strcmp(q-template-type, error) == 0) +q_text = q_get_extended_description(obj, q); +else +q_text = get_full_description(obj, q); +if (q_text != NULL) { +height += cdebconf_newt_get_text_height(q_text, win_width) + 1; +free (q_text); +} if (strcmp(type, multiselect) == 0 || strcmp(type, select) == 0) -height += 4; // at least three lines for choices + blank line +height += 4; // x lines for choices + blank line else if (strcmp(type, string) == 0 || strcmp(type, password) == 0) height += 2; // input line + blank line // the others don't need more space @@ -298,7 +308,8 @@ newtGetScreenSize(width, height); x = min_window_height(obj, q, width-7); -return (x = height-5); +return (x height-5); +// 5: blue border + title + bottom frame + shadow + menu } static char *
Bug#508042: newt frontent have inefficient use of screen real estate (multiselect)
On Thu, Feb 26, 2009 at 02:46:46PM +0100, Nicolas François wrote: There is probably still some space that could be saved for select (not multiselect) because 2 lines are reserved for a button, which is not displayed if the text and select fits on one window. (i.e. when show_select_window(obj, q, 1) is called the Continue button is not displayed, but some place is reserved for it, as when show_select_window(obj, q, 0) is called) I could fix that one too with cdebconf_newt_reduce_space_select.patch (it needs cdebconf_newt_need_separate_window.patch) So here are the 3 patches * cdebconf_loadtemplate.patch * cdebconf_newt_need_separate_window.patch * cdebconf_newt_reduce_space_select.patch Best Regards, -- Nekral If a description ends with a verbatim block (asis == 1), remove_newlines() adds a newline instead of removing the trailing newline. This causes the debconf frontend(s?) to display 3 blank lines, instead of one, between the long description and the short description. The end of string must be tested before asis. * src/template.c (remove_newlines): Fix the removal of trailing newline for descriptions ending with a verbatim block. diff -aruN ../orig/cdebconf-0.139/src/template.c ./cdebconf-0.139/src/template.c --- ../orig/cdebconf-0.139/src/template.c 2008-12-26 14:46:33.0 +0100 +++ ./cdebconf-0.139/src/template.c 2009-02-26 10:31:41.214635082 +0100 @@ -619,17 +619,14 @@ in+=2; asis=0; } + else if (*(in+1) == 0) +*out = 0; else if (*(in+1) == ' ') asis=1; else if (asis) asis=0; else - { -if (*(in+1) != 0) - *out = ' '; -else - *out = 0; - } +*out = ' '; } out++; } This fixes the computation and usage of the window's height. If the height is not computed correctly, the newt frontend may decide to put the input box and the explanatory text on the same window, but the text will overlap on the input box, which renders the input impossible. #508042 is an example for a multiselect, although I think it could appear with a select window (not for string and password windows because I think the input field is always forced to be on the same window). * src/modules/frontend/newt/newt.c (min_window_height): Document the computation of the window's height. * src/modules/frontend/newt/newt.c (min_window_height): Use the full description instead of the extended description when possible. This should make min_window_height() more independent from the get_full_description() internals. * src/modules/frontend/newt/newt.c (min_window_height): The height of the text needs to be added to the original size (decoration buttons). * src/modules/frontend/newt/newt.c (need_separate_window): Document why we subtract 5 for the comparison of the window's height. * src/modules/frontend/newt/newt.c (need_separate_window): Do not use an extra window if the text fits exactly (min_window_height() == height-5) diff -aruN ../orig/cdebconf-0.139/src/modules/frontend/newt/newt.c ./cdebconf-0.139/src/modules/frontend/newt/newt.c --- ../orig/cdebconf-0.139/src/modules/frontend/newt/newt.c 2009-02-13 17:43:37.0 +0100 +++ ./cdebconf-0.139/src/modules/frontend/newt/newt.c 2009-02-26 16:17:12.907008645 +0100 @@ -119,6 +119,9 @@ static void newt_progress_stop(struct frontend *obj); +/* Result must be freed by the caller */ +static char *get_full_description(struct frontend *obj, struct question *q); + #include cdebconf_newt.h /* Padding of title width, allows for leading [!!] before title @@ -275,15 +278,22 @@ static int min_window_height(struct frontend *obj, struct question *q, int win_width) { +// start with a blank or description (note and error) +// End with Continue/boolean buttons + blank int height = 3; char *type = q-template-type; -char *q_ext_text; +char *q_text; -q_ext_text = q_get_extended_description(obj, q); -if (q_ext_text != NULL) -height = cdebconf_newt_get_text_height(q_ext_text, win_width) + 1; +if (strcmp(q-template-type, note) == 0 || strcmp(q-template-type, error) == 0) +q_text = q_get_extended_description(obj, q); +else +q_text = get_full_description(obj, q); +if (q_text != NULL) { +height += cdebconf_newt_get_text_height(q_text, win_width) + 1; +free (q_text); +} if (strcmp(type, multiselect) == 0 || strcmp(type, select) == 0) -height += 4; // at least three lines for choices + blank line +height += 4; // x lines for choices + blank line else if (strcmp(type, string) == 0 || strcmp(type, password) == 0) height += 2; // input line + blank line // the others don't need more space @@ -298,7 +308,8 @@ newtGetScreenSize(width, height); x = min_window_height(obj, q, width-7); -return (x = height-5); +return (x height-5); +// 5: blue border + title + bottom frame + shadow + menu } static char * The newt frontend does no use the window
Bug#501161: cdebconf-newt: Displays too many * is accented characters are typed
reassign 501161 newt forcemerge 501161 430102 thanks Hello, On Sun, Oct 05, 2008 at 01:04:03AM +0200, Frans Pop wrote: During password entry the frontend displays two asterisks if I type a single accented character like ä or ö using the special keys for those characters on the German keyboard. Notable is that the cursor remains on the correct position. Example: I type: qwertzöä(on a US keyboard this is: qwerty;') I see:** Cursor is:^ Could be this is not a bug in cdebconf but in newt or something. This is a bug in newt, and is fixed in the current upstream release. I could test that the attached newt patch fixes the cdebconf bug. This is also the current version of the NEWT_FLAG_PASSWORD handling in entry.c Best Regards, -- Nekral --- newt-0.52.2-old/entry.c.org 2009-02-26 23:18:30.726625269 +0100 +++ newt-0.52.2/entry.c 2009-02-26 23:24:47.424902210 +0100 @@ -184,13 +184,12 @@ chptr = en-buf + en-firstChar; if (en-flags NEWT_FLAG_PASSWORD) { - char *p; - tmpptr = alloca(strlen(chptr)+2); - strcpy(tmpptr, chptr); - for (p = tmpptr; *p; p++) - *p = '*'; + len = wstrlen(chptr, -1); + tmpptr = alloca(len+1); + memset(tmpptr, '*', len); + tmpptr[len] = '\0'; chptr = tmpptr; -} +} len = wstrlen(chptr, -1);
Bug#492766: hw-detect: French debconf templates translation
Hello, Here is the missing fr.po file. Best Regards, -- Nekral fr.po Description: application/gettext