]> hydra-www.ietfng.org Git - gtetrinet/commitdiff
From James Antill: fix segfault when opening about twice. Autofocus text entry box...
authorJordi Albornoz <jordi@src.gnome.org>
Sun, 5 Jan 2003 19:10:21 +0000 (19:10 +0000)
committerJordi Albornoz <jordi@src.gnome.org>
Sun, 5 Jan 2003 19:10:21 +0000 (19:10 +0000)
ChangeLog
src/commands.c
src/gtetrinet.c
src/gtetrinet.h
src/partyline.c

index 2805a3f1d42071a3beb75295581e53314e52a6db..f0e9be50d0e2536677e31a5c3582de458c212603 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,12 @@
-2003-01-05  Dani Carbonell <bocata@panete.net>
+2003-01-05  Jordi Mallach  <jordi@sindominio.net>
+
+       * src/commands.c (about_command): fix segfault when calling two about
+       dialogs. Patch from James Antill.
+
+       * src/gtetrinet.c (main): autofocus the text box when switching from
+       some notetab to partyline. Patch from James Antill.
+
+2003-01-05  Dani Carbonell  <bocata@panete.net>
 
        * TODO: updated.
 
index 25d662130830e9f0813020a2e9b765bef84a1e0a..b116af637a30e02fce52c1224faa24526db81ce6 100644 (file)
@@ -34,8 +34,6 @@
 #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),
@@ -223,6 +221,7 @@ void about_command (GtkWidget *widget, gpointer data)
 {
     GtkWidget *hbox;
     GdkPixbuf *logo;
+    static GtkWidget *about = NULL;
 
     if (!GTK_IS_WINDOW (about))
     {
@@ -258,6 +257,9 @@ void about_command (GtkWidget *widget, gpointer data)
                          hbox, TRUE, FALSE, 0);
       gtk_widget_show_all (hbox);
 
+      g_signal_connect(G_OBJECT(about), "destroy",
+                      G_CALLBACK(gtk_widget_destroyed), &about);
+
       gtk_widget_show (about);
     }
     else
index 798a9d3494a94069d87a8ab53a913ec82f03fd5e..f0343a9f50277fad74aceb5aaa6a52a96d712a28 100644 (file)
@@ -216,9 +216,9 @@ int main (int argc, char *argv[])
     gtk_notebook_append_page (GTK_NOTEBOOK(notebook), pwinlist, label);
 
     /* add signal to focus the text entry when switching to the partyline page*/
-    g_signal_connect (G_OBJECT (notebook), "switch_page",
-                   GTK_SIGNAL_FUNC (partyline_switch_entryfocus),
-                   NULL);
+    g_signal_connect_after(G_OBJECT (notebook), "switch_page",
+                          GTK_SIGNAL_FUNC (partyline_switch_entryfocus),
+                          NULL);
 
     gtk_widget_show (notebook);
     gtk_widget_show (app);
@@ -396,7 +396,7 @@ static int gtetrinet_key (int keyval, int mod)
     case GDK_1: gtk_notebook_set_page (GTK_NOTEBOOK(notebook), 0); break;
     case GDK_2:
         gtk_notebook_set_page (GTK_NOTEBOOK(notebook), 1);
-        partyline_entryfocus();
+        /* partyline_entryfocus(); */
         break;
     case GDK_3: gtk_notebook_set_page (GTK_NOTEBOOK(notebook), 2); break;
     default:
index 1b4fe27c21d78011cf20cd1d1006ebf8728734fc..05d5d4541a65d22a78a7fe94a771da43cdafe7a7 100644 (file)
@@ -7,8 +7,6 @@
 
 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);
index 129bab7b671d50fbaff8ec4a3daaca39e4f9b810..00d266f4f314d50f66dd2604afbc5a4139b8c23a 100644 (file)
@@ -255,7 +255,7 @@ void partyline_entryfocus (void)
 }
 
 void partyline_switch_entryfocus (void)
-{
+{ /* FIXME: should only grab when in right notebook */
     if (connected) gtk_widget_grab_focus (entrybox);
 }