From 4f66bc4c1962d0d82613094801e5751758c9c0d9 Mon Sep 17 00:00:00 2001 From: eAndrew Date: Sun, 8 Nov 2015 17:05:45 +0000 Subject: [PATCH] Open: hide nonexistent applications git-svn-id: svn://kolibrios.org@5903 a494cfbc-eb01-0410-851d-a64ba20cac60 --- data/common/settings/assoc.ini | 8 ++++-- programs/system/open/macros.inc | 47 --------------------------------- programs/system/open/open.asm | 22 ++++++++++++--- 3 files changed, 24 insertions(+), 53 deletions(-) delete mode 100644 programs/system/open/macros.inc diff --git a/data/common/settings/assoc.ini b/data/common/settings/assoc.ini index 573af519a6..c7deecd361 100644 --- a/data/common/settings/assoc.ini +++ b/data/common/settings/assoc.ini @@ -67,8 +67,12 @@ icon=75 [cObj] exec=/sys/develop/cObj +[Eolite] +exec=/sys/file managers/eolite +icon=1 + [Assoc] -/=/sys/file managers/eolite +/=$Eolite kf=$FontViewer @@ -131,4 +135,4 @@ asc=$View3DS skn=/sys/desktop lif=/sys/demos/life2 -kla=/sys/games/klavisha \ No newline at end of file +kla=/sys/games/klavisha diff --git a/programs/system/open/macros.inc b/programs/system/open/macros.inc deleted file mode 100644 index a5ea74720e..0000000000 --- a/programs/system/open/macros.inc +++ /dev/null @@ -1,47 +0,0 @@ -macro cmpe a, b, c -{ - cmp a, b - je c -} - -macro cmpne a, b, c -{ - cmp a, b - jne c -} - -macro cmpg a, b, c -{ - cmp a, b - jg c -} - -macro cmpl a, b, c -{ - cmp a, b - jl c -} - -macro cmpnl a, b, c -{ - cmp a, b - jnl c -} - -macro cmpng a, b, c -{ - cmp a, b - jng c -} - -macro cmpge a, b, c -{ - cmp a, b - jge c -} - -macro cmple a, b, c -{ - cmp a, b - jle c -} \ No newline at end of file diff --git a/programs/system/open/open.asm b/programs/system/open/open.asm index 028ce78c8e..93c1d94a79 100644 --- a/programs/system/open/open.asm +++ b/programs/system/open/open.asm @@ -15,6 +15,7 @@ include "../../proc32.inc" include "../../macros.inc" include "../../dll.inc" + include "../../cmp.inc" include "../../string.inc" include "../../develop/libraries/box_lib/trunk/box_lib.mac" @@ -24,8 +25,6 @@ if DEBUG eq 1 include "../../debug.inc" end if - include "macros.inc" - ;=============================== if lang eq ru @@ -134,11 +133,16 @@ end if db 0 dd icons + is_file_exists: + dd 0, 0, 0, 0, buffer6 + db 0 + dd buffer + last_x dd -1 last_y dd -1 if DEBUG eq 1 - std_param db "~/sys/settings/assoc.ini", 0 + std_param db "~/sys/example.asm", 0 end if imports: @@ -233,7 +237,10 @@ end if open: invoke libini.get_str, assoc_ini, assoc_ini.sec, slash, buffer, 2048, undefined + cmpne [buffer], byte "$", @f + invoke libini.get_str, assoc_ini, buffer + 1, assoc_ini.exec, buffer, 2048, undefined cmpe [buffer], byte 0, ini_error + @@: mov eax, [param_s] mov [is_open + 8], eax mcall 70, is_open @@ -707,6 +714,11 @@ end if ;---------------------- proc section_cb, _file, _sec + ;; CHECK IF EXISTS + invoke libini.get_str, assoc_ini, [_sec], assoc_ini.exec, buffer, 2048, undefined + mcall 70, is_file_exists + cmpe ebx, -1, .exit + mov ebx, [list.size] shl ebx, 5 add ebx, list @@ -721,6 +733,7 @@ end if inc [sb_apps.max_area] @@: mov eax, 1 + .exit: ret endp @@ -752,6 +765,7 @@ end if buffer3 rb 2048 buffer4 rb 4096 buffer5 rb 4096 + buffer6 rb 2048 params rb 2048 _stack rb 2048 - memory: \ No newline at end of file + memory: