]> hydra-www.ietfng.org Git - gtetrinet/commitdiff
Add ESC for "/list" parser when user types "/list".
authorJames Antill <james@src.gnome.org>
Thu, 20 Feb 2003 05:15:26 +0000 (05:15 +0000)
committerJames Antill <james@src.gnome.org>
Thu, 20 Feb 2003 05:15:26 +0000 (05:15 +0000)
* 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.

ChangeLog
src/misc.c
src/partyline.c
src/tetrinet.c

index 3136231dc086a9f7b1b4ed6109d020478f507005..6d4b9dc0af21cf9333dfd50040107734e9838890 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2003-02-19  James Antill  <james@and.org>
+
+       * 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  <jordi@sindominio.net>
 
        * Makefile.am (INCLUDES): removed, not needed here.
index a377b66d87980be10e7b45e36673e67241d21d4d..b2c8ae97055290d0536b38896e33ac179511b1f9 100644 (file)
@@ -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);
             
           }
           
index c63016c0358c214eefeac3c9c7f1553e7d62575f..cf496d57b13c4c53dbacfbfd50c862a85151685e 100644 (file)
@@ -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);
index 4a073d4ce726a8f6a10a039b2ca47035f6b4b99c..74786c26734751be1d6da54f10e6946a3b606419 100644 (file)
@@ -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;
                       }