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