SYSPANEL: add Russian translation

git-svn-id: svn://kolibrios.org@7769 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2020-04-06 15:22:12 +00:00
parent 37a69c4efa
commit 0a6d41ab86
5 changed files with 126 additions and 79 deletions

View File

@ -68,50 +68,54 @@ img_files = {
{"SETTINGS/LANG.INI", build_type .. "/settings/lang.ini"}, {"SETTINGS/LANG.INI", build_type .. "/settings/lang.ini"},
{"SETTINGS/MENU.DAT", build_type .. "/settings/menu.dat"}, {"SETTINGS/MENU.DAT", build_type .. "/settings/menu.dat"},
{"SETTINGS/NETWORK.INI", "common/settings/network.ini"}, {"SETTINGS/NETWORK.INI", "common/settings/network.ini"},
{"SETTINGS/SYSPANEL.INI", "common/settings/syspanel.ini"},
{"SETTINGS/SYSTEM.INI", "common/settings/system.ini"}, {"SETTINGS/SYSTEM.INI", "common/settings/system.ini"},
{"SETTINGS/TASKBAR.INI", "common/settings/taskbar.ini"}, {"SETTINGS/TASKBAR.INI", "common/settings/taskbar.ini"},
} }
-- For russian build, add russian-only files. -- For russian build, add russian-only files.
if build_type == "rus" then tup.append_table(img_files, { if build_type == "rus" then tup.append_table(img_files, {
{"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/rus/example.asm"},
{"PIPETKA", build_type .. "/pipetka"},
{"GAMES/BASEKURS.KLA", build_type .. "/games/basekurs.kla"},
{"GAMES/PADENIE", build_type .. "/games/padenie"},
{"File Managers/KFAR.INI", build_type .. "/File Managers/kfar.ini"},
{"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/russian/dos_kolibri/kfm_keys.txt"}, {"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/russian/dos_kolibri/kfm_keys.txt"},
{"SETTINGS/.shell", PROGS .. "/system/shell/bin/rus/.shell"}, {"SETTINGS/.shell", PROGS .. "/system/shell/bin/rus/.shell"},
{"SETTINGS/GAMES.INI", "rus/settings/games.ini"}, {"SETTINGS/GAMES.INI", "rus/settings/games.ini"},
{"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey.ini"}, {"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey.ini"},
{"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/rus/example.asm"}, {"SETTINGS/SYSPANEL.INI", "rus/settings/syspanel.ini"},
{"PIPETKA", build_type .. "/pipetka"},
{"File Managers/KFAR.INI", build_type .. "/File Managers/kfar.ini"},
{"GAMES/BASEKURS.KLA", build_type .. "/games/basekurs.kla"},
{"GAMES/PADENIE", build_type .. "/games/padenie"},
}) elseif build_type == "eng" then tup.append_table(img_files, { }) elseif build_type == "eng" then tup.append_table(img_files, {
{"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/english/kfm_keys.txt"},
{"SETTINGS/GAMES.INI", "common/settings/games.ini"},
{"SETTINGS/.shell", PROGS .. "/system/shell/bin/eng/.shell"},
{"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/example.asm"}, {"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/example.asm"},
{"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey.ini"},
{"File Managers/KFAR.INI", "common/File Managers/kfar.ini"}, {"File Managers/KFAR.INI", "common/File Managers/kfar.ini"},
{"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/english/kfm_keys.txt"},
{"SETTINGS/.shell", PROGS .. "/system/shell/bin/eng/.shell"},
{"SETTINGS/GAMES.INI", "common/settings/games.ini"},
{"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey.ini"},
{"SETTINGS/SYSPANEL.INI", "common/settings/syspanel.ini"},
}) elseif build_type == "sp" then tup.append_table(img_files, { }) elseif build_type == "sp" then tup.append_table(img_files, {
{"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/english/kfm_keys.txt"},
{"SETTINGS/GAMES.INI", "common/settings/games.ini"},
{"SETTINGS/.shell", PROGS .. "/system/shell/bin/eng/.shell"},
{"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/example.asm"}, {"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/example.asm"},
{"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey.ini"},
{"File Managers/KFAR.INI", "common/File Managers/kfar.ini"}, {"File Managers/KFAR.INI", "common/File Managers/kfar.ini"},
{"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/english/kfm_keys.txt"},
{"SETTINGS/.shell", PROGS .. "/system/shell/bin/eng/.shell"},
{"SETTINGS/GAMES.INI", "common/settings/games.ini"},
{"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey.ini"},
{"SETTINGS/SYSPANEL.INI", "common/settings/syspanel.ini"},
}) elseif build_type == "it" then tup.append_table(img_files, { }) elseif build_type == "it" then tup.append_table(img_files, {
{"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/english/kfm_keys.txt"},
{"SETTINGS/GAMES.INI", "common/settings/games.ini"},
{"SETTINGS/.shell", PROGS .. "/system/shell/bin/eng/.shell"},
{"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/example.asm"}, {"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/example.asm"},
{"File Managers/KFAR.INI", "common/File Managers/kfar.ini"},
{"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/english/kfm_keys.txt"},
{"SETTINGS/.shell", PROGS .. "/system/shell/bin/eng/.shell"},
{"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey_it.ini"}, {"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey_it.ini"},
{"File Managers/KFAR.INI", "common/File Managers/kfar.ini"},
}) else tup.append_table(img_files, {
{"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/english/kfm_keys.txt"},
{"SETTINGS/GAMES.INI", "common/settings/games.ini"}, {"SETTINGS/GAMES.INI", "common/settings/games.ini"},
{"SETTINGS/.shell", PROGS .. "/system/shell/bin/eng/.shell"}, {"SETTINGS/SYSPANEL.INI", "common/settings/syspanel.ini"},
}) else tup.append_table(img_files, {
{"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/example.asm"}, {"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/example.asm"},
{"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey.ini"}, {"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/english/kfm_keys.txt"},
{"File Managers/KFAR.INI", "common/File Managers/kfar.ini"}, {"File Managers/KFAR.INI", "common/File Managers/kfar.ini"},
{"SETTINGS/.shell", PROGS .. "/system/shell/bin/eng/.shell"},
{"SETTINGS/GAMES.INI", "common/settings/games.ini"},
{"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey.ini"},
{"SETTINGS/SYSPANEL.INI", "common/settings/syspanel.ini"},
}) end }) end
--[[ --[[

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

@ -0,0 +1,40 @@
[Config]
title=‘¨á⥬­ ï ¯ ­¥«ì KolibriOS
win_width=700
cell_w=84
cell_h=84
[Š®­ä¨£ãà æ¨ï]
‚¨àâã «ì­ë¥ ¤¨áª¨=tmpdisk,36
<EFBFBD> §à¥è¥­¨¥ íªà ­ =vmode,108
‘¥â¥¢ë¥ ãáâனá⢠=network/netcfg,71
‘¨á⥬­ë¥ ­ áâனª¨=setup,5
„ â  ¨ ¢à¥¬ï=calendar,52
ƒ¥­¥à â®à ä®­ =media/palitra,61
Žä®à¬«¥­¨¥=/k/utils/appearance,62
Žª­ =skincfg,80
ƒà®¬ª®áâì=@VOLUME,64
<EFBFBD> ­¥«¨=barscfg,63
Œëèì=mousecfg,54
“áâ ­®¢ª  ¤à ©¢¥à®¢=/k/drivers/DRVINST.KEX,38
€¢â®§ £à㧪 =tinypad|/sys/settings/autorun.dat,55
HotAngles=HACONFIG,105
<EFBFBD>¨â ­¨¥=apm,76
[Œ®­¨â®à¨­£]
„®áª  ®â« ¤ª¨=develop/board,19
‘â âãá á¥â¨=network/netstat,33
Ghost monitor=gmon,107
‘¨á⥬­ë© ¬®­¨â®à=sysmon,57
<EFBFBD>à®æ¥ááë=cpu,60
<EFBFBD>ãä¥à ®¡¬¥­ =develop/clipview,83
[’¥áâ¨à®¢ ­¨¥]
’¥áâ § é¨âë=test,37
CpuId=cpuid,37
<EFBFBD>ªà ­=disptest,113
‘ª®à®áâì ”‘=fspeed,45
ˆ­ä®à¬ æ¨ï ® ¤¨áª å=hdd_info,50
˜¨­ =kbd,37
‘ª®à®áâì £à ä¨ª¨=mgb,121
“áâனá⢠ PCI=pcidev,38

View File

@ -103,12 +103,12 @@ int kfont_char_width[255];
return true; return true;
} }
:dword KFONT::getsize(byte fontSizePoints, dword text1) :dword KFONT::getsize(byte font_size, dword text1)
{ {
size.height = size.width = 0; size.height = size.width = 0;
size.offset_x = size.offset_y = -1; size.offset_x = size.offset_y = -1;
if (size.pt != fontSizePoints) { if (size.pt != font_size) {
size.pt = fontSizePoints; size.pt = font_size;
if(!changeSIZE())return 0; if(!changeSIZE())return 0;
} }
WHILE(DSBYTE[text1]) WHILE(DSBYTE[text1])
@ -123,7 +123,7 @@ int kfont_char_width[255];
return size.width; return size.width;
} }
//WILL NOT WORK if requested fontSizePoints //WILL NOT WORK if requested font_size
//is differ from precalculated kfont_char_width[] //is differ from precalculated kfont_char_width[]
:int KFONT::get_label_width(dword _label) :int KFONT::get_label_width(dword _label)
{ {
@ -242,13 +242,13 @@ inline fastcall dword b32(EAX) { return DSDWORD[EAX]; }
} }
} }
:void KFONT::WriteIntoBuffer(int x,y,w,h; dword _background, _color; byte fontSizePoints; dword text1) :void KFONT::WriteIntoBuffer(int x,y,w,h; dword _background, _color; byte font_size; dword text1)
{ {
dword new_raw_size; dword new_raw_size;
if(!text1)return; if(!text1)return;
if (size.pt != fontSizePoints) { if (size.pt != font_size) {
getsize(fontSizePoints, text1); getsize(font_size, text1);
y -= size.offset_y; y -= size.offset_y;
} }
color = _color; color = _color;
@ -277,22 +277,22 @@ inline fastcall dword b32(EAX) { return DSDWORD[EAX]; }
return; return;
} }
:int KFONT::WriteIntoWindow(int x,y; dword _background, _color; byte fontSizePoints; dword text1) :int KFONT::WriteIntoWindow(int x,y; dword _background, _color; byte font_size; dword text1)
{ {
if(!text1)return 0; if(!text1)return 0;
getsize(fontSizePoints, text1); getsize(font_size, text1);
raw_size = NULL; raw_size = NULL;
WriteIntoBuffer(0, -size.offset_y, size.width-size.offset_x, WriteIntoBuffer(0, -size.offset_y, size.width-size.offset_x,
size.height-size.offset_y, _background, _color, fontSizePoints, text1); size.height-size.offset_y, _background, _color, font_size, text1);
if (smooth) ApplySmooth(); if (smooth) ApplySmooth();
ShowBuffer(x,y); ShowBuffer(x,y);
return size.offset_x + size.width; return size.offset_x + size.width;
} }
:int KFONT::WriteIntoWindowCenter(dword x,y,w,h; dword _background, _color; byte fontSizePoints; dword text1) :int KFONT::WriteIntoWindowCenter(dword x, _y,w,h, _background, _color; byte font_size; dword text1)
{ {
getsize(fontSizePoints, text1); getsize(font_size, text1);
return WriteIntoWindow(w-size.width/2+x-1,y, _background, _color, fontSizePoints, text1); return WriteIntoWindow(w-size.width/2+x-1, _y, _background, _color, font_size, text1);
} }
:void KFONT::ShowBuffer(dword _x, _y) :void KFONT::ShowBuffer(dword _x, _y)

View File

@ -18,7 +18,7 @@ SOFTWARE CENTER v2.86
proc_info Form; proc_info Form;
llist list; llist list;
collection app_path_collection; collection app_path_collection;
byte kolibrios_mounted; bool kolibrios_mounted;
int window_width, int window_width,
window_height; window_height;
@ -29,7 +29,7 @@ int list_pos,
default_icon; default_icon;
char window_title[128], char window_title[128],
settings_ini_path[256] = "/sys/settings/"; settings_ini_path[256];
bool small_screen = false; bool small_screen = false;
@ -42,22 +42,20 @@ struct SW_COLORS
dword light; dword light;
} swc; } swc;
block ipos[128]; block selection[128];
void load_config() void load_ini_config(dword _ini_path)
{ {
ini_get_str stdcall (#settings_ini_path, "Config", "title", #window_title, sizeof(window_title), "Software widget"); _ini ini;
ini_get_int stdcall (#settings_ini_path, "Config", "win_width", 690); ini.path = _ini_path;
window_width = EAX; ini.section = "Config";
ini_get_int stdcall (#settings_ini_path, "Config", "cell_w", 73); ini.GetString("title", #window_title, sizeof(window_title), "Software widget");
list.item_w = EAX; window_width = ini.GetInt("win_width", 690);
ini_get_int stdcall (#settings_ini_path, "Config", "cell_h", 71); list.item_w = ini.GetInt("cell_w", 73);
list.item_h = EAX; list.item_h = ini.GetInt("cell_h", 71);
ini_get_int stdcall (#settings_ini_path, "Config", "default_icon", 2); default_icon = ini.GetInt("default_icon", 2);
default_icon = EAX;
} }
void main() void main()
{ {
dword id; dword id;
@ -68,17 +66,15 @@ void main()
kolibrios_mounted = dir_exists("/kolibrios"); kolibrios_mounted = dir_exists("/kolibrios");
if (param) if (param) {
{
strcpy(#settings_ini_path, #param); strcpy(#settings_ini_path, #param);
} } else {
else strcpy(#settings_ini_path, "/sys/settings/");
{
strcat(#settings_ini_path, I_Path + strrchr(I_Path, '/')); strcat(#settings_ini_path, I_Path + strrchr(I_Path, '/'));
strcat(#settings_ini_path, ".ini"); strcat(#settings_ini_path, ".ini");
} }
load_config(); load_ini_config(#settings_ini_path);
list.cur_y = -1; list.cur_y = -1;
list.y = 32; list.y = 32;
@ -98,13 +94,13 @@ void main()
if (SCAN_CODE_LEFT == key_scancode) key_scancode = SCAN_CODE_UP; if (SCAN_CODE_LEFT == key_scancode) key_scancode = SCAN_CODE_UP;
if (SCAN_CODE_RIGHT == key_scancode) key_scancode = SCAN_CODE_DOWN; if (SCAN_CODE_RIGHT == key_scancode) key_scancode = SCAN_CODE_DOWN;
if (list.ProcessKey(key_scancode)) DrawSelection(); if (list.ProcessKey(key_scancode)) DrawSelection();
if (SCAN_CODE_ENTER == key_scancode) EventRunApp(list.cur_y); if (SCAN_CODE_ENTER == key_scancode) EventIconClick(list.cur_y);
break; break;
case evButton: case evButton:
id=GetButtonID(); id=GetButtonID();
if (id==1) ExitProcess(); if (id==1) ExitProcess();
if (id>=100) EventRunApp(id-100); if (id>=100) EventIconClick(id-100);
break; break;
case evReDraw: case evReDraw:
@ -120,7 +116,7 @@ void main()
list.y = 0; list.y = 0;
} else { } else {
DrawTitle(NULL); DrawTitle(NULL);
draw_top_bar(); DrawTopBar();
} }
DrawList(); DrawList();
DrawBar(0, row +1 * list.item_h + list_pos, Form.cwidth, -row - 1 * list.item_h - list_pos + Form.cheight, swc.list_bg); DrawBar(0, row +1 * list.item_h + list_pos, Form.cwidth, -row - 1 * list.item_h - list_pos + Form.cheight, swc.list_bg);
@ -169,10 +165,11 @@ void DrawList() {
byte draw_icons_from_section(dword key_value, key_name, sec_name, f_name) byte draw_icons_from_section(dword key_value, key_name, sec_name, f_name)
{ {
int tmp, int icon_id = default_icon,
icon_id,
icon_char_pos; icon_char_pos;
int text_w; int space_pos;
dword icon_x, icon_y, text_x, text_y;
//do not show items located in /kolibrios/ if this directory not mounted //do not show items located in /kolibrios/ if this directory not mounted
if (!strncmp(key_value, "/kolibrios/", 11)) || (!strncmp(key_value, "/k/", 3)) if (!strncmp(key_value, "/kolibrios/", 11)) || (!strncmp(key_value, "/k/", 3))
@ -184,19 +181,28 @@ byte draw_icons_from_section(dword key_value, key_name, sec_name, f_name)
} }
if (col==0) DrawBar(0, row * list.item_h + list_pos, Form.cwidth, list.item_h, swc.list_bg); if (col==0) DrawBar(0, row * list.item_h + list_pos, Form.cwidth, list.item_h, swc.list_bg);
DefineButton(col*list.item_w+6, row*list.item_h + list_pos,list.item_w,list.item_h-5,list.count + 100 + BT_HIDE,0); DefineButton(col*list.item_w+6, row*list.item_h + list_pos,list.item_w,list.item_h-3,list.count + 100 + BT_HIDE,0);
tmp = list.item_w/2;
icon_char_pos = strchr(key_value, ','); icon_char_pos = strchr(key_value, ',');
if (icon_char_pos) icon_id = atoi(icon_char_pos+1); else icon_id = default_icon; icon_x = col*list.item_w+calc(list.item_w/2)-10;
img_draw stdcall(skin.image, col*list.item_w+tmp-10, row*list.item_h+5 + list_pos, 32, 32, 0, icon_id*32); icon_y = row*list.item_h+5 + list_pos;
selection[list.count].x = icon_x-2;
selection[list.count].y = icon_y-2;
if (icon_char_pos) ESBYTE[icon_char_pos] = '\0'; //delete icon from string if (icon_char_pos) ESBYTE[icon_char_pos] = '\0'; //delete icon from string
app_path_collection.add(key_value); app_path_collection.add(key_value);
//kfont.WriteIntoWindowCenter(col*list.item_w+7,row*list.item_h+47 + list_pos, list.item_w,0, swc.list_bg, swc.dark, 12, key_name);
text_w = kfont.WriteIntoWindowCenter(col*list.item_w+5,row*list.item_h+46 + list_pos, list.item_w,0, swc.list_bg, swc.text, 12, key_name); text_x = col*list.item_w+5;
ipos[list.count].x = list.item_w-text_w/2+calc(col*list.item_w)+5; text_y = list.item_h - 40 / 2;
ipos[list.count].y = row*list.item_h+46 + list_pos + 16; if (kfont.getsize(key_name)+30<list.item_w) || (!strchr(key_name, ' ')) {
ipos[list.count].w = text_w; kfont.WriteIntoWindowCenter(text_x, row*list.item_h+46 + list_pos, list.item_w,0, swc.list_bg, swc.text, 12, key_name);
} else {
space_pos = strrchr(key_name, ' ');
ESBYTE[key_name+space_pos-1] = '\0';
kfont.WriteIntoWindowCenter(text_x, row*list.item_h+46 + list_pos - 2, list.item_w,0, swc.list_bg, swc.text, 12, key_name);
kfont.WriteIntoWindowCenter(text_x, row*list.item_h+46 + list_pos + 14, list.item_w,0, swc.list_bg, swc.text, 12, key_name+space_pos);
}
if (icon_char_pos) icon_id = atoi(icon_char_pos+1);
img_draw stdcall(skin.image, icon_x, icon_y, 32, 32, 0, icon_id*32);
list.count++; list.count++;
col++; col++;
return true; return true;
@ -231,7 +237,7 @@ byte process_sections(dword sec_name, f_name)
return true; return true;
} }
void draw_top_bar() void DrawTopBar()
{ {
DrawBar(0,0,Form.cwidth, list.y-2, system.color.work); DrawBar(0,0,Form.cwidth, list.y-2, system.color.work);
DrawBar(0,list.y-2, Form.cwidth, 1, MixColors(system.color.work, system.color.work_graph, 180)); DrawBar(0,list.y-2, Form.cwidth, 1, MixColors(system.color.work, system.color.work_graph, 180));
@ -239,7 +245,7 @@ void draw_top_bar()
kfont.WriteIntoWindowCenter(0,5, Form.cwidth, list.y, system.color.work, system.color.work_text, 16, #window_title); kfont.WriteIntoWindowCenter(0,5, Form.cwidth, list.y, system.color.work, system.color.work_text, 16, #window_title);
} }
void EventRunApp(dword appid) void EventIconClick(dword appid)
{ {
char run_app_path[4096]=0; char run_app_path[4096]=0;
dword app_path = app_path_collection.get(appid); dword app_path = app_path_collection.get(appid);
@ -264,13 +270,10 @@ void EventRunApp(dword appid)
strcat(#run_app_path, app_path); strcat(#run_app_path, app_path);
// }end // }end
if (file_exists(#run_app_path)) if (file_exists(#run_app_path)) {
{
io.run(#run_app_path, param_pos); //0 or offset io.run(#run_app_path, param_pos); //0 or offset
if (param_pos) ESBYTE[param_pos - 1] = '|'; if (param_pos) ESBYTE[param_pos - 1] = '|';
} } else {
else
{
notify("'Application not found' -E"); notify("'Application not found' -E");
} }
} }
@ -281,7 +284,7 @@ void DrawSelection()
dword col; dword col;
for (i=0; i<list.count; i++) { for (i=0; i<list.count; i++) {
if (i==list.cur_y) col=0x0080FF; else col=swc.list_bg; if (i==list.cur_y) col=0x0080FF; else col=swc.list_bg;
DrawBar(ipos[i].x, ipos[i].y, ipos[i].w+2, 3, col); DrawWideRectangle(selection[i].x, selection[i].y, 36, 36, 2, col);
} }
} }