Of course, that cleanup I did earlier in which I rationalised all
[u/mdw/putty] / windlg.c
index 4924a74..7c3a8d1 100644 (file)
--- a/windlg.c
+++ b/windlg.c
@@ -657,11 +657,6 @@ static const char *const colours[] = {
     "ANSI Cyan", "ANSI Cyan Bold",
     "ANSI White", "ANSI White Bold"
 };
-static const int permcolour[] = {
-    TRUE, FALSE, TRUE, FALSE, TRUE, TRUE,
-    TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE,
-    TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE
-};
 
 static void fmtfont(char *buf)
 {
@@ -1136,11 +1131,11 @@ static void init_dlg_ctrls(HWND hwnd, int keepsess)
     CheckDlgButton(hwnd, IDC_TELNETKEY, cfg.telnet_keyboard);
     CheckDlgButton(hwnd, IDC_TELNETRET, cfg.telnet_newline);
     CheckRadioButton(hwnd, IDC_ECHOBACKEND, IDC_ECHONO,
-                    cfg.localecho == LD_BACKEND ? IDC_ECHOBACKEND :
-                    cfg.localecho == LD_YES ? IDC_ECHOYES : IDC_ECHONO);
+                    cfg.localecho == AUTO ? IDC_ECHOBACKEND :
+                    cfg.localecho == FORCE_ON ? IDC_ECHOYES : IDC_ECHONO);
     CheckRadioButton(hwnd, IDC_EDITBACKEND, IDC_EDITNO,
-                    cfg.localedit == LD_BACKEND ? IDC_EDITBACKEND :
-                    cfg.localedit == LD_YES ? IDC_EDITYES : IDC_EDITNO);
+                    cfg.localedit == AUTO ? IDC_EDITBACKEND :
+                    cfg.localedit == FORCE_ON ? IDC_EDITYES : IDC_EDITNO);
     SetDlgItemText(hwnd, IDC_ANSWEREDIT, cfg.answerback);
     CheckDlgButton(hwnd, IDC_ALWAYSONTOP, cfg.alwaysontop);
     CheckDlgButton(hwnd, IDC_FULLSCREENONALTENTER, cfg.fullscreenonaltenter);
@@ -1176,7 +1171,7 @@ static void init_dlg_ctrls(HWND hwnd, int keepsess)
     CheckDlgButton(hwnd, IDC_BLINKTEXT, cfg.blinktext);
 
     SetDlgItemText(hwnd, IDC_WINEDIT, cfg.wintitle);
-    CheckDlgButton(hwnd, IDC_WINNAME, cfg.win_name_always);
+    CheckDlgButton(hwnd, IDC_WINNAME, !cfg.win_name_always);
     CheckDlgButton(hwnd, IDC_HIDEMOUSE, cfg.hide_mouseptr);
     CheckDlgButton(hwnd, IDC_SUNKENEDGE, cfg.sunken_edge);
     SetDlgItemInt(hwnd, IDC_WINBEDIT, cfg.window_border, FALSE);
@@ -1192,9 +1187,9 @@ static void init_dlg_ctrls(HWND hwnd, int keepsess)
                     cfg.resize_action == RESIZE_EITHER ? IDC_RESIZEEITHER :
                     IDC_RESIZENONE);
     CheckRadioButton(hwnd, IDC_COEALWAYS, IDC_COENORMAL,
-                    cfg.close_on_exit == COE_NORMAL ? IDC_COENORMAL :
+                    cfg.close_on_exit == AUTO ? IDC_COENORMAL :
                     cfg.close_on_exit ==
-                    COE_NEVER ? IDC_COENEVER : IDC_COEALWAYS);
+                    FORCE_OFF ? IDC_COENEVER : IDC_COEALWAYS);
     CheckDlgButton(hwnd, IDC_CLOSEWARN, cfg.warn_on_close);
 
     SetDlgItemText(hwnd, IDC_TTEDIT, cfg.termtype);
@@ -1308,9 +1303,8 @@ static void init_dlg_ctrls(HWND hwnd, int keepsess)
            SendDlgItemMessage(hwnd, IDC_COLOURLIST,
                               LB_DELETESTRING, i, 0);
        for (i = 0; i < 22; i++)
-           if (cfg.bold_colour || permcolour[i])
-               SendDlgItemMessage(hwnd, IDC_COLOURLIST, LB_ADDSTRING, 0,
-                                  (LPARAM) colours[i]);
+           SendDlgItemMessage(hwnd, IDC_COLOURLIST, LB_ADDSTRING, 0,
+                              (LPARAM) colours[i]);
     }
     SendDlgItemMessage(hwnd, IDC_COLOURLIST, LB_SETCURSEL, 0, 0);
     SetDlgItemInt(hwnd, IDC_RVALUE, cfg.colours[0][0], FALSE);
@@ -1373,8 +1367,8 @@ static void init_dlg_ctrls(HWND hwnd, int keepsess)
     SetDlgItemText(hwnd, IDC_PROXYEXCLUDEEDIT, cfg.proxy_exclude_list);
     CheckDlgButton(hwnd, IDC_PROXYLOCALHOST, cfg.even_proxy_localhost);
     CheckRadioButton(hwnd, IDC_PROXYDNSNO, IDC_PROXYDNSYES,
-                    cfg.proxy_dns == PROXYDNS_NO ? IDC_PROXYDNSNO :
-                    cfg.proxy_dns == PROXYDNS_YES ? IDC_PROXYDNSYES :
+                    cfg.proxy_dns == FORCE_OFF ? IDC_PROXYDNSNO :
+                    cfg.proxy_dns == FORCE_ON ? IDC_PROXYDNSYES :
                     IDC_PROXYDNSAUTO);
     SetDlgItemText(hwnd, IDC_PROXYTELNETCMDEDIT, cfg.proxy_telnet_command);
     SetDlgItemText(hwnd, IDC_PROXYUSEREDIT, cfg.proxy_username);
@@ -1388,50 +1382,50 @@ static void init_dlg_ctrls(HWND hwnd, int keepsess)
     SendDlgItemMessage(hwnd, IDC_BUGD_IGNORE1, CB_ADDSTRING, 0, (LPARAM)"Off");
     SendDlgItemMessage(hwnd, IDC_BUGD_IGNORE1, CB_ADDSTRING, 0, (LPARAM)"On");
     SendDlgItemMessage(hwnd, IDC_BUGD_IGNORE1, CB_SETCURSEL,
-                      cfg.sshbug_ignore1 == BUG_ON ? 2 :
-                      cfg.sshbug_ignore1 == BUG_OFF ? 1 : 0, 0);
+                      cfg.sshbug_ignore1 == FORCE_ON ? 2 :
+                      cfg.sshbug_ignore1 == FORCE_OFF ? 1 : 0, 0);
     SendDlgItemMessage(hwnd, IDC_BUGD_PLAINPW1, CB_RESETCONTENT, 0, 0);
     SendDlgItemMessage(hwnd, IDC_BUGD_PLAINPW1, CB_ADDSTRING, 0, (LPARAM)"Auto");
     SendDlgItemMessage(hwnd, IDC_BUGD_PLAINPW1, CB_ADDSTRING, 0, (LPARAM)"Off");
     SendDlgItemMessage(hwnd, IDC_BUGD_PLAINPW1, CB_ADDSTRING, 0, (LPARAM)"On");
     SendDlgItemMessage(hwnd, IDC_BUGD_PLAINPW1, CB_SETCURSEL,
-                      cfg.sshbug_plainpw1 == BUG_ON ? 2 :
-                      cfg.sshbug_plainpw1 == BUG_OFF ? 1 : 0, 0);
+                      cfg.sshbug_plainpw1 == FORCE_ON ? 2 :
+                      cfg.sshbug_plainpw1 == FORCE_OFF ? 1 : 0, 0);
     SendDlgItemMessage(hwnd, IDC_BUGD_RSA1, CB_RESETCONTENT, 0, 0);
     SendDlgItemMessage(hwnd, IDC_BUGD_RSA1, CB_ADDSTRING, 0, (LPARAM)"Auto");
     SendDlgItemMessage(hwnd, IDC_BUGD_RSA1, CB_ADDSTRING, 0, (LPARAM)"Off");
     SendDlgItemMessage(hwnd, IDC_BUGD_RSA1, CB_ADDSTRING, 0, (LPARAM)"On");
     SendDlgItemMessage(hwnd, IDC_BUGD_RSA1, CB_SETCURSEL,
-                      cfg.sshbug_rsa1 == BUG_ON ? 2 :
-                      cfg.sshbug_rsa1 == BUG_OFF ? 1 : 0, 0);
+                      cfg.sshbug_rsa1 == FORCE_ON ? 2 :
+                      cfg.sshbug_rsa1 == FORCE_OFF ? 1 : 0, 0);
     SendDlgItemMessage(hwnd, IDC_BUGD_HMAC2, CB_RESETCONTENT, 0, 0);
     SendDlgItemMessage(hwnd, IDC_BUGD_HMAC2, CB_ADDSTRING, 0, (LPARAM)"Auto");
     SendDlgItemMessage(hwnd, IDC_BUGD_HMAC2, CB_ADDSTRING, 0, (LPARAM)"Off");
     SendDlgItemMessage(hwnd, IDC_BUGD_HMAC2, CB_ADDSTRING, 0, (LPARAM)"On");
     SendDlgItemMessage(hwnd, IDC_BUGD_HMAC2, CB_SETCURSEL,
-                      cfg.sshbug_hmac2 == BUG_ON ? 2 :
-                      cfg.sshbug_hmac2 == BUG_OFF ? 1 : 0, 0);
+                      cfg.sshbug_hmac2 == FORCE_ON ? 2 :
+                      cfg.sshbug_hmac2 == FORCE_OFF ? 1 : 0, 0);
     SendDlgItemMessage(hwnd, IDC_BUGD_DERIVEKEY2, CB_RESETCONTENT, 0, 0);
     SendDlgItemMessage(hwnd, IDC_BUGD_DERIVEKEY2, CB_ADDSTRING, 0, (LPARAM)"Auto");
     SendDlgItemMessage(hwnd, IDC_BUGD_DERIVEKEY2, CB_ADDSTRING, 0, (LPARAM)"Off");
     SendDlgItemMessage(hwnd, IDC_BUGD_DERIVEKEY2, CB_ADDSTRING, 0, (LPARAM)"On");
     SendDlgItemMessage(hwnd, IDC_BUGD_DERIVEKEY2, CB_SETCURSEL,
-                      cfg.sshbug_derivekey2 == BUG_ON ? 2 :
-                      cfg.sshbug_derivekey2 == BUG_OFF ? 1 : 0, 0);
+                      cfg.sshbug_derivekey2 == FORCE_ON ? 2 :
+                      cfg.sshbug_derivekey2 == FORCE_OFF ? 1 : 0, 0);
     SendDlgItemMessage(hwnd, IDC_BUGD_RSAPAD2, CB_RESETCONTENT, 0, 0);
     SendDlgItemMessage(hwnd, IDC_BUGD_RSAPAD2, CB_ADDSTRING, 0, (LPARAM)"Auto");
     SendDlgItemMessage(hwnd, IDC_BUGD_RSAPAD2, CB_ADDSTRING, 0, (LPARAM)"Off");
     SendDlgItemMessage(hwnd, IDC_BUGD_RSAPAD2, CB_ADDSTRING, 0, (LPARAM)"On");
     SendDlgItemMessage(hwnd, IDC_BUGD_RSAPAD2, CB_SETCURSEL,
-                      cfg.sshbug_rsapad2 == BUG_ON ? 2 :
-                      cfg.sshbug_rsapad2 == BUG_OFF ? 1 : 0, 0);
+                      cfg.sshbug_rsapad2 == FORCE_ON ? 2 :
+                      cfg.sshbug_rsapad2 == FORCE_OFF ? 1 : 0, 0);
     SendDlgItemMessage(hwnd, IDC_BUGD_DHGEX2, CB_RESETCONTENT, 0, 0);
     SendDlgItemMessage(hwnd, IDC_BUGD_DHGEX2, CB_ADDSTRING, 0, (LPARAM)"Auto");
     SendDlgItemMessage(hwnd, IDC_BUGD_DHGEX2, CB_ADDSTRING, 0, (LPARAM)"Off");
     SendDlgItemMessage(hwnd, IDC_BUGD_DHGEX2, CB_ADDSTRING, 0, (LPARAM)"On");
     SendDlgItemMessage(hwnd, IDC_BUGD_DHGEX2, CB_SETCURSEL,
-                      cfg.sshbug_dhgex2 == BUG_ON ? 2 :
-                      cfg.sshbug_dhgex2 == BUG_OFF ? 1 : 0, 0);
+                      cfg.sshbug_dhgex2 == FORCE_ON ? 2 :
+                      cfg.sshbug_dhgex2 == FORCE_OFF ? 1 : 0, 0);
 }
 
 struct treeview_faff {
@@ -1720,7 +1714,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel)
                 IDC_BOX_APPEARANCE3);
        multiedit(&cp,
                  "Window &title:", IDC_WINTITLE, IDC_WINEDIT, 100, NULL);
-       checkbox(&cp, "Avoid ever using &icon title", IDC_WINNAME);
+       checkbox(&cp, "Separate window and &icon titles", IDC_WINNAME);
        endbox(&cp);
        beginbox(&cp, "Adjust the use of the mouse pointer",
                 IDC_BOX_APPEARANCE4);
@@ -1965,7 +1959,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel)
     }
 
     if (panel == sshpanelstart) {
-       /* The SSH panel. Accelerators used: [acgoh] r pe12ni sd */
+       /* The SSH panel. Accelerators used: [acgoh] r pel12n sud i */
        struct ctlpos cp;
        ctlposinit(&cp, hwnd, 80, 3, 13);
        if (dlgtype == 0) {
@@ -1986,10 +1980,11 @@ static void create_controls(HWND hwnd, int dlgtype, int panel)
                      "2 o&nly", IDC_SSHPROT2ONLY, NULL);
            endbox(&cp);
            beginbox(&cp, "Encryption options", IDC_BOX_SSH3);
+           /* Adds accelerators: ud */
            prefslist(&cipherlist, &cp, "Encryption cipher &selection policy:",
                      IDC_CIPHERSTATIC2, IDC_CIPHERLIST, IDC_CIPHERUP,
                      IDC_CIPHERDN);
-           checkbox(&cp, "Enable non-standard use of single-&DES in SSH 2",
+           checkbox(&cp, "Enable non-standard use of s&ingle-DES in SSH 2",
                     IDC_SSH2DES);
            endbox(&cp);
        }
@@ -2022,7 +2017,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel)
     }
 
     if (panel == sshbugspanelstart) {
-       /* The SSH bugs panel. Accelerators used: [acgoh] isrmep */
+       /* The SSH bugs panel. Accelerators used: [acgoh] isrmepd */
        struct ctlpos cp;
        ctlposinit(&cp, hwnd, 80, 3, 13);
        if (dlgtype == 0) {
@@ -2049,7 +2044,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel)
     }
 
     if (panel == tunnelspanelstart) {
-       /* The Tunnels panel. Accelerators used: [acgoh] deilmrstxp */
+       /* The Tunnels panel. Accelerators used: [acgoh] exu tprsdilm */
        struct ctlpos cp;
        ctlposinit(&cp, hwnd, 80, 3, 13);
        if (dlgtype == 0) {
@@ -2677,11 +2672,11 @@ static int GenericMainDlgProc(HWND hwnd, UINT msg,
                if (HIWORD(wParam) == BN_CLICKED ||
                    HIWORD(wParam) == BN_DOUBLECLICKED) {
                    if (LOWORD(wParam) == IDC_ECHOBACKEND)
-                       cfg.localecho = LD_BACKEND;
+                       cfg.localecho = AUTO;
                    if (LOWORD(wParam) == IDC_ECHOYES)
-                       cfg.localecho = LD_YES;
+                       cfg.localecho = FORCE_ON;
                    if (LOWORD(wParam) == IDC_ECHONO)
-                       cfg.localecho = LD_NO;
+                       cfg.localecho = FORCE_OFF;
                }
                break;
              case IDC_EDITBACKEND:
@@ -2690,11 +2685,11 @@ static int GenericMainDlgProc(HWND hwnd, UINT msg,
                if (HIWORD(wParam) == BN_CLICKED ||
                    HIWORD(wParam) == BN_DOUBLECLICKED) {
                    if (LOWORD(wParam) == IDC_EDITBACKEND)
-                       cfg.localedit = LD_BACKEND;
+                       cfg.localedit = AUTO;
                    if (LOWORD(wParam) == IDC_EDITYES)
-                       cfg.localedit = LD_YES;
+                       cfg.localedit = FORCE_ON;
                    if (LOWORD(wParam) == IDC_EDITNO)
-                       cfg.localedit = LD_NO;
+                       cfg.localedit = FORCE_OFF;
                }
                break;
              case IDC_ANSWEREDIT:
@@ -2909,7 +2904,7 @@ static int GenericMainDlgProc(HWND hwnd, UINT msg,
                if (HIWORD(wParam) == BN_CLICKED ||
                    HIWORD(wParam) == BN_DOUBLECLICKED)
                        cfg.win_name_always =
-                       IsDlgButtonChecked(hwnd, IDC_WINNAME);
+                       !IsDlgButtonChecked(hwnd, IDC_WINNAME);
                break;
              case IDC_HIDEMOUSE:
                if (HIWORD(wParam) == BN_CLICKED ||
@@ -2991,10 +2986,10 @@ static int GenericMainDlgProc(HWND hwnd, UINT msg,
                    HIWORD(wParam) == BN_DOUBLECLICKED) {
                    cfg.close_on_exit =
                        IsDlgButtonChecked(hwnd,
-                                          IDC_COEALWAYS) ? COE_ALWAYS :
+                                          IDC_COEALWAYS) ? FORCE_ON :
                        IsDlgButtonChecked(hwnd,
-                                          IDC_COENEVER) ? COE_NEVER :
-                       COE_NORMAL;
+                                          IDC_COENEVER) ? FORCE_OFF :
+                       AUTO;
                }
                break;
              case IDC_CLOSEWARN:
@@ -3073,9 +3068,9 @@ static int GenericMainDlgProc(HWND hwnd, UINT msg,
                if (HIWORD(wParam) == BN_CLICKED ||
                    HIWORD(wParam) == BN_DOUBLECLICKED) {
                    cfg.proxy_dns =
-                       IsDlgButtonChecked(hwnd, IDC_PROXYDNSNO) ? PROXYDNS_NO :
-                       IsDlgButtonChecked(hwnd, IDC_PROXYDNSYES) ? PROXYDNS_YES :
-                       PROXYDNS_AUTO;
+                       IsDlgButtonChecked(hwnd, IDC_PROXYDNSNO) ? FORCE_OFF :
+                       IsDlgButtonChecked(hwnd, IDC_PROXYDNSYES) ? FORCE_ON :
+                       AUTO;
                }
                break;
              case IDC_PROXYTYPENONE:
@@ -3333,7 +3328,7 @@ static int GenericMainDlgProc(HWND hwnd, UINT msg,
                of.lStructSize = sizeof(of);
 #endif
                of.hwndOwner = hwnd;
-               of.lpstrFilter = "PuTTY Private Key Files\0*.PPK\0"
+               of.lpstrFilter = "PuTTY Private Key Files (*.ppk)\0*.PPK\0"
                    "AllFiles\0*\0\0\0";
                of.lpstrCustomFilter = NULL;
                of.nFilterIndex = 1;
@@ -3398,25 +3393,6 @@ static int GenericMainDlgProc(HWND hwnd, UINT msg,
                    int n, i;
                    cfg.bold_colour =
                        IsDlgButtonChecked(hwnd, IDC_BOLDCOLOUR);
-                   SendDlgItemMessage(hwnd, IDC_COLOURLIST, WM_SETREDRAW,
-                                      FALSE, 0);
-                   n =
-                       SendDlgItemMessage(hwnd, IDC_COLOURLIST,
-                                          LB_GETCOUNT, 0, 0);
-                   if (n != 12 + 10 * cfg.bold_colour) {
-                       for (i = n; i-- > 0;)
-                           SendDlgItemMessage(hwnd, IDC_COLOURLIST,
-                                              LB_DELETESTRING, i, 0);
-                       for (i = 0; i < 22; i++)
-                           if (cfg.bold_colour || permcolour[i])
-                               SendDlgItemMessage(hwnd, IDC_COLOURLIST,
-                                                  LB_ADDSTRING, 0,
-                                                  (LPARAM) colours[i]);
-                   }
-                   SendDlgItemMessage(hwnd, IDC_COLOURLIST, WM_SETREDRAW,
-                                      TRUE, 0);
-                   InvalidateRect(GetDlgItem(hwnd, IDC_COLOURLIST), NULL,
-                                  TRUE);
                }
                break;
              case IDC_PALETTE:
@@ -3648,56 +3624,56 @@ static int GenericMainDlgProc(HWND hwnd, UINT msg,
                if (HIWORD(wParam) == CBN_SELCHANGE) {
                    int index = SendDlgItemMessage(hwnd, IDC_BUGD_IGNORE1,
                                                   CB_GETCURSEL, 0, 0);
-                   cfg.sshbug_ignore1 = (index == 0 ? BUG_AUTO :
-                                         index == 1 ? BUG_OFF : BUG_ON);
+                   cfg.sshbug_ignore1 = (index == 0 ? AUTO :
+                                         index == 1 ? FORCE_OFF : FORCE_ON);
                }
                break;
              case IDC_BUGD_PLAINPW1:
                if (HIWORD(wParam) == CBN_SELCHANGE) {
                    int index = SendDlgItemMessage(hwnd, IDC_BUGD_PLAINPW1,
                                                   CB_GETCURSEL, 0, 0);
-                   cfg.sshbug_plainpw1 = (index == 0 ? BUG_AUTO :
-                                          index == 1 ? BUG_OFF : BUG_ON);
+                   cfg.sshbug_plainpw1 = (index == 0 ? AUTO :
+                                          index == 1 ? FORCE_OFF : FORCE_ON);
                }
                break;
              case IDC_BUGD_RSA1:
                if (HIWORD(wParam) == CBN_SELCHANGE) {
                    int index = SendDlgItemMessage(hwnd, IDC_BUGD_RSA1,
                                                   CB_GETCURSEL, 0, 0);
-                   cfg.sshbug_rsa1 = (index == 0 ? BUG_AUTO :
-                                      index == 1 ? BUG_OFF : BUG_ON);
+                   cfg.sshbug_rsa1 = (index == 0 ? AUTO :
+                                      index == 1 ? FORCE_OFF : FORCE_ON);
                }
                break;
              case IDC_BUGD_HMAC2:
                if (HIWORD(wParam) == CBN_SELCHANGE) {
                    int index = SendDlgItemMessage(hwnd, IDC_BUGD_HMAC2,
                                                   CB_GETCURSEL, 0, 0);
-                   cfg.sshbug_hmac2 = (index == 0 ? BUG_AUTO :
-                                       index == 1 ? BUG_OFF : BUG_ON);
+                   cfg.sshbug_hmac2 = (index == 0 ? AUTO :
+                                       index == 1 ? FORCE_OFF : FORCE_ON);
                }
                break;
              case IDC_BUGD_DERIVEKEY2:
                if (HIWORD(wParam) == CBN_SELCHANGE) {
                    int index = SendDlgItemMessage(hwnd, IDC_BUGD_DERIVEKEY2,
                                                   CB_GETCURSEL, 0, 0);
-                   cfg.sshbug_derivekey2 = (index == 0 ? BUG_AUTO :
-                                            index == 1 ? BUG_OFF : BUG_ON);
+                   cfg.sshbug_derivekey2 = (index == 0 ? AUTO :
+                                            index == 1 ? FORCE_OFF:FORCE_ON);
                }
                break;
              case IDC_BUGD_RSAPAD2:
                if (HIWORD(wParam) == CBN_SELCHANGE) {
                    int index = SendDlgItemMessage(hwnd, IDC_BUGD_RSAPAD2,
                                                   CB_GETCURSEL, 0, 0);
-                   cfg.sshbug_rsapad2 = (index == 0 ? BUG_AUTO :
-                                         index == 1 ? BUG_OFF : BUG_ON);
+                   cfg.sshbug_rsapad2 = (index == 0 ? AUTO :
+                                         index == 1 ? FORCE_OFF : FORCE_ON);
                }
                break;
              case IDC_BUGD_DHGEX2:
                if (HIWORD(wParam) == CBN_SELCHANGE) {
                    int index = SendDlgItemMessage(hwnd, IDC_BUGD_DHGEX2,
                                                   CB_GETCURSEL, 0, 0);
-                   cfg.sshbug_dhgex2 = (index == 0 ? BUG_AUTO :
-                                        index == 1 ? BUG_OFF : BUG_ON);
+                   cfg.sshbug_dhgex2 = (index == 0 ? AUTO :
+                                        index == 1 ? FORCE_OFF : FORCE_ON);
                }
                break;
            }