]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/install+setup/setup/main.c
langs: add russian to buildsystem.
[people/pmueller/ipfire-2.x.git] / src / install+setup / setup / main.c
index f168220e10183055f9a70ef91e19cb1cb044bc59..65878f98a53975fc80862bd2c192509e9241f503 100644 (file)
@@ -5,10 +5,6 @@
  *
  * (c) Lawrence Manning, 2001
  * Contains main entry point, and misc functions.
- * 
- * modified 16/11/2002 eoberlander - French language added
- *
- * $Id: main.c,v 1.4.2.7 2005/12/01 20:13:08 eoberlander Exp $
  *
  */
 
@@ -21,8 +17,15 @@ char **ctr = NULL;
 
 int automode = 0;
 
+struct  nic  nics[20] = { { "" , "" , "" , "" } };
+struct knic knics[20] = { { "" , "" , "" , "" } };
+
 extern char *en_tr[];
 extern char *de_tr[];
+extern char *fr_tr[];
+extern char *es_tr[];
+extern char *pl_tr[];
+extern char *ru_tr[];
 
 int main(int argc, char *argv[])
 {
@@ -30,8 +33,8 @@ int main(int argc, char *argv[])
        char *shortlangnames[] = { "en", NULL };
        char **langtrs[] = { en_tr, NULL };
 #else
-       char *shortlangnames[] = { "de", "en", NULL };
-       char **langtrs[] = { de_tr, en_tr, NULL };
+       char *shortlangnames[] = { "de", "en", "fr", "es", "pl", "ru", NULL };
+       char **langtrs[] = { de_tr, en_tr, fr_tr, es_tr, pl_tr, ru_tr, NULL };
 #endif
        int choice;
        char *sections[11]; /* need to fill this out AFTER knowning lang */
@@ -59,6 +62,9 @@ int main(int argc, char *argv[])
 
        fprintf(flog, "Setup program started.\n");
 
+       if (!setlocale(LC_CTYPE,""))
+               fprintf(flog, "Locale not spezified. Check LANG, LC_CTYPE, RC_ALL.");
+
        kv = initkeyvalues();
        if (!(readkeyvalues(kv, CONFIG_ROOT "/main/settings")))
        {
@@ -78,7 +84,6 @@ int main(int argc, char *argv[])
 
        if (!ctr)
        {
-               /* zh,lt,ro,ru,th languages not available in setup, so use English */
                for (choice = 0; shortlangnames[choice]; choice++)
                {
                        if (strcmp(shortlangnames[choice], "en") == 0)
@@ -93,8 +98,8 @@ int main(int argc, char *argv[])
        sections[1] = ctr[TR_TIMEZONE];
        sections[2] = ctr[TR_HOSTNAME];
        sections[3] = ctr[TR_DOMAINNAME];
-       sections[4] = ctr[TR_ISDN_CONFIGURATION];
-       sections[5] = ctr[TR_NETWORKING];
+       sections[4] = ctr[TR_NETWORKING];
+       sections[5] = ctr[TR_ISDN];
        sections[6] = ctr[TR_ROOT_PASSWORD];
        sections[7] = ctr[TR_ADMIN_PASSWORD];
        sections[8] = NULL;
@@ -145,11 +150,11 @@ int main(int argc, char *argv[])
                                        break;
 
                                case 4:
-                                       handleisdn();
+                                       handlenetworking();
                                        break;
-
+                               
                                case 5:
-                                       handlenetworking();
+                                       handleisdn();
                                        break;
 
                                case 6:
@@ -175,16 +180,16 @@ int main(int argc, char *argv[])
                        goto EXIT;
                if (!(handledomainname()))
                        goto EXIT;
+               if (!(handlerootpassword()))
+                       goto EXIT;
+               if (!(handleadminpassword()))
+                       goto EXIT;
                if (!(handleisdn()))
                        goto EXIT;
                if (!(handlenetworking()))
                        goto EXIT;
                if (!(handledhcp()))
                        goto EXIT;
-               if (!(handlerootpassword()))
-                       goto EXIT;
-               if (!(handleadminpassword()))
-                       goto EXIT;
 
                autook = 1;
        }
@@ -196,7 +201,17 @@ EXIT:
                if (autook)
                        newtWinMessage(title, ctr[TR_OK], ctr[TR_SETUP_FINISHED]);
                else
+               {
                        newtWinMessage(ctr[TR_WARNING], ctr[TR_OK], ctr[TR_SETUP_NOT_COMPLETE]);
+
+                       fprintf(flog, "Setup program has not finished.\n");
+                       fflush(flog);
+                       fclose(flog);
+
+                       newtFinished();
+
+                       return 1;
+               }
        }
 
        fprintf(flog, "Setup program ended.\n");
@@ -207,4 +222,3 @@ EXIT:
 
        return 0;
 }
-