Cleanup in elf.c with .bss section clean; adm command mounts cdrom instead of floppy...
[ZeXOS.git] / apps / zde / zinstall / main.c
blob8b434eb3f26acceefac20a79abeace0ebe0b385e
1 /*
2 * ZeX/OS
3 * Copyright (C) 2009 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
4 * Copyright (C) 2010 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #include <appcl.h>
23 typedef struct {
24 unsigned step;
25 char drive[32];
26 } zinstall_t;
27 zinstall_t zinst;
29 void zinstall_draw_step1 ()
31 zgui_puts (10, 40, "First step is focused on hard-drive ID,\nthat mean, you must select\n correct disk for installation.\n\n", 0);
33 zgui_input (10, 100, &zinst.drive, 31, 0);
36 void zinstall_draw ()
38 zgui_puts (10, 10, "ZeX/OS Installer\n-=-=-=-=-=-=-=-=-", 0);
40 unsigned btn_next = zgui_button (150, 145, "Next");
42 if (!btn_next)
43 zinst.step ++;
45 switch (zinst.step) {
46 case 0:
47 zgui_puts (10, 40, "Welcome !\nYou are attempting to install ZeX/OS\nonto your hard-drive, please be sure\nabout your backup because of data loss.\n\nWarning: This version is in the alpha-stage,\nit is possible that some error may occur.\n\nPress button \"Next\" for continue\nin installation process", 0);
48 break;
49 case 1:
50 return zinstall_draw_step1 ();
51 case 2:
52 zgui_puts (10, 40, "In this step we should setup HDD partition\ntable before installation process begin.\nIt is necessary to choose current partition\ntype, respectively filesystem ID.", 0);
53 break;
57 int main (int argc, char **argv)
59 int exit = 0;
61 zinst.step = 0;
62 zinst.drive = 0;
64 if (zgui_init () == -1)
65 return -1;
67 while (!exit) {
68 unsigned state = zgui_event ();
70 if (state & APPCL_STATE_REDRAW)
71 zinstall_draw ();
73 if (state & APPCL_STATE_EXIT)
74 exit = 1;
77 return zgui_exit ();