From 4c89ff791a13036e94ede0613b387e7e1af508de Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Tue, 15 May 2001 22:29:29 +0000 Subject: allow wait_message calls to be multi-lines --- mdk-stage1/newt-frontend.c | 21 +++++++++++++-------- mdk-stage1/probing.c | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) (limited to 'mdk-stage1') diff --git a/mdk-stage1/newt-frontend.c b/mdk-stage1/newt-frontend.c index 867a6d7f1..a822227a3 100644 --- a/mdk-stage1/newt-frontend.c +++ b/mdk-stage1/newt-frontend.c @@ -78,11 +78,12 @@ void info_message(char *msg, ...) void wait_message(char *msg, ...) { - int width = 8; - int height = 3; + int width, height; char * title = "Please wait..."; newtComponent c, f; + newtGrid grid; char * buf = NULL; + char * flowed; int size = 0; int i = 0; va_list args; @@ -94,19 +95,23 @@ void wait_message(char *msg, ...) if (buf) free(buf); buf = malloc(size); i = vsnprintf(buf, size, msg, args); - width += i; - } while (i == size); + } while (i >= size || i == -1); + + flowed = newtReflowText(buf, 60, 5, 5, &width, &height); va_end(args); - newtCenteredWindow(width, height, title); + c = newtTextbox(-1, -1, width, height, NEWT_TEXTBOX_WRAP); + newtTextboxSetText(c, flowed); - c = newtTextbox(1, 1, width - 2, height - 2, NEWT_TEXTBOX_WRAP); - newtTextboxSetText(c, buf); - f = newtForm(NULL, NULL, 0); + grid = newtCreateGrid(1, 1); + newtGridSetField(grid, 0, 0, NEWT_GRID_COMPONENT, c, 0, 0, 0, 0, 0, 0); + newtGridWrappedWindow(grid, title); + free(flowed); free(buf); + f = newtForm(NULL, NULL, 0); newtFormAddComponent(f, c); newtDrawForm(f); diff --git a/mdk-stage1/probing.c b/mdk-stage1/probing.c index 2ffc54199..721f29dcf 100644 --- a/mdk-stage1/probing.c +++ b/mdk-stage1/probing.c @@ -164,7 +164,7 @@ static void probe_that_type(enum driver_type type) #ifndef DISABLE_MEDIAS if (type == SCSI_ADAPTERS) { /* insmod takes time, let's use the wait message */ - wait_message("Installing: %s", pcidb[i].name); + wait_message("Installing driver for SCSI adapter:\n \n%s", pcidb[i].name); garb = my_insmod(pcidb[i].module, SCSI_ADAPTERS, NULL); remove_wait_message(); warning_insmod_failed(garb); -- cgit v1.2.1