Subversion Repositories Kolibri OS

Rev

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