X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=blobdiff_plain;f=src%2Finstall%2Bsetup%2Flibsmooth%2Fmain.c;h=8de8c231e9d9eb8c4a329d6a17c0f32ad77f69ee;hp=710183a2156228154631c605cf0c3dc89c4a098f;hb=e0bbaf87779eaf0d53d96bf4bc2efd91a9fde28b;hpb=59093c5ec474be7eb22c17a8f1cb0c1922f1f93a diff --git a/src/install+setup/libsmooth/main.c b/src/install+setup/libsmooth/main.c index 710183a215..8de8c231e9 100644 --- a/src/install+setup/libsmooth/main.c +++ b/src/install+setup/libsmooth/main.c @@ -45,6 +45,61 @@ void errorbox(char *message) newtWinMessage(ctr[TR_ERROR], ctr[TR_OK], message); } +int scrollmsgbox(int width, int height, char *title, char *text, ...) +{ + int rc = 0; + newtComponent t, f, b, c; + char *buf = NULL; + char checkbox; + int size = 0; + int i = 0; + va_list args; + + va_start(args, text); + + do { + size += 40000; + if (buf) free(buf); + buf = malloc(size); + i = vsnprintf(buf, size, text, args); + } while (i == size); + + va_end(args); + + newtCenteredWindow(width, height, title); + + b = newtCompactButton(width - 15 ,height - 2, ctr[TR_OK]); + c = newtCheckbox(3, height - 2, ctr[TR_LICENSE_ACCEPT], ' ', " *", &checkbox); + + t = newtTextbox(1, 1, width - 2, height - 4, NEWT_TEXTBOX_WRAP+NEWT_TEXTBOX_SCROLL); + newtTextboxSetText(t, buf); + + f = newtForm(NULL, NULL, 0); + free(buf); + + newtFormAddComponent(f, c); + newtFormAddComponent(f, b); + newtFormAddComponent(f, t); + + newtRunForm(f); + if (checkbox=='*') rc=1; + newtFormDestroy(f); + return rc; +} + +int disclaimerbox(char *message) +{ + int rc; + char title[STRING_SIZE]; + + sprintf (title, "%s v%s - %s", NAME, VERSION, SLOGAN); + rc = scrollmsgbox(75, 20, title, message); + newtPopWindow(); + + return rc; +} + + void statuswindow(int width, int height, char *title, char *text, ...) { newtComponent t, f;