Rev 5960 | Rev 5977 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5960 | Rev 5974 | ||
---|---|---|---|
Line 4... | Line 4... | ||
4 | #ifndef AUTOBUILD |
4 | #ifndef AUTOBUILD |
5 | #include "lang.h--" |
5 | #include "lang.h--" |
6 | #endif |
6 | #endif |
Line 7... | Line 7... | ||
7 | 7 | ||
8 | //libraries |
8 | //libraries |
9 | #define MEMSIZE 4096 * 150 |
9 | #define MEMSIZE 4096 * 180 |
10 | #include "..\lib\clipboard.h" |
10 | #include "..\lib\clipboard.h" |
11 | #include "..\lib\strings.h" |
11 | #include "..\lib\strings.h" |
12 | #include "..\lib\mem.h" |
12 | #include "..\lib\mem.h" |
13 | #include "..\lib\file_system.h" |
13 | #include "..\lib\file_system.h" |
Line 31... | Line 31... | ||
31 | enum {CREATE_FILE=1, CREATE_FOLDER, RENAME_ITEM }; //NewElement |
31 | enum {CREATE_FILE=1, CREATE_FOLDER, RENAME_ITEM }; //NewElement |
Line 32... | Line 32... | ||
32 | 32 | ||
Line 33... | Line 33... | ||
33 | dword col_padding, col_selec, col_lpanel; |
33 | dword col_padding, col_selec, col_lpanel; |
34 | - | ||
Line 35... | Line 34... | ||
35 | int toolbar_buttons_x[7]={9,46,85,134,167,203}; |
34 | |
36 | struct path_string { char Item[4096]; }; |
35 | int toolbar_buttons_x[7]={9,46,85,134,167,203}; |
37 | 36 | ||
38 | byte smooth_font=false; |
37 | byte smooth_font=false; |
Line 108... | Line 107... | ||
108 | #include "include\history.h" |
107 | #include "include\history.h" |
109 | #include "include\menu.h" |
108 | #include "include\menu.h" |
110 | #include "include\about.h" |
109 | #include "include\about.h" |
111 | #include "include\properties.h" |
110 | #include "include\properties.h" |
Line 112... | Line -... | ||
112 | - | ||
113 | char TMPS[4096]; |
- | |
114 | //char *TMP_PARS,*TMP_PARS2; |
111 | |
115 | void main() |
112 | void main() |
116 | { |
113 | { |
117 | word id; |
114 | word id; |
118 | byte count_sl = 0; |
115 | byte count_sl = 0; |
Line 123... | Line 120... | ||
123 | char IPC_BUF[10]; |
120 | char IPC_BUF[10]; |
124 | rand_n = random(40); |
121 | rand_n = random(40); |
Line 125... | Line 122... | ||
125 | 122 | ||
126 | load_dll(boxlib, #box_lib_init,0); |
123 | load_dll(boxlib, #box_lib_init,0); |
127 | load_dll(libini, #lib_init,1); |
- | |
Line -... | Line 124... | ||
- | 124 | load_dll(libini, #lib_init,1); |
|
128 | eolite_ini_path = abspath("Eolite.ini"); |
125 | |
129 | - | ||
130 | fd_path_eolite_ini_path = "/fd/1/File Managers/Eolite.ini"; |
- | |
131 | /* |
- | |
132 | TMP_PARS2 = #fd_path_eolite_ini_path; |
- | |
133 | WHILE(DSBYTE[TMP_PARS]) |
- | |
134 | { |
- | |
135 | IF(count_sl!=1) |
- | |
136 | { |
- | |
137 | DSBYTE[TMP_PARS2] = DSBYTE[TMP_PARS]; |
- | |
138 | TMP_PARS2++; |
- | |
139 | } |
- | |
140 | ELSE IF(count_sl==2) |
- | |
141 | { |
- | |
142 | strlcpy(TMP_PARS2,"fd",2); |
- | |
143 | TMP_PARS2+=2; |
- | |
144 | } |
- | |
145 | IF(DSBYTE[TMP_PARS]=='/')count_sl++; |
- | |
146 | TMP_PARS++; |
- | |
Line 147... | Line 126... | ||
147 | } |
126 | eolite_ini_path = abspath("Eolite.ini"); |
148 | */ |
127 | fd_path_eolite_ini_path = "/fd/1/File Managers/Eolite.ini"; |
149 | 128 | ||
150 | LoadIniSettings(); |
129 | LoadIniSettings(); |
Line 157... | Line 136... | ||
157 | } |
136 | } |
Line 158... | Line 137... | ||
158 | 137 | ||
159 | Open_Dir(#path,ONLY_OPEN); |
138 | Open_Dir(#path,ONLY_OPEN); |
160 | strcpy(#inactive_path, #path); |
139 | strcpy(#inactive_path, #path); |
161 | llist_copy(#files_inactive, #files); |
- | |
162 | font.no_bg_copy = true; |
- | |
163 | - | ||
164 | ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font file",#TMPS,4096,"/sys/FONTS/Tahoma.kf"); |
- | |
165 | font.load(#TMPS); |
- | |
166 | ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#TMPS,4096,"on"); |
- | |
167 | if(!strcmp(#TMPS,"off"))smooth_font = false; |
- | |
168 | else smooth_font = true; |
140 | llist_copy(#files_inactive, #files); |
169 | SetEventMask(1100111b); |
141 | SetEventMask(1100111b); |
170 | loop(){ |
142 | loop(){ |
171 | switch(WaitEvent()) |
143 | switch(WaitEvent()) |
172 | { |
144 | { |
Line 196... | Line 168... | ||
196 | 168 | ||
197 | if (adif_x>adif_y) |
169 | if (adif_x>adif_y) |
198 | { |
170 | { |
199 | if (dif_x > 150) |
171 | if (dif_x > 150) |
200 | { |
172 | { |
201 | if (HistoryPath(GO_FORWARD)) |
173 | if (FoldersHistory.forward()) |
202 | { |
174 | { |
203 | files.KeyHome(); |
175 | files.KeyHome(); |
204 | Open_Dir(#path,WITH_REDRAW); |
176 | Open_Dir(#path,WITH_REDRAW); |
205 | } |
177 | } |
Line 349... | Line 321... | ||
349 | { |
321 | { |
350 | case 21: //Back |
322 | case 21: //Back |
351 | GoBack(); |
323 | GoBack(); |
352 | break; |
324 | break; |
353 | case 22: //Forward |
325 | case 22: //Forward |
354 | if (HistoryPath(GO_FORWARD)) |
326 | if (FoldersHistory.forward()) |
355 | { |
327 | { |
356 | files.KeyHome(); |
328 | files.KeyHome(); |
357 | Open_Dir(#path,WITH_REDRAW); |
329 | Open_Dir(#path,WITH_REDRAW); |
358 | } |
330 | } |
359 | break; |
331 | break; |
Line 761... | Line 733... | ||
761 | if (buf) free(buf); |
733 | if (buf) free(buf); |
762 | errornum = GetDir(#buf, #files.count, dir_path, DIRS_NOROOT); |
734 | errornum = GetDir(#buf, #files.count, dir_path, DIRS_NOROOT); |
763 | if (ESBYTE[dir_path+1]!='\0') chrcat(dir_path, '/'); |
735 | if (ESBYTE[dir_path+1]!='\0') chrcat(dir_path, '/'); |
764 | if (errornum) |
736 | if (errornum) |
765 | { |
737 | { |
766 | HistoryPath(ADD_NEW_PATH); |
738 | FoldersHistory.add(); |
767 | GoBack(); |
739 | GoBack(); |
768 | Write_Error(errornum); |
740 | Write_Error(errornum); |
769 | return; |
741 | return; |
770 | } |
742 | } |
771 | maxcount = sizeof(file_mas)/sizeof(dword)-1; |
743 | maxcount = sizeof(file_mas)/sizeof(dword)-1; |
Line 779... | Line 751... | ||
779 | PathShow.area_size_x = Form.cwidth-306; |
751 | PathShow.area_size_x = Form.cwidth-306; |
780 | DrawBar(PathShow.start_x-3, PathShow.start_y-4, PathShow.area_size_x+2, 15, 0xFFFfff); |
752 | DrawBar(PathShow.start_x-3, PathShow.start_y-4, PathShow.area_size_x+2, 15, 0xFFFfff); |
781 | PathShow_prepare stdcall(#PathShow); |
753 | PathShow_prepare stdcall(#PathShow); |
782 | PathShow_draw stdcall(#PathShow); |
754 | PathShow_draw stdcall(#PathShow); |
783 | } |
755 | } |
784 | HistoryPath(ADD_NEW_PATH); |
756 | FoldersHistory.add(); |
785 | files.visible = files.h / files.item_h; |
757 | files.visible = files.h / files.item_h; |
786 | if (files.count < files.visible) files.visible = files.count; |
758 | if (files.count < files.visible) files.visible = files.count; |
787 | if (redraw!=ONLY_SHOW) Sorting(); |
759 | if (redraw!=ONLY_SHOW) Sorting(); |
788 | list_full_redraw = true; |
760 | list_full_redraw = true; |
789 | if (redraw!=ONLY_OPEN)&&(!_not_draw) List_ReDraw(); |
761 | if (redraw!=ONLY_OPEN)&&(!_not_draw) List_ReDraw(); |
Line 964... | Line 936... | ||
964 | 936 | ||
965 | void Del_File(byte dodel) { |
937 | void Del_File(byte dodel) { |
966 | del_active=0; |
938 | del_active=0; |
967 | if (dodel) |
939 | if (dodel) |
968 | { |
940 | { |
969 | delete_stak = malloc(20000); |
941 | delete_stak = malloc(40000); |
970 | CreateThread(#Del_File_Thread,delete_stak+20000-4); |
942 | CreateThread(#Del_File_Thread,delete_stak+40000-4); |
971 | } |
943 | } |
972 | else draw_window(); |
944 | else draw_window(); |
Line 973... | Line 945... | ||
973 | } |
945 | } |
Line 1022... | Line 994... | ||
1022 | files.first=files.cur_y=0; |
994 | files.first=files.cur_y=0; |
1023 | Open_Dir(#path,WITH_REDRAW); |
995 | Open_Dir(#path,WITH_REDRAW); |
1024 | } |
996 | } |
1025 | } |
997 | } |
Line 1026... | Line -... | ||
1026 | - | ||
1027 | 998 | ||
1028 | inline fastcall void GoBack() |
999 | inline fastcall void GoBack() |
1029 | { |
1000 | { |
1030 | char cur_folder[4096]; |
1001 | char cur_folder[4096]; |
- | 1002 | strcpy(#cur_folder, #path); |
|
1031 | strcpy(#cur_folder, GetCurrentFolder()); |
1003 | cur_folder[strlen(#cur_folder)-1]=0x00; //delete last '/' |
1032 | if (HistoryPath(GO_BACK)) SelectFileByName(#cur_folder); |
1004 | if (FoldersHistory.back()) SelectFileByName(#cur_folder+strrchr(#cur_folder,'/')); |
Line 1033... | Line 1005... | ||
1033 | } |
1005 | } |
1034 | 1006 | ||
1035 | void ShowOpenWithDialog() |
1007 | void ShowOpenWithDialog() |