Rev 6403 | Rev 6505 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5416 | punk_joker | 1 | |
2 | ?define TITLE_SETT "Настройки" |
||
3 | ?define SHOW_DEVICE_CLASS "Выводить названия класса устройств" |
||
5526 | leency | 4 | ?define SHOW_REAL_NAMES "Показывать имена файлов не меняя регистр" |
5 | ?define NOTIFY_COPY_END "Уведомлять о завершении копирования" |
||
6290 | leency | 6 | ?define SHOW_BREADCRUMBS "Использовать 'хлебные крошки'" |
7 | ?define USE_TWO_PANELS "Две панели" |
||
8 | ?define FONT_SIZE_LABEL "Размер шрифта" |
||
5743 | leency | 9 | ?define LIST_LINE_HEIGHT "Высота строки в списке" |
5526 | leency | 10 | ?define SAVE_PATH_AS_DEFAULT "Текущий путь" |
6403 | punk_joker | 11 | ?define SAVE_START_PATH_AS_DEFAULT "Введенный путь" |
12 | ?define EDIT_FILE_ASSOCIATIONS "Редактировать ассоциации файлов" |
||
6290 | leency | 13 | ?define START_PATH "Стартовый путь:" |
6406 | punk_joker | 14 | #else |
5416 | punk_joker | 15 | ?define TITLE_SETT "Settings" |
5428 | leency | 16 | ?define SHOW_DEVICE_CLASS "Show device class name" |
5526 | leency | 17 | ?define SHOW_REAL_NAMES "Show file names in original case" |
6278 | leency | 18 | ?define NOTIFY_COPY_END "Notify when copying finished" |
6290 | leency | 19 | ?define SHOW_BREADCRUMBS "Show breadcrumbs" |
20 | ?define USE_TWO_PANELS "Two panels" |
||
21 | ?define FONT_SIZE_LABEL "Font size" |
||
5743 | leency | 22 | ?define LIST_LINE_HEIGHT "List line height" |
5526 | leency | 23 | ?define SAVE_PATH_AS_DEFAULT "Сurrent path" |
6403 | punk_joker | 24 | ?define SAVE_START_PATH_AS_DEFAULT "Typed path" |
25 | ?define EDIT_FILE_ASSOCIATIONS "Edit file associations" |
||
6290 | leency | 26 | ?define START_PATH "Start path:" |
6406 | punk_joker | 27 | #endif |
5416 | punk_joker | 28 | |
29 | |||
5748 | leency | 30 | int WinX, WinY, WinW, WinH; |
31 | |||
5416 | punk_joker | 32 | |
6403 | punk_joker | 33 | char path_start[4096]="\0"; |
34 | edit_box path_start_ed = {230,50,57,0xffffff,0x94AECE,0xffffff,0xffffff,2,4098,#path_start,#set_mouse_dd, 100000000000010b,0,0}; |
||
6406 | punk_joker | 35 | |
6403 | punk_joker | 36 | |
5416 | punk_joker | 37 | { |
38 | byte id; |
||
39 | active_settings=1; |
||
5761 | leency | 40 | SetEventMask(0x27); |
6403 | punk_joker | 41 | loop(){ |
5576 | pavelyakov | 42 | switch(WaitEvent()) |
5591 | pavelyakov | 43 | { |
44 | case evMouse: |
||
6403 | punk_joker | 45 | edit_box_mouse stdcall (#path_start_ed); |
46 | break; |
||
47 | |||
48 | |||
5591 | pavelyakov | 49 | id=GetButtonID(); |
5416 | punk_joker | 50 | if (id==1) { ExitSettings(); break; } |
5761 | leency | 51 | else if (id==5) |
5591 | pavelyakov | 52 | { |
5435 | leency | 53 | RunProgram("tinypad", "/sys/settings/assoc.ini"); |
54 | break; |
||
5463 | leency | 55 | } |
5435 | leency | 56 | else if (id==6) |
5833 | pavelyakov | 57 | { |
58 | strcpy(#path_start,#path); |
||
6403 | punk_joker | 59 | path_start_ed.size = strlen(#path_start); |
60 | path_start_ed.pos = strlen(#path_start); |
||
61 | ini_set_str stdcall (eolite_ini_path, #config_section, "DefaultPath", #path,strlen(#path)); |
||
5833 | pavelyakov | 62 | edit_box_draw stdcall (#path_start_ed); |
6403 | punk_joker | 63 | break; |
5833 | pavelyakov | 64 | } |
65 | else if (id==7) |
||
6403 | punk_joker | 66 | { |
67 | ini_set_str stdcall (eolite_ini_path, #config_section, "DefaultPath", #path_start,strlen(#path_start)); |
||
68 | break; |
||
69 | } |
||
70 | else if (id==20) show_dev_name ^= 1; |
||
5591 | pavelyakov | 71 | else if (id==21) { action_buf=109; real_files_names_case ^= 1; } |
5743 | leency | 72 | else if (id==22) info_after_copy ^= 1; |
5591 | pavelyakov | 73 | else if (id==24) two_panels ^= true; |
5846 | pavelyakov | 74 | else if (id==32) show_breadcrumb ^= true; |
6289 | leency | 75 | else if (id==25) { files.item_h++; files_active.item_h = files_inactive.item_h = files.item_h; } |
5825 | leency | 76 | else if (id==26) && (files.item_h>15) files_inactive.item_h = files.item_h = files.item_h-1; |
6291 | leency | 77 | else if (id==30) { label.size.pt++; IF(!label.changeSIZE()) label.size.pt--; BigFontsChange(); } |
5987 | leency | 78 | else if (id==31) { label.size.pt--; IF(!label.changeSIZE()) label.size.pt++; BigFontsChange(); } |
79 | EventRedrawWindow(Form.left,Form.top); |
||
5606 | pavelyakov | 80 | break; |
6403 | punk_joker | 81 | |
5591 | pavelyakov | 82 | |
83 | GetKeys(); |
||
5707 | leency | 84 | if (key_scancode==SCAN_CODE_ESC) ExitSettings(); |
5743 | leency | 85 | EAX= key_ascii << 8; |
6403 | punk_joker | 86 | edit_box_key stdcall (#path_start_ed); |
87 | break; |
||
5416 | punk_joker | 88 | |
5591 | pavelyakov | 89 | |
90 | DefineAndDrawWindow(Form.cwidth-300/2+Form.left, Form.cheight-292/2+Form.top, 376, 332+GetSkinHeight(),0x34,system.color.work,TITLE_SETT); |
||
6406 | punk_joker | 91 | DrawSettingsCheckBoxes(); |
5463 | leency | 92 | } |
5591 | pavelyakov | 93 | } |
5416 | punk_joker | 94 | } |
5428 | leency | 95 | |
96 | |||
5743 | leency | 97 | { |
98 | active_settings = 0; |
||
5761 | leency | 99 | settings_window = 0; |
5743 | leency | 100 | cmd_free = 4; |
101 | ExitProcess(); |
||
102 | } |
||
103 | |||
104 | |||
5463 | leency | 105 | { |
106 | incn y; |
||
6289 | leency | 107 | int x=11; |
6290 | leency | 108 | y.n = 0; |
6289 | leency | 109 | CheckBox(x, y.inc(14), 20, SHOW_DEVICE_CLASS, show_dev_name); |
6290 | leency | 110 | CheckBox(x, y.inc(25), 21, SHOW_REAL_NAMES, real_files_names_case); |
111 | CheckBox(x, y.inc(25), 22, NOTIFY_COPY_END, info_after_copy); |
||
112 | CheckBox(x, y.inc(25), 32, SHOW_BREADCRUMBS, show_breadcrumb); |
||
113 | CheckBox(x, y.inc(25), 24, USE_TWO_PANELS, two_panels); |
||
114 | MoreLessBox(x, y.inc(31), 30, 31, label.size.pt, FONT_SIZE_LABEL); |
||
115 | MoreLessBox(x, y.inc(31), 25, 26, files.item_h, LIST_LINE_HEIGHT); |
||
116 | WriteText(6, y.inc(28), 0xD0, system.color.work_text, START_PATH); |
||
6406 | punk_joker | 117 | path_start_ed.top = y.inc(23); |
118 | path_start_ed.left = x; |
||
6403 | punk_joker | 119 | DrawEditBox(#path_start_ed); |
6406 | punk_joker | 120 | DrawFlatButton(x-1, y.inc(26), strlen(SAVE_PATH_AS_DEFAULT)+3*8, 24, 6, SAVE_PATH_AS_DEFAULT); |
6403 | punk_joker | 121 | DrawFlatButton(x-1+strlen(SAVE_PATH_AS_DEFAULT)+3*8, y.inc(0), strlen(SAVE_START_PATH_AS_DEFAULT)+3*8, 24, 7, SAVE_START_PATH_AS_DEFAULT); |
122 | DrawFlatButton(x-1, y.inc(36), strlen(EDIT_FILE_ASSOCIATIONS)+3*8, 24, 5, EDIT_FILE_ASSOCIATIONS); |
||
6290 | leency | 123 | } |
5463 | leency | 124 | |
5428 | leency | 125 | |
5463 | leency | 126 | |
5441 | leency | 127 | { |
5428 | leency | 128 | files.SetFont(6, 9, 10000000b); |
5767 | leency | 129 | FileShow.font_size_x = files.font_w; |
130 | FileShow.font_number = 0; |
||
131 | ini_get_int stdcall (eolite_ini_path, #config_section, "ShowDeviceName", 1); show_dev_name = EAX; |
||
5748 | leency | 132 | ini_get_int stdcall (eolite_ini_path, #config_section, "RealFileNamesCase", 0); real_files_names_case = EAX; |
133 | ini_get_int stdcall (eolite_ini_path, #config_section, "InfoAfterCopy", 0); info_after_copy = EAX; |
||
134 | ini_get_int stdcall (eolite_ini_path, #config_section, "FontSize", 12); label.size.pt = EAX; |
||
6039 | leency | 135 | ini_get_int stdcall (eolite_ini_path, #config_section, "TwoPanels", 0); two_panels = EAX; |
5748 | leency | 136 | ini_get_int stdcall (eolite_ini_path, #config_section, "LineHeight", 19); files.item_h = EAX; |
6039 | leency | 137 | ini_get_int stdcall (eolite_ini_path, #config_section, "WinX", 200); WinX = EAX; |
5748 | leency | 138 | ini_get_int stdcall (eolite_ini_path, #config_section, "WinY", 50); WinY = EAX; |
139 | ini_get_int stdcall (eolite_ini_path, #config_section, "WinW", 550); WinW = EAX; |
||
140 | ini_get_int stdcall (eolite_ini_path, #config_section, "WinH", 506); WinH = EAX; |
||
6039 | leency | 141 | ini_get_str stdcall (eolite_ini_path, #config_section, "DefaultPath", #path,4096,"/rd/1/"); |
5974 | leency | 142 | ini_get_str stdcall (eolite_ini_path, #config_section, "DefaultPath", #path_start,4096,"/rd/1/"); |
6403 | punk_joker | 143 | path_start_ed.size = strlen(#path_start); |
144 | path_start_ed.pos = strlen(#path_start); |
||
145 | |||
5974 | leency | 146 | |
5987 | leency | 147 | label.init(#temp); |
148 | ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on"); |
||
5974 | leency | 149 | if(!strcmp(#temp,"off")) label.smooth = false; else label.smooth = true; |
5996 | leency | 150 | } |
5428 | leency | 151 | |
152 | |||
5687 | leency | 153 | |
5441 | leency | 154 | { |
155 | ini_set_int stdcall (eolite_ini_path, #config_section, "ShowDeviceName", show_dev_name); |
||
6049 | leency | 156 | ini_set_int stdcall (eolite_ini_path, #config_section, "RealFileNamesCase", real_files_names_case); |
157 | ini_set_int stdcall (eolite_ini_path, #config_section, "InfoAfterCopy", info_after_copy); |
||
158 | ini_set_int stdcall (eolite_ini_path, #config_section, "FontSize", label.size.pt); |
||
159 | ini_set_int stdcall (eolite_ini_path, #config_section, "TwoPanels", two_panels); |
||
160 | ini_set_int stdcall (eolite_ini_path, #config_section, "LineHeight", files.item_h); |
||
161 | ini_set_int stdcall (eolite_ini_path, #config_section, "WinX", Form.left); |
||
162 | ini_set_int stdcall (eolite_ini_path, #config_section, "WinY", Form.top); |
||
163 | ini_set_int stdcall (eolite_ini_path, #config_section, "WinW", Form.width); |
||
164 | ini_set_int stdcall (eolite_ini_path, #config_section, "WinH", Form.height); |
||
165 | } |
||
5441 | leency | 166 | |
5428 | leency | 167 | |
5441 | leency | 168 | |
169 | |||
5428 | leency | 170 | { |
171 | char error_message[500]; |
||
172 | dword ii; |
||
173 | if (files.cur_y>=0) Line_ReDraw(0xFF0000, files.cur_y); |
||
5825 | leency | 174 | pause(5); |
5428 | leency | 175 | sprintf(#error_message,"\"%s\n%s\" -%s","Eolite",get_error(error_number),"tE"); |
5576 | pavelyakov | 176 | notify(#error_message); |
5620 | leency | 177 | } |
5428 | leency | 178 | |
179 | |||
180 | |||
181 | { |
||
182 | system.color.get(); |
||
6191 | leency | 183 | //system.color.work = 0xE4DFE1; |
184 | //system.color.work_text = 0; |
||
185 | //system.color.work_graph = 0x7E87A3; //A0A0B8; |
||
186 | //system.color.work_button = 0x7E87A3; |
||
187 | //system.color.work_button_text = 0x000000 |
||
188 | col_work = 0xE4DFE1; |
||
189 | col_padding = 0xC8C9C9; |
||
5428 | leency | 190 | col_selec = 0x94AECE; |
5767 | leency | 191 | col_lpanel = 0x00699C; |
5428 | leency | 192 | col_graph = 0x7E87A3; |
6191 | leency | 193 | } |
5463 | leency | 194 | |
195 | |||
196 | |||
5687 | leency | 197 | { |
198 | files.item_h = label.size.pt + 4; |
||
5987 | leency | 199 | if (files.item_h<18) files.item_h = 18; |
5825 | leency | 200 | files_active.item_h = files_inactive.item_h = files.item_h; |
201 | }18)>><> |
||
5687 | leency | 202 |