Rev 6291 | Rev 6406 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6291 | Rev 6403 | ||
---|---|---|---|
Line 6... | Line 6... | ||
6 | ?define SHOW_BREADCRUMBS "ᯮ«ì§®¢ âì 'å«¥¡ë¥ ªà®èª¨'" |
6 | ?define SHOW_BREADCRUMBS "ᯮ«ì§®¢ âì 'å«¥¡ë¥ ªà®èª¨'" |
7 | ?define USE_TWO_PANELS "¢¥ ¯ ¥«¨" |
7 | ?define USE_TWO_PANELS "¢¥ ¯ ¥«¨" |
8 | ?define FONT_SIZE_LABEL " §¬¥à èà¨äâ " |
8 | ?define FONT_SIZE_LABEL " §¬¥à èà¨äâ " |
9 | ?define LIST_LINE_HEIGHT "ëá®â áâப¨ ¢ ᯨ᪥" |
9 | ?define LIST_LINE_HEIGHT "ëá®â áâப¨ ¢ ᯨ᪥" |
10 | ?define SAVE_PATH_AS_DEFAULT "¤¥« âì ⥪ã騩 ¯ãâì ¤®¬ 訬 ª â «®£®¬" |
10 | ?define SAVE_PATH_AS_DEFAULT "¥ªã騩 ¯ãâì" |
11 | ?define EDIT_FILE_ASSOCIATIONS "¥¤ ªâ¨à®¢ âì áá®æ¨ 樨 ä ©«®¢" |
11 | ?define SAVE_START_PATH_AS_DEFAULT "¢¥¤¥ë© ¯ãâì" |
- | 12 | ?define EDIT_FILE_ASSOCIATIONS "¥¤ ªâ¨à®¢ âì áá®æ¨ 樨 ä ©«®¢" |
|
12 | #else |
13 | #else |
13 | ?define TITLE_SETT "Settings" |
14 | ?define TITLE_SETT "Settings" |
14 | ?define SHOW_DEVICE_CLASS "Show device class name" |
15 | ?define SHOW_DEVICE_CLASS "Show device class name" |
15 | ?define SHOW_REAL_NAMES "Show file names in original case" |
16 | ?define SHOW_REAL_NAMES "Show file names in original case" |
16 | ?define NOTIFY_COPY_END "Notify when copying finished" |
17 | ?define NOTIFY_COPY_END "Notify when copying finished" |
17 | ?define SHOW_BREADCRUMBS "Show breadcrumbs" |
18 | ?define SHOW_BREADCRUMBS "Show breadcrumbs" |
18 | ?define USE_TWO_PANELS "Two panels" |
19 | ?define USE_TWO_PANELS "Two panels" |
19 | ?define FONT_SIZE_LABEL "Font size" |
20 | ?define FONT_SIZE_LABEL "Font size" |
20 | ?define LIST_LINE_HEIGHT "List line height" |
21 | ?define LIST_LINE_HEIGHT "List line height" |
21 | ?define SAVE_PATH_AS_DEFAULT "Save current path as home folder" |
22 | ?define SAVE_PATH_AS_DEFAULT "urrent path" |
22 | ?define EDIT_FILE_ASSOCIATIONS "Edit file associations" |
23 | ?define SAVE_START_PATH_AS_DEFAULT "Typed path" |
- | 24 | ?define EDIT_FILE_ASSOCIATIONS "Edit file associations" |
|
23 | #endif |
25 | #endif |
24 | 26 | ||
Line 25... | Line 27... | ||
25 | char config_section[] = "Config"; |
27 | char config_section[] = "Config"; |
26 | int WinX, WinY, WinW, WinH; |
28 | int WinX, WinY, WinW, WinH; |
Line -... | Line 29... | ||
- | 29 | ||
- | 30 | dword set_mouse_dd; |
|
- | 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}; |
|
27 | 33 | ||
28 | void settings_dialog() |
34 | void settings_dialog() |
29 | { |
35 | { |
30 | byte id; |
36 | byte id; |
- | 37 | active_settings=1; |
|
31 | active_settings=1; |
38 | SetEventMask(0x27); |
32 | loop(){ |
39 | loop(){ |
33 | switch(WaitEvent()) |
40 | switch(WaitEvent()) |
- | 41 | { |
|
- | 42 | case evMouse: |
|
- | 43 | edit_box_mouse stdcall (#path_start_ed); |
|
- | 44 | break; |
|
34 | { |
45 | |
35 | case evButton: |
46 | case evButton: |
36 | id=GetButtonID(); |
47 | id=GetButtonID(); |
37 | if (id==1) { ExitSettings(); break; } |
48 | if (id==1) { ExitSettings(); break; } |
38 | else if (id==5) |
49 | else if (id==5) |
39 | { |
50 | { |
40 | RunProgram("tinypad", "/sys/settings/assoc.ini"); |
51 | RunProgram("tinypad", "/sys/settings/assoc.ini"); |
41 | break; |
52 | break; |
42 | } |
53 | } |
43 | else if (id==6) |
54 | else if (id==6) |
- | 55 | { |
|
- | 56 | strcpy(#path_start,#path); |
|
- | 57 | path_start_ed.size = strlen(#path_start); |
|
44 | { |
58 | path_start_ed.pos = strlen(#path_start); |
- | 59 | ini_set_str stdcall (eolite_ini_path, #config_section, "DefaultPath", #path,strlen(#path)); |
|
- | 60 | edit_box_draw stdcall (#path_start_ed); |
|
- | 61 | break; |
|
- | 62 | } |
|
- | 63 | else if (id==7) |
|
- | 64 | { |
|
45 | ini_set_str stdcall (eolite_ini_path, #config_section, "DefaultPath", #path,strlen(#path)); |
65 | ini_set_str stdcall (eolite_ini_path, #config_section, "DefaultPath", #path_start,strlen(#path_start)); |
46 | break; |
66 | break; |
47 | } |
67 | } |
48 | else if (id==20) show_dev_name ^= 1; |
68 | else if (id==20) show_dev_name ^= 1; |
49 | else if (id==21) { action_buf=109; real_files_names_case ^= 1; } |
69 | else if (id==21) { action_buf=109; real_files_names_case ^= 1; } |
Line 59... | Line 79... | ||
59 | 79 | ||
Line 60... | Line 80... | ||
60 | case evKey: |
80 | case evKey: |
61 | GetKeys(); |
81 | GetKeys(); |
62 | if (key_scancode==SCAN_CODE_ESC) ExitSettings(); |
82 | if (key_scancode==SCAN_CODE_ESC) ExitSettings(); |
- | 83 | EAX= key_ascii << 8; |
|
- | 84 | edit_box_key stdcall (#path_start_ed); |
|
63 | break; |
85 | break; |
Line 64... | Line 86... | ||
64 | 86 | ||
65 | case evReDraw: |
87 | case evReDraw: |
66 | DefineAndDrawWindow(Form.cwidth-300/2+Form.left, Form.cheight-292/2+Form.top, 376, 292+GetSkinHeight(),0x34,system.color.work,TITLE_SETT); |
88 | DefineAndDrawWindow(Form.cwidth-300/2+Form.left, Form.cheight-292/2+Form.top, 376, 312+GetSkinHeight(),0x34,system.color.work,TITLE_SETT); |
67 | DrawSettingsCheckBoxes(); |
89 | DrawSettingsCheckBoxes(); |
68 | } |
90 | } |
69 | } |
91 | } |
Line 88... | Line 110... | ||
88 | CheckBox(x, y.inc(25), 32, SHOW_BREADCRUMBS, show_breadcrumb); |
110 | CheckBox(x, y.inc(25), 32, SHOW_BREADCRUMBS, show_breadcrumb); |
89 | CheckBox(x, y.inc(25), 24, USE_TWO_PANELS, two_panels); |
111 | 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); |
112 | 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); |
113 | 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); |
114 | path_start_ed.top = y.inc(31); |
- | 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); |
|
93 | DrawFlatButton(x-1, y.inc(36), strlen(EDIT_FILE_ASSOCIATIONS)+3*8, 24, 5, EDIT_FILE_ASSOCIATIONS); |
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); |
|
94 | } |
120 | } |
95 | 121 | ||
Line 96... | Line 122... | ||
96 | 122 | ||
Line 109... | Line 135... | ||
109 | ini_get_int stdcall (eolite_ini_path, #config_section, "WinY", 50); WinY = EAX; |
135 | 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; |
136 | 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; |
137 | ini_get_int stdcall (eolite_ini_path, #config_section, "WinH", 506); WinH = EAX; |
112 | ini_get_str stdcall (eolite_ini_path, #config_section, "DefaultPath", #path,4096,"/rd/1/"); |
138 | ini_get_str stdcall (eolite_ini_path, #config_section, "DefaultPath", #path,4096,"/rd/1/"); |
113 | 139 | ini_get_str stdcall (eolite_ini_path, #config_section, "DefaultPath", #path_start,4096,"/rd/1/"); |
|
114 | - | ||
- | 140 | path_start_ed.size = strlen(#path_start); |
|
- | 141 | path_start_ed.pos = strlen(#path_start); |
|
- | 142 | ||
Line 115... | Line 143... | ||
115 | ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font file",#temp,4096,DEFAULT_FONT); |
143 | ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font file",#temp,4096,DEFAULT_FONT); |
116 | label.init(#temp); |
144 | label.init(#temp); |
117 | ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on"); |
145 | ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on"); |
118 | if(!strcmp(#temp,"off")) label.smooth = false; else label.smooth = true; |
146 | if(!strcmp(#temp,"off")) label.smooth = false; else label.smooth = true; |