summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2001-05-15 22:29:29 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2001-05-15 22:29:29 +0000
commit4c89ff791a13036e94ede0613b387e7e1af508de (patch)
tree3249ddb478d70032d24c264c953a22f9161e6f51
parent0748a0f4729d111dc7ed3b035efd90295dccdca5 (diff)
downloaddrakx-backup-do-not-use-4c89ff791a13036e94ede0613b387e7e1af508de.tar
drakx-backup-do-not-use-4c89ff791a13036e94ede0613b387e7e1af508de.tar.gz
drakx-backup-do-not-use-4c89ff791a13036e94ede0613b387e7e1af508de.tar.bz2
drakx-backup-do-not-use-4c89ff791a13036e94ede0613b387e7e1af508de.tar.xz
drakx-backup-do-not-use-4c89ff791a13036e94ede0613b387e7e1af508de.zip
allow wait_message calls to be multi-lines
-rw-r--r--mdk-stage1/newt-frontend.c21
-rw-r--r--mdk-stage1/probing.c2
2 files changed, 14 insertions, 9 deletions
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);