Fix minor breakage on Windows as a result of term_mouse revamp.
[sgt/putty] / windlg.c
index cb19e76..bf98129 100644 (file)
--- a/windlg.c
+++ b/windlg.c
@@ -27,6 +27,8 @@ static int requested_help;
 
 static struct prefslist cipherlist;
 
+extern Config cfg;                    /* defined in window.c */
+
 struct sesslist sesslist;             /* exported to window.c */
 
 #define PRINTER_DISABLED_STRING "None (printing disabled)"
@@ -620,6 +622,9 @@ enum { IDCX_ABOUT =
     IDC_X11_FORWARD,
     IDC_X11_DISPSTATIC,
     IDC_X11_DISPLAY,
+    IDC_X11AUTHSTATIC,
+    IDC_X11MIT,
+    IDC_X11XDM,
     IDC_LPORT_ALL,
     IDC_RPORT_ALL,
     IDC_PFWDSTATIC,
@@ -1025,6 +1030,10 @@ char *help_context_cmd(int id)
       case IDC_X11_DISPSTATIC:
       case IDC_X11_DISPLAY:
         return "JI(`',`ssh.tunnels.x11')";
+      case IDC_X11AUTHSTATIC:
+      case IDC_X11MIT:
+      case IDC_X11XDM:
+       return "JI(`',`ssh.tunnels.x11auth')";
       case IDC_PFWDSTATIC:
       case IDC_PFWDSTATIC2:
       case IDC_PFWDREMOVE:
@@ -1167,7 +1176,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);
@@ -1347,6 +1356,8 @@ static void init_dlg_ctrls(HWND hwnd, int keepsess)
 
     CheckDlgButton(hwnd, IDC_X11_FORWARD, cfg.x11_forward);
     SetDlgItemText(hwnd, IDC_X11_DISPLAY, cfg.x11_display);
+    CheckRadioButton(hwnd, IDC_X11MIT, IDC_X11XDM,
+                    cfg.x11_auth == X11_MIT ? IDC_X11MIT : IDC_X11XDM);
 
     CheckDlgButton(hwnd, IDC_LPORT_ALL, cfg.lport_acceptall);
     CheckDlgButton(hwnd, IDC_RPORT_ALL, cfg.rport_acceptall);
@@ -1709,7 +1720,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);
@@ -1954,7 +1965,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) {
@@ -1975,10 +1986,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);
        }
@@ -2011,7 +2023,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) {
@@ -2038,7 +2050,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) {
@@ -2046,8 +2058,12 @@ static void create_controls(HWND hwnd, int dlgtype, int panel)
                     IDC_TITLE_TUNNELS);
            beginbox(&cp, "X11 forwarding", IDC_BOX_TUNNELS1);
            checkbox(&cp, "&Enable X11 forwarding", IDC_X11_FORWARD);
-           multiedit(&cp, "&X display location", IDC_X11_DISPSTATIC,
-                     IDC_X11_DISPLAY, 50, NULL);
+           staticedit(&cp, "&X display location", IDC_X11_DISPSTATIC,
+                     IDC_X11_DISPLAY, 50);
+           radioline(&cp, "Remote X11 a&uthentication protocol",
+                     IDC_X11AUTHSTATIC, 2,
+                     "MIT-Magic-Cookie-1", IDC_X11MIT,
+                     "XDM-Authorization-1", IDC_X11XDM, NULL);
            endbox(&cp);
            beginbox(&cp, "Port forwarding", IDC_BOX_TUNNELS2);
            checkbox(&cp, "Local ports accept connections from o&ther hosts",
@@ -2894,7 +2910,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 ||
@@ -3318,7 +3334,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;
@@ -3535,6 +3551,16 @@ static int GenericMainDlgProc(HWND hwnd, UINT msg,
                    GetDlgItemText(hwnd, IDC_X11_DISPLAY, cfg.x11_display,
                                   sizeof(cfg.x11_display) - 1);
                break;
+             case IDC_X11MIT:
+             case IDC_X11XDM:
+               if (HIWORD(wParam) == BN_CLICKED ||
+                   HIWORD(wParam) == BN_DOUBLECLICKED) {
+                   if (IsDlgButtonChecked(hwnd, IDC_X11MIT))
+                       cfg.x11_auth = X11_MIT;
+                   else if (IsDlgButtonChecked(hwnd, IDC_X11XDM))
+                       cfg.x11_auth = X11_XDM;
+               }
+               break;
              case IDC_PFWDADD:
                if (HIWORD(wParam) == BN_CLICKED ||
                    HIWORD(wParam) == BN_DOUBLECLICKED) {