X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fgtkwin.c;h=616a69adb4b20042fc5b77b68ea4ecc10625de04;hb=0395e52bb8db4b77e792ea1c46b2c0024c67986b;hp=c9455a5ced29a1ce0ed1df5358a87819f60d05f1;hpb=92688ff47bf4b489414c24449d20c5771020be5c;p=PuTTY.git diff --git a/unix/gtkwin.c b/unix/gtkwin.c index c9455a5c..616a69ad 100644 --- a/unix/gtkwin.c +++ b/unix/gtkwin.c @@ -151,24 +151,20 @@ void connection_fatal(void *frontend, char *p, ...) /* * Default settings that are specific to pterm. */ -FontSpec platform_default_fontspec(const char *name) +FontSpec *platform_default_fontspec(const char *name) { - FontSpec ret; if (!strcmp(name, "Font")) - strcpy(ret.name, "server:fixed"); + return fontspec_new("server:fixed"); else - *ret.name = '\0'; - return ret; + 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) @@ -2541,36 +2537,36 @@ int do_cmdline(int argc, char **argv, int do_everything, int *allow_launch, } if (!strcmp(p, "-fn") || !strcmp(p, "-font")) { - FontSpec fs; + FontSpec *fs; EXPECTS_ARG; SECOND_PASS_ONLY; - strncpy(fs.name, val, sizeof(fs.name)); - fs.name[sizeof(fs.name)-1] = '\0'; - conf_set_fontspec(conf, CONF_font, &fs); + fs = fontspec_new(val); + conf_set_fontspec(conf, CONF_font, fs); + fontspec_free(fs); } else if (!strcmp(p, "-fb")) { - FontSpec fs; + FontSpec *fs; EXPECTS_ARG; SECOND_PASS_ONLY; - strncpy(fs.name, val, sizeof(fs.name)); - fs.name[sizeof(fs.name)-1] = '\0'; - conf_set_fontspec(conf, CONF_boldfont, &fs); + fs = fontspec_new(val); + conf_set_fontspec(conf, CONF_boldfont, fs); + fontspec_free(fs); } else if (!strcmp(p, "-fw")) { - FontSpec fs; + FontSpec *fs; EXPECTS_ARG; SECOND_PASS_ONLY; - strncpy(fs.name, val, sizeof(fs.name)); - fs.name[sizeof(fs.name)-1] = '\0'; - conf_set_fontspec(conf, CONF_widefont, &fs); + fs = fontspec_new(val); + conf_set_fontspec(conf, CONF_widefont, fs); + fontspec_free(fs); } else if (!strcmp(p, "-fwb")) { - FontSpec fs; + FontSpec *fs; EXPECTS_ARG; SECOND_PASS_ONLY; - strncpy(fs.name, val, sizeof(fs.name)); - fs.name[sizeof(fs.name)-1] = '\0'; - conf_set_fontspec(conf, CONF_wideboldfont, &fs); + fs = fontspec_new(val); + conf_set_fontspec(conf, CONF_wideboldfont, fs); + fontspec_free(fs); } else if (!strcmp(p, "-cs")) { EXPECTS_ARG; @@ -2650,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; @@ -2729,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); @@ -2975,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) !=