From: James Antill Date: Thu, 20 Feb 2003 05:15:26 +0000 (+0000) Subject: Add ESC for "/list" parser when user types "/list". X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=68b8fade2baf25b6d34fae72d87594cbbf002e85;p=gtetrinet Add ESC for "/list" parser when user types "/list". * src/partyline.c (textentry): Add ESC for "/list" parser when user types "/list". * src/misc.c (textbox_addtext): Fix attributes (bold, italic etc. were never being set). (textbox_addtext): Don't insert using tags if nothing changed, this seems to work around a bug when using LANG=en_US.UTF-8 gtetrinet. Don't ask me why. --- diff --git a/ChangeLog b/ChangeLog index 3136231..6d4b9dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2003-02-19 James Antill + + * src/partyline.c (textentry): Add ESC for "/list" parser when user + types "/list". + + * src/misc.c (textbox_addtext): Fix attributes (bold, italic etc. + were never being set). + (textbox_addtext): Don't insert using tags if nothing changed, this + seems to work around a bug when using LANG=en_US.UTF-8 gtetrinet. Don't + ask me why. + 2003-02-18 Jordi Mallach * Makefile.am (INCLUDES): removed, not needed here. diff --git a/src/misc.c b/src/misc.c index a377b66..b2c8ae9 100644 --- a/src/misc.c +++ b/src/misc.c @@ -173,9 +173,9 @@ void textbox_addtext (GtkTextView *textbox, const unsigned char *text) g_assert(TETRI_TB_C_END_OFFSET <= TETRI_TB_END_OFFSET); switch (text[i]) { - case TETRI_TB_BOLD: attr_bold = !!attr_bold; break; - case TETRI_TB_ITALIC: attr_italic = !!attr_italic; break; - case TETRI_TB_UNDERLINE: attr_underline = !!attr_underline; break; + case TETRI_TB_BOLD: attr_bold = !attr_bold; break; + case TETRI_TB_ITALIC: attr_italic = !attr_italic; break; + case TETRI_TB_UNDERLINE: attr_underline = !attr_underline; break; default: /* it is a color... */ if (text[i] > TETRI_TB_C_END_OFFSET) break; if (text[i] == last) { @@ -225,9 +225,11 @@ void textbox_addtext (GtkTextView *textbox, const unsigned char *text) gtk_text_buffer_insert_with_tags (textbox->buffer, &iter, out, -1, t_a, color, NULL); } - else + else if (color != lastcolor) gtk_text_buffer_insert_with_tags (textbox->buffer, &iter, out, -1, color, NULL); + else + gtk_text_buffer_insert (textbox->buffer, &iter, out, -1); } diff --git a/src/partyline.c b/src/partyline.c index c63016c..cf496d5 100644 --- a/src/partyline.c +++ b/src/partyline.c @@ -306,6 +306,10 @@ void textentry (GtkWidget *widget) text = gtk_entry_get_text (GTK_ENTRY(widget)); if (strlen(text) == 0) return; + + if (!strncmp("/list", text, strlen("/list"))) + stop_list(); /* Parsing can't be perfect, + so make sure they can do it by hand... */ /* convert from UTF-8 to the current locale, will work with ISO8859-1 locales */ iso_text = g_locale_from_utf8 (text, -1, NULL, NULL, NULL); diff --git a/src/tetrinet.c b/src/tetrinet.c index 4a073d4..74786c2 100644 --- a/src/tetrinet.c +++ b/src/tetrinet.c @@ -1,3 +1,4 @@ + /* * GTetrinet * Copyright (C) 1999, 2000, 2001, 2002, 2003 Ka-shu Wong (kswong@zip.com.au) @@ -425,9 +426,7 @@ void tetrinet_inmessage (enum inmsg_type msgtype, char *data) if (!strncmp ("You", line, 3)) { /* we will use the error message as list stopper */ - list_issued--; - if (list_issued <= 0) - stop_list(); + stop_list(); break; }