From fdc92c8ba80ac410b2c03226d1a60365faf17745 Mon Sep 17 00:00:00 2001 From: Goraf <22941576+Goraf@users.noreply.github.com> Date: Sat, 27 Jan 2018 23:44:27 +0100 Subject: Gadu-Gadu: improved advanced options form * make labels of inactive controls inactive as well * display reconnetion_required info with every change related to connection settings * improve clarity by indenting dependencies --- protocols/Gadu-Gadu/src/options.cpp | 44 +++++-- protocols/Gadu-Gadu/src/options.h | 6 + protocols/Gadu-Gadu/src/resource.h | 233 ++++++++++++++++++------------------ 3 files changed, 154 insertions(+), 129 deletions(-) (limited to 'protocols/Gadu-Gadu/src') diff --git a/protocols/Gadu-Gadu/src/options.cpp b/protocols/Gadu-Gadu/src/options.cpp index c2e5a4dddd..f99a3abc8f 100644 --- a/protocols/Gadu-Gadu/src/options.cpp +++ b/protocols/Gadu-Gadu/src/options.cpp @@ -26,11 +26,15 @@ GaduOptionsDlgAdvanced::GaduOptionsDlgAdvanced(GaduProto * proto) : chkSslConnection(this, IDC_SSLCONN), chkManualHosts(this, IDC_MANUALHOST), edtServerHosts(this, IDC_HOST), + txtServerHostsLabel(this, IDC_HOST_LIST_L), chkDirectConnections(this, IDC_DIRECTCONNS), edtDirectPort(this, IDC_DIRECTPORT), + txtDirectPortLabel(this, IDC_DIRECTPORT_L), chkForwarding(this, IDC_FORWARDING), edtForwardHost(this, IDC_FORWARDHOST), + txtForwardHostLabel(this, IDC_FORWARDHOST_L), edtForwardPort(this, IDC_FORWARDPORT), + txtForwardPortLabel(this, IDC_FORWARDPORT_L), txtReconnectRequired(this, IDC_RELOADREQD) { CreateLink(chkAutoReconnect, proto->m_gaduOptions.autoRecconect); @@ -51,7 +55,10 @@ GaduOptionsDlgAdvanced::GaduOptionsDlgAdvanced(GaduProto * proto) : chkManualHosts.OnChange = Callback(this, &GaduOptionsDlgAdvanced::onCheck_ManualHosts); chkDirectConnections.OnChange = Callback(this, &GaduOptionsDlgAdvanced::onCheck_DirectConnections); + edtDirectPort.OnChange = Callback(this, &GaduOptionsDlgAdvanced::showRecconectRequired); chkForwarding.OnChange = Callback(this, &GaduOptionsDlgAdvanced::onCheck_Forwarding); + edtForwardHost.OnChange = Callback(this, &GaduOptionsDlgAdvanced::showRecconectRequired); + edtForwardPort.OnChange = Callback(this, &GaduOptionsDlgAdvanced::showRecconectRequired); } void GaduOptionsDlgAdvanced::OnInitDialog() @@ -60,44 +67,61 @@ void GaduOptionsDlgAdvanced::OnInitDialog() chkSslConnection.Disable(); chkManualHosts.Disable(); - edtServerHosts.Enable(chkManualHosts.GetState()); - edtServerHosts.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 = chkForwarding.GetState(); - edtForwardHost.Enable(useDirectConnection && useForwarding); - edtForwardPort.Enable(useDirectConnection && useForwarding); + bool useForwarding = useDirectConnection && chkForwarding.GetState(); + edtForwardHost.Enable(useForwarding); + txtForwardHostLabel.Enable(useForwarding); + edtForwardPort.Enable(useForwarding); + txtForwardPortLabel.Enable(useForwarding); + + txtReconnectRequired.Hide(); } void GaduOptionsDlgAdvanced::onCheck_ManualHosts(CCtrlCheck *) { bool useManualHosts = chkManualHosts.GetState(); edtServerHosts.Enable(useManualHosts); + txtServerHostsLabel.Enable(useManualHosts); - txtReconnectRequired.Show(); + showRecconectRequired(); } void GaduOptionsDlgAdvanced::onCheck_DirectConnections(CCtrlCheck *) { bool useDirectConnection = chkDirectConnections.GetState(); edtDirectPort.Enable(useDirectConnection); + txtDirectPortLabel.Enable(useDirectConnection); chkForwarding.Enable(useDirectConnection); - bool useForwarding = chkForwarding.GetState(); - edtForwardHost.Enable(useDirectConnection && useForwarding); - edtForwardPort.Enable(useDirectConnection && useForwarding); + bool useForwarding = useDirectConnection && chkForwarding.GetState(); + edtForwardHost.Enable(useForwarding); + txtForwardHostLabel.Enable(useForwarding); + edtForwardPort.Enable(useForwarding); + txtForwardPortLabel.Enable(useForwarding); - txtReconnectRequired.Show(); + showRecconectRequired(); } void GaduOptionsDlgAdvanced::onCheck_Forwarding(CCtrlCheck *) { bool useForwarding = chkForwarding.GetState(); edtForwardHost.Enable(useForwarding); + txtForwardHostLabel.Enable(useForwarding); edtForwardPort.Enable(useForwarding); + txtForwardPortLabel.Enable(useForwarding); + showRecconectRequired(); +} + +void GaduOptionsDlgAdvanced::showRecconectRequired(CCtrlBase*) +{ txtReconnectRequired.Show(); } diff --git a/protocols/Gadu-Gadu/src/options.h b/protocols/Gadu-Gadu/src/options.h index c0eaecae75..58e1de767e 100644 --- a/protocols/Gadu-Gadu/src/options.h +++ b/protocols/Gadu-Gadu/src/options.h @@ -35,13 +35,17 @@ private: CCtrlCheck chkManualHosts; CCtrlEdit edtServerHosts; + CCtrlBase txtServerHostsLabel; CCtrlCheck chkDirectConnections; CCtrlEdit edtDirectPort; + CCtrlBase txtDirectPortLabel; CCtrlCheck chkForwarding; CCtrlEdit edtForwardHost; + CCtrlBase txtForwardHostLabel; CCtrlEdit edtForwardPort; + CCtrlBase txtForwardPortLabel; CCtrlBase txtReconnectRequired; @@ -54,4 +58,6 @@ private: void onCheck_ManualHosts(CCtrlCheck*); void onCheck_DirectConnections(CCtrlCheck*); void onCheck_Forwarding(CCtrlCheck*); + + void showRecconectRequired(CCtrlBase* = nullptr); }; diff --git a/protocols/Gadu-Gadu/src/resource.h b/protocols/Gadu-Gadu/src/resource.h index e1e7284225..212b35ec8a 100644 --- a/protocols/Gadu-Gadu/src/resource.h +++ b/protocols/Gadu-Gadu/src/resource.h @@ -2,124 +2,119 @@ // Microsoft Visual C++ generated include file. // Used by D:\Repozytoria\Miranda NG\protocols\Gadu-Gadu\res\resource.rc // -#define IDI_GG 251 -#define IDI_IMPORT_TEXT 252 -#define IDI_IMPORT_SERVER 253 -#define IDI_EXPORT_TEXT 254 -#define IDI_EXPORT_SERVER 255 -#define IDI_REMOVE_SERVER 256 -#define IDI_SETTINGS 257 -#define IDI_LIST 258 -#define IDI_NEXT 259 -#define IDI_PREV 260 -#define IDI_SCALE 261 -#define IDI_IMAGE 262 -#define IDI_DELETE 263 -#define IDI_SAVE 264 -#define IDI_CONFERENCE 265 -#define IDI_CLEAR_CONFERENCE 266 -#define IDI_SESSIONS 267 -#define IDI_BLOCK 268 - -#define IDD_INFO_GG 301 -#define IDD_CHPASS 302 -#define IDD_CHINFO_GG 303 -#define IDD_GGADVANCEDSEARCH 304 -#define IDD_CREATEACCOUNT 305 -#define IDD_REMOVEACCOUNT 306 -#define IDD_CHEMAIL 307 -#define IDD_OPT_GG_ADVANCED 308 -#define IDD_TOKEN 309 -#define IDD_CONFERENCE 310 -#define IDD_OPT_GG_GENERAL 311 -#define IDD_OPT_GG_CONFERENCE 312 -#define IDD_IMAGE_RECV 313 -#define IDD_IMAGE_SEND 314 -#define IDD_ACCMGRUI 315 -#define IDD_SESSIONS 316 - -#define IDC_UIN 401 -#define IDC_PASSWORD 402 -#define IDC_LOSTPASS 403 -#define IDC_FRIENDSONLY 404 -#define IDC_SHOWINVISIBLE 405 -#define IDC_KEEPALIVE 406 -#define IDC_SAFESTATUS 407 -#define IDC_MANUALHOST 408 -#define IDC_HOST 409 -#define IDC_PORT 410 -#define IDC_RELOADREQD 411 -#define IDC_IP 412 -#define IDC_REALIP 413 -#define IDC_FIRSTNAME 420 -#define IDC_LASTNAME 421 -#define IDC_NICKNAME 422 -#define IDC_GENDER 423 -#define IDC_BIRTHYEAR 424 -#define IDC_CITY 425 -#define IDC_FAMILYNAME 426 -#define IDC_CITYORIGIN 427 -#define IDC_STATUSDESCR 428 -#define IDC_EMAIL 429 -#define IDC_CPASSWORD 430 -#define IDC_SHOWCERRORS 431 -#define IDC_ARECONNECT 432 -#define IDC_LEAVESTATUSMSG 433 -#define IDC_LEAVESTATUS 434 -#define IDC_AGEFROM 435 -#define IDC_AGETO 436 -#define IDC_ONLYCONNECTED 437 -#define IDC_WHITERECT 438 -#define IDC_CREATEACCOUNT 439 -#define IDC_REMOVEACCOUNT 440 -#define IDC_CONFIRM 441 -#define IDC_SAVE 442 -#define IDC_CHPASS 443 -#define IDC_CHEMAIL 444 -#define IDC_DIRECTCONNS 445 -#define IDC_DIRECTPORT 446 -#define IDC_FORWARDHOST 447 -#define IDC_FORWARDPORT 448 -#define IDC_FORWARDING 449 -#define IDC_MSGACK 450 -#define IDC_SSLCONN 451 -#define IDC_VERSION 452 -#define IDC_TOKEN 453 -#define IDC_IGNORECONF 454 -#define IDC_SHOWLINKS 455 -#define IDC_IMGRECEIVE 456 -#define IDC_IMGMETHOD 457 - -#define IDC_IMAGECLOSE 458 -#define IDC_TABCONTROL 459 -#define IDC_IMAGE_SEND 460 -#define IDC_IMAGE_SAVE 461 - -#define IDC_GC_POLICY_TOTAL 462 -#define IDC_GC_POLICY_UNKNOWN 463 -#define IDC_GC_POLICY_DEFAULT 464 -#define IDC_GC_COUNT_TOTAL 465 -#define IDC_GC_COUNT_UNKNOWN 466 - -#define IDC_OPTIONSTAB 467 -#define IDC_ENABLEAVATARS 468 - -#define IDC_HEADERBAR 1001 -#define IDC_SESSIONS 1002 -#define IDC_SIGNOUTALL 1003 - -#define IDC_IMG_DELETE 1010 -#define IDC_IMG_SEND 1011 -#define IDC_IMG_PREV 1012 -#define IDC_IMG_NEXT 1013 -#define IDC_IMG_SCALE 1014 -#define IDC_IMG_SAVE 1015 -#define IDC_IMG_CANCEL 1016 -#define IDC_IMG_IMAGE 1017 -#define IDC_IMG_NAME 1018 - -#define IDC_CLIST 1200 - +#define IDI_GG 251 +#define IDI_IMPORT_TEXT 252 +#define IDI_IMPORT_SERVER 253 +#define IDI_EXPORT_TEXT 254 +#define IDI_EXPORT_SERVER 255 +#define IDI_REMOVE_SERVER 256 +#define IDI_SETTINGS 257 +#define IDI_LIST 258 +#define IDI_NEXT 259 +#define IDI_PREV 260 +#define IDI_SCALE 261 +#define IDI_IMAGE 262 +#define IDI_DELETE 263 +#define IDI_SAVE 264 +#define IDI_CONFERENCE 265 +#define IDI_CLEAR_CONFERENCE 266 +#define IDI_SESSIONS 267 +#define IDI_BLOCK 268 +#define IDD_INFO_GG 301 +#define IDD_CHPASS 302 +#define IDD_CHINFO_GG 303 +#define IDD_GGADVANCEDSEARCH 304 +#define IDD_CREATEACCOUNT 305 +#define IDD_REMOVEACCOUNT 306 +#define IDD_CHEMAIL 307 +#define IDD_OPT_GG_ADVANCED 308 +#define IDD_TOKEN 309 +#define IDD_CONFERENCE 310 +#define IDD_OPT_GG_GENERAL 311 +#define IDD_OPT_GG_CONFERENCE 312 +#define IDD_IMAGE_RECV 313 +#define IDD_IMAGE_SEND 314 +#define IDD_ACCMGRUI 315 +#define IDD_SESSIONS 316 +#define IDC_UIN 401 +#define IDC_PASSWORD 402 +#define IDC_LOSTPASS 403 +#define IDC_FRIENDSONLY 404 +#define IDC_SHOWINVISIBLE 405 +#define IDC_KEEPALIVE 406 +#define IDC_SAFESTATUS 407 +#define IDC_MANUALHOST 408 +#define IDC_HOST 409 +#define IDC_PORT 410 +#define IDC_RELOADREQD 411 +#define IDC_IP 412 +#define IDC_REALIP 413 +#define IDC_FIRSTNAME 420 +#define IDC_LASTNAME 421 +#define IDC_NICKNAME 422 +#define IDC_GENDER 423 +#define IDC_BIRTHYEAR 424 +#define IDC_CITY 425 +#define IDC_FAMILYNAME 426 +#define IDC_CITYORIGIN 427 +#define IDC_STATUSDESCR 428 +#define IDC_EMAIL 429 +#define IDC_CPASSWORD 430 +#define IDC_SHOWCERRORS 431 +#define IDC_ARECONNECT 432 +#define IDC_LEAVESTATUSMSG 433 +#define IDC_LEAVESTATUS 434 +#define IDC_AGEFROM 435 +#define IDC_AGETO 436 +#define IDC_ONLYCONNECTED 437 +#define IDC_WHITERECT 438 +#define IDC_CREATEACCOUNT 439 +#define IDC_REMOVEACCOUNT 440 +#define IDC_CONFIRM 441 +#define IDC_SAVE 442 +#define IDC_CHPASS 443 +#define IDC_CHEMAIL 444 +#define IDC_DIRECTCONNS 445 +#define IDC_DIRECTPORT 446 +#define IDC_FORWARDHOST 447 +#define IDC_FORWARDPORT 448 +#define IDC_FORWARDING 449 +#define IDC_MSGACK 450 +#define IDC_SSLCONN 451 +#define IDC_VERSION 452 +#define IDC_TOKEN 453 +#define IDC_IGNORECONF 454 +#define IDC_SHOWLINKS 455 +#define IDC_IMGRECEIVE 456 +#define IDC_IMGMETHOD 457 +#define IDC_IMAGECLOSE 458 +#define IDC_TABCONTROL 459 +#define IDC_IMAGE_SEND 460 +#define IDC_IMAGE_SAVE 461 +#define IDC_GC_POLICY_TOTAL 462 +#define IDC_GC_POLICY_UNKNOWN 463 +#define IDC_GC_POLICY_DEFAULT 464 +#define IDC_GC_COUNT_TOTAL 465 +#define IDC_GC_COUNT_UNKNOWN 466 +#define IDC_OPTIONSTAB 467 +#define IDC_ENABLEAVATARS 468 +#define IDC_HOST_LIST_L 469 +#define IDC_DIRECTPORT_L 470 +#define IDC_FORWARDHOST_L 471 +#define IDC_FORWARDPORT_L 472 +#define IDC_HEADERBAR 1001 +#define IDC_SESSIONS 1002 +#define IDC_SIGNOUTALL 1003 +#define IDC_IMG_DELETE 1010 +#define IDC_IMG_SEND 1011 +#define IDC_IMG_PREV 1012 +#define IDC_IMG_NEXT 1013 +#define IDC_IMG_SCALE 1014 +#define IDC_IMG_SAVE 1015 +#define IDC_IMG_CANCEL 1016 +#define IDC_IMG_IMAGE 1017 +#define IDC_IMG_NAME 1018 +#define IDC_CLIST 1200 // Next default values for new objects // @@ -128,6 +123,6 @@ #define _APS_NEXT_RESOURCE_VALUE 102 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 +#define _APS_NEXT_SYMED_VALUE 473 #endif #endif -- cgit v1.2.3