Revision: 8735 https://osdn.net/projects/ttssh2/scm/svn/commits/8735 Author: zmatsuo Date: 2020-04-23 23:29:36 +0900 (Thu, 23 Apr 2020) Log Message: ----------- SSH認証ダイアログで一部のコントロールが常に有効になっていた Modified Paths: -------------- trunk/ttssh2/ttxssh/auth.c trunk/ttssh2/ttxssh/resource.h -------------- next part -------------- Modified: trunk/ttssh2/ttxssh/auth.c =================================================================== --- trunk/ttssh2/ttxssh/auth.c 2020-04-23 14:29:25 UTC (rev 8734) +++ trunk/ttssh2/ttxssh/auth.c 2020-04-23 14:29:36 UTC (rev 8735) @@ -168,19 +168,36 @@ BOOL TIS_enabled = controlID == IDC_SSHUSETIS; BOOL PAGEANT_enabled = controlID == IDC_SSHUSEPAGEANT; int i; + static const int password_item_ids[] = { + IDC_SSHPASSWORDCAPTION, + IDC_SSHPASSWORD, + IDC_SSHPASSWORD_OPTION, + }; + static const int rsa_item_ids[] = { + IDC_RSAFILENAMELABEL, + IDC_RSAFILENAME, + IDC_CHOOSERSAFILE, + }; + static const int rhosts_item_ids[] = { + IDC_LOCALUSERNAMELABEL, + IDC_LOCALUSERNAME, + IDC_HOSTRSAFILENAMELABEL, + IDC_HOSTRSAFILENAME, + IDC_CHOOSEHOSTRSAFILE, + }; CheckRadioButton(dlg, IDC_SSHUSEPASSWORD, MAX_AUTH_CONTROL, controlID); - EnableWindow(GetDlgItem(dlg, IDC_SSHPASSWORDCAPTION), (!TIS_enabled && !PAGEANT_enabled)); - EnableWindow(GetDlgItem(dlg, IDC_SSHPASSWORD), (!TIS_enabled && !PAGEANT_enabled)); - EnableWindow(GetDlgItem(dlg, IDC_SSHPASSWORD_OPTION), (!TIS_enabled && !PAGEANT_enabled)); + for (i = 0; i < _countof(password_item_ids); i++) { + EnableWindow(GetDlgItem(dlg, password_item_ids[i]), (!TIS_enabled && !PAGEANT_enabled)); + } - for (i = IDC_CHOOSERSAFILE; i <= IDC_RSAFILENAME; i++) { - EnableWindow(GetDlgItem(dlg, i), RSA_enabled); + for (i = 0; i < _countof(rsa_item_ids); i++) { + EnableWindow(GetDlgItem(dlg, rsa_item_ids[i]), RSA_enabled); } - for (i = IDC_LOCALUSERNAMELABEL; i <= IDC_HOSTRSAFILENAME; i++) { - EnableWindow(GetDlgItem(dlg, i), rhosts_enabled); + for (i = 0; i < _countof(rhosts_item_ids); i++) { + EnableWindow(GetDlgItem(dlg, rhosts_item_ids[i]), rhosts_enabled); } } Modified: trunk/ttssh2/ttxssh/resource.h =================================================================== --- trunk/ttssh2/ttxssh/resource.h 2020-04-23 14:29:25 UTC (rev 8734) +++ trunk/ttssh2/ttxssh/resource.h 2020-04-23 14:29:36 UTC (rev 8735) @@ -168,7 +168,6 @@ #define IDC_FN_STATIC 1095 #define IDC_RECVFILE 1096 #define IDC_RECV 1097 -#define IDC_BUTTON1 1098 #define IDC_SFTP_TEST 1098 #define IDC_DUMMY_LINE 1099 #define IDC_LOCALUSERNAMELABEL 1100