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