dl: automatically extract downloaded zip and 7z files

various fixes

git-svn-id: svn://kolibrios.org@8839 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2021-06-13 14:09:46 +00:00
parent c986378f55
commit 0aae2f3c46
14 changed files with 55 additions and 34 deletions

View File

@ -30,8 +30,8 @@ docx=3
exc=3
wtx=3
inf=3
xml=3
odt=3
ob07=3
inc=4
h=4
img=5
@ -148,18 +148,14 @@ mov=11
mp4=11
vob=11
webm=11
ttf=12
ttc=12
chr=12
kf=12
mt=12
htm=13
html=13
mht=13
eml=13
url=13
lif=14
grf=14
htm=12
html=12
mht=12
eml=12
url=12
css=13
js=14
lif=15
3ds=15
asc=15
vox=15
@ -190,14 +186,22 @@ h=27
java=27
pas=27
pp=27
xml=27
cpp=28
c=28
fb2=29
ob7=29
grf=47
mgb=47
ch8=48
dtp=52
pal=52
ch8=48
ttf=59
ttc=59
chr=59
kf=59
mt=59
[icons32]
<dir>=45

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -70,8 +70,8 @@ void ProcessButtonClick(int id)
if (id==BTN_EXIT) { StopDownloading(); ExitProcess(); }
if (id==BTN_START) StartDownloading();
if (id==BTN_STOP) StopDownloading();
if (id==BTN_DIR) RunProgram("/sys/File managers/Eolite", #filepath);
if (id==BTN_RUN) RunProgram("/sys/@open", #filepath);
if (id==BTN_DIR) { RunProgram("/sys/File managers/Eolite", #filepath); ExitProcess(); }
if (id==BTN_RUN) { RunProgram("/sys/@open", #filepath); ExitProcess(); }
}
void ProcessKeyPress()
@ -236,10 +236,32 @@ void SaveFile(int attempt)
}
if (!exit_param) notify(#notify_message);
if (!strcmpi(#filepath+strlen(#filepath)-4, ".zip"))
|| (!strcmpi(#filepath+strlen(#filepath)-3, ".7z")) {
Unarchive(#filepath);
}
if (open_file) ProcessButtonClick(BTN_RUN);
if (autoclose.checked) ExitProcess();
}
void Unarchive(dword _arc)
{
char folder_name[4096];
strcpy(#folder_name, "/tmp0/1/Downloads/");
strcpy(#folder_name, #filepath+strrchr(#filepath, '/'));
folder_name[strlen(#folder_name)-4] = '\0';
CreateDir(#folder_name);
strcpy(#param, "-o \"");
strcat(#param, #folder_name);
strcat(#param, "\" -h \"");
strcat(#param, #filepath);
chrcat(#param, '\"');
RunProgram("/sys/unz", #param);
}
/*
struct TIME

View File

@ -21,7 +21,7 @@ void DrawIconByExtension(dword file_path, extension, xx, yy, fairing_color)
default_icon=2;
}
if (chrnum(file_path, '/')==2) {
if (ESBYTE[file_path+1]!='k') && (chrnum(file_path, '/')==2) {
if (ESBYTE[file_path+1]=='/') ext[0] = ESBYTE[file_path+2];
else ext[0] = ESBYTE[file_path+1];
ext[1] = '\0';

View File

@ -41,6 +41,6 @@ struct opendialog
};
char communication_area_name[] = "FFFFFFFF_open_dialog";
char open_dialog_path[] = "/rd/1/File managers/opendial";
char open_dialog_path[] = "/sys/File managers/opendial";
#endif

View File

@ -122,10 +122,10 @@ void main()
dword GetFreeSpaceOfRamdisk()
{
dword rdempty = malloc(1440*1024);
CreateFile(0, 1440*1024, rdempty, "/rd/1/rdempty");
CreateFile(0, 1440*1024, rdempty, "/sys/rdempty");
free(rdempty);
rdempty = get_file_size("/rd/1/rdempty");
DeleteFile("/rd/1/rdempty");
rdempty = get_file_size("/sys/rdempty");
DeleteFile("/sys/rdempty");
return rdempty;
}
@ -184,7 +184,7 @@ void EventDownloadComplete()
} else {
copyf("/sys", #backup);
copyf(#latest, "/sys");
if (keep_settings.checked) copyf(#backup_settings, "/rd/1/settings");
if (keep_settings.checked) copyf(#backup_settings, "/sys/settings");
if (restart_apps.checked) RestartAllProcess();
install_complete = true;
}

View File

@ -66,7 +66,7 @@ import mtar, \
mtar_read_header, 'mtar_read_header', \
mtar_write_data, 'mtar_write_data', \
mtar_finalize, 'mtar_finalize', \
mtar_close, 'mtar_finalize'
mtar_close, 'mtar_close'
import libc, \
printf, 'printf'

View File

@ -62,7 +62,7 @@ import mtar, \
mtar_write_file_header, 'mtar_write_file_header', \
mtar_write_data, 'mtar_write_data', \
mtar_finalize, 'mtar_finalize', \
mtar_close, 'mtar_finalize'
mtar_close, 'mtar_close'
IM_END:
align 4

View File

@ -131,13 +131,13 @@ fiTree dd 1
imgFree:
file 'free.raw'
; file 'pic/free.raw'
imgOk:
file 'ok.raw'
; file 'pic/ok.raw'
imgMinus:
file 'minus.raw'
; file 'pic/minus.raw'
imgPlus:
file 'plus.raw'
; file 'pic/plus.raw'
i_end:
readFolder dd rdFoldforTree ;äã­ªæ¨ï, ª®â®à®© ç¨â ¥âáï ¯ ¯ª 

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix es >lang.inc
@fasm unz.asm unz
@erase lang.inc
@pause