diff options
author | Berke Viktor <bviktor@hexchat.org> | 2012-09-01 21:38:00 +0200 |
---|---|---|
committer | Berke Viktor <bviktor@hexchat.org> | 2012-09-01 21:38:00 +0200 |
commit | 4f887a1e536044cca9b4a865917ca56288032b07 (patch) | |
tree | 10c841790aa7bd5532743facd59afb203b9204aa /src/fe-gtk | |
parent | fb00928c9df3a8152113674f4b85ba0fdf1679c8 (diff) |
Consolidate color stripping for messages, topic and scrollback
Diffstat (limited to 'src/fe-gtk')
-rw-r--r-- | src/fe-gtk/fe-gtk.c | 24 | ||||
-rw-r--r-- | src/fe-gtk/setup.c | 25 |
2 files changed, 45 insertions, 4 deletions
diff --git a/src/fe-gtk/fe-gtk.c b/src/fe-gtk/fe-gtk.c index 706ab776..cb9c0376 100644 --- a/src/fe-gtk/fe-gtk.c +++ b/src/fe-gtk/fe-gtk.c @@ -552,13 +552,31 @@ fe_set_topic (session *sess, char *topic, char *stripped_topic) { if (!sess->gui->is_tab || sess == current_tab) { - gtk_entry_set_text (GTK_ENTRY (sess->gui->topic_entry), stripped_topic); + if (prefs.text_stripcolor_topic) + { + gtk_entry_set_text (GTK_ENTRY (sess->gui->topic_entry), stripped_topic); + } + else + { + gtk_entry_set_text (GTK_ENTRY (sess->gui->topic_entry), topic); + } mg_set_topic_tip (sess); - } else + } + else { if (sess->res->topic_text) + { free (sess->res->topic_text); - sess->res->topic_text = strdup (stripped_topic); + } + + if (prefs.text_stripcolor_topic) + { + sess->res->topic_text = strdup (stripped_topic); + } + else + { + sess->res->topic_text = strdup (topic); + } } } diff --git a/src/fe-gtk/setup.c b/src/fe-gtk/setup.c index fafb8334..6dd84521 100644 --- a/src/fe-gtk/setup.c +++ b/src/fe-gtk/setup.c @@ -281,6 +281,15 @@ static const setting tabs_settings[] = {ST_END, 0, 0, 0, 0, 0} }; +static const setting color_settings[] = +{ + {ST_TOGGLE, N_("Messages"), P_OFFINTNL(text_stripcolor_msg), 0, 0, 0}, + {ST_TOGGLE, N_("Scrollback"), P_OFFINTNL(text_stripcolor_replay), 0, 0, 0}, + {ST_TOGGLE, N_("Topic"), P_OFFINTNL(text_stripcolor_topic), 0, 0, 0}, + + {ST_END, 0, 0, 0, 0, 0} +}; + static const char *const dccaccept[] = { N_("No"), @@ -464,7 +473,9 @@ static const setting logging_settings[] = { {ST_HEADER, N_("Logging"),0,0,0}, {ST_TOGGLE, N_("Display scrollback from previous session"), P_OFFINTNL(text_replay), 0, 0, 0}, - {ST_TOGGLE, N_("Strip colors when displaying scrollback"), P_OFFINTNL(text_replay_strip_color), 0, 0, 0}, +#if 0 /* Now it's done under Colors */ + {ST_TOGGLE, N_("Strip colors when displaying scrollback"), P_OFFINTNL(text_stripcolor_replay), 0, 0, 0}, +#endif {ST_TOGGLE, N_("Enable logging of conversations to disk"), P_OFFINTNL(logging), 0, 0, 2}, {ST_ENTRY, N_("Log filename:"), P_OFFSETNL(logmask), 0, 0, sizeof prefs.logmask}, {ST_LABEL, N_("%s=Server %c=Channel %n=Network.")}, @@ -1417,6 +1428,18 @@ setup_create_color_page (void) setup_create_other_colorR (_("Spell checker:"), COL_SPELL, 11, tab); #endif + setup_create_header (tab, 15, N_("Color Stripping")); + + /* label = gtk_label_new (_("Strip colors from:")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_table_attach (GTK_TABLE (tab), label, 2, 3, 16, 17, + GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, LABEL_INDENT, 0); */ + + for (i = 0; i < 3; i++) + { + setup_create_toggleL (tab, i + 16, &color_settings[i]); + } + return box; } |