Eolite 1.43: use libini

git-svn-id: svn://kolibrios.org@5399 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Serhii Sakhno 2015-02-13 22:17:57 +00:00
parent 09b55147be
commit d41d908dd0
3 changed files with 15 additions and 136 deletions

View File

@ -1,96 +1,5 @@
; be cafefull: there should be no spaces in the lines end
[Assoc]
txt=TinyPad
asm=TinyPad
inc=TinyPad
ini=TinyPad
log=TinyPad
inf=TinyPad
conf=TinyPad
htm=/sys/network/WebView
html=/sys/network/WebView
mht=/sys/network/WebView
fb2=/sys/network/WebView
gif=/sys/media/kiv
tga=/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
png=/sys/media/kiv
jpg=/sys/media/kiv
jpeg=/sys/media/kiv
tif=/sys/media/kiv
tiff=/sys/media/kiv
wbmp=/sys/media/kiv
wav=/sys/media/AC97SND
xm=/sys/media/AC97SND
m3u=/sys/media/AC97SND
lap=/sys/media/listplay
asf=/sys/media/listplay
mid=/sys/media/MIDAMP
midi=/sys/media/MIDAMP
skn=desktop
rtf=RtfRead
grf=graph
obj=/sys/develop/cObj
3ds=/sys/3d/view3ds
lif=/sys/demos/life2
kla=/sys/games/klavisha
raw=/sys/develop/heed
sh=SHELL
;;;;;;SYS additional programs;;;;;;;;;;;
txt=/sys/develop/t_edit
bmp=/sys/media/animage
kexp=kpack
;;;;;/kolibrios/ additional programs;;;;
pdf=/kolibrios/updf
ttf=/kolibrios/vttf
exe=/kolibrios/demos/peload/peload
bmp=/kolibrios/media/zsea/zsea
png=/kolibrios/media/zsea/zsea
jpg=/kolibrios/media/zsea/zsea
jpeg=/kolibrios/media/zsea/zsea
avi=/kolibrios/media/fplay
mkv=/kolibrios/media/fplay
wmv=/kolibrios/media/fplay
vob=/kolibrios/media/fplay
flv=/kolibrios/media/fplay
mp4=/kolibrios/media/fplay
mpg=/kolibrios/media/fplay
mpeg=/kolibrios/media/fplay
mov=/kolibrios/media/fplay
webm=/kolibrios/media/fplay
mp3=/kolibrios/media/fplay
;emul
smc=/kolibrios/emul/zsnes
mcr=/kolibrios/emul/psx4all
nes=/kolibrios/emul/fce
sna=/kolibrios/emul/e80
gb=/kolibrios/emul/gameboy
gbc=/kolibrios/emul/gameboy
;develop
lua=/kolibrios/develop/lua/lua
py=/kolibrios/develop/python/tinypy
js=/kolibrios/develop/js_engine/seelib
bf=/kolibrios/develop/brainfuck
ob07=/kolibrios/develop/Oberton-07/Oberton
[Config]
SelectionColor=94AECE
LineHeight=18

View File

@ -12,6 +12,7 @@
#include "..\lib\strings.h"
#include "..\lib\mem.h"
#include "..\lib\dll.h"
#include "..\lib\lib.obj\libini.h"
#include "..\lib\lib.obj\box_lib.h"
#include "..\lib\file_system.h"
#include "..\lib\figures.h"
@ -19,7 +20,6 @@
#include "..\lib\list_box.h"
#include "..\lib\copyf.h"
#include "..\lib\random.h"
#include "..\lib\lib.obj\libini.h"
//images
#include "imgs\toolbar.txt"
#include "imgs\left_p.txt"
@ -83,8 +83,8 @@
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
#define TITLE "Eolite File Manager v2.42"
#define ABOUT_TITLE "Eolite v2.42"
#define TITLE "Eolite File Manager v2.43"
#define ABOUT_TITLE "Eolite v2.43"
dword col_padding, col_selec, col_lpanel;
int toolbar_buttons_x[7]={9,46,85,134,167,203};
@ -164,7 +164,7 @@ void main()
files.line_h=18;
mem_Init();
if (load_dll2(boxlib, #box_lib_init,0)!=0) notify(ERROR_1);
if (load_dll2(libini, #lib_init,1)!=0) notify("Error: library doesn't exists - libini");
if (load_dll2(libini, #lib_init,1)!=0) notify("Error: library doesn't exists - libini");
SystemDiscsGet();
GetIni(1);
SetAppColors();

View File

@ -18,47 +18,17 @@ void GetIni(byte onload)
free(buff);
if (!GetFile(#buff, #fsize, abspath("Eolite.ini"))) notify("Eolite.ini not found. Defaults will be used.");
}
for (tj=0; tj<fsize; tj++;)
{
bukva = ESBYTE[buff+tj];
switch (bukva)
{
case ';': InfType=COMMENT; break;
case '[': InfType=SECTION; section=NULL; break;
case ']': InfType=PARAM; break;
case '=': InfType=OPTION; break;
case 0x0a:
case 0x0d:
InfType=PARAM;
if (!strcmp(#parametr,"SelectionColor")) edit2.shift_color=col_selec=StrToCol(#option);
if (!strcmp(#parametr,"LineHeight")) files.line_h = atoi(#option);
if (!strcmp(#parametr,"ShowDeviceName")) show_dev_name=atoi(#option);
if (!strcmp(#parametr,"RealFileNamesCase")) real_files_names_case=atoi(#option);
if (!strcmp(#parametr,"DrwRamDiskSpace")) drw_ram_disk_space=atoi(#option);
if (parametr) && (!strcmpi(#file_name+strrchr(#file_name,'.'),#parametr)) && (!onload)
{
errornum = RunProgram(#option,#file_path);
if (errornum<0)
{
if (errornum==-5) ShowOpenWithDialog(); else Write_Error(errornum);
}
return;
}
parametr=option=NULL;
break;
default:
IF (InfType==SECTION) chrcat(#section, bukva);
IF (InfType==PARAM) chrcat(#parametr, bukva);
IF (InfType==OPTION) chrcat(#option, bukva);
}
}
if (file_path) && (!onload)
{
errornum = RunProgram(#file_path,NULL);
if (errornum==-31) menu_action(201); else if (errornum<0) Write_Error(errornum);
return;
}
ini_get_color stdcall (abspath("Eolite.ini"), "Config", "SelectionColor", 0x94AECE);
edit2.shift_color = EAX;
ini_get_int stdcall (abspath("Eolite.ini"), "Config", "LineHeight", 18);
files.line_h = EAX;
ini_get_int stdcall (abspath("Eolite.ini"), "Config", "ShowDeviceName", 1);
show_dev_name = EAX;
ini_get_int stdcall (abspath("Eolite.ini"), "Config", "RealFileNamesCase", 0);
real_files_names_case = EAX;
ini_get_int stdcall (abspath("Eolite.ini"), "Config", "DrwRamDiskSpace", 0);
drw_ram_disk_space = EAX;
}