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