Subversion Repositories Kolibri OS

Rev

Rev 8981 | Rev 9044 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3399 leency 1
 
6034 leency 2
{
3
	collection list;
4
	int dev_num;
7422 leency 5
	void Get();
6
	void Draw();
6034 leency 7
	void DrawSelect();
8854 leency 8
	void DrawOptions();
9
} SystemDiscs=0;
7972 leency 10
3848 punk_joker 11
 
7422 leency 12
{
3363 leency 13
	char dev_name[10], sys_discs[10];
5150 leency 14
	int i1, j1, dev_disc_num, real_dev_num;
8981 leency 15
	dword devbuf, diskbuf;
8872 leency 16
5734 leency 17
 
6034 leency 18
	devbuf = malloc(10000);
5960 leency 19
	ReadDir(19, devbuf, "/");
3363 leency 20
	dev_num = real_dev_num = EBX;
8981 leency 21
22
 
23
	dev_num++;
24
25
 
26
		//need to check that /sys != /kolibrios
27
		list.add("/kolibrios");
28
		dev_num++;
29
	}
30
31
 
32
	{
7310 pavelyakov 33
		sprintf(#dev_name,"/%s",i1*304+ devbuf+72);
6635 leency 34
		GetDir(#diskbuf, #dev_disc_num, #dev_name, DIRS_NOROOT);
8872 leency 35
		for (j1=0; j1
3363 leency 36
		{
37
			sprintf(#sys_discs,"%s/%s",#dev_name,j1*304+ diskbuf+72);
8872 leency 38
			if (sys_discs[1]=='r') {
8981 leency 39
				dev_num--;
40
				continue;
41
			}
7422 leency 42
			if (sys_discs[1]=='c') || (sys_discs[1]=='f') || (dir_exists(#sys_discs)) {
8981 leency 43
				list.add(#sys_discs);
44
			}
45
		}
4225 punk_joker 46
	}
3363 leency 47
	free(devbuf);
5960 leency 48
	free(diskbuf);
8872 leency 49
}
3363 leency 50
51
 
8981 leency 52
{
8949 leency 53
	int i;
54
	for (i=0; devinfo[i]!=0; i+=3) {
55
		if (!strncmp(dev_name+1, devinfo[i], 2)) {
8981 leency 56
			ESBYTE[dev_icon] = devinfo[i+1];
8949 leency 57
			strcpy(disc_name, devinfo[i+2]);
58
			return;
59
		}
60
	}
61
	ESBYTE[dev_icon]=5;
62
	strcpy(disc_name, T_UNC);
63
}
64
65
 
6034 leency 66
{
3363 leency 67
	char dev_name[15], disc_name[100], i, dev_icon;
8949 leency 68
	bool is_active=0;
69
	int draw_y, draw_x;
7989 leency 70
3363 leency 71
 
8854 leency 72
		DrawSelect(2, KFM_DEV_DROPDOWN_1, location[0]);
8952 leency 73
		DrawSelect(Form.cwidth/2, KFM_DEV_DROPDOWN_2, location[sizeof(dword)]);
74
		files.y = 40 + 17;
8854 leency 75
	} else {
76
		Tip(56, T_DEVICES, 55, "=");
8951 leency 77
		for (i=0; i<30; i++) DeleteButton(100+i);
78
79
 
8854 leency 80
		draw_x = 17;
81
		for (i=0;i
82
			strcpy(#dev_name, list.get(i));
83
			GetDiskIconAndName(#dev_name, #dev_icon, #disc_name);
8981 leency 84
			if (strstr(path, #dev_name)==path) is_active=true; else is_active=false;
8949 leency 85
6034 leency 86
 
7989 leency 87
			DrawBar(draw_x+6+18,draw_y,160-6-18,DEV_H+1,0xFFFFFF);
88
			DefineHiddenButton(draw_x,draw_y,159,16,100+i);
8949 leency 89
			if (show_dev_name.checked)
7244 leency 90
			{
5698 leency 91
				strcat(#disc_name, #dev_name);
92
				if (is_active) WriteText(draw_x+30,draw_y+5,0x80,0x555555,#disc_name);
6034 leency 93
				WriteText(draw_x+29,draw_y+5,0x80,0,#disc_name);
7806 leency 94
				//if (is_active) kfont.bold = true;
8854 leency 95
				//kfont.WriteIntoWindow(draw_x + 29, draw_y+2, 0xFFFfff, 0x000000, kfont.size.pt, #disc_name);
96
				//kfont.bold = false;
97
			} else {
7806 leency 98
				if (is_active) WriteText(draw_x+30,draw_y+5,0x80,0x555555,#dev_name);
6034 leency 99
				WriteText(draw_x+29,draw_y+5,0x80,0,#dev_name);
100
			}
5698 leency 101
			_PutImage(draw_x+6,draw_y, 18,17, is_active*7+dev_icon*17*18*3+#devices);
7989 leency 102
			draw_y += DEV_H;
8854 leency 103
		}
5633 leency 104
		DrawBar(draw_x+6, draw_y, 18, 1, 0xFFFfff);
7989 leency 105
		ActionsDraw(list.count*DEV_H+108);
8952 leency 106
		DrawLeftPanelBg(list.count*DEV_H);
107
	}
5703 leency 108
}
3363 leency 109
110
 
8949 leency 111
{
8854 leency 112
	char dev_name[15], disc_name[100], i, dev_icon;
8949 leency 113
114
 
115
		strcpy(#dev_name, "/root");
8854 leency 116
		dev_icon = 0;
117
	} else if (chrnum(_path, '/')==1) {
8949 leency 118
		strcpy(#dev_name, _path);
119
		GetDiskIconAndName(#dev_name, #dev_icon, #disc_name);
8981 leency 120
	} else for (i=0;i
8854 leency 121
		strcpy(#dev_name, list.get(i));
122
		GetDiskIconAndName(#dev_name, #dev_icon, #disc_name);
8981 leency 123
		if (strstr(_path, #dev_name)-_path==0) break;
8949 leency 124
	}
8854 leency 125
	DrawRectangle(draw_x-1, SELECTY-1, DDW+2-KFM2_DEVH, KFM2_DEVH+1, sc.work_graph);
8949 leency 126
	DrawBar(draw_x, SELECTY, DDW+1-KFM2_DEVH, KFM2_DEVH, 0xFFFFFF);
127
	_PutImage(draw_x + 5, SELECTY+2, 18,17, dev_icon*17*18*3+#devices);
128
	kfont.WriteIntoWindow(draw_x + 24, math.max(KFM2_DEVH-kfont.height/2+SELECTY,0), 0xFFFfff, 0x000000, kfont.size.pt, #dev_name+1);
129
	DefineHiddenButton(draw_x, SELECTY, DDW-1, KFM2_DEVH-1, btid);
8953 leency 130
	DrawFlatButtonSmall(draw_x+DDW-KFM2_DEVH+1, SELECTY-1, KFM2_DEVH-1, KFM2_DEVH+1, NULL, "\x19");
131
}
8854 leency 132
133
 
8949 leency 134
{
8854 leency 135
	int optionsy = SELECTY+KFM2_DEVH+1;
8949 leency 136
	char dev_name[15], disc_name[100], i, dev_icon, is_active=0;
8854 leency 137
138
 
8996 leency 139
8854 leency 140
 
8949 leency 141
8854 leency 142
 
143
		strcpy(#dev_name, list.get(i));
144
		GetDiskIconAndName(#dev_name, #dev_icon, #disc_name);
8981 leency 145
		if (strstr(path, #dev_name)!=0) is_active=true; else is_active=false;
8949 leency 146
8854 leency 147
 
8949 leency 148
		DefineButton(draw_x, optionsy, DDW, KFM2_DEVH-1, 100+i+BT_HIDE,0xFFFFFF);
149
		_PutImage(draw_x + 5, optionsy+2, 18,17, is_active*7+dev_icon*17*18*3+#devices);
150
		if (is_active) kfont.bold = true;
8854 leency 151
		kfont.WriteIntoWindow(draw_x + 24, optionsy+2, 0xFFFfff, 0x000000, kfont.size.pt, #dev_name+1);
8949 leency 152
		kfont.bold = false;
8854 leency 153
		optionsy += KFM2_DEVH;
8949 leency 154
	}
8854 leency 155
}
156