[gnome-games] gnibbles: Better error message if clutter fails to init
- From: Thomas Hindoe Paaboel Andersen <thomashpa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] gnibbles: Better error message if clutter fails to init
- Date: Thu, 17 Mar 2011 22:22:56 +0000 (UTC)
commit 82602fe728f35f113026f43d482ad355d93db246
Author: Thomas Hindoe Paaboel Andersen <phomes gmail com>
Date: Thu Mar 17 23:20:50 2011 +0100
gnibbles: Better error message if clutter fails to init
gnibbles/main.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/gnibbles/main.c b/gnibbles/main.c
index 37851cd..802793b 100644
--- a/gnibbles/main.c
+++ b/gnibbles/main.c
@@ -1004,7 +1004,19 @@ main (int argc, char **argv)
setgid_io_init ();
#endif
- gtk_clutter_init (&argc, &argv);
+ g_set_application_name (_("Nibbles"));
+
+ if (gtk_clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS) {
+ GtkWidget *dialog = gtk_message_dialog_new (NULL,
+ GTK_DIALOG_MODAL,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_NONE,
+ "%s", "Unable to initialize Clutter.");
+ gtk_window_set_title (GTK_WINDOW (dialog), g_get_application_name ());
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+ exit (1);
+ }
context = g_option_context_new (NULL);
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
@@ -1018,8 +1030,6 @@ main (int argc, char **argv)
exit (1);
}
- g_set_application_name (_("Nibbles"));
-
gtk_window_set_default_icon_name ("gnome-gnibbles");
srand (time (NULL));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]