Subversion Repositories Kolibri OS

Rev

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

Rev 8765 Rev 8779
Line 1... Line 1...
1
//Leency, Veliant, Punk_Joker, PavelYakov & KolibriOS Team 2008-2021
1
//Leency, Veliant, Punk_Joker, PavelYakov & KolibriOS Team 2008-2021
2
//GNU GPL license.
2
//GNU GPL license.
Line 3... Line 3...
3
 
3
 
Line 4... Line 4...
4
// 70.5 - get volume info and label
4
// 70.5 - get volume info and label
5
 
5
 
Line 6... Line 6...
6
#define TITLE "Eolite File Manager 4.61"
6
#define TITLE "Eolite File Manager 4.65"
7
#define ABOUT_TITLE "EOLITE 4.61"
7
#define ABOUT_TITLE "EOLITE 4.65"
8
 
8
 
Line 165... Line 165...
165
{
165
{
166
	//-p  : just show file/folder properties dialog
166
	//-p  : just show file/folder properties dialog
167
	//-d  : delete file/folder
167
	//-d  : delete file/folder
168
	//-v : paste files/folder from clipboard
168
	//-v : paste files/folder from clipboard
169
	dword p = #param;
169
	dword p = #param;
170
	if (param[0]=='/') && (param[1]=='E') && (param[2]=='F') && (param[3]=='M') {
170
	if (param[0]=='\\') && (param[1]=='E') && (param[2]=='F') && (param[3]=='M') {
171
		efm = true;
171
		efm = true;
172
		p += 4;
172
		p += 4;
173
		if (param[4]==' ') p++;
173
		if (param[4]==' ') p++;
174
	}
174
	}
Line -... Line 175...
-
 
175
 
-
 
176
	LoadIniSettings();
175
 
177
 
Line 176... Line 178...
176
	if (ESBYTE[p]=='\0') return;
178
	if (ESBYTE[p]=='\0') return;
177
 
179
 
178
	if (ESBYTE[p]=='-') switch (ESBYTE[p+1]) 
180
	if (ESBYTE[p]=='-') switch (ESBYTE[p+1]) 
Line 196... Line 198...
196
			strcpy(#path, p + 4);
198
			strcpy(#path, p + 4);
197
			PasteThread();
199
			PasteThread();
198
			ExitProcess();
200
			ExitProcess();
199
	}
201
	}
Line -... Line 202...
-
 
202
 
-
 
203
	ESBYTE[0] = NULL;
200
 
204
 
Line 201... Line 205...
201
	if (ESBYTE[strlen(p)+p-1]=='/') ESBYTE[strlen(p)+p-1]=NULL; //no "/" at the end
205
	if (param[strlen(#param)-1]=='/') ESBYTE[strlen(#param)-1]=NULL; //no "/" at the end
202
 
206
 
203
	if (dir_exists(p)) {
207
	if (dir_exists(p)) {
204
		strcpy(#path, p);
208
		strcpy(#path, p);
205
	} else {
209
	} else {
206
		if (file_exists(p)) {
210
		if (file_exists(p)) {
207
			ESBYTE[strrchr(p, '/')+p-1] = '\0';
211
			ESBYTE[strrchr(p, '/')+p-1] = '\0';
208
			strcpy(#path, p);
212
			strcpy(#path, p);
209
			SelectFileByName(p+strlen(p)+1);
213
			SelectFileByName(p+strlen(#path)+1);
210
		} else {
214
		} else {
211
			notify(T_NOTIFY_APP_PARAM_WRONG);
215
			notify(T_NOTIFY_APP_PARAM_WRONG);
212
		}
216
		}
Line 220... Line 224...
220
 
224
 
221
	load_libraries();
225
	load_libraries();
Line 222... Line 226...
222
	SetAppColors();
226
	SetAppColors();
223
 
-
 
224
	handle_param();
-
 
225
	ESBYTE[0] = NULL;
227
 
Line 226... Line -...
226
 
-
 
227
	rand_n = random(80);
228
	handle_param();
Line 228... Line 229...
228
 
229
	rand_n = random(80);
229
	LoadIniSettings();
230
 
230
	SystemDiscs.Get();
231
	SystemDiscs.Get();
Line 657... Line 658...
657
		DrawList();
658
		DrawList();
658
		Open_Dir(#path,ONLY_SHOW);
659
		Open_Dir(#path,ONLY_SHOW);
659
	}
660
	}
660
	else
661
	else
661
	{
662
	{
662
		SystemDiscs.Get();
663
		//SystemDiscs.Get();
663
		llist_copy(#files, #files_inactive);
664
		llist_copy(#files, #files_inactive);
664
		strcpy(#path, #inactive_path);
665
		strcpy(#path, #inactive_path);
665
		col.selec = col.selec_inactive;
666
		col.selec = col.selec_inactive;
666
		SystemDiscs.Draw();
667
		SystemDiscs.Draw();
667
		files_y = files.y;
668
		files_y = files.y;
Line 700... Line 701...
700
void List_ReDraw()
701
void List_ReDraw()
701
{
702
{
702
	int all_lines_h;
703
	int all_lines_h;
703
	dword j;
704
	dword j;
704
	static int old_cur_y, old_first;
705
	static int old_cur_y, old_first;
-
 
706
	dword separator_color;
Line 705... Line 707...
705
 
707
 
Line 706... Line 708...
706
	files.CheckDoesValuesOkey(); //prevent some shit
708
	files.CheckDoesValuesOkey(); //prevent some shit
707
 
709
 
Line 727... Line 729...
727
		else Line_ReDraw(col.selec, files.cur_y-files.first);		
729
		else Line_ReDraw(col.selec, files.cur_y-files.first);		
728
	}
730
	}
729
	//in the bottom
731
	//in the bottom
730
	all_lines_h = j * files.item_h;
732
	all_lines_h = j * files.item_h;
731
	DrawBar(files.x,all_lines_h + files.y,files.w,files.h - all_lines_h, col.list_bg);
733
	DrawBar(files.x,all_lines_h + files.y,files.w,files.h - all_lines_h, col.list_bg);
-
 
734
	if (colored_lines.checked) separator_color = col.list_bg; else separator_color = col.list_vert_line;
732
	DrawBar(files.x+files.w-141,all_lines_h + files.y,1,files.h - all_lines_h,col.list_vert_line);
735
	DrawBar(files.x+files.w-141,all_lines_h + files.y,1,files.h - all_lines_h, separator_color);
733
	DrawBar(files.x+files.w-68,all_lines_h + files.y,1,files.h - all_lines_h,col.list_vert_line);
736
	DrawBar(files.x+files.w-68,all_lines_h + files.y,1,files.h - all_lines_h, separator_color);
734
	Scroll();
737
	Scroll();
Line 735... Line 738...
735
 
738
 
736
	if (del_active) Del_Form();
739
	if (del_active) Del_Form();
737
	if (new_element_active) && (col.selec != 0xCCCccc) NewElement_Form(new_element_active, #new_element_name);
740
	if (new_element_active) && (col.selec != 0xCCCccc) NewElement_Form(new_element_active, #new_element_name);
Line 762... Line 765...
762
		  file_size=0,
765
		  file_size=0,
763
		  y=filenum*files.item_h+files.y,
766
		  y=filenum*files.item_h+files.y,
764
		  icon_y = files.item_h-icon_size/2+y;
767
		  icon_y = files.item_h-icon_size/2+y;
765
		  BDVK file;
768
		  BDVK file;
766
		  char full_path[4096];
769
		  char full_path[4096];
-
 
770
		  dword separator_color;
767
	char label_file_name[4096];
771
	char label_file_name[4096];
768
	if (filenum==-1) return;
772
	if (filenum==-1) return;
-
 
773
 
769
	DrawBar(files.x,y,4,files.item_h,bgcol);
774
	DrawBar(files.x,y,4,files.item_h,bgcol);
770
	DrawBar(files.x+4,y,icon_size,icon_y-y,bgcol);
775
	DrawBar(files.x+4,y,icon_size,icon_y-y,bgcol);
771
	if (files.item_h>icon_size) DrawBar(files.x+4,icon_y+icon_size-1,icon_size,y+files.item_h-icon_y-icon_size+1,bgcol);
776
	if (files.item_h>icon_size) DrawBar(files.x+4,icon_y+icon_size-1,icon_size,y+files.item_h-icon_y-icon_size+1,bgcol);
-
 
777
	if (colored_lines.checked) {
772
	if (colored_lines.checked) && (bgcol!=col.selec) && (filenum%2) bgcol=col.odd_line;
778
		if (bgcol!=col.selec) && (filenum%2) bgcol=col.odd_line;
-
 
779
		separator_color = bgcol;
-
 
780
	} else {
-
 
781
		separator_color = col.list_vert_line;
-
 
782
	}
773
	DrawBar(files.x+icon_size+4,y,files.w-icon_size-4,files.item_h,bgcol);
783
	DrawBar(files.x+icon_size+4,y,files.w-icon_size-4,files.item_h,bgcol);
-
 
784
	DrawBar(files.x+files.w-141,y,1,files.item_h, separator_color);
-
 
785
	DrawBar(files.x+files.w-68,y,1,files.item_h, separator_color);
Line 774... Line 786...
774
 
786
 
775
	file_offet = items.get(filenum+files.first)*304 + buf+32;
787
	file_offet = items.get(filenum+files.first)*304 + buf+32;
776
	attr = ESDWORD[file_offet];
788
	attr = ESDWORD[file_offet];
777
	file.selected = ESBYTE[file_offet+7];
789
	file.selected = ESBYTE[file_offet+7];
Line 795... Line 807...
795
		}
807
		}
796
		if (chrnum(#path, '/')==1) && (streq(#path, "/kolibrios")==false) file_size = GetDeviceSizeLabel(#full_path);
808
		if (chrnum(#path, '/')==1) && (streq(#path, "/kolibrios")==false) file_size = GetDeviceSizeLabel(#full_path);
797
	}
809
	}
798
	if (file_size) WriteText(7-strlen(file_size)*6+files.x+files.w-58, 
810
	if (file_size) WriteText(7-strlen(file_size)*6+files.x+files.w-58, 
799
			files.text_y+y+1, files.font_type, col.list_gb_text, file_size);
811
			files.text_y+y+1, files.font_type, col.list_gb_text, file_size);
800
	DrawIconByExtension(#full_path, ext1, files.x+4, icon_y, bgcol);
-
 
Line 801... Line 812...
801
 
812
 
802
	if (TestBit(attr, 1)) || (TestBit(attr, 2)) text_col=col.list_text_hidden; //system or hiden?
813
	if (TestBit(attr, 1)) || (TestBit(attr, 2)) text_col=col.list_text_hidden; //system or hiden?
803
	if (bgcol==col.selec)
814
	if (bgcol==col.selec)
804
	{
815
	{
Line 836... Line 847...
836
			strcpy(#label_file_name+strlen(#label_file_name)-2, "...");			
847
			strcpy(#label_file_name+strlen(#label_file_name)-2, "...");			
837
		}
848
		}
838
		kfont.WriteIntoWindow(files.x + icon_size+7, files.item_h - kfont.height / 2 + y, 
849
		kfont.WriteIntoWindow(files.x + icon_size+7, files.item_h - kfont.height / 2 + y, 
839
			bgcol, text_col, kfont.size.pt, #label_file_name);
850
			bgcol, text_col, kfont.size.pt, #label_file_name);
840
	}
851
	}
841
	DrawBar(files.x+files.w-141,y,1,files.item_h,col.list_vert_line); //gray line 1
852
	if (bgcol == col.selec_inactive) DrawWideRectangle(files.x+2, y, files.w-4, files.item_h, 2, 0x92B1D9);
842
	DrawBar(files.x+files.w-68,y,1,files.item_h,col.list_vert_line); //gray line 2
853
	DrawIconByExtension(#full_path, ext1, files.x+4, icon_y, bgcol);
843
}
854
}
Line 844... Line 855...
844
 
855
 
845
 
856
 
Line 1135... Line 1146...
1135
			break;
1146
			break;
1136
		case 5: //refresh cur dir & devs
1147
		case 5: //refresh cur dir & devs
1137
			if (two_panels.checked)
1148
			if (two_panels.checked)
1138
			{
1149
			{
1139
				DrawFilePanels();
1150
				DrawFilePanels();
1140
			}
-
 
1141
			else 
1151
			} else {
1142
			{
-
 
1143
				Tip(56, T_DEVICES, 55, "-");
1152
				Tip(56, T_DEVICES, 55, "-");
1144
				Open_Dir(#path,WITH_REDRAW);
1153
				Open_Dir(#path,WITH_REDRAW);
1145
				pause(10);
1154
				pause(10);
1146
				SystemDiscs.Get();
1155
				SystemDiscs.Get();
1147
				Open_Dir(#path,WITH_REDRAW);
1156
				Open_Dir(#path,WITH_REDRAW);