Subversion Repositories Kolibri OS

Rev

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

Rev 8417 Rev 8750
Line 1... Line 1...
1
//Leency, Veliant, Punk_Joker, PavelYakov & KolibriOS Team 2008-2020
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.49"
6
#define TITLE "Eolite File Manager 4.5"
7
#define ABOUT_TITLE "EOLITE 4.49"
7
#define ABOUT_TITLE "EOLITE 4.5"
8
 
8
 
Line 1019... Line 1019...
1019
}
1019
}
Line 1020... Line 1020...
1020
 
1020
 
1021
void NewElement()
1021
void NewElement()
1022
{
1022
{
1023
	BDVK element_info;
1023
	BDVK element_info;
Line 1024... Line 1024...
1024
	byte del_rezult, copy_rezult, info_result;
1024
	byte del_result, copy_result, info_result;
1025
 
1025
 
1026
	sprintf(#temp,"%s/%s",#path,new_file_ed.text);
1026
	sprintf(#temp,"%s/%s",#path,new_file_ed.text);
1027
	info_result = GetFileInfo(#temp, #element_info);
1027
	info_result = GetFileInfo(#temp, #element_info);
1028
	switch(new_element_active)
1028
	switch(new_element_active)
1029
	{
1029
	{
-
 
1030
		case CREATE_FILE:
1030
		case CREATE_FILE:
1031
			if (info_result!=5) {
1031
			if (info_result==5)
1032
				notify(FS_ITEM_ALREADY_EXISTS);
1032
			{
1033
			} else {
1033
				CreateFile(0, 0, #temp);
1034
				CreateFile(0, 0, #temp);
1034
				if (EAX)
1035
				if (EAX)
1035
				{
1036
				{
1036
					if (EAX==5) notify(NOT_CREATE_FILE);
1037
					if (EAX==5) notify(NOT_CREATE_FILE);
1037
					else Write_Error(EAX);
1038
					else Write_Error(EAX);
1038
				}
-
 
1039
			}
-
 
1040
			else
-
 
1041
			{
-
 
1042
				notify(FS_ITEM_ALREADY_EXISTS);
1039
				}
1043
			}
1040
			}
1044
			break;
1041
			break;
-
 
1042
		case CREATE_FOLDER:
1045
		case CREATE_FOLDER:
1043
			if (info_result!=5) {
1046
			if (info_result==5)
1044
				notify(FS_ITEM_ALREADY_EXISTS);
1047
			{
1045
			} else {
1048
				CreateDir(#temp);
1046
				CreateDir(#temp);
1049
				if (EAX)
1047
				if (EAX)
1050
				{
1048
				{
1051
					if (EAX==5) notify(NOT_CREATE_FOLDER);
1049
					if (EAX==5) notify(NOT_CREATE_FOLDER);
1052
					else Write_Error(EAX);
1050
					else Write_Error(EAX);
1053
				}
-
 
1054
			}
-
 
1055
			else
-
 
1056
			{
-
 
1057
				notify(FS_ITEM_ALREADY_EXISTS);
1051
				}
1058
			}
1052
			}
1059
			break;
1053
			break;
1060
		case RENAME_ITEM:
-
 
1061
			if (info_result==5)
1054
		case RENAME_ITEM:
1062
			{
1055
			if (info_result!=5) {
1063
				if (itdir)
-
 
1064
				{
1056
				notify(FS_ITEM_ALREADY_EXISTS);
1065
					//rename only empty folders
1057
			} else {
-
 
1058
				(RenameMove(new_file_ed.text, #file_path))
1066
					if (del_rezult = DeleteFile(#file_path))
1059
				{
1067
					{
1060
					if (itdir) {
1068
						Write_Error(del_rezult);
-
 
1069
						return;
-
 
1070
					}
-
 
1071
					if (CreateDir(#temp)) CreateDir(#file_path);
-
 
1072
					Open_Dir(#path,WITH_REDRAW);
-
 
1073
					SelectFileByName(new_file_ed.text);
1061
						notify("'Error renaming folder' -E");
1074
				}
-
 
1075
				else
1062
						return;
1076
				{
-
 
1077
					if (copy_rezult = CopyFile(#file_path,#temp))
1063
					} else {
1078
					{
-
 
1079
						Write_Error(copy_rezult);
1064
						if (copy_result = CopyFile(#file_path,#temp)) {
1080
					}
-
 
1081
					else
1065
							Write_Error(copy_result);
1082
					{
1066
						} else {
1083
						DeleteFile(#file_path);
1067
							DeleteFile(#file_path);
1084
						SelectFileByName(new_file_ed.text);
1068
							SelectFileByName(new_file_ed.text);
1085
					}
1069
						}
1086
				}
-
 
1087
			}
-
 
1088
			else
-
 
1089
			{
1070
					}
1090
				notify(FS_ITEM_ALREADY_EXISTS);
1071
				}
1091
			}
1072
			}
1092
	}
1073
	}
1093
	Open_Dir(#path,WITH_REDRAW);
1074
	Open_Dir(#path,WITH_REDRAW);