diff options
-rw-r--r-- | protocols/Gadu-Gadu/src/core.cpp | 10 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/gg_proto.cpp | 2 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/options.cpp | 38 |
3 files changed, 16 insertions, 34 deletions
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index 71c5726c0b..7009141127 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -299,12 +299,10 @@ void __cdecl GaduProto::mainthread(void *) int hostcount = 0;
GGHOST hosts[64];
- if (m_useManualHosts) {
- CMStringW serverHosts = m_serverHosts;
- if (!serverHosts.IsEmpty()) {
- ptrA pHostsList(mir_u2a(serverHosts.c_str()));
- hostcount = gg_decodehosts(pHostsList, hosts, 64);
- }
+ CMStringW serverHosts = (m_useManualHosts) ? m_serverHosts : GG_KEYDEF_SERVERHOSTS;
+ if (!serverHosts.IsEmpty()) {
+ ptrA pHostsList(mir_u2a(serverHosts.c_str()));
+ hostcount = gg_decodehosts(pHostsList, hosts, 64);
}
// Readup password
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index 44234ddb35..7f6affb0c4 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -29,7 +29,7 @@ GaduProto::GaduProto(const char *pszProtoName, const wchar_t *tszUserName) : // options
m_forwardPort(this, "ForwardPort", 1550),
m_forwardHost(this, "ForwardHost", L""),
- m_serverHosts(this, "ServerHosts", GG_KEYDEF_SERVERHOSTS),
+ m_serverHosts(this, "ServerHosts", L""),
m_autoRecconect(this, "AReconnect", 0),
m_useForwarding(this, "Forwarding", 0),
m_useManualHosts(this, "ManualHost", 1),
diff --git a/protocols/Gadu-Gadu/src/options.cpp b/protocols/Gadu-Gadu/src/options.cpp index bfe9a6394b..6714d3aeb0 100644 --- a/protocols/Gadu-Gadu/src/options.cpp +++ b/protocols/Gadu-Gadu/src/options.cpp @@ -405,10 +405,10 @@ public: chkManualHosts.OnChange = Callback(this, &GaduOptionsDlgAdvanced::onCheck_ManualHosts); chkDirectConnections.OnChange = Callback(this, &GaduOptionsDlgAdvanced::onCheck_DirectConnections); - edtDirectPort.OnChange = Callback(this, &GaduOptionsDlgAdvanced::showRecconectRequired); + edtDirectPort.OnChange = Callback(this, &GaduOptionsDlgAdvanced::showReconnectRequired); chkForwarding.OnChange = Callback(this, &GaduOptionsDlgAdvanced::onCheck_Forwarding); - edtForwardHost.OnChange = Callback(this, &GaduOptionsDlgAdvanced::showRecconectRequired); - edtForwardPort.OnChange = Callback(this, &GaduOptionsDlgAdvanced::showRecconectRequired); + edtForwardHost.OnChange = Callback(this, &GaduOptionsDlgAdvanced::showReconnectRequired); + edtForwardPort.OnChange = Callback(this, &GaduOptionsDlgAdvanced::showReconnectRequired); } bool OnInitDialog() override @@ -416,22 +416,6 @@ public: chkKeepConnectionAlive.Disable(); chkSslConnection.Disable(); - chkManualHosts.Disable(); - bool useManualHosts = chkManualHosts.GetState() && chkManualHosts.Enabled(); - edtServerHosts.Enable(useManualHosts); - txtServerHostsLabel.Enable(useManualHosts); - - bool useDirectConnection = chkDirectConnections.GetState(); - edtDirectPort.Enable(useDirectConnection); - txtDirectPortLabel.Enable(useDirectConnection); - chkForwarding.Enable(useDirectConnection); - - bool useForwarding = useDirectConnection && chkForwarding.GetState(); - edtForwardHost.Enable(useForwarding); - txtForwardHostLabel.Enable(useForwarding); - edtForwardPort.Enable(useForwarding); - txtForwardPortLabel.Enable(useForwarding); - txtReconnectRequired.Hide(); return true; } @@ -447,41 +431,41 @@ public: void onCheck_ManualHosts(CCtrlCheck *) { - bool useManualHosts = chkManualHosts.GetState(); + bool useManualHosts = chkManualHosts.IsChecked(); edtServerHosts.Enable(useManualHosts); txtServerHostsLabel.Enable(useManualHosts); - showRecconectRequired(); + showReconnectRequired(); } void onCheck_DirectConnections(CCtrlCheck *) { - bool useDirectConnection = chkDirectConnections.GetState(); + bool useDirectConnection = chkDirectConnections.IsChecked(); edtDirectPort.Enable(useDirectConnection); txtDirectPortLabel.Enable(useDirectConnection); chkForwarding.Enable(useDirectConnection); - bool useForwarding = useDirectConnection && chkForwarding.GetState(); + bool useForwarding = useDirectConnection && chkForwarding.IsChecked(); edtForwardHost.Enable(useForwarding); txtForwardHostLabel.Enable(useForwarding); edtForwardPort.Enable(useForwarding); txtForwardPortLabel.Enable(useForwarding); - showRecconectRequired(); + showReconnectRequired(); } void onCheck_Forwarding(CCtrlCheck *) { - bool useForwarding = chkForwarding.GetState(); + bool useForwarding = chkForwarding.IsChecked(); edtForwardHost.Enable(useForwarding); txtForwardHostLabel.Enable(useForwarding); edtForwardPort.Enable(useForwarding); txtForwardPortLabel.Enable(useForwarding); - showRecconectRequired(); + showReconnectRequired(); } - void showRecconectRequired(CCtrlBase* = nullptr) + void showReconnectRequired(CCtrlBase* = nullptr) { txtReconnectRequired.Show(); } |