[byzanz] Make showing errors not modal and not run their own main loop



commit 3ec207ec08bbc4c78054407330e9d47241a8397a
Author: Benjamin Otte <otte gnome org>
Date:   Sat Aug 15 18:33:56 2009 +0200

    Make showing errors not modal and not run their own main loop
    
    Also give the error windows an icon and fix an omission of updating the
    button state.

 src/byzanzapplet.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/byzanzapplet.c b/src/byzanzapplet.c
index 2d3d212..0512811 100644
--- a/src/byzanzapplet.c
+++ b/src/byzanzapplet.c
@@ -74,13 +74,15 @@ byzanz_applet_show_error (GtkWindow *parent, const char *error, const char *deta
   va_start (args, details);
   msg = g_strdup_vprintf (details, args);
   va_end (args);
-  dialog = gtk_message_dialog_new (parent, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR,
+  dialog = gtk_message_dialog_new (parent, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR,
       GTK_BUTTONS_CLOSE, "%s", error ? error : msg);
+  if (parent == NULL)
+    gtk_window_set_icon_name (GTK_WINDOW (dialog), "byzanz-record-desktop");
   if (error)
     gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%s", msg);
-  gtk_dialog_run (GTK_DIALOG (dialog));
-  gtk_widget_destroy (dialog);
   g_free (msg);
+  g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+  gtk_widget_show_all (dialog);
 }
 
 static void
@@ -258,7 +260,7 @@ byzanz_applet_start_recording (AppletPrivate *priv)
     byzanz_applet_show_error (NULL, _("Cannot start recording."),
 	_("Byzanz requires a 24bpp or 32bpp depth for recording. "
 	  "The current resolution is set to %dbpp."), gdk_drawable_get_depth (window));
-    return;
+    goto out;
   }
   
   priv->tmp_file = (char *) "SELECTING"; /* so the rest of the world thinks we're recording */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]