+2003-01-05 Jordi Mallach <jordi@sindominio.net>
+
+ * TODO: add missing item.
+
+ * New patch from Dani Carbonell:
+
+ * src/commands.c (about_command): only create dialog if it doesn't
+ exist. If it does, raise it.
+
+ * src/dialogs.c (connectingdialog_destroy): remove timeouttag only if
+ it isn't 0.
+
+ * src/misc.c (leftlabel_set): convert theme info to UTF-8 before
+ displaying.
+ * src/winlist.c (winlist_additem): convert winlist items to UTF-8.
+
+ * src/partyline.c (partyline_page_new): port gtk_signal_connect to
+ g_signal_connect.
+
2003-01-05 Jordi Mallach <jordi@sindominio.net>
* AUTHORS: add Dani Carbonell.
+ keybindings
+ multiple about windows (raise already open window)
+ playfields messages cleared when games start
+ + problem when typing composed letters (รก) in fields messages.
- Make gtetrinet resizeable (at least the fields messages bit).
#include "commands.h"
#include "dialogs.h"
+extern GtkWidget *about;
+
GnomeUIInfo gamemenu[] = {
GNOMEUIINFO_ITEM(N_("_Connect to server..."), NULL, connect_command, NULL),
GNOMEUIINFO_ITEM(N_("_Disconnect from server"), NULL, disconnect_command, NULL),
void about_command (GtkWidget *widget, gpointer data)
{
- GtkWidget *about, *hbox;
+ GtkWidget *hbox;
GdkPixbuf *logo;
- const char *authors[] = {N_("Ka-shu Wong <kswong@zip.com.au>"),
- N_("James Antill <james@and.org>"),
- N_("Jordi Mallach <jordi@sindominio.net>"),
- N_("Dani Carbonell <bocata@panete.net>"),
- NULL};
- const char *documenters[] = {N_("Jordi Mallach <jordi@sindominio.net>"),
- NULL};
- /* Translators: translate as your names & emails */
- const char *translators = _("translator_credits");
-
- logo = gdk_pixbuf_new_from_file (PIXMAPSDIR "/gtetrinet.png", NULL);
+ if (!GTK_IS_WINDOW (about))
+ {
+ const char *authors[] = {N_("Ka-shu Wong <kswong@zip.com.au>"),
+ N_("James Antill <james@and.org>"),
+ N_("Jordi Mallach <jordi@sindominio.net>"),
+ N_("Dani Carbonell <bocata@panete.net>"),
+ NULL};
+ const char *documenters[] = {N_("Jordi Mallach <jordi@sindominio.net>"),
+ NULL};
+ /* Translators: translate as your names & emails */
+ const char *translators = _("translator_credits");
+
+ logo = gdk_pixbuf_new_from_file (PIXMAPSDIR "/gtetrinet.png", NULL);
- about = gnome_about_new (APPNAME, APPVERSION,
- _("(C) 1999, 2000, 2001, 2002 Ka-shu Wong"),
- _("A Tetrinet client for GNOME.\n"),
- authors,
- documenters,
- strcmp (translators, "translator_credits") != 0 ?
- translators : NULL,
- logo);
-
- if (logo != NULL)
- g_object_unref (logo);
-
- hbox = gtk_hbox_new (TRUE, 0);
- gtk_box_pack_start (GTK_BOX (hbox),
- gnome_href_new ("http://gtetrinet.sourceforge.net/", _("GTetrinet Home Page")),
- FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (about)->vbox),
- hbox, TRUE, FALSE, 0);
- gtk_widget_show_all (hbox);
-
- gtk_widget_show (about);
+ about = gnome_about_new (APPNAME, APPVERSION,
+ _("(C) 1999, 2000, 2001, 2002 Ka-shu Wong"),
+ _("A Tetrinet client for GNOME.\n"),
+ authors,
+ documenters,
+ strcmp (translators, "translator_credits") != 0 ?
+ translators : NULL,
+ logo);
+
+ if (logo != NULL)
+ g_object_unref (logo);
+
+ hbox = gtk_hbox_new (TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox),
+ gnome_href_new ("http://gtetrinet.sourceforge.net/", _("GTetrinet Home Page")),
+ FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (about)->vbox),
+ hbox, TRUE, FALSE, 0);
+ gtk_widget_show_all (hbox);
+
+ gtk_widget_show (about);
+ }
+ else
+ {
+ gtk_window_present (GTK_WINDOW (about));
+ }
}
void connectingdialog_destroy (void)
{
- gtk_timeout_remove (timeouttag);
+ if (timeouttag != 0) gtk_timeout_remove (timeouttag);
timeouttag = 0;
if (connectingdialog == 0) return;
gtk_widget_destroy (connectingdialog);
theme_selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (themelist));
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (themelist), FALSE);
gtk_widget_set_usize (themelist, 160, 0);
- gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (themelist), -1, _("Theme"), renderer,
+ gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (themelist), -1, "theme", renderer,
"text", 0, NULL);
gtk_widget_show (themelist);
extern int gamemode;
+GtkWidget *about;
+
extern void destroymain (GtkWidget *widget, gpointer data);
extern gint keypress (GtkWidget *widget, GdkEventKey *key);
extern gint keyrelease (GtkWidget *widget, GdkEventKey *key);
void leftlabel_set (GtkWidget *align, char *str)
{
- gtk_label_set (GTK_LABEL(GTK_BIN(align)->child), str);
+ gchar *aux;
+
+ aux = g_locale_to_utf8 (str, -1, NULL, NULL, NULL);
+ gtk_label_set (GTK_LABEL(GTK_BIN(align)->child), aux);
+ g_free (aux);
}
/* returns a random number in the range 0 to n-1 --
gtk_box_pack_start (GTK_BOX(leftbox), textboxscroll, TRUE, TRUE, 0);
/* entry box */
entrybox = gtk_entry_new_with_max_length (200);
- gtk_signal_connect (GTK_OBJECT(entrybox), "activate",
- GTK_SIGNAL_FUNC(textentry), NULL);
- gtk_signal_connect (GTK_OBJECT(entrybox), "key_press_event",
- GTK_SIGNAL_FUNC(entrykey), NULL);
+ g_signal_connect (G_OBJECT(entrybox), "activate",
+ GTK_SIGNAL_FUNC(textentry), NULL);
+ g_signal_connect (G_OBJECT(entrybox), "key_press_event",
+ GTK_SIGNAL_FUNC(entrykey), NULL);
gtk_widget_show (entrybox);
gtk_box_pack_start (GTK_BOX(leftbox), entrybox, FALSE, FALSE, 0);
gtk_widget_show (leftbox);
token = strtok (data, " ");
if (token == NULL) break;
g_snprintf (buf, sizeof(buf),
- _("%c*** You have joined %c%s"),
- TETRI_TB_C_DARK_BLUE, TETRI_TB_BOLD, token);
+ _("%c*** You have joined %c%s%c%c"),
+ TETRI_TB_C_DARK_BLUE, TETRI_TB_BOLD, token,
+ TETRI_TB_RESET, TETRI_TB_C_DARK_BLUE);
partyline_text (buf);
while ((token = strtok (NULL, " ")) != NULL) speclist_add (token);
playerlistupdate ();
GtkListStore *winlist_model = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (winlist)));
GtkTreeIter iter;
char buf[16], *item[3];
+ gchar *name_utf8;
if (team) item[0] = "T";
else item[0] = "";
item[1] = nocolor (name);
+ name_utf8 = g_locale_to_utf8 (item[1], -1, NULL, NULL, NULL);
g_snprintf (buf, sizeof(buf), "%d", score);
item[2] = buf;
gtk_list_store_append (winlist_model, &iter);
gtk_list_store_set (winlist_model, &iter,
0, item[0],
- 1, item[1],
+ 1, name_utf8,
2, item[2],
-1);
}