From 752c59eb0ab37ca75bb410052aaf40514818cd54 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Thu, 14 Dec 2000 23:47:36 +0000 Subject: - do progressbar since it seems nobody can live without it - write real separation between cdrom, disk, and network code; have multiple targets for that issue - begin network code: network interface is up and runing (static IP only), network is configured --- mdk-stage1/newt-frontend.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'mdk-stage1/newt-frontend.c') diff --git a/mdk-stage1/newt-frontend.c b/mdk-stage1/newt-frontend.c index f5bfae047..4f62f87f0 100644 --- a/mdk-stage1/newt-frontend.c +++ b/mdk-stage1/newt-frontend.c @@ -202,3 +202,35 @@ enum return_type ask_yes_no(char *msg) return RETURN_BACK; else return RETURN_ERROR; } + +enum return_type ask_from_entries(char *msg, char ** questions, char *** answers, int entry_size) +{ + struct newtWinEntry entries[50]; + int j, i = 0; + int rc; + + while (questions && *questions) { + entries[i].text = *questions; + entries[i].flags = NEWT_FLAG_SCROLL; + i++; + questions++; + } + entries[i].text = NULL; + entries[i].value = NULL; + + *answers = (char **) malloc(sizeof(char *) * i); + + for (j = 0 ; j < i ; j++) { + entries[j].value = &((*answers)[j]); + *(entries[j].value) = NULL; + } + + rc = newtWinEntries("Please fill entries...", msg, 52, 5, 5, entry_size, entries, "Ok", "Cancel", NULL); + + if (rc == 3) + return RETURN_BACK; + if (rc != 1) + return RETURN_ERROR; + + return RETURN_OK; +} -- cgit v1.2.1