2012-04-08 00:09:46 +02:00
|
|
|
|
//06.04.2012
|
|
|
|
|
|
2012-06-29 16:08:48 +02:00
|
|
|
|
path_string history_list[40];
|
2012-04-08 00:09:46 +02:00
|
|
|
|
int history_num;
|
|
|
|
|
int history_current;
|
|
|
|
|
|
2012-06-29 16:08:48 +02:00
|
|
|
|
#define ADD_NEW_PATH 1
|
|
|
|
|
#define GO_BACK 2
|
|
|
|
|
#define GO_FORWARD 3
|
2012-04-08 00:09:46 +02:00
|
|
|
|
|
|
|
|
|
dword GetCurrentFolder()
|
|
|
|
|
{
|
|
|
|
|
char cur_fol[4096];
|
|
|
|
|
copystr(#path,#cur_fol);
|
|
|
|
|
cur_fol[strlen(#cur_fol)-1]=0x00; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> /
|
2012-07-16 13:58:24 +02:00
|
|
|
|
copystr(#cur_fol+strchr(#cur_fol,'/'),#cur_fol);
|
2012-04-08 00:09:46 +02:00
|
|
|
|
return #cur_fol;
|
|
|
|
|
}
|
|
|
|
|
|
2012-07-16 13:58:24 +02:00
|
|
|
|
int HistoryPath(byte action)
|
2012-04-08 00:09:46 +02:00
|
|
|
|
{
|
2012-06-29 16:08:48 +02:00
|
|
|
|
int MAX_HISTORY_NUM;
|
|
|
|
|
|
|
|
|
|
if (action==ADD_NEW_PATH)
|
2012-04-08 00:09:46 +02:00
|
|
|
|
{
|
2012-06-29 16:08:48 +02:00
|
|
|
|
if (history_num>0) && (!strcmp(#path,#history_list[history_current].Item)) return;
|
|
|
|
|
|
|
|
|
|
MAX_HISTORY_NUM = sizeof(history_list)/sizeof(path_string);
|
2012-04-10 11:21:59 +02:00
|
|
|
|
if (history_current>=MAX_HISTORY_NUM-1)
|
|
|
|
|
{
|
|
|
|
|
history_current/=2;
|
|
|
|
|
for (i=0; i<history_current; i++;)
|
|
|
|
|
{
|
|
|
|
|
copystr(#history_list[MAX_HISTORY_NUM-i].Item, #history_list[i].Item);
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-04-09 00:01:35 +02:00
|
|
|
|
history_current++;
|
|
|
|
|
copystr(#path,#history_list[history_current].Item);
|
|
|
|
|
history_num=history_current;
|
2012-04-08 00:09:46 +02:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-29 16:08:48 +02:00
|
|
|
|
if (action==GO_BACK)
|
2012-04-08 00:09:46 +02:00
|
|
|
|
{
|
2012-07-16 13:58:24 +02:00
|
|
|
|
if (history_current<=2) return 0;
|
2012-04-09 00:01:35 +02:00
|
|
|
|
history_current--;
|
|
|
|
|
copystr(#history_list[history_current].Item,#path);
|
2012-07-16 13:58:24 +02:00
|
|
|
|
return 1;
|
2012-04-08 00:09:46 +02:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-29 16:08:48 +02:00
|
|
|
|
if (action==GO_FORWARD)
|
2012-04-08 00:09:46 +02:00
|
|
|
|
{
|
2012-07-16 13:58:24 +02:00
|
|
|
|
if (history_current==history_num) return 0;
|
2012-04-09 00:01:35 +02:00
|
|
|
|
history_current++;
|
|
|
|
|
copystr(#history_list[history_current].Item,#path);
|
2012-07-16 13:58:24 +02:00
|
|
|
|
return 1;
|
2012-04-08 00:09:46 +02:00
|
|
|
|
}
|
|
|
|
|
}
|