Subversion Repositories Kolibri OS

Rev

Rev 6604 | Rev 6641 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6604 Rev 6635
Line 150... Line 150...
150
	SystemDiscs.Get();
150
	SystemDiscs.Get();
151
	SetAppColors();
151
	SetAppColors();
152
	if (param)
152
	if (param)
153
	{
153
	{
154
		strcpy(#path, #param);
154
		strcpy(#path, #param);
155
		if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //add "/" to the end of the string
155
		if (path[strlen(#path)-1]=='/') path[strlen(#path)-1]=NULL; //no "/" in the end
156
	}		
156
	}		
Line 157... Line 157...
157
	
157
	
158
	Open_Dir(#path,ONLY_OPEN);
158
	Open_Dir(#path,ONLY_OPEN);
159
	strcpy(#inactive_path, #path);
159
	strcpy(#inactive_path, #path);
Line 705... Line 705...
705
	if (TestBit(attr, 1)) || (TestBit(attr, 2)) text_col=0xA6A6B7; //system or hiden?
705
	if (TestBit(attr, 1)) || (TestBit(attr, 2)) text_col=0xA6A6B7; //system or hiden?
706
	if (bgcol!=0xFFFfff)
706
	if (bgcol!=0xFFFfff)
707
	{
707
	{
708
		itdir = TestBit(attr, 4);
708
		itdir = TestBit(attr, 4);
709
		strcpy(#file_name, file_name_off);
709
		strcpy(#file_name, file_name_off);
-
 
710
		if (!strcmp(#path,"/")) sprintf(#file_path,"%s%s",#path,file_name_off);
710
		sprintf(#file_path,"%s%s",#path,file_name_off);
711
			else sprintf(#file_path,"%s/%s",#path,file_name_off);
711
		if (text_col==0xA6A6B7) text_col=0xFFFFFF;
712
		if (text_col==0xA6A6B7) text_col=0xFFFFFF;
712
	}
713
	}
713
	if (file.selected) text_col=0xFF0000;
714
	if (file.selected) text_col=0xFF0000;
714
	if (label.size.pt==9) || (!label.font)
715
	if (label.size.pt==9) || (!label.font)
715
	{
716
	{
Line 744... Line 745...
744
void Open_Dir(dword dir_path, redraw){
745
void Open_Dir(dword dir_path, redraw){
745
	int errornum, maxcount, i;
746
	int errornum, maxcount, i;
746
	if (redraw!=ONLY_SHOW)
747
	if (redraw!=ONLY_SHOW)
747
	{
748
	{
748
		selected_count = 0;
749
		selected_count = 0;
749
		if (ESBYTE[dir_path+1]!='\0') ESBYTE[dir_path+strlen(dir_path)-1] = '\0';
-
 
750
		if (buf) free(buf);
750
		if (buf) free(buf);
751
		errornum = GetDir(#buf, #files.count, dir_path, DIRS_NOROOT);
751
		errornum = GetDir(#buf, #files.count, dir_path, DIRS_NOROOT);
752
		if (ESBYTE[dir_path+1]!='\0') chrcat(dir_path, '/');
-
 
753
		if (errornum)
752
		if (errornum)
754
		{
753
		{
755
			history.add(#path);
754
			history.add(#path);
756
			GoBack();
755
			GoBack();
757
			Write_Error(errornum);
756
			Write_Error(errornum);
Line 864... Line 863...
864
}
863
}
Line 865... Line 864...
865
 
864
 
866
 
865
 
867
void Dir_Up()
866
void Dir_Up()
868
{
867
{
869
	char cur_folder[4096];
868
	char old_folder_name[4096];
870
	i=strlen(#path)-1;
869
	i=strlen(#path)-1;
871
	if (i==0) return;
870
	if (i==0) return;
872
	path[i]=0x00;
871
	//path[i]=0x00;
873
	i = strrchr(#path, '/');
872
	i = strrchr(#path, '/');
874
	strcpy(#cur_folder, #path+i);
873
	strcpy(#old_folder_name, #path+i);
875
	path[i]=0x00;
874
	if (i>1) path[i-1]=NULL; else path[i]=NULL;
Line 876... Line 875...
876
	SelectFileByName(#cur_folder);
875
	SelectFileByName(#old_folder_name);
877
}
876
}
878
 
877
 
879
void Open(byte rez)
878
void Open(byte rez)
880
{
879
{
881
	byte temp[4096];
880
	byte temp[4096];
882
	selected_count = 0;
881
	selected_count = 0;
883
	if (rez)
882
	if (rez)
884
	{
-
 
885
		if (!strncmp(#file_name,"..",3)) return;
883
	{
886
		strcpy(#temp, #file_path);
884
		if (!strncmp(#file_name,"..",3)) return;
887
		if (path[strlen(#temp)-1]!='/') chrcat(#temp, '/'); //need "/" in the end
885
		strcpy(#temp, #file_path);
888
		RunProgram("/sys/File Managers/Eolite", #temp);
886
		RunProgram("/sys/File Managers/Eolite", #temp);
889
		return;
887
		return;
Line 895... Line 893...
895
	} 
893
	} 
896
	else
894
	else
897
	{
895
	{
898
		if (!strncmp(#file_name,"..",3)) { Dir_Up(); return; }
896
		if (!strncmp(#file_name,"..",3)) { Dir_Up(); return; }
899
		strcpy(#path, #file_path);
897
		strcpy(#path, #file_path);
900
		if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //need "/" in the end
-
 
901
		files.first=files.cur_y=0;
898
		files.first=files.cur_y=0;
902
		Open_Dir(#path,WITH_REDRAW);
899
		Open_Dir(#path,WITH_REDRAW);
903
	}
900
	}
904
}
901
}
Line 905... Line 902...
905
 
902
 
906
inline fastcall void GoBack()
903
inline fastcall void GoBack()
907
{
904
{
908
	char cur_folder[4096];
905
	char cur_folder[4096];
909
	strcpy(#cur_folder, #path);
-
 
910
	cur_folder[strlen(#cur_folder)-1]=0x00; //delete last '/'
906
	strcpy(#cur_folder, #path);
911
	if (history.back()) {
907
	if (history.back()) {
912
		strcpy(#path, history.current());
908
		strcpy(#path, history.current());
913
		SelectFileByName(#cur_folder+strrchr(#cur_folder,'/'));
909
		SelectFileByName(#cur_folder+strrchr(#cur_folder,'/'));
914
	}
910
	}
Line 925... Line 921...
925
{
921
{
926
	BDVK element_info;
922
	BDVK element_info;
927
	byte del_rezult, copy_rezult, info_result;
923
	byte del_rezult, copy_rezult, info_result;
928
	if (newf)
924
	if (newf)
929
	{
925
	{
930
		sprintf(#temp,"%s%s",#path,new_file_ed.text);
926
		sprintf(#temp,"%s/%s",#path,new_file_ed.text);
931
		info_result = GetFileInfo(#temp, #element_info);
927
		info_result = GetFileInfo(#temp, #element_info);
932
		switch(new_element_active)
928
		switch(new_element_active)
933
		{
929
		{
934
			case CREATE_FILE:
930
			case CREATE_FILE:
935
				if (info_result==5)
931
				if (info_result==5)