Rev 7819 | Rev 7977 | 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_STATUS_BAR "Показывать статус бар" |
6505 | punk_joker | 5 | ?define NOTIFY_COPY_END "Уведомлять о завершении копирования" |
6290 | leency | 6 | ?define SHOW_BREADCRUMBS "Использовать 'хлебные крошки'" |
7 | ?define BIG_ICONS "Использовать большие иконки" |
||
7242 | leency | 8 | ?define USE_TWO_PANELS "Две панели" |
6290 | leency | 9 | ?define COLORED_LINES "Подсвечивать четные линии в списке" |
7422 | leency | 10 | ?define FONT_SIZE_LABEL "Размер шрифта" |
5743 | leency | 11 | ?define LIST_LINE_HEIGHT "Высота строки в списке" |
5526 | leency | 12 | ?define SAVE_PATH_AS_DEFAULT "Текущий путь" |
6403 | punk_joker | 13 | ?define SAVE_START_PATH_AS_DEFAULT "Введенный путь" |
14 | ?define EDIT_FILE_ASSOCIATIONS "Редактировать ассоциации файлов" |
||
6290 | leency | 15 | ?define START_PATH " Стартовый путь: " |
7227 | leency | 16 | #else |
5416 | punk_joker | 17 | ?define TITLE_SETT "Settings" |
5428 | leency | 18 | ?define SHOW_DEVICE_CLASS "Show device class name" |
5526 | leency | 19 | ?define SHOW_STATUS_BAR "Show status bar" |
6505 | punk_joker | 20 | ?define NOTIFY_COPY_END "Notify when copying finished" |
6290 | leency | 21 | ?define SHOW_BREADCRUMBS "Show breadcrumbs" |
22 | ?define BIG_ICONS "Big icons in list" |
||
7242 | leency | 23 | ?define USE_TWO_PANELS "Two panels" |
6290 | leency | 24 | ?define COLORED_LINES "Highlight even lines in list" |
7422 | leency | 25 | ?define FONT_SIZE_LABEL "Font size" |
5743 | leency | 26 | ?define LIST_LINE_HEIGHT "List line height" |
5526 | leency | 27 | ?define SAVE_PATH_AS_DEFAULT "Current path" |
7245 | leency | 28 | ?define SAVE_START_PATH_AS_DEFAULT "Typed path" |
6403 | punk_joker | 29 | ?define EDIT_FILE_ASSOCIATIONS "Edit file associations" |
6290 | leency | 30 | ?define START_PATH " Start path: " |
7227 | leency | 31 | #endif |
5416 | punk_joker | 32 | |
33 | |||
7252 | leency | 34 | edit_box path_start_ed = {290,50,57,0xffffff,0x94AECE,0xffffff,0xffffff,0x10000000,4098, |
7227 | leency | 35 | #path_start,0, 100000000000010b,0,0}; |
7252 | leency | 36 | |
6403 | punk_joker | 37 | |
7244 | leency | 38 | more_less_box line_height = { NULL, 16, 64, LIST_LINE_HEIGHT }; |
7243 | leency | 39 | checkbox show_dev_name = { SHOW_DEVICE_CLASS }; |
7244 | leency | 40 | checkbox show_status_bar = { SHOW_STATUS_BAR }; |
41 | checkbox info_after_copy = { NOTIFY_COPY_END }; |
||
42 | checkbox show_breadcrumb = { SHOW_BREADCRUMBS }; |
||
43 | checkbox big_icons = { BIG_ICONS }; |
||
44 | checkbox two_panels = { USE_TWO_PANELS }; |
||
45 | checkbox colored_lines = { COLORED_LINES }; |
||
7422 | leency | 46 | |
7243 | leency | 47 | |
48 | |||
5416 | punk_joker | 49 | { |
50 | proc_info Settings; |
||
7254 | leency | 51 | int id; |
7244 | leency | 52 | active_settings=1; |
5761 | leency | 53 | font_size.value = kfont.size.pt; |
7243 | leency | 54 | line_height.value = files.item_h; |
7252 | leency | 55 | SetEventMask(0x27); |
6403 | punk_joker | 56 | loop(){ |
5576 | pavelyakov | 57 | switch(WaitEvent()) |
5591 | pavelyakov | 58 | { |
59 | case evMouse: |
||
6403 | punk_joker | 60 | edit_box_mouse stdcall (#path_start_ed); |
61 | break; |
||
62 | |||
63 | |||
5591 | pavelyakov | 64 | id=GetButtonID(); |
5416 | punk_joker | 65 | if (1==id) { ExitSettings(); break; } |
7244 | leency | 66 | else if (id==5) |
5591 | pavelyakov | 67 | { |
5435 | leency | 68 | RunProgram("/sys/tinypad", "/sys/settings/assoc.ini"); |
7352 | leency | 69 | break; |
5463 | leency | 70 | } |
5435 | leency | 71 | else if (id==6) |
5833 | pavelyakov | 72 | { |
73 | strcpy(#path_start,#path); |
||
6403 | punk_joker | 74 | path_start_ed.size = path_start_ed.pos = strlen(#path_start); |
7245 | leency | 75 | ini.SetString("DefaultPath", #path, strlen(#path)); |
7202 | leency | 76 | edit_box_draw stdcall (#path_start_ed); |
6403 | punk_joker | 77 | break; |
5833 | pavelyakov | 78 | } |
79 | else if (id==7) |
||
6403 | punk_joker | 80 | { |
81 | SetDefaultPath(#path_start); |
||
7462 | leency | 82 | break; |
6403 | punk_joker | 83 | } |
84 | show_dev_name.click(id); |
||
7244 | leency | 85 | info_after_copy.click(id); |
86 | two_panels.click(id); |
||
87 | show_breadcrumb.click(id); |
||
88 | show_status_bar.click(id); |
||
89 | colored_lines.click(id); |
||
7422 | leency | 90 | if (font_size.click(id)) { |
7244 | leency | 91 | kfont.size.pt = font_size.value; |
7243 | leency | 92 | kfont.changeSIZE(); |
93 | BigFontsChange(); |
||
94 | } |
||
95 | if (line_height.click(id)) files.item_h = files_inactive.item_h = line_height.value; |
||
7375 | leency | 96 | if (big_icons.click(id)) BigIconsSwitch(); |
7244 | leency | 97 | EventRedrawWindow(Form.left,Form.top); |
5606 | pavelyakov | 98 | //RefreshWindow(Form.slot, Settings.slot); |
7266 | leency | 99 | break; |
6403 | punk_joker | 100 | |
5591 | pavelyakov | 101 | |
102 | GetKeys(); |
||
5707 | leency | 103 | if (key_scancode==SCAN_CODE_ESC) ExitSettings(); |
5743 | leency | 104 | EAX= key_ascii << 8; |
6403 | punk_joker | 105 | edit_box_key stdcall (#path_start_ed); |
106 | break; |
||
5416 | punk_joker | 107 | |
5591 | pavelyakov | 108 | |
109 | DefineAndDrawWindow(Form.cwidth-300/2+Form.left, Form.cheight-292/2+Form.top, 400, |
||
7242 | leency | 110 | 435+skin_height,0x34,sc.work,TITLE_SETT,0); |
7806 | leency | 111 | GetProcessInfo(#Settings, SelfInfo); |
7254 | leency | 112 | DrawSettingsCheckBoxes(); |
5463 | leency | 113 | } |
5591 | pavelyakov | 114 | } |
5416 | punk_joker | 115 | } |
5428 | leency | 116 | |
117 | |||
5743 | leency | 118 | { |
119 | active_settings = 0; |
||
5761 | leency | 120 | settings_window = 0; |
5743 | leency | 121 | cmd_free = 4; |
122 | ExitProcess(); |
||
123 | } |
||
124 | |||
125 | |||
5463 | leency | 126 | { |
127 | incn y; |
||
6289 | leency | 128 | int x=11, frx=26, but_x; |
7227 | leency | 129 | y.n = 0; |
6289 | leency | 130 | show_dev_name.draw(x, y.inc(14)); |
7244 | leency | 131 | show_status_bar.draw(x, y.inc(25)); |
132 | info_after_copy.draw(x, y.inc(25)); |
||
133 | show_breadcrumb.draw(x, y.inc(25)); |
||
134 | big_icons.draw(x, y.inc(25)); |
||
135 | two_panels.draw(x, y.inc(25)); |
||
136 | colored_lines.draw(x, y.inc(25)); |
||
7422 | leency | 137 | font_size.draw(x, y.inc(31)); |
7243 | leency | 138 | line_height.draw(x, y.inc(31)); |
139 | |||
7227 | leency | 140 | |
141 | // START_PATH { |
||
142 | DrawEditBoxPos(frx, y.inc(21), #path_start_ed); |
||
7245 | leency | 143 | but_x = DrawStandartCaptButton(frx, y.inc(34), 6, SAVE_PATH_AS_DEFAULT); |
7227 | leency | 144 | DrawStandartCaptButton(frx+but_x, y.inc(0), 7, SAVE_START_PATH_AS_DEFAULT); |
145 | // } START_PATH |
||
146 | |||
147 | |||
148 | } |
||
5463 | leency | 149 | |
5428 | leency | 150 | |
5463 | leency | 151 | |
5441 | leency | 152 | { |
5428 | leency | 153 | ini.path = GetIni(#eolite_ini_path, "app.ini"); |
7429 | leency | 154 | ini.section = "Eolite"; |
155 | |||
7202 | leency | 156 | |
5767 | leency | 157 | show_dev_name.checked = ini.GetInt("ShowDeviceName", true); |
7244 | leency | 158 | show_status_bar.checked = ini.GetInt("ShowStatusBar", true); |
159 | info_after_copy.checked = ini.GetInt("InfoAfterCopy", false); |
||
160 | big_icons.checked = ini.GetInt("BigIcons", false); BigIconsSwitch(); |
||
7375 | leency | 161 | two_panels.checked = ini.GetInt("TwoPanels", false); |
7244 | leency | 162 | colored_lines.checked = ini.GetInt("ColoredLines", false); |
7422 | leency | 163 | kfont.size.pt = ini.GetInt("FontSize", 13); |
7202 | leency | 164 | files.item_h = ini.GetInt("LineHeight", 19); |
165 | Form.left = ini.GetInt("WinX", 200); |
||
7278 | leency | 166 | Form.top = ini.GetInt("WinY", 50); |
167 | Form.width = ini.GetInt("WinW", 550); |
||
168 | Form.height = ini.GetInt("WinH", 506); |
||
169 | ini.GetString("DefaultPath", #path, 4096, "/rd/1"); |
||
7202 | leency | 170 | ini.GetString("DefaultPath", #path_start, 4096, "/rd/1"); |
171 | path_start_ed.size = path_start_ed.pos = strlen(#path_start); |
||
7252 | leency | 172 | |
5974 | leency | 173 | |
5987 | leency | 174 | kfont.init(#temp); |
6806 | leency | 175 | ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on"); |
5974 | leency | 176 | if(!strcmp(#temp,"off")) kfont.smooth = false; else kfont.smooth = true; |
6806 | leency | 177 | } |
5428 | leency | 178 | |
179 | |||
5687 | leency | 180 | |
5441 | leency | 181 | { |
182 | ini.SetInt("ShowDeviceName", show_dev_name.checked); |
||
7244 | leency | 183 | ini.SetInt("ShowStatusBar", show_status_bar.checked); |
184 | ini.SetInt("InfoAfterCopy", info_after_copy.checked); |
||
185 | ini.SetInt("BigIcons", big_icons.checked); |
||
7375 | leency | 186 | ini.SetInt("TwoPanels", two_panels.checked); |
7244 | leency | 187 | ini.SetInt("ColoredLines", colored_lines.checked); |
7422 | leency | 188 | ini.SetInt("FontSize", kfont.size.pt); |
189 | ini.SetInt("LineHeight", files.item_h); |
||
7202 | leency | 190 | ini.SetInt("WinX", Form.left); |
191 | ini.SetInt("WinY", Form.top); |
||
192 | ini.SetInt("WinW", Form.width); |
||
193 | ini.SetInt("WinH", Form.height); |
||
194 | } |
||
5441 | leency | 195 | |
5428 | leency | 196 | |
5441 | leency | 197 | |
198 | |||
5428 | leency | 199 | { |
200 | char error_message[500]; |
||
201 | sprintf(#error_message,"\"%s\n%s\" -%s","Eolite",get_error(error_number),"tE"); |
||
5576 | pavelyakov | 202 | notify(#error_message); |
5620 | leency | 203 | } |
5428 | leency | 204 | |
205 | |||
206 | |||
7635 | leency | 207 | { |
208 | //ICONS16.PNG |
||
209 | Libimg_LoadImage(#icons16_default, "/sys/icons16.png"); |
||
210 | Libimg_LoadImage(#icons16_selected, "/sys/icons16.png"); |
||
211 | Libimg_ReplaceColor(icons16_selected.image, icons16_selected.w, icons16_selected.h, 0xffFFFfff, col.selec); |
||
212 | Libimg_ReplaceColor(icons16_selected.image, icons16_selected.w, icons16_selected.h, 0xffCACBD6, MixColors(col.selec, 0, 200)); |
||
213 | if (col.list_bg!=0xFFFfff) { |
||
214 | Libimg_ReplaceColor(icons16_default.image, icons16_selected.w, icons16_selected.h, 0xffFFFfff, col.list_bg); |
||
215 | Libimg_ReplaceColor(icons16_default.image, icons16_selected.w, icons16_selected.h, 0xffCACBD6, MixColors(col.list_bg, 0, 200)); |
||
216 | } |
||
217 | //ICONS32.PNG |
||
218 | Libimg_LoadImage(#icons32_default, "/sys/icons32.png"); |
||
219 | Libimg_LoadImage(#icons32_selected, "/sys/icons32.png"); |
||
220 | Libimg_ReplaceColor(icons32_default.image, icons32_selected.w, icons32_selected.h, 0x00000000, col.list_bg); |
||
221 | Libimg_ReplaceColor(icons32_selected.image, icons32_selected.w, icons32_selected.h, 0x00000000, col.selec); |
||
222 | } |
||
223 | |||
224 | |||
5428 | leency | 225 | { |
226 | int i; |
||
7462 | leency | 227 | static dword bg_col; |
7806 | leency | 228 | dword old_list_bg_color = col.list_bg; |
229 | sc.get(); |
||
230 | sc.work_dark = MixColors(0, sc.work, 35); |
||
7819 | leency | 231 | if (sc.work == 0) sc.work = 1; |
7928 | leency | 232 | if (bg_col == sc.work) return; |
7806 | leency | 233 | bg_col = sc.work; |
234 | if (skin_is_dark()) |
||
7780 | leency | 235 | { |
7634 | leency | 236 | //use dark colors |
237 | col.def = false; |
||
7647 | leency | 238 | col.list_bg = sc.work; |
7806 | leency | 239 | col.list_gb_text = sc.work_text; |
240 | col.list_text_hidden = 0xA6A6B7; |
||
7634 | leency | 241 | col.list_vert_line = sc.work_graph; |
7806 | leency | 242 | col.lpanel = MixColors(sc.work_graph, sc.work, 65); |
243 | col.selec = col.selec_active = sc.button; |
||
244 | col.selec_text = sc.button_text; |
||
245 | if (col.list_bg==col.selec) col.selec = sc.work_graph; //for fucking skins |
||
246 | col.slider_bg_big = MixColors(0xCED0D0, sc.work, 35); |
||
247 | col.odd_line = MixColors(0xFFFfff, sc.work, 15); |
||
248 | } |
||
7634 | leency | 249 | else |
7780 | leency | 250 | { |
251 | //use light colors |
||
252 | col.def = true; |
||
253 | col.list_bg = 0xFFFfff; |
||
254 | col.list_gb_text = 0x000000; |
||
255 | col.list_text_hidden = 0xA6A6B7; |
||
256 | col.list_vert_line = 0xDDD7CF; |
||
257 | col.lpanel = 0x00699C; |
||
258 | col.selec = col.selec_active = 0x94AECE; |
||
259 | col.selec_text = 0x000000; |
||
260 | col.slider_bg_big = 0xCDCFCF; |
||
261 | col.odd_line = 0xF1F1F1; |
||
262 | } |
||
263 | col.selec_inactive = MixColors(0xBBBbbb, col.list_bg, 65); |
||
7634 | leency | 264 | col.slider_bg_left = MixColors(sc.work_graph, col.slider_bg_big, 10); |
7806 | leency | 265 | for (i=0; i<20; i++) col.work_gradient[i] = MixColors(sc.work_light, sc.work, i*5); |
266 | if (old_list_bg_color!=col.list_bg) LoadIcons(); |
||
7635 | leency | 267 | } |
5463 | leency | 268 | |
269 | |||
270 | |||
5687 | leency | 271 | { |
272 | files.item_h = kfont.size.pt + 4; |
||
6806 | leency | 273 | if (files.item_h |
7375 | leency | 274 | files.item_h = icon_size+3; |
275 | line_height.value = files.item_h; |
||
276 | line_height.redraw(); |
||
277 | } |
||
278 | files_active.item_h = files_inactive.item_h = files.item_h; |
||
5825 | leency | 279 | } |
5687 | leency | 280 | |
7244 | leency | 281 | |
282 | { |
||
283 | if (big_icons.checked) icon_size=32; else icon_size=16; |
||
7635 | leency | 284 | BigFontsChange(); |
7375 | leency | 285 | } |
7244 | leency | 286 | |
7462 | leency | 287 | |
288 | { |
||
289 | ini.SetString("DefaultPath", p, strlen(p)); |
||
290 | notify("'Default path has been set' -O"); |
||
291 | }20;>><> |
||
292 |