Subversion Repositories Kolibri OS

Rev

Rev 8381 | Rev 8933 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8381 Rev 8915
Line 59... Line 59...
59
 
59
 
Line 60... Line 60...
60
collection ini_sections=0;
60
collection ini_sections=0;
61
 
61
 
62
char drvinf_path[4096] = "/kolibrios/drivers/drvinf.ini";
62
char drvinf_path[4096] = "/kolibrios/drivers/drvinf.ini";
63
char cur_version[64];
63
char cur_version[64];
64
char cur_type[12];
64
int  cur_icon;
65
char cur_description[1024];
65
char cur_description[1024];
Line 66... Line 66...
66
char cur_readme_path[4096];
66
char cur_readme_path[4096];
Line 135... Line 135...
135
}
135
}
Line 136... Line 136...
136
 
136
 
137
 
137
 
138
void Draw_DriverListWindow()
138
void Draw_DriverListWindow()
139
{
139
{
140
	int PADDING = 12;
140
	#define PADDING 12
141
	int right_frame_x = Form.cwidth*46/100;
-
 
142
	int readme_w = 0;
141
	int right_frame_x = Form.cwidth*46/100;
143
	int icon_n = 38;
142
	int readme_w = 0;
144
	//LEFT FRAME
143
	//LEFT FRAME
145
	SelectList_Init(PADDING, 
144
	SelectList_Init(PADDING, 
146
		PADDING, 
145
		PADDING, 
Line 150... Line 149...
150
	SelectList_Draw();
149
	SelectList_Draw();
151
	SelectList_DrawBorder();
150
	SelectList_DrawBorder();
152
	//RIGHT FRAME
151
	//RIGHT FRAME
153
	GetCurrentSectionData();
152
	GetCurrentSectionData();
154
	DrawBar(right_frame_x, PADDING+3, Form.cwidth - right_frame_x - PADDING, 80, sc.work);
153
	DrawBar(right_frame_x, PADDING+3, Form.cwidth - right_frame_x - PADDING, 80, sc.work);
155
	if (streq(#cur_type, "disk")) icon_n = 50;
-
 
156
	DrawIcon32(right_frame_x, PADDING, sc.work, icon_n);	
154
	DrawIcon32(right_frame_x, PADDING, sc.work, cur_icon);	
157
	WriteTextB(right_frame_x+44, PADDING+3, 0x81, sc.work_text, ini_sections.get(select_list.cur_y));
155
	WriteTextB(right_frame_x+44, PADDING+3, 0x81, sc.work_text, ini_sections.get(select_list.cur_y));
158
	WriteText(right_frame_x+44, PADDING+23, 0x80, sc.work_text, #cur_version);
156
	WriteText(right_frame_x+44, PADDING+23, 0x80, sc.work_text, #cur_version);
159
	if(cur_readme_path[0]) readme_w = DrawStandartCaptButton(right_frame_x, PADDING+45, BUTTON_ID_README, T_README);
157
	if(cur_readme_path[0]) readme_w = DrawStandartCaptButton(right_frame_x, PADDING+45, BUTTON_ID_README, T_README);
160
	DrawStandartCaptButton(right_frame_x + readme_w, PADDING+45, BUTTON_ID_INSTALL, T_INSTALL);
158
	DrawStandartCaptButton(right_frame_x + readme_w, PADDING+45, BUTTON_ID_INSTALL, T_INSTALL);
161
	DrawTextViewArea(right_frame_x-2, PADDING+83, Form.cwidth - right_frame_x - PADDING, Form.cheight-PADDING-PADDING, 
159
	DrawTextViewArea(right_frame_x-2, PADDING+83, Form.cwidth - right_frame_x - PADDING, Form.cheight-PADDING-PADDING, 
Line 188... Line 186...
188
 
186
 
189
void GetCurrentSectionData()
187
void GetCurrentSectionData()
190
{
188
{
191
	dword section_name = ini_sections.get(select_list.cur_y);
189
	dword section_name = ini_sections.get(select_list.cur_y);
192
	ini_get_str stdcall (#drvinf_path, section_name, "ver", #cur_version, sizeof(cur_version), 0);
190
	ini_get_str stdcall (#drvinf_path, section_name, "ver", #cur_version, sizeof(cur_version), 0);
193
	ini_get_str stdcall (#drvinf_path, section_name, "type", #cur_type, sizeof(cur_type), 0);
191
	ini_get_int stdcall (#drvinf_path, section_name, "icon", 38); cur_icon = EAX;
194
	ini_get_str stdcall (#drvinf_path, section_name, #description_name, #cur_description, sizeof(cur_description), 0);
192
	ini_get_str stdcall (#drvinf_path, section_name, #description_name, #cur_description, sizeof(cur_description), 0);
195
	ini_get_str stdcall (#drvinf_path, section_name, "readme", #cur_readme_path, sizeof(cur_readme_path), 0);
193
	ini_get_str stdcall (#drvinf_path, section_name, "readme", #cur_readme_path, sizeof(cur_readme_path), 0);
196
	ini_get_str stdcall (#drvinf_path, section_name, "install", #cur_install_path, sizeof(cur_install_path), 0);
194
	ini_get_str stdcall (#drvinf_path, section_name, "install", #cur_install_path, sizeof(cur_install_path), 0);
Line 239... Line 237...
239
{
237
{
240
	int result;
238
	int result;
241
	result = io.run(#cur_install_path, NULL);
239
	result = io.run(#cur_install_path, NULL);
242
	if (result) notify(T_DRIVER_INSTALLARION_STARTED);
240
	if (result) notify(T_DRIVER_INSTALLARION_STARTED);
243
	pause(300);
241
	pause(300);
244
	if (streq(#cur_type, "video")) {
242
	if (cur_icon == 61) {
245
		RestartProcessByName("/sys/@taskbar", SINGLE);
243
		RestartProcessByName("/sys/@taskbar", SINGLE);
246
		RestartProcessByName("/sys/@docky", SINGLE);	
244
		RestartProcessByName("/sys/@docky", SINGLE);	
247
		RestartProcessByName("/sys/@icon", MULTIPLE);	
245
		RestartProcessByName("/sys/@icon", MULTIPLE);	
248
	}
246
	}
249
}
247
}
250
248