summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu
diff options
context:
space:
mode:
authorGoraf <22941576+Goraf@users.noreply.github.com>2018-01-27 23:44:27 +0100
committerGoraf <22941576+Goraf@users.noreply.github.com>2018-01-28 11:46:33 +0100
commitfdc92c8ba80ac410b2c03226d1a60365faf17745 (patch)
treeb6e0abbae03e25d9c2f9fe5c0c944ad1afd77653 /protocols/Gadu-Gadu
parentf71ba68ef30c799b3311a5079c6f5bea199bb7a6 (diff)
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
Diffstat (limited to 'protocols/Gadu-Gadu')
-rw-r--r--protocols/Gadu-Gadu/res/resource.rc10
-rw-r--r--protocols/Gadu-Gadu/src/options.cpp44
-rw-r--r--protocols/Gadu-Gadu/src/options.h6
-rw-r--r--protocols/Gadu-Gadu/src/resource.h233
4 files changed, 159 insertions, 134 deletions
diff --git a/protocols/Gadu-Gadu/res/resource.rc b/protocols/Gadu-Gadu/res/resource.rc
index 07a29a61b4..15aba9a943 100644
--- a/protocols/Gadu-Gadu/res/resource.rc
+++ b/protocols/Gadu-Gadu/res/resource.rc
@@ -127,16 +127,16 @@ BEGIN
CONTROL "Manually specify connection servers' hosts",IDC_MANUALHOST,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,77,286,10
EDITTEXT IDC_HOST,22,91,144,39,ES_MULTILINE | ES_AUTOHSCROLL | ES_WANTRETURN | WS_DISABLED | WS_VSCROLL
- LTEXT "* new line is separator\n** hostname:port format",IDC_STATIC,174,92,119,32
+ LTEXT "* new line is separator\n** hostname:port format",IDC_HOST_LIST_L,174,92,119,32
CONTROL "Use SSL secure connection",IDC_SSLCONN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,132,286,10
GROUPBOX "File Transfer",IDC_STATIC,4,150,297,58
CONTROL "Use direct connections",IDC_DIRECTCONNS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,164,153,10
- LTEXT "Port:",IDC_STATIC,161,165,21,8
+ RTEXT "Port:",IDC_DIRECTPORT_L,157,165,25,8
EDITTEXT IDC_DIRECTPORT,186,163,31,12,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED
- CONTROL "Use forwarding",IDC_FORWARDING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,178,153,10
- LTEXT "Host:",IDC_STATIC,31,192,26,8
+ CONTROL "Use forwarding",IDC_FORWARDING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,178,153,10
+ RTEXT "Host:",IDC_FORWARDHOST_L,21,192,36,8
EDITTEXT IDC_FORWARDHOST,62,191,90,12,ES_AUTOHSCROLL | WS_DISABLED
- LTEXT "Port:",IDC_STATIC,161,192,21,8
+ RTEXT "Port:",IDC_FORWARDPORT_L,157,192,25,8
EDITTEXT IDC_FORWARDPORT,186,191,31,12,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED
CTEXT "These changes will take effect the next time you connect to the GG network.",IDC_RELOADREQD,7,213,286,8,NOT WS_VISIBLE
END
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