Rev 7398 | Rev 7447 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
7202 | leency | 1 | //Leency, Veliant, Punk_Joker, PavelYakov & KolibriOS Team 2008-2018 |
3363 | leency | 2 | //GNU GPL licence. |
3 | |||
7361 | leency | 4 | // 70.5 - get volume info and label |
5 | |||
4022 | leency | 6 | #ifndef AUTOBUILD |
7 | #include "lang.h--" |
||
8 | #endif |
||
9 | |||
3363 | leency | 10 | //libraries |
7220 | leency | 11 | #define MEMSIZE 1024 * 720 |
7054 | leency | 12 | #include "../lib/clipboard.h" |
13 | #include "../lib/strings.h" |
||
14 | #include "../lib/mem.h" |
||
7219 | leency | 15 | #include "../lib/fs.h" |
7054 | leency | 16 | #include "../lib/gui.h" |
17 | #include "../lib/list_box.h" |
||
18 | #include "../lib/random.h" |
||
19 | #include "../lib/kfont.h" |
||
20 | #include "../lib/collection.h" |
||
21 | #include "../lib/menu.h" |
||
22 | #include "../lib/copyf.h" |
||
5834 | pavelyakov | 23 | |
7054 | leency | 24 | #include "../lib/obj/libini.h" |
25 | #include "../lib/obj/box_lib.h" |
||
7230 | leency | 26 | #include "../lib/obj/libimg.h" |
7054 | leency | 27 | |
28 | #include "../lib/patterns/history.h" |
||
29 | |||
3363 | leency | 30 | //images |
7054 | leency | 31 | #include "imgs/left_p.txt" |
3363 | leency | 32 | |
6278 | leency | 33 | //Button IDs |
34 | enum { |
||
7422 | leency | 35 | PATH_BTN = 10, |
6278 | leency | 36 | POPUP_BTN1 = 201, |
6289 | leency | 37 | POPUP_BTN2 = 202, |
38 | BREADCRUMB_ID = 300 |
||
6278 | leency | 39 | }; |
3444 | leency | 40 | |
6278 | leency | 41 | //NewElement options |
42 | enum { |
||
43 | CREATE_FILE=1, |
||
44 | CREATE_FOLDER, |
||
45 | RENAME_ITEM |
||
46 | }; |
||
47 | |||
48 | //OpenDir options |
||
49 | enum { |
||
50 | ONLY_SHOW, |
||
51 | WITH_REDRAW, |
||
52 | ONLY_OPEN |
||
53 | }; |
||
54 | |||
7422 | leency | 55 | dword col_padding=0, col_selec, col_lpanel, col_work, col_graph, col_list_line=0xDDD7CF; |
3363 | leency | 56 | |
3434 | leency | 57 | int toolbar_buttons_x[7]={9,46,85,134,167,203}; |
3363 | leency | 58 | |
4136 | punk_joker | 59 | byte active_about=0; |
4070 | punk_joker | 60 | word about_window; |
5416 | punk_joker | 61 | word settings_window; |
5753 | leency | 62 | byte active_settings=0; |
5606 | pavelyakov | 63 | dword _not_draw = false; |
4136 | punk_joker | 64 | byte menu_call_mouse=0; |
6403 | punk_joker | 65 | byte exif_load=0; |
4136 | punk_joker | 66 | |
5733 | leency | 67 | byte del_active=0; |
68 | byte new_element_active=0; |
||
5698 | leency | 69 | |
5733 | leency | 70 | llist files, files_active, files_inactive; |
3434 | leency | 71 | |
5694 | leency | 72 | byte list_full_redraw; |
73 | |||
5698 | leency | 74 | dword buf; |
75 | dword file_mas[6898]; |
||
76 | int selected_count; |
||
6406 | punk_joker | 77 | int count_dir; |
5698 | leency | 78 | |
3434 | leency | 79 | byte |
3363 | leency | 80 | path[4096], |
81 | file_path[4096], |
||
3404 | leency | 82 | file_name[256], |
5555 | punk_joker | 83 | new_element_name[256], |
5698 | leency | 84 | temp[4096], |
3441 | leency | 85 | itdir; |
3363 | leency | 86 | |
5719 | leency | 87 | char active_path[4096], inactive_path[4096]; |
5698 | leency | 88 | |
7202 | leency | 89 | dword eolite_ini_path[4096]; |
90 | _ini ini; |
||
5441 | leency | 91 | |
5698 | leency | 92 | char scroll_used=false; |
5695 | leency | 93 | |
5804 | punk_joker | 94 | dword menu_stak,about_stak,properties_stak,settings_stak,copy_stak,delete_stak; |
5608 | leency | 95 | |
3363 | leency | 96 | proc_info Form; |
7252 | leency | 97 | int sc_slider_h; |
4028 | leency | 98 | int action_buf; |
4863 | leency | 99 | int rand_n; |
3363 | leency | 100 | |
6291 | leency | 101 | char sort_num=2; |
7244 | leency | 102 | int active_panel=1; |
5549 | punk_joker | 103 | |
7054 | leency | 104 | libimg_image icons16_default; |
105 | libimg_image icons16_selected; |
||
106 | |||
7242 | leency | 107 | libimg_image icons32_default; |
108 | libimg_image icons32_selected; |
||
7197 | leency | 109 | |
6564 | leency | 110 | #define STATUS_BAR_H 16; |
111 | int status_bar_h = 0; |
||
112 | |||
7197 | leency | 113 | int icon_size = 16; |
114 | |||
7252 | leency | 115 | edit_box new_file_ed = {200,213,180,0xFFFFFF,0x94AECE,0xFFFFFF,0xFFFFFF,0x10000000, |
116 | 248,#new_element_name,0,100000000000010b,6,0}; |
||
7004 | leency | 117 | PathShow_data FileShow = {0, 56,215, 8, 100, 1, 0, 0x0, 0xFFFfff, #file_name, #temp, 0}; |
5694 | leency | 118 | byte cmd_free=0; |
5698 | leency | 119 | #include "include\translations.h" |
5834 | pavelyakov | 120 | |
5748 | leency | 121 | #include "include\settings.h" |
5804 | punk_joker | 122 | #include "include\progress_dialog.h" |
4042 | leency | 123 | #include "include\copy.h" |
5435 | leency | 124 | #include "include\gui.h" |
3363 | leency | 125 | #include "include\sorting.h" |
4042 | leency | 126 | #include "include\icons.h" |
3363 | leency | 127 | #include "include\left_panel.h" |
4042 | leency | 128 | #include "include\menu.h" |
6278 | leency | 129 | #include "include\delete.h" |
4042 | leency | 130 | #include "include\about.h" |
5447 | punk_joker | 131 | #include "include\properties.h" |
6289 | leency | 132 | #include "include\breadcrumbs.h" |
3363 | leency | 133 | |
134 | void main() |
||
135 | { |
||
6289 | leency | 136 | dword id; |
5834 | pavelyakov | 137 | byte count_sl = 0; |
5748 | leency | 138 | signed x_old, y_old, dif_x, dif_y, adif_x, adif_y; |
6735 | leency | 139 | char stats; |
4863 | leency | 140 | rand_n = random(40); |
5651 | pavelyakov | 141 | |
5626 | leency | 142 | load_dll(boxlib, #box_lib_init,0); |
5991 | leency | 143 | load_dll(libini, #lib_init,1); |
7054 | leency | 144 | load_dll(libio, #libio_init,1); |
145 | load_dll(libimg, #libimg_init,1); |
||
5834 | pavelyakov | 146 | |
7375 | leency | 147 | SetAppColors(); |
5441 | leency | 148 | LoadIniSettings(); |
6034 | leency | 149 | SystemDiscs.Get(); |
7041 | leency | 150 | |
7054 | leency | 151 | Libimg_LoadImage(#icons16_default, "/sys/icons16.png"); |
152 | Libimg_LoadImage(#icons16_selected, "/sys/icons16.png"); |
||
7203 | leency | 153 | Libimg_ReplaceColor(icons16_selected.image, icons16_selected.w, icons16_selected.h, 0xffFFFfff, col_selec); |
154 | Libimg_ReplaceColor(icons16_selected.image, icons16_selected.w, icons16_selected.h, 0xffCACBD6, MixColors(col_selec, 0, 200)); |
||
7054 | leency | 155 | |
7041 | leency | 156 | //-p just show file/folder properties dialog |
157 | if (param) && (param[0]=='-') && (param[1]=='p') |
||
158 | { |
||
159 | strcpy(#file_path, #param + 3); |
||
160 | strcpy(#file_name, #param + strrchr(#param, '/')); |
||
161 | properties_dialog(); |
||
162 | ExitProcess(); |
||
163 | } |
||
164 | |||
7422 | leency | 165 | ESBYTE[0] = NULL; |
166 | |||
3363 | leency | 167 | if (param) |
168 | { |
||
7245 | leency | 169 | if (strlen(#param)>1) && (param[strlen(#param)-1]=='/') param[strlen(#param)-1]=NULL; //no "/" at the end |
6930 | leency | 170 | |
171 | if (dir_exists(#param)==true) |
||
172 | { |
||
173 | strcpy(#path, #param); |
||
174 | } |
||
175 | else |
||
176 | { |
||
177 | notify(T_NOTIFY_APP_PARAM_WRONG); |
||
178 | } |
||
7041 | leency | 179 | } |
5833 | pavelyakov | 180 | |
5733 | leency | 181 | Open_Dir(#path,ONLY_OPEN); |
5719 | leency | 182 | strcpy(#inactive_path, #path); |
5733 | leency | 183 | llist_copy(#files_inactive, #files); |