Eolite 1.2: path history. Forward button should work now.

git-svn-id: svn://kolibrios.org@2591 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2012-04-08 22:01:35 +00:00
parent 267774dd55
commit a612dc8dfb
3 changed files with 31 additions and 29 deletions

View File

@ -3,6 +3,7 @@
//êîïèðîâàòü ÷åðåç ïîòîê
//IF (strcmp(#path+strlen(#path)-1,"/")<>0) copystr("/",#path+strlen(#path)); //åñëè íåò, + "/" ïåðåíåñòèâ îïåíäèð
//3. Äóìàþ áóäåò ôëàã îòîáðàæàòü ïîäïèñè èëè íåò. È äà, èêîíêà äåéñòâèòåëüíî íóæíà äðóãàÿ.
#include "lib\kolibri.h"
#include "lib\memory.h"
@ -19,7 +20,7 @@ int BUTTON_HEIGHT=18;
#define ONLY_OPEN 2
//ïåðåìåííûå
#define title "Eolite File Manager v1.15"
#define title "Eolite File Manager v1.2"
dword videlenie=0x94AECE; //öâåò âûäåëåííîãî ýëåìåíòà èç ñïèñêà ôàéëîâ
//
int but_num,
@ -163,8 +164,8 @@ int pressed_y;
case 21: //Back
GoBack();
break;
case 22: //Forvard
HistoryPath(go_forvard);
case 22: //Forward
HistoryPath(go_forward);
break;
case 23: //up!
IF (strcmp(#path,"/")<>0) Dir_Up();
@ -787,12 +788,12 @@ void SelectFile(dword that_file)
void Dir_Up()
{
byte temp_[4096];
char cur_folder[4096];
i=strlen(#path)-1;
path[i]=0x00;
do i--; while (path[i]<>'/'); copystr(#path+i+1,#temp_);
do i--; while (path[i]<>'/'); copystr(#path+i+1,#cur_folder);
path[i+1]=0x00;
SelectFile(#temp_);
SelectFile(#cur_folder);
}

View File

@ -37,10 +37,10 @@ void authors()
DefineAndDrawWindow(600,150,181,256,0x34,0x10EFEBEF,0,0,"About Eolite");
DrawBar(0,0,172,50,0x8494C4); //ãîëóáîå ñçàäè
PutPaletteImage(#logo,85,85,43,7,#logo_pal);
WriteText(54-3,100,0x80,0xBF40BF,"Eolite v1.15",0);
WriteText(54,100,0x80,0xBF40BF,"Eolite v1.2",0);
WriteText(55,120,0x80,0,"Developers:",0);
WriteText(39,130,0x80,0,"Leency & Veliant",0);
WriteText(30,140,0x80,0,"Diamond, Lrz, Nable",0);
WriteText(45,140,0x80,0,"KolibriOS Team",0);
WriteText(55,150,0x80,0," 2008-2012 ",0);
WriteText(12,170,0x80,0,"Visit",0);
DrawLink(48,170,23, "kolibri-os.narod.ru"); //ññûëêa

View File

@ -6,9 +6,7 @@ int history_current;
#define add_new_path 1
#define go_back 2
#define go_forvard 3
//history_current
#define go_forward 3
dword GetCurrentFolder()
{
@ -21,33 +19,36 @@ dword GetCurrentFolder()
void HistoryPath(byte action)
{
/*WriteDebug("");
WriteDebug(IntToStr(history_current));
for (i=0; i<history_num; i++;)
{
WriteDebug(#history_list[i].Item);
WriteDebug(IntToStr(history_num));
}*/
if (action==add_new_path)
{
if (history_num>0) && (strcmp(#path,#history_list[history_num-1].Item)==0) return;
copystr(#path,#history_list[history_num].Item);
history_num++;
if (history_num>0) && (strcmp(#path,#history_list[history_current].Item)==0) return;
history_current++;
copystr(#path,#history_list[history_current].Item);
history_num=history_current;
}
if (action==go_back)
{
if (history_num<=2) return;
history_num--;
copystr(#history_list[history_num-1].Item,#path);
if (history_current<=2) return;
WriteDebug("");
WriteDebug("Fuck!");
history_current--;
copystr(#history_list[history_current].Item,#path);
}
if (action==go_forvard)
if (action==go_forward)
{
WriteDebug("");
for (i=0; i<history_num; i++;)
{
WriteDebug(#history_list[i].Item);
WriteDebug(IntToStr(history_num));
}
if (strcmp("",#history_list[history_num].Item)==0) return;
history_num++;
copystr(#history_list[history_num-1].Item,#path);
if (history_current==history_num) return;
history_current++;
copystr(#history_list[history_current].Item,#path);
SelectFile("");
return;
}
}