diff --git a/programs/cmm/installer/installer.c b/programs/cmm/installer/installer.c index fdb8dc6a94..e78d35ec89 100644 --- a/programs/cmm/installer/installer.c +++ b/programs/cmm/installer/installer.c @@ -12,20 +12,14 @@ #define LOGOW 16 #define LOGOH 16 -#define BLACK_H 40 -#define TEXTX 20 -#define WIN_W 300 -#define WIN_H 200 +#define WIN_W 240 +#define WIN_H 140 unsigned char logo[LOGOW*LOGOH*3]= FROM "img\logo.raw"; +char iclock[3]={1,2}; proc_info Form; system_colors sc; -char dialog; -enum { - INSTALL, - END -}; #ifdef LANG_RUS ?define T_WTITILE "Установка Kolibri N9" @@ -35,72 +29,32 @@ enum { ?define T_END "KolibriN install complete." #endif - -int DefineWindow(dword wtitle, wbutton) -{ - sc.get(); - DefineAndDrawWindow(GetScreenWidth()-WIN_W/2,GetScreenHeight()-WIN_H/2-30, WIN_W+9, WIN_H+GetSkinHeight()+4,0x74,0,T_WTITILE); - GetProcessInfo(#Form, SelfInfo); - if (Form.status_window>2) return 0; //rolled_up - - DrawBar(0, 0, Form.cwidth, BLACK_H, 0); - _PutImage(BLACK_H-LOGOW/2, BLACK_H-LOGOH/2, LOGOW,LOGOH, #logo); - WriteTextB(BLACK_H-LOGOW + LOGOW, BLACK_H-6/2, 0x90, 0xFFFfff, wtitle); - DrawBar(0, BLACK_H, Form.cwidth, Form.cheight-BLACK_H, 0xFFFfff); - DrawCaptButton(Form.cwidth-107, Form.cheight-40, 90, 24, 10, sc.work_button, sc.work_button_text,wbutton); - return 1; -} - void main() { + byte id, started=false; mem_Init(); - InstallationLoop(INSTALL); -} - -char iclock[3]={1,2}; - -void InstallationLoop(int dialog_t) -{ - byte id, key, started=false; - int free_ram; - unsigned char free_ram_text[256]; - - dialog = dialog_t; - goto _DRAW_WIN; loop() switch(WaitEvent()) { case evButton: - id=GetButtonID(); - if (id == 01) ExitProcess(); - if (id == 11) RunProgram("/sys/htmlv", "http://kolibri-n.org/index.php"); - if (id == 10) - { - if (dialog==INSTALL) InstallationLoop(END); - else if (dialog==END) ExitProcess(); - } + if (GetButtonID() == 01) ExitProcess(); break; case evReDraw: - _DRAW_WIN: - if (dialog==INSTALL) - { - if !(DefineWindow("Installation Started", "Stop")) break; - //iclock[0]>2) break; - if (!started) - { - started = true; - if (GetFreeRAM()/1024<15) notify("Too less free ram. May cause problems"); - Install(); - } - } - if (dialog==END) + _PutImage(Form.cwidth-LOGOW/2, Form.height-LOGOH/2, LOGOW,LOGOH, LOGOW*LOGOH*3*iclock[0]+ #logo); //iclock[0]>