]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/install+setup/libsmooth/main.c
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next
[people/teissler/ipfire-2.x.git] / src / install+setup / libsmooth / main.c
index 0491d5e80ff4a470f39ba318cea68429ef786b1c..39cde7b9ded52d9c45bb354556a898be078d5d73 100644 (file)
@@ -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;
@@ -287,7 +342,11 @@ int replace(char filename1[], char *from, char *to)
 #else
        #include "lang_de.c"
        #include "lang_en.c"
+       #include "lang_es.c"
        #include "lang_fr.c"
+       #include "lang_pl.c"
+       #include "lang_ru.c"
+       #include "lang_nl.c"
 #endif
 
 // returns a pointer to the actual running version number of IPFire.