Subversion Repositories Kolibri OS

Rev

Rev 6678 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6678 Rev 7244
Line 1... Line 1...
1
//Leency & SoUrcerer, LGPL
1
//Leency & SoUrcerer, LGPL
Line 2... Line -...
2
 
-
 
3
#define CUSTOM 0
-
 
4
#define MANUAL 1
-
 
5
char checked[3] = { 1, 0 };
-
 
6
 
2
 
Line 7... Line 3...
7
char *text1[] = {"POP server adress:", "POP server port:", "SMTP server adress:", "SMTP server port:", '\0'};
3
char *text1[] = {"POP server adress:", "POP server port:", "SMTP server adress:", "SMTP server port:", '\0'};
8
 
4
 
9
dword mouse_opt;
5
dword mouse_opt;
Line 14... Line 10...
14
edit_box POP_server_box        = {210,230,125 ,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,sizeof(POP_server1),#POP_server1,#mouse_opt,100000000000b};
10
edit_box POP_server_box        = {210,230,125 ,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,sizeof(POP_server1),#POP_server1,#mouse_opt,100000000000b};
15
edit_box POP_server_port_box   = {210,230,160,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,5,#POP_server_port1,#mouse_opt,100000000000b};
11
edit_box POP_server_port_box   = {210,230,160,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,5,#POP_server_port1,#mouse_opt,100000000000b};
16
edit_box SMTP_server_box       = {210,230,195,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,sizeof(SMTP_server1),#SMTP_server1,#mouse_opt,100000000000b};
12
edit_box SMTP_server_box       = {210,230,195,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,sizeof(SMTP_server1),#SMTP_server1,#mouse_opt,100000000000b};
17
edit_box SMTP_server_port_box  = {210,230,230,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,5,#SMTP_server_port1,#mouse_opt,100000000000b};
13
edit_box SMTP_server_port_box  = {210,230,230,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,5,#SMTP_server_port1,#mouse_opt,100000000000b};
Line -... Line 14...
-
 
14
 
Line 18... Line 15...
18
 
15
checkbox automatic = { "Automatic configuration", true };
19
 
16
 
20
void SettingsDialog()
17
void SettingsDialog()
Line 42... Line 39...
42
				
39
				
43
			case evButton:
40
			case evButton:
44
				id = GetButtonID(); 
41
				id = GetButtonID(); 
45
				if (id==1) SaveAndExit();
42
				if (id==1) SaveAndExit();
46
				if (id==19) LoginBoxLoop();
43
				if (id==19) LoginBoxLoop();
47
				if (id==17) || (id==18)
44
				if (automatic.click(id))
48
				{
-
 
49
					if (checked[id-17]==1) break;
-
 
50
					checked[0]>
45
				{
51
					if (checked[1]) {
-
 
52
						POP_server_box.flags = 0b10;
46
					if (automatic.checked) {
53
						POP_server_port_box.flags = SMTP_server_box.flags = SMTP_server_port_box.flags = 0b;
47
						POP_server_box.flags = POP_server_box.flags = POP_server_port_box.flags = SMTP_server_box.flags = SMTP_server_port_box.flags = 100000000000b;
54
						POP_server_box.blur_border_color = POP_server_box.blur_border_color = POP_server_port_box.blur_border_color =
48
						POP_server_box.blur_border_color = POP_server_box.blur_border_color = POP_server_port_box.blur_border_color =
55
						 SMTP_server_box.blur_border_color = SMTP_server_port_box.blur_border_color = 0xFFFfff;
49
						 SMTP_server_box.blur_border_color = SMTP_server_port_box.blur_border_color = 0xCACACA;
56
					}
50
					}
-
 
51
					else {
57
					else {
52
						POP_server_box.flags = 0b10;
58
						POP_server_box.flags = POP_server_box.flags = POP_server_port_box.flags = SMTP_server_box.flags = SMTP_server_port_box.flags = 100000000000b;
53
						POP_server_port_box.flags = SMTP_server_box.flags = SMTP_server_port_box.flags = 0b;
59
						POP_server_box.blur_border_color = POP_server_box.blur_border_color = POP_server_port_box.blur_border_color =
54
						POP_server_box.blur_border_color = POP_server_box.blur_border_color = POP_server_port_box.blur_border_color =
60
						 SMTP_server_box.blur_border_color = SMTP_server_port_box.blur_border_color = 0xCACACA;
55
						 SMTP_server_box.blur_border_color = SMTP_server_port_box.blur_border_color = 0xFFFfff;
61
					}
56
					}
62
					OptionsWindow();
57
					DrawOptionsWindow();
63
				}
58
				}
Line 64... Line 59...
64
				break;
59
				break;
65
				
60
				
Line 66... Line 61...
66
			case evKey:
61
			case evKey:
67
				GetKeys();;
62
				GetKeys();;
68
 
63
 
69
				if (checked[1]==0) break;
64
				if (automatic.checked==true) break;
70
				if (key_scancode==SCAN_CODE_TAB)
65
				if (key_scancode==SCAN_CODE_TAB)
71
				{
66
				{
72
					if (POP_server_box.flags & 0b10)       { POP_server_box.flags -= 0b10;         POP_server_port_box.flags += 0b10;  } else
67
					if (POP_server_box.flags & 0b10)       { POP_server_box.flags -= 0b10;         POP_server_port_box.flags += 0b10;  } else
73
					if (POP_server_port_box.flags & 0b10)  { POP_server_port_box.flags -= 0b10;    SMTP_server_box.flags += 0b10;      } else
68
					if (POP_server_port_box.flags & 0b10)  { POP_server_port_box.flags -= 0b10;    SMTP_server_box.flags += 0b10;      } else
74
					if (SMTP_server_box.flags & 0b10)      { SMTP_server_box.flags -= 0b10;        SMTP_server_port_box.flags += 0b10; } else
69
					if (SMTP_server_box.flags & 0b10)      { SMTP_server_box.flags -= 0b10;        SMTP_server_port_box.flags += 0b10; } else
75
					if (SMTP_server_port_box.flags & 0b10) { SMTP_server_port_box.flags -= 0b10;   POP_server_box.flags += 0b10;       } else
70
					if (SMTP_server_port_box.flags & 0b10) { SMTP_server_port_box.flags -= 0b10;   POP_server_box.flags += 0b10;       } else
Line 76... Line 71...
76
					                                         POP_server_box.flags = 0b10;
71
					                                         POP_server_box.flags = 0b10;
77
					OptionsWindow();
72
					DrawOptionsWindow();
78
				}
73
				}
Line 85... Line 80...
85
				break;
80
				break;
Line 86... Line 81...
86
 
81
 
87
			case evReDraw: _OPT_WIN:
82
			case evReDraw: _OPT_WIN:
88
				if !(DefineWindow(OPTIONS_HEADER)) break;
83
				if !(DefineWindow(OPTIONS_HEADER)) break;
89
				DrawBar(0,0, Form.cwidth, Form.cheight, system.color.work);
84
				DrawBar(0,0, Form.cwidth, Form.cheight, system.color.work);
90
				OptionsWindow();
85
				DrawOptionsWindow();
91
				break;
86
				break;
92
		}
87
		}
93
	}
88
	}
Line 94... Line 89...
94
}
89
}
95
 
90
 
96
void OptionsWindow()
91
void DrawOptionsWindow()
97
{
92
{
98
	#define ELEM_X 25
93
	#define ELEM_X 25
99
	int i;
94
	int i;
100
	incn y;
95
	incn y;
101
	y.n=0;
96
	y.n=0;
102
	DrawBar(0, Form.cheight - 40, Form.cwidth, 1, system.color.work_graph);
97
	DrawBar(0, Form.cheight - 40, Form.cwidth, 1, system.color.work_graph);
Line 103... Line 98...
103
	DrawBar(0, Form.cheight - 40+1, Form.cwidth, 1, LBUMP);
98
	DrawBar(0, Form.cheight - 40+1, Form.cwidth, 1, LBUMP);
104
	DrawCaptButton(Form.cwidth-79, Form.cheight-32, 70, 25, 19, system.color.work_button, system.color.work_button_text,"Apply");
99
	DrawCaptButton(Form.cwidth-79, Form.cheight-32, 70, 25, 19, system.color.work_button, system.color.work_button_text,"Apply");
105
 
-
 
106
	WriteText(ELEM_X, y.inc(20), 0x81, system.color.work_text, "Network settings");
100
 
107
	CheckBox(ELEM_X, y.inc(35), 17, "Use custom settings", checked[0]);
101
	WriteText(ELEM_X, y.inc(20), 0x81, system.color.work_text, "Network settings");
108
	CheckBox(ELEM_X, y.inc(30), 18, "Manual configuration", checked[1]);
102
	automatic.draw(ELEM_X, y.inc(65));
109
	EDI = system.color.work;
103
	EDI = system.color.work;
110
	for (i=0; i<4; i++)	WriteText(ELEM_X+40, i*35+POP_server_box.top + 3, 0xD0, system.color.work_text, text1[i]);
104
	for (i=0; i<4; i++)	WriteText(ELEM_X+40, i*35+POP_server_box.top + 3, 0xD0, system.color.work_text, text1[i]);