Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. void HalloLoop()
  2. {
  3.         byte id, key;
  4.         goto _HALLO_DRAW;
  5.         loop() switch(WaitEvent())
  6.         {
  7.                                         case evButton:
  8.                                                         id=GetButtonID();
  9.                                                         if(id == 1)   ExitProcess();
  10.                                                         if (id == 11) RunProgram("/sys/htmlv", "http://kolibri-n.org/index.php");
  11.                                                         if (id == 10) GotoInstall();
  12.                                                         break;
  13.                                         case evKey:
  14.                                                         key = GetKey();
  15.                                                         if (key == 13) GotoInstall();
  16.                                                         break;
  17.                                                    
  18.                                         case evReDraw: _HALLO_DRAW:
  19.                                                         if !(DefineWindow("Prepearing installation", "Install")) break;
  20.  
  21.                                                         HalloWindow();
  22.                                                         break;
  23.         }
  24. }
  25.  
  26. void HalloWindow()
  27. {
  28.         int free_ram;
  29.         unsigned char free_ram_text[256];
  30.  
  31.  
  32.         WriteTextB(TEXTX, 80, 0x90, 0xCC00CC, "KolibriN 8.2a Upgrade Pack is ready for install.");
  33.         DrawLink(TEXTX, 95, 0x90, 11, "http://kolibri-n.org");
  34.        
  35.         free_ram = GetFreeRAM()/1024;
  36.         strcpy(#free_ram_text, "You have ");
  37.         strcat(#free_ram_text, itoa(free_ram));
  38.         strcat(#free_ram_text, " MB of free RAM. You need 100 Mb for installation.");
  39.  
  40.         WriteText(TEXTX, 140, 0x80, 0, #free_ram_text);
  41.         WriteText(TEXTX, 160, 0x80, 0, "Please, close all opened applications before start.");
  42. }
  43.  
  44. void GotoInstall()
  45. {
  46.         if (GetFreeRAM()/1024>100) InstallationLoop();
  47.         else notify("You do not have enought free RAM for installation!");
  48. }