[gnome-games] libgames-support: Remove games-help.c



commit e53280dd392075bc8de302d6fc8ed2e14c8e48c6
Author: Robert Ancell <robert ancell canonical com>
Date:   Sun Jan 1 13:11:52 2012 +1100

    libgames-support: Remove games-help.c

 glines/src/glines.c                         |    8 +-
 gnect/src/main.c                            |    8 +-
 gnibbles/src/main.c                         |    8 +-
 gnobots2/src/menu.c                         |    8 +-
 gnomine/src/gnomine.vala                    |    9 ++-
 gnotravex/src/gnotravex.vala                |    9 ++-
 gnotski/src/gnotski.c                       |    8 +-
 gtali/src/gyahtzee.c                        |    8 +-
 iagno/src/iagno.vala                        |    9 ++-
 libgames-support/GnomeGamesSupport-1.0.vapi |    7 +-
 libgames-support/Makefile.am                |    2 -
 libgames-support/games-help.c               |  151 ---------------------------
 libgames-support/games-help.h               |   36 -------
 lightsoff/src/lightsoff.vala                |    9 ++-
 mahjongg/src/mahjongg.vala                  |    9 ++-
 15 files changed, 77 insertions(+), 212 deletions(-)
---
diff --git a/glines/src/glines.c b/glines/src/glines.c
index cc2d615..9f1da3d 100644
--- a/glines/src/glines.c
+++ b/glines/src/glines.c
@@ -37,7 +37,6 @@
 
 #include <libgames-support/games-files.h>
 #include <libgames-support/games-gridframe.h>
-#include <libgames-support/games-help.h>
 #include <libgames-support/games-preimage.h>
 #include <libgames-support/games-runtime.h>
 #include <libgames-support/games-scores.h>
@@ -1421,7 +1420,12 @@ game_quit_callback (GtkAction * action, gpointer data)
 void
 game_help_callback (GtkAction * action, gpointer data)
 {
-  games_help_display (app, "glines", NULL);
+  GError *error = NULL;
+
+  gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (app)), "ghelp:glines", gtk_get_current_event_time (), &error);
+  if (error)
+    g_warning ("Failed to show help: %s", error->message);
+  g_clear_error (&error);
 }
 
 static int
diff --git a/gnect/src/main.c b/gnect/src/main.c
index 382a25f..56f3272 100644
--- a/gnect/src/main.c
+++ b/gnect/src/main.c
@@ -31,7 +31,6 @@
 
 #include <libgames-support/games-conf.h>
 #include <libgames-support/games-gridframe.h>
-#include <libgames-support/games-help.h>
 #include <libgames-support/games-runtime.h>
 #include <libgames-support/games-stock.h>
 #include <libgames-support/games-fullscreen-action.h>
@@ -843,7 +842,12 @@ on_help_about (GtkAction * action, gpointer data)
 static void
 on_help_contents (GtkAction * action, gpointer data)
 {
-  games_help_display (app, "gnect", NULL);
+  GError *error = NULL;
+
+  gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (app)), "ghelp:gnect", gtk_get_current_event_time (), &error);
+  if (error)
+    g_warning ("Failed to show help: %s", error->message);
+  g_clear_error (&error);
 }
 
 
diff --git a/gnibbles/src/main.c b/gnibbles/src/main.c
index 21af74a..61050ca 100644
--- a/gnibbles/src/main.c
+++ b/gnibbles/src/main.c
@@ -32,7 +32,6 @@
 
 #include <libgames-support/games-conf.h>
 #include <libgames-support/games-gridframe.h>
-#include <libgames-support/games-help.h>
 #include <libgames-support/games-runtime.h>
 #include <libgames-support/games-scores.h>
 #include <libgames-support/games-stock.h>
@@ -593,7 +592,12 @@ show_cursor_cb (GtkWidget * widget, GdkEventMotion *event, gpointer data)
 static void
 help_cb (GtkAction * action, gpointer data)
 {
-  games_help_display (window, "gnibbles", NULL);
+  GError *error = NULL;
+
+  gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (window)), "ghelp:gnibbles", gtk_get_current_event_time (), &error);
+  if (error)
+    g_warning ("Failed to show help: %s", error->message);
+  g_clear_error (&error);
 }
 
 static const GtkActionEntry action_entry[] = {
diff --git a/gnobots2/src/menu.c b/gnobots2/src/menu.c
index c4f70de..f3ae434 100644
--- a/gnobots2/src/menu.c
+++ b/gnobots2/src/menu.c
@@ -26,7 +26,6 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 
-#include <libgames-support/games-help.h>
 #include <libgames-support/games-stock.h>
 #include <libgames-support/games-fullscreen-action.h>
 #include <libgames-support/games-scores.h>
@@ -231,7 +230,12 @@ quit_cb (GtkAction * action, gpointer data)
 static void
 help_cb (GtkAction * action, gpointer data)
 {
-  games_help_display (app, "gnobots2", NULL);
+  GError *error = NULL;
+
+  gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (app)), "ghelp:gnobots2", gtk_get_current_event_time (), &error);
+  if (error)
+    g_warning ("Failed to show help: %s", error->message);
+  g_clear_error (&error);
 }
 
 
diff --git a/gnomine/src/gnomine.vala b/gnomine/src/gnomine.vala
index 49a3d4a..12b67fa 100644
--- a/gnomine/src/gnomine.vala
+++ b/gnomine/src/gnomine.vala
@@ -689,7 +689,14 @@ public class GnoMine : Gtk.Application
 
     private void help_cb ()
     {
-        GnomeGamesSupport.help_display (window, "gnomine", null);
+        try
+        {
+            Gtk.show_uri (window.get_screen (), "ghelp:gnomine", Gtk.get_current_event_time ());
+        }
+        catch (Error e)
+        {
+            warning ("Failed to show help: %s", e.message);
+        }
     }
 
     private const Gtk.ActionEntry actions[] =
diff --git a/gnotravex/src/gnotravex.vala b/gnotravex/src/gnotravex.vala
index 950ec0c..3875182 100644
--- a/gnotravex/src/gnotravex.vala
+++ b/gnotravex/src/gnotravex.vala
@@ -209,7 +209,14 @@ public class Gnotravex : Gtk3.Application
 
     private void help_cb ()
     {
-        GnomeGamesSupport.help_display (window, "gnotravex", null);
+        try
+        {
+            Gtk.show_uri (window.get_screen (), "ghelp:gnotravex", Gtk.get_current_event_time ());
+        }
+        catch (Error e)
+        {
+            warning ("Failed to show help: %s", e.message);
+        }
     }
 
     private void about_cb ()
diff --git a/gnotski/src/gnotski.c b/gnotski/src/gnotski.c
index 50836c7..3d650c8 100644
--- a/gnotski/src/gnotski.c
+++ b/gnotski/src/gnotski.c
@@ -30,7 +30,6 @@
 
 #include <libgames-support/games-conf.h>
 #include <libgames-support/games-gridframe.h>
-#include <libgames-support/games-help.h>
 #include <libgames-support/games-preimage.h>
 #include <libgames-support/games-runtime.h>
 #include <libgames-support/games-scores.h>
@@ -1410,7 +1409,12 @@ prev_level_cb (GtkAction * action)
 void
 help_cb (GtkAction * action)
 {
-  games_help_display (window, "gnotski", NULL);
+  GError *error = NULL;
+
+  gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (window)), "ghelp:gnotski", gtk_get_current_event_time (), &error);
+  if (error)
+    g_warning ("Failed to show help: %s", error->message);
+  g_clear_error (&error);
 }
 
 void
diff --git a/gtali/src/gyahtzee.c b/gtali/src/gyahtzee.c
index 4583fac..33793bb 100644
--- a/gtali/src/gyahtzee.c
+++ b/gtali/src/gyahtzee.c
@@ -44,7 +44,6 @@
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
-#include <libgames-support/games-help.h>
 #include <libgames-support/games-stock.h>
 #include <libgames-support/games-scores.h>
 #include <libgames-support/games-scores-dialog.h>
@@ -703,7 +702,12 @@ update_undo_sensitivity (void)
 static void
 help_cb (GtkAction * action, gpointer data)
 {
-  games_help_display (window, "gtali", NULL);
+  GError *error = NULL;
+
+  gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (window)), "ghelp:gtali", gtk_get_current_event_time (), &error);
+  if (error)
+    g_warning ("Failed to show help: %s", error->message);
+  g_clear_error (&error);
 }
 
 
diff --git a/iagno/src/iagno.vala b/iagno/src/iagno.vala
index e682fbe..4360bde 100644
--- a/iagno/src/iagno.vala
+++ b/iagno/src/iagno.vala
@@ -295,7 +295,14 @@ public class Iagno : Gtk.Application
 
     private void help_cb (Gtk.Action action)
     {
-        GnomeGamesSupport.help_display (window, "iagno", null);
+        try
+        {
+            Gtk.show_uri (window.get_screen (), "ghelp:iagno", Gtk.get_current_event_time ());
+        }
+        catch (Error e)
+        {
+            warning ("Failed to show help: %s", e.message);
+        }
     }
 
     private void game_move_cb ()
diff --git a/libgames-support/GnomeGamesSupport-1.0.vapi b/libgames-support/GnomeGamesSupport-1.0.vapi
index e8524c5..55303ea 100644
--- a/libgames-support/GnomeGamesSupport-1.0.vapi
+++ b/libgames-support/GnomeGamesSupport-1.0.vapi
@@ -92,12 +92,7 @@ namespace GnomeGamesSupport
     public static int runtime_get_gpl_version  ();
     [CCode (cheader_filename = "games-runtime.h")]
     public static bool runtime_is_system_prefix ();
-   
-    [CCode (cheader_filename = "games-help.h")]
-    public static void help_display (Gtk.Widget window, string doc_module, string? section);
-    [CCode (cheader_filename = "games-help.h")]
-    public static bool help_display_full (Gtk.Widget window, string doc_module, string? section) throws GLib.Error;
-    
+
     [CCode (cheader_filename = "games-settings.h")]    
     public static void settings_bind_window_state (string path, Gtk.Window window);
 
diff --git a/libgames-support/Makefile.am b/libgames-support/Makefile.am
index 5443127..a6d3813 100644
--- a/libgames-support/Makefile.am
+++ b/libgames-support/Makefile.am
@@ -13,8 +13,6 @@ BUILT_SOURCES = \
 libgames_support_la_SOURCES =		\
 	games-conf.c			\
 	games-conf.h			\
-	games-help.c			\
-	games-help.h			\
 	games-runtime.c			\
 	games-runtime.h			\
 	games-show.c			\
diff --git a/lightsoff/src/lightsoff.vala b/lightsoff/src/lightsoff.vala
index e66f6fa..ef5eb53 100644
--- a/lightsoff/src/lightsoff.vala
+++ b/lightsoff/src/lightsoff.vala
@@ -95,7 +95,14 @@ public class LightsOff
     [CCode (cname = "G_MODULE_EXPORT help_cb", instance_pos = -1)]
     public void help_cb (Gtk.Widget widget)
     {
-        GnomeGamesSupport.help_display (window, "lightsoff", null);
+        try
+        {
+            Gtk.show_uri (window.get_screen (), "ghelp:lightsoff", Gtk.get_current_event_time ());
+        }
+        catch (Error e)
+        {
+            warning ("Failed to show help: %s", e.message);
+        }
     }
 
     [CCode (cname = "G_MODULE_EXPORT about_cb", instance_pos = -1)]
diff --git a/mahjongg/src/mahjongg.vala b/mahjongg/src/mahjongg.vala
index a0bfa8c..effc432 100644
--- a/mahjongg/src/mahjongg.vala
+++ b/mahjongg/src/mahjongg.vala
@@ -636,7 +636,14 @@ public class Mahjongg : Gtk.Application
 
     private void help_cb (Gtk.Action action)
     {
-        GnomeGamesSupport.help_display (window, "mahjongg", null);
+        try
+        {
+            Gtk.show_uri (window.get_screen (), "ghelp:mahjongg", Gtk.get_current_event_time ());
+        }
+        catch (Error e)
+        {
+            warning ("Failed to show help: %s", e.message);
+        }
     }
 
     private const Gtk.ActionEntry actions[] =



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