Subversion Repositories Kolibri OS

Rev

Rev 2833 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2833 Rev 2875
1
//06.04.2012
1
//06.04.2012
2
 
2
 
3
path_string history_list[40];
3
path_string history_list[40];
4
int history_num;
4
int history_num;
5
int history_current;
5
int history_current;
6
 
6
 
7
#define ADD_NEW_PATH 1
7
#define ADD_NEW_PATH 1
8
#define GO_BACK      2
8
#define GO_BACK      2
9
#define GO_FORWARD   3
9
#define GO_FORWARD   3
10
 
10
 
11
dword GetCurrentFolder()
11
dword GetCurrentFolder()
12
{
12
{
13
	char cur_fol[4096];
13
	char cur_fol[4096];
14
	copystr(#path,#cur_fol);
14
	copystr(#path,#cur_fol);
15
	cur_fol[strlen(#cur_fol)-1]=0x00; //îáðåçàåì ïîñëåäíèé /
15
	cur_fol[strlen(#cur_fol)-1]=0x00; //îáðåçàåì ïîñëåäíèé /
16
	copystr(#cur_fol+find_symbol(#cur_fol,'/'),#cur_fol);
16
	copystr(#cur_fol+strchr(#cur_fol,'/'),#cur_fol);
17
	return #cur_fol;
17
	return #cur_fol;
18
}
18
}
19
 
19
 
20
void HistoryPath(byte action)
20
int HistoryPath(byte action)
21
{
21
{
22
	int MAX_HISTORY_NUM;
22
	int MAX_HISTORY_NUM;
23
	
23
	
24
	if (action==ADD_NEW_PATH)
24
	if (action==ADD_NEW_PATH)
25
	{
25
	{
26
		if (history_num>0) && (!strcmp(#path,#history_list[history_current].Item)) return;
26
		if (history_num>0) && (!strcmp(#path,#history_list[history_current].Item)) return;
27
		
27
		
28
		MAX_HISTORY_NUM = sizeof(history_list)/sizeof(path_string);
28
		MAX_HISTORY_NUM = sizeof(history_list)/sizeof(path_string);
29
		if (history_current>=MAX_HISTORY_NUM-1)
29
		if (history_current>=MAX_HISTORY_NUM-1)
30
		{
30
		{
31
			history_current/=2;
31
			history_current/=2;
32
			for (i=0; i
32
			for (i=0; i
33
			{
33
			{
34
				copystr(#history_list[MAX_HISTORY_NUM-i].Item, #history_list[i].Item);
34
				copystr(#history_list[MAX_HISTORY_NUM-i].Item, #history_list[i].Item);
35
			}	
35
			}	
36
		}
36
		}
37
		history_current++;
37
		history_current++;
38
		copystr(#path,#history_list[history_current].Item);
38
		copystr(#path,#history_list[history_current].Item);
39
		history_num=history_current;
39
		history_num=history_current;
40
	}
40
	}
41
	
41
	
42
	if (action==GO_BACK)
42
	if (action==GO_BACK)
43
	{
43
	{
44
		if (history_current<=2) return;
44
		if (history_current<=2) return 0;
45
		history_current--;
45
		history_current--;
46
		copystr(#history_list[history_current].Item,#path);
46
		copystr(#history_list[history_current].Item,#path);
-
 
47
		return 1;
47
	}
48
	}
48
 
49
 
49
	if (action==GO_FORWARD)
50
	if (action==GO_FORWARD)
50
	{
51
	{
51
		if (history_current==history_num) return;
52
		if (history_current==history_num) return 0;
52
		history_current++;
53
		history_current++;
53
		copystr(#history_list[history_current].Item,#path);
54
		copystr(#history_list[history_current].Item,#path);
-
 
55
		return 1;
54
	}	
56
	}	
55
}
57
}