+2003-01-05 Dani Carbonell <bocata@panete.net>
+
+ * TODO: updated.
+
+ * src/tetrinet.c (tetrinet_inmessage): converted reason to disconnect
+ to UTF-8 so it can be displayed properly.
+
+ * src/winlist.c (winlist_additem): fixed memory leak.
+
+ * src/misc.c (nocolor): it wasn't doing anything, reverted to its
+ previous behaviour, but now it doesn't cut accented characters ( < 0 ).
+
+ * src/fields.c (fields_setlabel): now displays correctly all the UTF-8
+ characters, applying the nocolor () function to the ASCII strings
+ before recoding them to UTF-8.
+
+ * src/partyline.c (partyline_namelabel): likewise.
+ (partyline_page_new): added a horizontal scrollbar to the playerlist.
+
+ * src/gtetrinet.c (keypress): string "Playing Fields" wasn't been
+ translated, and gtk_object_get_data ported to g_object_get_data.
+ (keyreleased): likewise.
+
2003-01-05 Jordi Mallach <jordi@sindominio.net>
* TODO: updated.
+ problem when typing composed letters (รก) in fields messages
+ add real tooltips
+ port deprecated widgets (-DGTK_DISABLE_DEPRECATED)
+ + pressing a key when a game is in progress, but you are not playing it,
+ causes a Gtk-CRITICAL
+ + detaching and reattaching the Menu Bar causes two Bonobo-CRITICAL
- Make gtetrinet resizeable (at least the fields messages bit)
- Write a User Manual
gtk_label_set (GTK_LABEL(fieldlabels[field][5]), "");
}
else {
- name_utf8 = g_locale_to_utf8 (name, -1, NULL, NULL, NULL);
+ name_utf8 = g_locale_to_utf8 (nocolor (name), -1, NULL, NULL, NULL);
gtk_widget_show (fieldlabels[field][0]);
gtk_widget_show (fieldlabels[field][1]);
gtk_widget_show (fieldlabels[field][2]);
gtk_widget_hide (fieldlabels[field][3]);
gtk_label_set (GTK_LABEL(fieldlabels[field][0]), buf);
- gtk_label_set (GTK_LABEL(fieldlabels[field][2]), nocolor(name_utf8));
+ gtk_label_set (GTK_LABEL(fieldlabels[field][2]), name_utf8);
gtk_label_set (GTK_LABEL(fieldlabels[field][3]), "");
if (team == NULL || team[0] == 0) {
gtk_widget_hide (fieldlabels[field][4]);
gtk_label_set (GTK_LABEL(fieldlabels[field][5]), "");
}
else {
- team_utf8 = g_locale_to_utf8 (team, -1, NULL, NULL, NULL);
+ team_utf8 = g_locale_to_utf8 (nocolor (team), -1, NULL, NULL, NULL);
gtk_widget_show (fieldlabels[field][4]);
gtk_widget_show (fieldlabels[field][5]);
- gtk_label_set (GTK_LABEL(fieldlabels[field][5]), nocolor(team_utf8));
+ gtk_label_set (GTK_LABEL(fieldlabels[field][5]), team_utf8);
g_free (team_utf8);
}
g_free (name_utf8);
#include <gtk/gtk.h>
+
extern GtkWidget *fields_page_new (void);
extern void fields_page_destroy_contents (void);
extern void fields_init (void);
/* Sub-window - find out which */
char *title = NULL;
- title = gtk_object_get_data(GTK_OBJECT(widget), "title");
- game_area = title && !strcmp( title, "Playing Fields" );
+ title = g_object_get_data(G_OBJECT(widget), "title");
+ game_area = title && !strcmp( title, _("Playing Fields"));
}
if (game_area)
if (keytimeoutid && key->time == k.time)
gtk_timeout_remove (keytimeoutid);
}
+
if (gtetrinet_key(key->keyval, key->state & (GDK_MOD1_MASK |
GDK_CONTROL_MASK |
GDK_SHIFT_MASK)))
- goto keyprocessed;
- if (game_area && tetrinet_key (key->keyval, key->string)) goto keyprocessed;
+ {
+ gtk_signal_emit_stop_by_name (GTK_OBJECT(widget), "key_press_event");
+ return TRUE;
+ }
+ if (game_area && tetrinet_key (key->keyval, key->string))
+ {
+ gtk_signal_emit_stop_by_name (GTK_OBJECT(widget), "key_press_event");
+ return TRUE;
+ }
+
return FALSE;
-keyprocessed:
- gtk_signal_emit_stop_by_name (GTK_OBJECT(widget), "key_press_event");
- return TRUE;
}
gint keyrelease (GtkWidget *widget, GdkEventKey *key)
/* Sub-window - find out which */
char *title = NULL;
- title = gtk_object_get_data(GTK_OBJECT(widget), "title");
- game_area = title && !strcmp( title, "Playing Fields" );
+ title = g_object_get_data(G_OBJECT(widget), "title");
+ game_area = title && !strcmp( title, _("Playing Fields"));
}
if (game_area)
gtet_text_tags[n].t_c = gtk_text_buffer_create_tag (buffer, NULL,
"foreground-gdk",
>et_text_tags[n].c,
-// "background",
-// "white",
NULL);
t_bold = gtk_text_buffer_create_tag (buffer, NULL,
g_string_assign(ret, str);
p = scan = ret->str;
+ while (*scan != 0)
+ {
+ if ((*scan > 0x1F) || (*scan < 0x0)) *p++ = *scan;
+ scan++;
+ }
if (scan != p)
g_string_truncate(ret, len - (scan - p));
/* widgets that we have to do stuff with */
static GtkWidget *playerlist, *textbox, *entrybox,
- *namelabel, *teamlabel, *infolabel, *textboxscroll;
+ *namelabel, *teamlabel, *infolabel, *textboxscroll, *playerlist_scroll;
/* some more widgets for layout */
static GtkWidget *table, *leftbox, *rightbox;
gtk_box_pack_start (GTK_BOX(leftbox), entrybox, FALSE, FALSE, 0);
gtk_widget_show (leftbox);
- /* player list */
+ /* player list with scrollbar */
playerlist = GTK_WIDGET (gtk_tree_view_new_with_model (GTK_TREE_MODEL (playerlist_model)));
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (playerlist), -1, "", renderer,
"text", 0, NULL);
"text", 1, NULL);
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (playerlist), -1, _("Team"), renderer,
"text", 2, NULL);
- gtk_widget_set_usize (playerlist, 150, 200);
gtk_widget_show (playerlist);
-
+ playerlist_scroll = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (playerlist_scroll),
+ GTK_POLICY_AUTOMATIC,
+ GTK_POLICY_NEVER);
+ gtk_container_add (GTK_CONTAINER(playerlist_scroll), playerlist);
+ gtk_widget_set_usize (playerlist_scroll, 150, 200);
+ gtk_widget_show (playerlist_scroll);
+
/* right box */
box = gtk_vbox_new (FALSE, 2);
gtk_table_attach (GTK_TABLE(table), leftbox, 0, 1, 0, 2,
GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND,
0, 0);
- gtk_table_attach (GTK_TABLE(table), playerlist, 1, 2, 0, 1,
+ gtk_table_attach (GTK_TABLE(table), playerlist_scroll, 1, 2, 0, 1,
GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
gtk_table_attach (GTK_TABLE(table), rightbox, 1, 2, 1, 2,
GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
if (nick)
{
- nick_utf8 = g_locale_to_utf8 (nick, -1, NULL, NULL, NULL);
- gtk_label_set (GTK_LABEL(namelabel), nocolor(nick_utf8));
+ nick_utf8 = g_locale_to_utf8 (nocolor (nick), -1, NULL, NULL, NULL);
+ gtk_label_set (GTK_LABEL(namelabel), nick_utf8);
g_free (nick_utf8);
}
else gtk_label_set (GTK_LABEL(namelabel), "");
if (team)
{
- team_utf8 = g_locale_to_utf8 (team, -1, NULL, NULL, NULL);
- gtk_label_set (GTK_LABEL(teamlabel), nocolor(team_utf8));
+ team_utf8 = g_locale_to_utf8 (nocolor (team), -1, NULL, NULL, NULL);
+ gtk_label_set (GTK_LABEL(teamlabel), team_utf8);
g_free (team_utf8);
}
else gtk_label_set (GTK_LABEL(teamlabel), "");
connecterror:
{
GtkWidget *dialog;
+ gchar *data_utf8;
connectingdialog_destroy ();
GTET_O_STRCPY (buf, _("Error connecting: "));
- GTET_O_STRCAT (buf, data);
+ data_utf8 = g_locale_to_utf8 (data, -1, NULL, NULL, NULL);
+ GTET_O_STRCAT (buf, data_utf8);
dialog = gnome_message_box_new (buf, GNOME_MESSAGE_BOX_ERROR,
GNOME_STOCK_BUTTON_OK, NULL);
gtk_widget_show (dialog);
+ g_free (data_utf8);
}
break;
case IN_PLAYERNUM:
1, name_utf8,
2, item[2],
-1);
+ g_free (name_utf8);
}