Rev 5557 | Rev 5575 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5557 | Rev 5571 | ||
---|---|---|---|
Line 34... | Line 34... | ||
34 | ?define T_DELETE_FILE "ë ¤¥©áâ¢¨â¥«ì® å®â¨â¥ 㤠«¨âì" |
34 | ?define T_DELETE_FILE "ë ¤¥©áâ¢¨â¥«ì® å®â¨â¥ 㤠«¨âì" |
35 | ?define T_YES " " |
35 | ?define T_YES " " |
36 | ?define T_NO "¥â" |
36 | ?define T_NO "¥â" |
37 | ?define T_CANCEL "⬥ " |
37 | ?define T_CANCEL "⬥ " |
38 | ?define T_CREATE "®§¤ âì" |
38 | ?define T_CREATE "®§¤ âì" |
- | 39 | ?define T_RENAME "¥à¥¨¬¥®¢ âì" |
|
39 | ?define FILE_EXISTS " ©« á â ª¨¬ ¨¬¥¥¬ áãé¥áâ¢ã¥â" |
40 | ?define FILE_EXISTS " ©« á â ª¨¬ ¨¬¥¥¬ áãé¥áâ¢ã¥â" |
40 | ?define FOLDER_EXISTS " ¯ª á â ª¨¬ ¨¬¥¥¬ áãé¥áâ¢ã¥â" |
41 | ?define FOLDER_EXISTS " ¯ª á â ª¨¬ ¨¬¥¥¬ áãé¥áâ¢ã¥â" |
41 | ?define T_DEL_ERROR_1 "訡ª . ¯ª ¥ ¯ãáâ ï." |
42 | ?define T_DEL_ERROR_1 "訡ª . ¯ª ¥ ¯ãáâ ï." |
42 | ?define WAIT_DELETING_FOLDER "¤ «ï¥âáï ¯ ¯ª . ®¤®¦¨â¥..." |
43 | ?define WAIT_DELETING_FOLDER "¤ «ï¥âáï ¯ ¯ª . ®¤®¦¨â¥..." |
43 | ?define NOT_CREATE_FOLDER "¥ 㤠«®áì ᮧ¤ âì ¯ ¯ªã." |
44 | ?define NOT_CREATE_FOLDER "¥ 㤠«®áì ᮧ¤ âì ¯ ¯ªã." |
Line 60... | Line 61... | ||
60 | ?define T_DELETE_FILE "Kas sa tahad tõesti kustutada" |
61 | ?define T_DELETE_FILE "Kas sa tahad tõesti kustutada" |
61 | ?define T_YES "Jah" |
62 | ?define T_YES "Jah" |
62 | ?define T_NO "Ei" |
63 | ?define T_NO "Ei" |
63 | ?define T_CANCEL "Cancel" |
64 | ?define T_CANCEL "Cancel" |
64 | ?define T_CREATE "Create" |
65 | ?define T_CREATE "Create" |
- | 66 | ?define T_RENAME "Rename" |
|
65 | ?define FILE_EXISTS "The file with the same name exists" |
67 | ?define FILE_EXISTS "The file with the same name exists" |
66 | ?define FOLDER_EXISTS "A folder with the same name exists" |
68 | ?define FOLDER_EXISTS "A folder with the same name exists" |
67 | ?define T_DEL_ERROR_1 "Viga. Kataloog ei ole tühi." |
69 | ?define T_DEL_ERROR_1 "Viga. Kataloog ei ole tühi." |
68 | ?define WAIT_DELETING_FOLDER "Deleting folder. Please, wait..." |
70 | ?define WAIT_DELETING_FOLDER "Deleting folder. Please, wait..." |
69 | ?define NOT_CREATE_FOLDER "Kataloogi ei saa luua." |
71 | ?define NOT_CREATE_FOLDER "Kataloogi ei saa luua." |
Line 86... | Line 88... | ||
86 | ?define T_DELETE_FILE "Do you really want to delete" |
88 | ?define T_DELETE_FILE "Do you really want to delete" |
87 | ?define T_YES "Yes" |
89 | ?define T_YES "Yes" |
88 | ?define T_NO "No" |
90 | ?define T_NO "No" |
89 | ?define T_CANCEL "Cancel" |
91 | ?define T_CANCEL "Cancel" |
90 | ?define T_CREATE "Create" |
92 | ?define T_CREATE "Create" |
- | 93 | ?define T_RENAME "Rename" |
|
91 | ?define FILE_EXISTS "The file with the same name exists" |
94 | ?define FILE_EXISTS "The file with the same name exists" |
92 | ?define FOLDER_EXISTS "A folder with the same name exists" |
95 | ?define FOLDER_EXISTS "A folder with the same name exists" |
93 | ?define T_DEL_ERROR_1 "Error. Folder isn't empty." |
96 | ?define T_DEL_ERROR_1 "Error. Folder isn't empty." |
94 | ?define WAIT_DELETING_FOLDER "Deleting folder. Please, wait..." |
97 | ?define WAIT_DELETING_FOLDER "Deleting folder. Please, wait..." |
95 | ?define NOT_CREATE_FOLDER "Folder can not be created." |
98 | ?define NOT_CREATE_FOLDER "Folder can not be created." |
Line 105... | Line 108... | ||
105 | ?define DEL_MORE_FILES_2 " pcs.)?" |
108 | ?define DEL_MORE_FILES_2 " pcs.)?" |
106 | #endif |
109 | #endif |
Line 107... | Line 110... | ||
107 | 110 | ||
Line 108... | Line 111... | ||
108 | enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir |
111 | enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir |
109 | 112 | ||
110 | #define TITLE "Eolite File Manager v2.78" |
113 | #define TITLE "Eolite File Manager v2.8" |
Line 111... | Line 114... | ||
111 | #define ABOUT_TITLE "Eolite v2.78" |
114 | #define ABOUT_TITLE "Eolite v2.8" |
112 | dword col_padding, col_selec, col_lpanel; |
115 | dword col_padding, col_selec, col_lpanel; |
Line 128... | Line 131... | ||
128 | file_path[4096], |
131 | file_path[4096], |
129 | file_name[256], |
132 | file_name[256], |
130 | new_element_name[256], |
133 | new_element_name[256], |
131 | temp[4096]; |
134 | temp[4096]; |
132 | byte |
135 | byte |
133 | rename_active=0, |
- | |
134 | del_active=0, |
136 | del_active=0, |
135 | new_element_active=0, |
137 | new_element_active=0, |
136 | show_dev_name=1, |
138 | show_dev_name=1, |
137 | real_files_names_case=0, |
139 | real_files_names_case=0, |
138 | use_big_fonts=0, |
140 | use_big_fonts=0, |
Line 207... | Line 209... | ||
207 | if (new_element_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2) |
209 | if (new_element_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2) |
208 | { |
210 | { |
209 | edit_box_mouse stdcall(#new_file_ed); |
211 | edit_box_mouse stdcall(#new_file_ed); |
210 | break; |
212 | break; |
211 | } |
213 | } |
212 | if (rename_active) { edit_box_mouse stdcall(#edit2); break; } |
- | |
Line 213... | Line 214... | ||
213 | 214 | ||
Line 214... | Line 215... | ||
214 | m.get(); |
215 | m.get(); |
Line 357... | Line 358... | ||
357 | if (id==1) |
358 | if (id==1) |
358 | { |
359 | { |
359 | KillProcess(about_window); |
360 | KillProcess(about_window); |
360 | ExitProcess(); |
361 | ExitProcess(); |
361 | } |
362 | } |
362 | if (rename_active) break; |
- | |
363 | if (del_active) |
363 | if (del_active) |
364 | { |
364 | { |
365 | IF (id==301) || (id==302) Del_File(302-id); |
365 | IF (id==301) || (id==302) Del_File(302-id); |
366 | break; |
366 | break; |
367 | } |
367 | } |
Line 487... | Line 487... | ||
487 | } |
487 | } |
488 | selected_count = 0; |
488 | selected_count = 0; |
489 | List_ReDraw(); |
489 | List_ReDraw(); |
490 | break; |
490 | break; |
491 | case ASCII_KEY_ESC: |
491 | case ASCII_KEY_ESC: |
492 | IF (rename_active==1) ReName(false); |
- | |
493 | break; |
492 | break; |
494 | case ASCII_KEY_ENTER: |
493 | case ASCII_KEY_ENTER: |
495 | IF (rename_active==1) {ReName(true); break;} |
494 | //IF (rename_active==1) {ReName(true); break;} |
496 | Open(0); |
495 | Open(0); |
497 | break; |
496 | break; |
498 | case 074: //menu |
497 | case 074: //menu |
499 | menu_call_mouse=0; |
498 | menu_call_mouse=0; |
500 | SwitchToAnotherThread(); |
499 | SwitchToAnotherThread(); |
Line 627... | Line 626... | ||
627 | DrawFlatButton(files.x+files.w,40,16,16,0,sc.work,"\x18"); |
626 | DrawFlatButton(files.x+files.w,40,16,16,0,sc.work,"\x18"); |
628 | DrawFlatButton(files.x+files.w,onTop(22,0),16,16,0,sc.work,"\x19"); |
627 | DrawFlatButton(files.x+files.w,onTop(22,0),16,16,0,sc.work,"\x19"); |
629 | Open_Dir(#path,ONLY_SHOW); |
628 | Open_Dir(#path,ONLY_SHOW); |
630 | if (del_active) Del_Form(); |
629 | if (del_active) Del_Form(); |
631 | if (new_element_active) NewElement_Form(new_element_active); |
630 | if (new_element_active) NewElement_Form(new_element_active); |
632 | if (rename_active) FnProcess(2); |
- | |
633 | } |
631 | } |
Line 634... | Line 632... | ||
634 | 632 | ||
635 | 633 | ||
Line 955... | Line 953... | ||
955 | DeleteButton(302); |
953 | DeleteButton(302); |
956 | Open_Dir(#path,WITH_REDRAW); |
954 | Open_Dir(#path,WITH_REDRAW); |
957 | } |
955 | } |
Line 958... | Line -... | ||
958 | - | ||
959 | - | ||
960 | void ReName(byte rename) |
- | |
961 | { |
- | |
962 | int del_rezult, copy_rezult; |
- | |
963 | char edit_name[256]; |
- | |
964 | rename_active=0; |
- | |
965 | edit2.flags=64; |
- | |
966 | if (rename==true) |
- | |
967 | { |
- | |
968 | strcpy(#temp, #path); |
- | |
969 | strcpy(#edit_name, #file_name); //save edit name to select it later |
- | |
970 | strcat(#temp, #file_name); |
- | |
971 | if (strcmpi(#file_path,#temp)!=0) && (file_name) |
- | |
972 | if (itdir) |
- | |
973 | { |
- | |
974 | if (del_rezult = DeleteFile(#file_path)) |
- | |
975 | { |
- | |
976 | Write_Error(del_rezult); |
- | |
977 | ShowMessage(T_DEL_ERROR_1, 150); |
- | |
978 | return; |
- | |
979 | } |
- | |
980 | if (CreateDir(#temp)) CreateDir(#file_path); |
- | |
981 | Open_Dir(#path,WITH_REDRAW); |
- | |
982 | SelectFile(#edit_name); |
- | |
983 | } |
- | |
984 | else |
- | |
985 | { |
- | |
986 | if (copy_rezult = CopyFile(#file_path,#temp)) |
- | |
987 | { |
- | |
988 | Write_Error(copy_rezult); |
- | |
989 | } |
- | |
990 | else |
- | |
991 | { |
- | |
992 | Del_File(true); |
- | |
993 | SelectFile(#edit_name); |
- | |
994 | } |
- | |
995 | } |
- | |
996 | } |
- | |
997 | Line_ReDraw(col_selec,files.current); |
- | |
998 | } |
- | |
999 | 956 | ||
1000 | 957 | ||
1001 | void SelectFile(dword that_file) |
958 | void SelectFile(dword that_file) |
1002 | { |
959 | { |
1003 | files.first=files.current=0; |
960 | files.first=files.current=0; |
Line 1067... | Line 1024... | ||
1067 | } |
1024 | } |
Line 1068... | Line 1025... | ||
1068 | 1025 | ||
1069 | void NewElement(byte newf) |
1026 | void NewElement(byte newf) |
1070 | { |
1027 | { |
1071 | BDVK element_info; |
- | |
1072 | //char edit_name[256]; |
1028 | BDVK element_info; |
1073 | //strcpy(#edit_name, #file_name); |
1029 | int del_rezult, copy_rezult; |
1074 | if (newf) |
1030 | if (newf) |
1075 | { |
1031 | { |
1076 | strcpy(#temp, #path); |
- | |
1077 | //strcpy(#edit_name, new_file_ed.text); |
1032 | strcpy(#temp, #path); |
1078 | strcat(#temp, new_file_ed.text); |
1033 | strcat(#temp, new_file_ed.text); |
1079 | if (new_element_active==1) |
1034 | switch(new_element_active) |
- | 1035 | { |
|
1080 | { |
1036 | case 1: |
1081 | GetFileInfo(#temp, #element_info); |
1037 | GetFileInfo(#temp, #element_info); |
1082 | if (EAX==5) |
1038 | if (EAX==5) |
1083 | { |
1039 | { |
1084 | WriteFile(0, 0, #temp); |
1040 | WriteFile(0, 0, #temp); |
Line 1090... | Line 1046... | ||
1090 | } |
1046 | } |
1091 | else |
1047 | else |
1092 | { |
1048 | { |
1093 | notify(FILE_EXISTS); |
1049 | notify(FILE_EXISTS); |
1094 | } |
1050 | } |
1095 | } |
- | |
1096 | else |
1051 | case 2: |
1097 | { |
- | |
1098 | GetFileInfo(#temp, #element_info); |
1052 | GetFileInfo(#temp, #element_info); |
1099 | if (EAX==5) |
1053 | if (EAX==5) |
1100 | { |
1054 | { |
1101 | CreateDir(#temp); |
1055 | CreateDir(#temp); |
1102 | if (EAX) |
1056 | if (EAX) |
Line 1107... | Line 1061... | ||
1107 | } |
1061 | } |
1108 | else |
1062 | else |
1109 | { |
1063 | { |
1110 | notify(FOLDER_EXISTS); |
1064 | notify(FOLDER_EXISTS); |
1111 | } |
1065 | } |
- | 1066 | case 3: |
|
- | 1067 | GetFileInfo(#temp, #element_info); |
|
- | 1068 | if (EAX==5) |
|
- | 1069 | { |
|
- | 1070 | if (itdir) |
|
- | 1071 | { |
|
- | 1072 | if (del_rezult = DeleteFile(#file_path)) |
|
- | 1073 | { |
|
- | 1074 | Write_Error(del_rezult); |
|
- | 1075 | ShowMessage(T_DEL_ERROR_1, 150); |
|
- | 1076 | return; |
|
- | 1077 | } |
|
- | 1078 | if (CreateDir(#temp)) CreateDir(#file_path); |
|
- | 1079 | Open_Dir(#path,WITH_REDRAW); |
|
- | 1080 | SelectFile(new_file_ed.text); |
|
- | 1081 | } |
|
- | 1082 | else |
|
- | 1083 | { |
|
- | 1084 | if (copy_rezult = CopyFile(#file_path,#temp)) |
|
- | 1085 | { |
|
- | 1086 | Write_Error(copy_rezult); |
|
- | 1087 | } |
|
- | 1088 | else |
|
- | 1089 | { |
|
- | 1090 | Del_File(true); |
|
- | 1091 | SelectFile(new_file_ed.text); |
|
- | 1092 | } |
|
- | 1093 | } |
|
- | 1094 | } |
|
- | 1095 | else |
|
- | 1096 | { |
|
- | 1097 | notify(FILE_EXISTS); |
|
- | 1098 | } |
|
1112 | } |
1099 | } |
1113 | new_element_active = 0; |
1100 | new_element_active = 0; |
1114 | Open_Dir(#path,WITH_REDRAW); |
1101 | Open_Dir(#path,WITH_REDRAW); |
1115 | SelectFile(new_file_ed.text); |
1102 | SelectFile(new_file_ed.text); |
1116 | } |
1103 | } |
1117 | new_element_active = 0; |
1104 | new_element_active = 0; |
1118 | Open_Dir(#path,WITH_REDRAW); |
1105 | Open_Dir(#path,WITH_REDRAW); |
1119 | } |
1106 | } |
Line 1120... | Line 1107... | ||
1120 | 1107 | ||
1121 | void NewElement_Form(byte crt) |
1108 | void NewElement_Form(byte crt, dword strng) |
1122 | { |
1109 | { |
1123 | int dform_x=files.w-220/2+files.x; |
1110 | int dform_x=files.w-220/2+files.x; |
1124 | if (!new_element_active) |
1111 | if (!new_element_active) |
1125 | { |
1112 | { |
1126 | new_element_active = crt; |
- | |
1127 | if (new_element_active==1) |
- | |
1128 | { |
1113 | new_element_active = crt; |
1129 | strcpy(#new_element_name, T_NEW_FILE); |
1114 | strcpy(#new_element_name, strng); |
1130 | new_file_ed.size = new_file_ed.pos = strlen(T_NEW_FILE); |
- | |
1131 | } |
- | |
1132 | else |
- | |
1133 | { |
- | |
1134 | strcpy(#new_element_name, T_NEW_FOLDER); |
- | |
1135 | new_file_ed.size = new_file_ed.pos = strlen(T_NEW_FOLDER); |
- | |
1136 | } |
1115 | new_file_ed.size = new_file_ed.pos = strlen(strng); |
1137 | } |
1116 | } |
1138 | DrawPopup(dform_x,160,220,80,1,sc.work,sc.work_graph); |
1117 | DrawPopup(dform_x,160,220,80,1,sc.work,sc.work_graph); |
1139 | new_file_ed.left = dform_x+27; |
1118 | new_file_ed.left = dform_x+27; |
1140 | new_file_ed.top = 180; |
1119 | new_file_ed.top = 180; |
- | 1120 | edit_box_draw stdcall (#new_file_ed); |
|
1141 | edit_box_draw stdcall (#new_file_ed); |
1121 | IF (new_element_active==3) DrawFlatButton(dform_x+22,208,85,20,301,0xFFB6B5,T_RENAME); |
1142 | DrawFlatButton(dform_x+27,208,70,20,301,0xFFB6B5,T_CREATE); |
1122 | ELSE DrawFlatButton(dform_x+27,208,70,20,301,0xFFB6B5,T_CREATE); |
1143 | DrawFlatButton(dform_x+120,208,70,20,302,0xC6DFC6,T_CANCEL); |
1123 | DrawFlatButton(dform_x+120,208,70,20,302,0xC6DFC6,T_CANCEL); |
Line 1144... | Line 1124... | ||
1144 | } |
1124 | } |
1145 | 1125 | ||
Line 1159... | Line 1139... | ||
1159 | ActivateWindow(GetProcessSlot(about_window)); |
1139 | ActivateWindow(GetProcessSlot(about_window)); |
1160 | } |
1140 | } |
1161 | break; |
1141 | break; |
1162 | case 2: |
1142 | case 2: |
1163 | if (!files.count) break; |
1143 | if (!files.count) break; |
1164 | edit2.flags = 100000000000010b; //set active |
1144 | //edit2.flags = 100000000000010b; //set active |
1165 | edit2.left = files.x + 21; |
1145 | //edit2.left = files.x + 21; |
1166 | edit2.width = files.w - 26; |
1146 | //edit2.width = files.w - 26; |
1167 | edit2.top=files.current*files.line_h+59; |
1147 | //edit2.top=files.current*files.line_h+59; |
1168 | edit2.size=edit2.pos=strlen(#file_name); |
1148 | //edit2.size=edit2.pos=strlen(#file_name); |
1169 | edit_box_draw stdcall (#edit2); |
1149 | //edit_box_draw stdcall (#edit2); |
1170 | DrawBar(edit2.left,files.current*files.line_h+58,edit2.width+1,1,0xFFFFCC); //bg |
1150 | //DrawBar(edit2.left,files.current*files.line_h+58,edit2.width+1,1,0xFFFFCC); //bg |
1171 | rename_active=1; |
1151 | //rename_active=1; |
- | 1152 | NewElement_Form(3, #file_name); |
|
1172 | break; |
1153 | break; |
1173 | case 3: |
1154 | case 3: |
1174 | IF (!itdir) RunProgram("/sys/tinypad", #file_path); |
1155 | IF (!itdir) RunProgram("/sys/tinypad", #file_path); |
1175 | break; |
1156 | break; |
1176 | case 4: |
1157 | case 4: |
Line 1196... | Line 1177... | ||
1196 | else |
1177 | else |
1197 | { |
1178 | { |
1198 | Write_Error(EAX); |
1179 | Write_Error(EAX); |
1199 | ShowMessage(NOT_CREATE_FOLDER, 150); |
1180 | ShowMessage(NOT_CREATE_FOLDER, 150); |
1200 | }*/ |
1181 | }*/ |
1201 | NewElement_Form(2); |
1182 | NewElement_Form(2, T_NEW_FOLDER); |
1202 | break; |
1183 | break; |
1203 | case 7: |
1184 | case 7: |
1204 | /*strcpy(#temp, #path); |
1185 | /*strcpy(#temp, #path); |
1205 | strcat(#temp, T_NEW_FILE); |
1186 | strcat(#temp, T_NEW_FILE); |
1206 | WriteFile(0, 0, #temp); |
1187 | WriteFile(0, 0, #temp); |
Line 1211... | Line 1192... | ||
1211 | else |
1192 | else |
1212 | { |
1193 | { |
1213 | Write_Error(EAX); |
1194 | Write_Error(EAX); |
1214 | ShowMessage(NOT_CREATE_FILE, 150); |
1195 | ShowMessage(NOT_CREATE_FILE, 150); |
1215 | }*/ |
1196 | }*/ |
1216 | NewElement_Form(1); |
1197 | NewElement_Form(1, T_NEW_FILE); |
1217 | break; |
1198 | break; |
1218 | case 8: |
1199 | case 8: |
1219 | SwitchToAnotherThread(); |
1200 | SwitchToAnotherThread(); |
1220 | CreateThread(#properties_dialog, #properties_stak+4092); |
1201 | CreateThread(#properties_dialog, #properties_stak+4092); |
1221 | break; |
1202 | break; |