Introduce a third setting for the 'bold as colour' mode, which lets
[sgt/putty] / unix / gtkwin.c
index e2e672e..550ec8c 100644 (file)
@@ -104,14 +104,14 @@ struct gui_data {
     guint32 input_event_time; /* Timestamp of the most recent input event. */
     int reconfiguring;
     /* Cached things out of conf that we refer to a lot */
-    int bold_colour;
+    int bold_style;
     int window_border;
     int cursor_type;
 };
 
 static void cache_conf_values(struct gui_data *inst)
 {
-    inst->bold_colour = conf_get_int(inst->conf, CONF_bold_colour);
+    inst->bold_style = conf_get_int(inst->conf, CONF_bold_style);
     inst->window_border = conf_get_int(inst->conf, CONF_window_border);
     inst->cursor_type = conf_get_int(inst->conf, CONF_cursor_type);
 }
@@ -159,14 +159,12 @@ FontSpec *platform_default_fontspec(const char *name)
         return fontspec_new("");
 }
 
-Filename platform_default_filename(const char *name)
+Filename *platform_default_filename(const char *name)
 {
-    Filename ret;
     if (!strcmp(name, "LogFileName"))
-       strcpy(ret.path, "putty.log");
+       return filename_from_str("putty.log");
     else
-       *ret.path = '\0';
-    return ret;
+       return filename_from_str("");
 }
 
 char *platform_default_s(const char *name)
@@ -2063,11 +2061,11 @@ void do_text_internal(Context ctx, int x, int y, wchar_t *text, int len,
        nfg = nbg;
        nbg = t;
     }
-    if (inst->bold_colour && (attr & ATTR_BOLD)) {
+    if ((inst->bold_style & 2) && (attr & ATTR_BOLD)) {
        if (nfg < 16) nfg |= 8;
        else if (nfg >= 256) nfg |= 1;
     }
-    if (inst->bold_colour && (attr & ATTR_BLINK)) {
+    if ((inst->bold_style & 2) && (attr & ATTR_BLINK)) {
        if (nbg < 16) nbg |= 8;
        else if (nbg >= 256) nbg |= 1;
     }
@@ -2085,7 +2083,7 @@ void do_text_internal(Context ctx, int x, int y, wchar_t *text, int len,
        widefactor = 1;
     }
 
-    if ((attr & ATTR_BOLD) && !inst->bold_colour) {
+    if ((attr & ATTR_BOLD) && (inst->bold_style & 1)) {
        bold = 1;
        fontid |= 1;
     } else {
@@ -2648,13 +2646,13 @@ int do_cmdline(int argc, char **argv, int do_everything, int *allow_launch,
            conf_set_str(conf, CONF_wintitle, val);
 
        } else if (!strcmp(p, "-log")) {
-           Filename fn;
+           Filename *fn;
            EXPECTS_ARG;
            SECOND_PASS_ONLY;
-           strncpy(fn.path, val, sizeof(fn.path));
-           fn.path[sizeof(fn.path)-1] = '\0';
-           conf_set_filename(conf, CONF_logfilename, &fn);
+            fn = filename_from_str(val);
+           conf_set_filename(conf, CONF_logfilename, fn);
            conf_set_int(conf, CONF_logtype, LGTYP_DEBUG);
+            filename_free(fn);
 
        } else if (!strcmp(p, "-ut-") || !strcmp(p, "+ut")) {
            SECOND_PASS_ONLY;
@@ -2727,6 +2725,24 @@ void uxsel_input_remove(int id) {
     gdk_input_remove(id);
 }
 
+int frontend_net_pending_error_idle_id;
+int frontend_got_net_pending_errors = FALSE;
+gboolean frontend_net_pending_errors(gpointer data)
+{
+    net_pending_errors();
+    gtk_idle_remove(frontend_net_pending_error_idle_id);
+    frontend_got_net_pending_errors = FALSE;
+    return FALSE;
+}
+void frontend_net_error_pending(void)
+{
+    if (!frontend_got_net_pending_errors) {
+        frontend_got_net_pending_errors = TRUE;
+        frontend_net_pending_error_idle_id =
+            gtk_idle_add(frontend_net_pending_errors, NULL);
+    }
+}
+
 void setup_fonts_ucs(struct gui_data *inst)
 {
     int shadowbold = conf_get_int(inst->conf, CONF_shadowbold);
@@ -2973,6 +2989,8 @@ void change_settings_menuitem(GtkMenuItem *item, gpointer data)
                   conf_get_fontspec(newconf, CONF_wideboldfont)->name) ||
            strcmp(conf_get_str(oldconf, CONF_line_codepage),
                   conf_get_str(newconf, CONF_line_codepage)) ||
+           conf_get_int(oldconf, CONF_utf8_override) !=
+           conf_get_int(newconf, CONF_utf8_override) ||
            conf_get_int(oldconf, CONF_vtmode) !=
            conf_get_int(newconf, CONF_vtmode) ||
            conf_get_int(oldconf, CONF_shadowbold) !=