14,10 → 14,12 |
#include "../lib/list_box.h" |
#include "../lib/obj/box_lib.h" |
#include "../lib/obj/libio.h" |
#include "../lib/obj/libimg.h" |
#include "../lib/obj/libini.h" |
#include "../lib/collection.h" |
#include "../lib/io.h" |
#include "../lib/patterns/select_list.h" |
#include "../lib/patterns/restart_process.h" |
|
//===================================================// |
// // |
34,6 → 36,7 |
#define T_ASSEPT_RISK " ¯à¨¨¬ î à¨áª" |
#define T_README "Readme" |
#define T_INSTALL "áâ ®¢¨âì" |
#define T_DRIVER_INSTALLARION_STARTED "' ç « áì ãáâ ®¢ª ¤à ©¢¥à .\n®£ ãáâ ®¢ª¨ 室¨âáï ¢ ¯à¨«®¦¥¨¨ BOARD.'I" |
char description_name[] = "description_ru"; |
#else |
#define WINDOW_TITLE "Driver Installer" |
42,6 → 45,7 |
#define T_ASSEPT_RISK "I accept the risk" |
#define T_README "Readme" |
#define T_INSTALL "Install" |
#define T_DRIVER_INSTALLARION_STARTED "'Driver installation started.\nInstallation log can be found in BOARD app.'I" |
char description_name[] = "description_en"; |
#endif |
|
58,6 → 62,7 |
|
char drvinf_path[4096] = "/kolibrios/drivers/drvinf.ini"; |
char cur_version[64]; |
char cur_type[12]; |
char cur_description[1024]; |
char cur_readme_path[4096]; |
char cur_install_path[4096]; |
86,6 → 91,7 |
load_dll(libio, #libio_init,1); |
load_dll(libini, #lib_init,1); |
load_dll(boxlib, #box_lib_init,0); |
load_dll(libimg, #libimg_init,1); |
GetIniData(); |
SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER); |
loop() switch(WaitEvent()) |
136,6 → 142,7 |
int PADDING = 12; |
int right_frame_x = Form.cwidth*46/100; |
int readme_w = 0; |
int icon_n = 38; |
//LEFT FRAME |
SelectList_Init(PADDING, |
PADDING, |
147,8 → 154,10 |
//RIGHT FRAME |
GetCurrentSectionData(); |
DrawBar(right_frame_x, PADDING+3, Form.cwidth - right_frame_x - PADDING, 80, system.color.work); |
WriteTextB(right_frame_x, PADDING+3, 0x81, system.color.work_text, ini_sections.get(select_list.cur_y)); |
WriteText(right_frame_x, PADDING+23, 0x80, system.color.work_text, #cur_version); |
if (streq(#cur_type, "disk")) icon_n = 50; |
DrawIcon32(right_frame_x, PADDING, system.color.work, icon_n); |
WriteTextB(right_frame_x+44, PADDING+3, 0x81, system.color.work_text, ini_sections.get(select_list.cur_y)); |
WriteText(right_frame_x+44, PADDING+23, 0x80, system.color.work_text, #cur_version); |
if(cur_readme_path[0]) readme_w = DrawStandartCaptButton(right_frame_x, PADDING+45, BUTTON_ID_README, T_README); |
DrawStandartCaptButton(right_frame_x + readme_w, PADDING+45, BUTTON_ID_INSTALL, T_INSTALL); |
DrawTextViewArea(right_frame_x-2, PADDING+83, Form.cwidth - right_frame_x - PADDING, Form.cheight-PADDING-PADDING, |
183,6 → 192,7 |
{ |
dword section_name = ini_sections.get(select_list.cur_y); |
ini_get_str stdcall (#drvinf_path, section_name, "ver", #cur_version, sizeof(cur_version), 0); |
ini_get_str stdcall (#drvinf_path, section_name, "type", #cur_type, sizeof(cur_type), 0); |
ini_get_str stdcall (#drvinf_path, section_name, #description_name, #cur_description, sizeof(cur_description), 0); |
ini_get_str stdcall (#drvinf_path, section_name, "readme", #cur_readme_path, sizeof(cur_readme_path), 0); |
ini_get_str stdcall (#drvinf_path, section_name, "install", #cur_install_path, sizeof(cur_install_path), 0); |
231,5 → 241,11 |
{ |
int result; |
result = io.run(#cur_install_path, NULL); |
if (result) notify("'Driver installation started.\nPlease, open BOARD to check status.'I"); |
if (result) notify(T_DRIVER_INSTALLARION_STARTED); |
pause(300); |
if (streq(#cur_type, "video")) { |
RestartProcessByName("/sys/@taskbar", SINGLE); |
RestartProcessByName("/sys/@docky", SINGLE); |
RestartProcessByName("/sys/@icon", MOLTIPLE); |
} |
} |