Make the shadow bold offset configurable, after discovering that
[u/mdw/putty] / settings.c
index e905397..71ae49e 100644 (file)
@@ -309,6 +309,11 @@ void save_settings(char *section, int do_host, Config * cfg)
     write_setting_i(sesskey, "BugDeriveKey2", cfg->sshbug_derivekey2);
     write_setting_i(sesskey, "BugRSAPad2", cfg->sshbug_rsapad2);
     write_setting_i(sesskey, "BugDHGEx2", cfg->sshbug_dhgex2);
+    write_setting_i(sesskey, "StampUtmp", cfg->stamp_utmp);
+    write_setting_i(sesskey, "LoginShell", cfg->login_shell);
+    write_setting_i(sesskey, "ScrollbarOnLeft", cfg->scrollbar_on_left);
+    write_setting_s(sesskey, "BoldFont", cfg->boldfont);
+    write_setting_i(sesskey, "ShadowBoldOffset", cfg->shadowboldoffset);
     close_settings_w(sesskey);
 }
 
@@ -362,7 +367,7 @@ void load_settings(char *section, int do_host, Config * cfg)
     /* proxy settings */
     gpps(sesskey, "ProxyExcludeList", "", cfg->proxy_exclude_list,
         sizeof(cfg->proxy_exclude_list));
-    gppi(sesskey, "ProxyType", PROXY_NONE, &cfg->proxy_type);
+    gppi(sesskey, "ProxyType", PROXY_NONE, &i); cfg->proxy_type = i;
     gpps(sesskey, "ProxyHost", "proxy", cfg->proxy_host,
         sizeof(cfg->proxy_host));
     gppi(sesskey, "ProxyPort", 80, &cfg->proxy_port);
@@ -451,8 +456,8 @@ void load_settings(char *section, int do_host, Config * cfg)
         sizeof(cfg->bell_wavefile));
     gppi(sesskey, "BellOverload", 1, &cfg->bellovl);
     gppi(sesskey, "BellOverloadN", 5, &cfg->bellovl_n);
-    gppi(sesskey, "BellOverloadT", 2000, &cfg->bellovl_t);
-    gppi(sesskey, "BellOverloadS", 5000, &cfg->bellovl_s);
+    gppi(sesskey, "BellOverloadT", 2*TICKSPERSEC, &cfg->bellovl_t);
+    gppi(sesskey, "BellOverloadS", 5*TICKSPERSEC, &cfg->bellovl_s);
     gppi(sesskey, "ScrollbackLines", 200, &cfg->savelines);
     gppi(sesskey, "DECOriginMode", 0, &cfg->dec_om);
     gppi(sesskey, "AutoWrapMode", 1, &cfg->wrap_mode);
@@ -506,7 +511,16 @@ void load_settings(char *section, int do_host, Config * cfg)
            cfg->colours[i][2] = c2;
        }
     }
+#ifndef _WINDOWS
+    /* Non-raw cut and paste of line-drawing chars works badly on the
+     * current Unix stub implementation of the Unicode functions.
+     * So I'm going to temporarily set the default to raw mode so
+     * that the failure mode isn't quite so drastically horrid.
+     * When Unicode comes in, this can all be put right. */
+    gppi(sesskey, "RawCNP", 1, &cfg->rawcnp);
+#else
     gppi(sesskey, "RawCNP", 0, &cfg->rawcnp);
+#endif
     gppi(sesskey, "PasteRTF", 0, &cfg->rtf_paste);
     gppi(sesskey, "MouseIsXterm", 0, &cfg->mouse_is_xterm);
     gppi(sesskey, "RectSelect", 0, &cfg->rect_select);
@@ -548,7 +562,7 @@ void load_settings(char *section, int do_host, Config * cfg)
     gppi(sesskey, "ScrollBarFullScreen", 0, &cfg->scrollbar_in_fullscreen);
     gppi(sesskey, "ScrollOnKey", 0, &cfg->scroll_on_key);
     gppi(sesskey, "ScrollOnDisp", 1, &cfg->scroll_on_disp);
-    gppi(sesskey, "LockSize", 0, &cfg->resize_action);
+    gppi(sesskey, "LockSize", 0, &i); cfg->resize_action = i;
     gppi(sesskey, "BCE", 1, &cfg->bce);
     gppi(sesskey, "BlinkText", 0, &cfg->blinktext);
     gppi(sesskey, "X11Forward", 0, &cfg->x11_forward);
@@ -577,21 +591,26 @@ void load_settings(char *section, int do_host, Config * cfg)
        }
        *q = '\0';
     }
-    gppi(sesskey, "BugIgnore1", BUG_AUTO, &cfg->sshbug_ignore1);
-    gppi(sesskey, "BugPlainPW1", BUG_AUTO, &cfg->sshbug_plainpw1);
-    gppi(sesskey, "BugRSA1", BUG_AUTO, &cfg->sshbug_rsa1);
+    gppi(sesskey, "BugIgnore1", BUG_AUTO, &i); cfg->sshbug_ignore1 = i;
+    gppi(sesskey, "BugPlainPW1", BUG_AUTO, &i); cfg->sshbug_plainpw1 = i;
+    gppi(sesskey, "BugRSA1", BUG_AUTO, &i); cfg->sshbug_rsa1 = i;
     {
        int i;
-       gppi(sesskey, "BugHMAC2", BUG_AUTO, &cfg->sshbug_hmac2);
+       gppi(sesskey, "BugHMAC2", BUG_AUTO, &i); cfg->sshbug_hmac2 = i;
        if (cfg->sshbug_hmac2 == BUG_AUTO) {
            gppi(sesskey, "BuggyMAC", 0, &i);
            if (i == 1)
                cfg->sshbug_hmac2 = BUG_ON;
        }
     }
-    gppi(sesskey, "BugDeriveKey2", BUG_AUTO, &cfg->sshbug_derivekey2);
-    gppi(sesskey, "BugRSAPad2", BUG_AUTO, &cfg->sshbug_rsapad2);
-    gppi(sesskey, "BugDHGEx2", BUG_AUTO, &cfg->sshbug_dhgex2);
+    gppi(sesskey, "BugDeriveKey2", BUG_AUTO, &i); cfg->sshbug_derivekey2 = i;
+    gppi(sesskey, "BugRSAPad2", BUG_AUTO, &i); cfg->sshbug_rsapad2 = i;
+    gppi(sesskey, "BugDHGEx2", BUG_AUTO, &i); cfg->sshbug_dhgex2 = i;
+    gppi(sesskey, "StampUtmp", 1, &cfg->stamp_utmp);
+    gppi(sesskey, "LoginShell", 1, &cfg->login_shell);
+    gppi(sesskey, "ScrollbarOnLeft", 0, &cfg->scrollbar_on_left);
+    gpps(sesskey, "BoldFont", "", cfg->boldfont, sizeof(cfg->boldfont));
+    gppi(sesskey, "ShadowBoldOffset", -1, &cfg->shadowboldoffset);
 
     close_settings_r(sesskey);
 }