MCPcopy Create free account
hub / github.com/MaxBelkov/visualsyslog / OKButtonClick

Method OKButtonClick

source/setup.cpp:104–171  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

102}
103//---------------------------------------------------------------------------
104void __fastcall TSetupForm::OKButtonClick(TObject *Sender)
105{
106 // main
107 int port;
108
109 if( ! TryStrToInt(UdpPortEdit->Text, port) )
110 {
111 ReportMess2("Invalid udp port number");
112 return;
113 }
114 if( port < 0 || port >= 65535 )
115 {
116 ReportMess2("Invalid udp port number");
117 return;
118 }
119 if( UdpInterfaceCB->Text.Length() == 0 )
120 {
121 ReportMess2("Invalid udp listener interface");
122 return;
123 }
124 if( port != MainCfg.UdpPort )
125 bUdpRestart = true;
126 if( MainCfg.UdpInterface != UdpInterfaceCB->Text )
127 bUdpRestart = true;
128 if( MainCfg.UdpEnable != EnableUdpCB->Checked )
129 bUdpRestart = true;
130 MainCfg.UdpEnable = EnableUdpCB->Checked;
131 MainCfg.UdpInterface = UdpInterfaceCB->Text;
132 MainCfg.UdpPort = port;
133
134 if( ! TryStrToInt(TcpPortEdit->Text, port) )
135 {
136 ReportMess2("Invalid tcp port number");
137 return;
138 }
139 if( port < 0 || port >= 65535 )
140 {
141 ReportMess2("Invalid tcp port number");
142 return;
143 }
144 if( TcpInterfaceCB->Text.Length() == 0 )
145 {
146 ReportMess2("Invalid tcp listener interface");
147 return;
148 }
149 if( port != MainCfg.TcpPort )
150 bTcpRestart = true;
151 if( MainCfg.TcpInterface != TcpInterfaceCB->Text )
152 bTcpRestart = true;
153 if( MainCfg.TcpEnable != EnableTcpCB->Checked )
154 bTcpRestart = true;
155 MainCfg.TcpEnable = EnableTcpCB->Checked;
156 MainCfg.TcpInterface = TcpInterfaceCB->Text;
157 MainCfg.TcpPort = port;
158
159 MainCfg.b3D = D3CB->Checked;
160 MainCfg.bWriteRaw = WriteRawCB->Checked;
161 MainCfg.bReceiveUTF8 = ReceiveUTF8CB->Checked;

Callers

nothing calls this directly

Calls 1

ReportMess2Function · 0.85

Tested by

no test coverage detected