Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
2588 leency 1
//06.04.2012
2
 
3
path_string history_list[40];
4
int history_num;
5
int history_current;
6
 
7
#define add_new_path 1
8
#define go_back 2
2591 leency 9
#define go_forward 3
2588 leency 10
 
11
dword GetCurrentFolder()
12
{
13
	char cur_fol[4096];
14
	copystr(#path,#cur_fol);
15
	cur_fol[strlen(#cur_fol)-1]=0x00; //обрезаем последний /
16
	copystr(#cur_fol+find_symbol(#cur_fol,'/'),#cur_fol);
17
	return #cur_fol;
18
}
19
 
20
void HistoryPath(byte action)
21
{
2591 leency 22
	/*WriteDebug("");
23
	WriteDebug(IntToStr(history_current));
24
	for (i=0; i
25
	{
26
		WriteDebug(#history_list[i].Item);
27
		WriteDebug(IntToStr(history_num));
28
	}*/
29
 
2588 leency 30
	if (action==add_new_path)
31
	{
2591 leency 32
		if (history_num>0) && (strcmp(#path,#history_list[history_current].Item)==0) return;
33
		history_current++;
34
		copystr(#path,#history_list[history_current].Item);
35
		history_num=history_current;
2588 leency 36
	}
37
 
38
	if (action==go_back)
39
	{
2591 leency 40
		if (history_current<=2) return;
41
		WriteDebug("");
42
		WriteDebug("Fuck!");
43
		history_current--;
44
		copystr(#history_list[history_current].Item,#path);
2588 leency 45
	}
46
 
2591 leency 47
	if (action==go_forward)
2588 leency 48
	{
2591 leency 49
		if (history_current==history_num) return;
50
		history_current++;
51
		copystr(#history_list[history_current].Item,#path);
2588 leency 52
		SelectFile("");
53
	}
54
}