From 0f2e98b6058835b2dc0dbad8fd648b398d2a8917 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 1 Mar 2023 18:38:47 +0300 Subject: =?UTF-8?q?fixes=20#3368=20(GG:=20=D0=BD=D0=B0=D0=BB=D0=B0=D0=B4?= =?UTF-8?q?=D0=B8=D1=82=D1=8C=20=D0=BE=D0=BF=D1=86=D0=B8=D1=8E=20"=D0=A3?= =?UTF-8?q?=D0=BA=D0=B0=D0=B7=D0=B0=D1=82=D1=8C=20=D1=81=D0=B5=D1=80=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D1=8B=20=D0=B2=D1=80=D1=83=D1=87=D0=BD=D1=83=D1=8E?= =?UTF-8?q?")?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Gadu-Gadu/src/core.cpp | 10 ++++------ protocols/Gadu-Gadu/src/gg_proto.cpp | 2 +- protocols/Gadu-Gadu/src/options.cpp | 38 +++++++++++------------------------- 3 files changed, 16 insertions(+), 34 deletions(-) (limited to 'protocols') 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(); } -- cgit v1.2.3