NewDownloader 0.6: start/stop downloading process

git-svn-id: svn://kolibrios.org@4667 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2014-03-21 00:31:57 +00:00
parent 99f3b47240
commit f01463ea5e

View File

@ -14,7 +14,7 @@
#include "..\lib\lib.obj\libio_lib.h" #include "..\lib\lib.obj\libio_lib.h"
#include "..\lib\lib.obj\http.h" #include "..\lib\lib.obj\http.h"
char header[]="New Downloader v0.5"; char header[]="New Downloader v0.6";
#ifdef LANG_RUS #ifdef LANG_RUS
char accept_language[]= "Accept-Language: ru\n"; char accept_language[]= "Accept-Language: ru\n";
@ -136,7 +136,7 @@ void DrawSpeed()
diagram.Fill(0xFCF8F7); diagram.Fill(0xFCF8F7);
max_speed = speed[speed_position]; max_speed = speed[speed_position];
if (speed_position < diagram.bufw) start_from = 0; else start_from = speed_position - diagram.bufw + 1; if (speed_position < diagram.bufw) start_from = 0; else start_from = speed_position - diagram.bufw + 1;
for (i = 0; i <= speed_position-start_from; i++) if (speed_position>0) for (i = 0; i <= speed_position-start_from; i++)
{ {
if (max_speed>0) if (max_speed>0)
{ {
@ -190,7 +190,7 @@ void Draw_Window()
void Scan(int id) void Scan(int id)
{ {
if (id==301) StartDownloading(); if (id==301) && (http_transfer <= 0) StartDownloading();
if (id==302) StopDownloading(); if (id==302) StopDownloading();
if (id==305) RunProgram("/sys/File managers/Eolite", "/tmp0/1/"); if (id==305) RunProgram("/sys/File managers/Eolite", "/tmp0/1/");
} }
@ -211,6 +211,7 @@ void StopDownloading()
bufpointer = mem_Free(bufpointer); bufpointer = mem_Free(bufpointer);
} }
address_box.color = address_box.blur_border_color = address_box.focus_border_color = 0xFFFfff; address_box.color = address_box.blur_border_color = address_box.focus_border_color = 0xFFFfff;
speed_position = 0;
Draw_Window(); Draw_Window();
} }
@ -221,9 +222,9 @@ void StartDownloading()
if (strncmp(#URL,"http:",5)==0) if (strncmp(#URL,"http:",5)==0)
{ {
address_box.color = address_box.blur_border_color = address_box.focus_border_color = 0xededed; address_box.color = address_box.blur_border_color = address_box.focus_border_color = 0xededed;
Draw_Window();
http_get stdcall (#URL, #accept_language); http_get stdcall (#URL, #accept_language);
http_transfer = EAX; http_transfer = EAX;
Draw_Window();
if (http_transfer == 0) if (http_transfer == 0)
{ {
StopDownloading(); StopDownloading();