KFM: use @open

git-svn-id: svn://kolibrios.org@7801 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2020-04-16 15:40:08 +00:00
parent 5c005d6f35
commit d802f7476f
6 changed files with 72 additions and 140 deletions

View File

@ -143,84 +143,4 @@ kex 0016
skn 0017
<>end
<>files_associations
asm /sys/tinypad
inc /sys/tinypad
mac /sys/tinypad
dbg /sys/tinypad
txt /sys/tinypad
ini /sys/develop/t_edit
log /sys/tinypad
dat /sys/tinypad
inf /sys/tinypad
bat /sys/tinypad
sh /sys/shell
jpg /sys/media/kiv
jpeg /sys/media/kiv
jpe /sys/media/kiv
gif /sys/media/kiv
bmp /sys/media/kiv
png /sys/media/kiv
ico /sys/media/kiv
cur /sys/media/kiv
pcx /sys/media/kiv
xcf /sys/media/kiv
pbm /sys/media/kiv
pgm /sys/media/kiv
pnm /sys/media/kiv
tif /sys/media/kiv
tiff /sys/media/kiv
wbmp /sys/media/kiv
m3u /sys/media/ac97snd
wav /sys/media/pixie
mp3 /sys/media/pixie
xm /sys/media/pixie
mid /sys/media/midamp
rtf /sys/rtfread
3ds /sys/3d/view3ds
asc /sys/3d/view3ds
skn /sys/skincfg
kf /sys/KF_VIEW
csv /sys/table
lif /kolibrios/demos/life2
pdf /kolibrios/media/updf
avi /kolibrios/media/fplay_run
mpg /kolibrios/media/fplay_run
mov /kolibrios/media/fplay_run
flv /kolibrios/media/fplay_run
wmv /kolibrios/media/fplay_run
vob /kolibrios/media/fplay_run
mkv /kolibrios/media/fplay_run
mp4 /kolibrios/media/fplay_run
mpeg /kolibrios/media/fplay_run
3gp /kolibrios/media/fplay_run
webm /kolibrios/media/fplay_run
smc /kolibrios/emul/zsnes
mcr /kolibrios/emul/psx4all
nes /kolibrios/emul/fceu/fceu
sna /kolibrios/emul/e80/e80
gb /kolibrios/emul/gameboy
gbc /kolibrios/emul/gameboy
min /kolibrios/emul/pokemini
nc /kolibrios/utils/cnc_editor/cnc_editor
lap /sys/media/listplay
asf /sys/media/listplay
cvs /sys/graph
obj /sys/develop/cObj
htm /sys/network/WebView
html /sys/network/WebView
mht /sys/network/WebView
docx /sys/network/WebView
url /sys/network/WebView
fb2 /sys/fb2read
kla /sys/games/klavisha
bin /sys/develop/heed
mgb /sys/mgb
<>end
<>files_association1
bmp /sys/media/animage
<>end
end

View File

@ -513,26 +513,30 @@ bool ReplaceSpaceInUrl(dword url, size) {
return was_changed;
}
bool HandleUrlFiles(dword _path, _data)
{
dword url_from_file;
if (!UrlExtIs(_path, "url")) return false;
url_from_file = strstri(_data, "URL=");
if (url_from_file == -1) return false;
replace_char(url_from_file, '\n', '\0', strlen(url_from_file));
OpenPage(url_from_file);
}
bool GetLocalFileData(dword _path)
{
dword data, size, url_from_file;
dword data, size;
file_size stdcall (_path);
if (!EBX) {
return false;
} else {
size = EBX;
data = malloc(size);
ReadFile(0, size, data, _path);
url_from_file = strstri(data, "URL=");
if (UrlExtIs(_path, "url")) && (url_from_file != -1) {
strtrim(url_from_file);
OpenPage(url_from_file);
} else {
LoadInternalPage(data, size);
}
free(data);
return true;
if (!EBX) return false;
size = EBX;
data = malloc(size);
ReadFile(0, size, data, _path);
if (!HandleUrlFiles(_path, data)) {
LoadInternalPage(data, size);
}
free(data);
return true;
}
void OpenPage(dword _open_URL)

View File

@ -1,4 +1,4 @@
char version[]="WebView 2.47";
char version[]="WebView 2.47a";
#ifdef LANG_RUS
char page_not_found[] = FROM "html\\page_not_found_ru.htm""\0";

View File

@ -266,4 +266,9 @@ read_folder_2_name:
align 4
read_folder_3_name:
rb 64
;---------------------------------------------------------------------
align 4
sysopen:
dd 7,0,start_parameter,0,0
db '/sys/@open',0
;---------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
header_text db 'Kolibri File Manager v0.47k',0
header_text db 'Kolibri File Manager v0.48',0
;---------------------------------------------------------------------
fbutton_name:
.f1 db '1 Help',0

View File

@ -75,48 +75,50 @@ open_file_with_appl_1:
open_file_with_appl:
; edx - start file name
; esi - start extension
mov ebp,files_associations
;mov ebp,files_associations ;Leency
.1:
mov [extension_start],esi
call search_star_and_end_tags
cmp ebp,-1
je .end
call normalize_extension_of_file
.search_association:
cmp [end_tag],edi
jbe .end
mov esi,extension_temp_storage
mov ecx,[extension_size]
inc edi
cld
push edi
rep cmpsb
pop edi
jne .search_association
push esi
mov esi,edi
add esi,[extension_size] ;4
cmp [esi],byte ' '
je @f
pop esi
jmp .search_association
@@:
add esp,4
inc esi
mov edi,file_name ;start_file_data.name
xor eax,eax
@@:
cld
lodsb
stosb
cmp al,' '
cmp al,13
jnz @b
mov [edi-1],byte 0 ;'#'
cmp [use_patch],0
je @f
mov [use_patch],0
jmp .continue
; mov [extension_start],esi ;Leency: do not get file assoc
; call search_star_and_end_tags ;from KFM.INI, use /sys/@open
; cmp ebp,-1
; je .end
; call normalize_extension_of_file
; .search_association:
; cmp [end_tag],edi
; jbe .end
; mov esi,extension_temp_storage
; mov ecx,[extension_size]
; inc edi
; cld
; push edi
; rep cmpsb
; pop edi
; jne .search_association
; push esi
; mov esi,edi
; add esi,[extension_size] ;4
; cmp [esi],byte ' '
; je @f
; pop esi
; jmp .search_association
; @@:
; add esp,4
; inc esi
; mov edi,file_name ;start_file_data.name
; xor eax,eax
; @@:
; cld
; lodsb
; stosb
; cmp al,' '
; cmp al,13
; jnz @b
; mov [edi-1],byte 0 ;'#'
; cmp [use_patch],0
; je @f
; mov [use_patch],0
.run_sysopen:
@@:
cmp [select_panel_counter],0
jne @f
@ -154,7 +156,8 @@ open_file_with_appl:
jnz @b
.continue:
mov [start_file_data.param],start_parameter
call start_appl
;call start_appl ;Leency
mcall 70,sysopen ;Leency
cmp eax,0
jge @f
mov ebx,0