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