Fixed/fortifie libgnomeui compatibility regarding modal dialogs closing.
authorlace <>
Wed, 25 Jan 2006 19:31:03 +0000 (19:31 +0000)
committerlace <>
Wed, 25 Jan 2006 19:31:03 +0000 (19:31 +0000)
 - There was stale dialog crashing on the 2nd click with: libgnomeui-2.10.0-1

src/install/acquire/ui-gnome.c

index 8f98f98..e6ffc43 100644 (file)
@@ -36,6 +36,7 @@
 #include <libgnomeui/gnome-druid-page-edge.h>
 #include "final.h"
 #include <libgnomevfs/gnome-vfs-utils.h>
+#include <libgnomeui/gnome-dialog.h>
 
 #include <captive/macros.h>
 #include <captive/captivemodid.h>
@@ -614,11 +615,15 @@ gint reply;
                        (GnomeReplyCallback)on_DruidButtonOK_clicked_dialog_callback,
                        &reply);        /* data */
        g_signal_connect((gpointer)dialog,"close",G_CALLBACK(gtk_main_quit),NULL);
+       /* It looks as if eariler libgnomeui had default TRUE
+        * but since libgnomeui-2.10.0 it is FALSE, weird.
+        */
+       gnome_dialog_set_close(GNOME_DIALOG(dialog),TRUE);
        /* Never call gtk_main() from other thread than the initial one.
         * We would have to switch GTK+ context (g_main_context()?).
         */
        gtk_main();
-       /* 'dialog' gets destroyed automatically */
+       /* 'dialog' gets destroyed automatically due to: gnome_dialog_set_close(,TRUE); */
        if (reply==0)   /* 0 for 'OK', 1 for 'Cancel', left -1 for dialog close. */
                exit(EXIT_SUCCESS);
 }
@@ -745,9 +750,13 @@ GtkWidget *dialog;
                dialog=gnome_app_message(App,message);
 
        gtk_window_set_modal(GTK_WINDOW(dialog),TRUE);
+       /* It looks as if eariler libgnomeui had default TRUE
+        * but since libgnomeui-2.10.0 it is FALSE, weird.
+        */
+       gnome_dialog_set_close(GNOME_DIALOG(dialog),TRUE);
        g_signal_connect((gpointer)dialog,"close",G_CALLBACK(gtk_main_quit),NULL);
        gtk_main();
-       /* 'dialog' gets destroyed automatically */
+       /* 'dialog' gets destroyed automatically due to: gnome_dialog_set_close(,TRUE); */
 
        gdk_flush();
        gdk_threads_leave();