gnome-games r8010 - trunk/glines



Author: thomashpa
Date: Mon Oct 13 11:50:19 2008
New Revision: 8010
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8010&view=rev

Log:
replace gnome_help_display with gtk_show_uri

Modified:
   trunk/glines/glines.c

Modified: trunk/glines/glines.c
==============================================================================
--- trunk/glines/glines.c	(original)
+++ trunk/glines/glines.c	Mon Oct 13 11:50:19 2008
@@ -1561,11 +1561,26 @@
 static void
 game_help_callback (GtkAction * action, gpointer data)
 {
-#ifdef HAVE_GNOME
-  gnome_help_display ("glines.xml", NULL, NULL);
-#else
-#warning need to port help to gtk-only!
-#endif /* HAVE_GNOME */
+  GdkScreen *screen;
+  GError *error = NULL;
+
+  screen = gtk_widget_get_screen (GTK_WIDGET (app));
+  gtk_show_uri (screen, "ghelp:glines", gtk_get_current_event_time (), &error);
+
+  if (error != NULL)
+  {
+    GtkWidget *d;
+    d = gtk_message_dialog_new (GTK_WINDOW (app), 
+                              GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+                              GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, 
+                              "%s", _("Unable to open help file"));
+    gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (d),
+                              "             %s", error->message);
+    g_signal_connect (d, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+    gtk_window_present (GTK_WINDOW (d));
+
+    g_error_free (error);
+  }
 }
 
 static int



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