[epiphany-extensions] manager: don't use ephy_gui_help



commit f367111b04542ecb712a7e1e6b863aa8ec27b6f7
Author: Diego Escalante Urrelo <descalante igalia com>
Date:   Sat Jan 23 10:34:35 2010 -0500

    manager: don't use ephy_gui_help
    
    We couldn't reuse the new ephy_gui_help because it receives only section names
    for the epiphany help, this means it prefixes everything with ghelp:epiphany.
    Extensions help is ghelp:epiphany-extensions, so we just copied a few lines
    from there.
    
    Bug #562763

 .../ephy-extensions-manager-ui-extension.c         |   25 +++++++++++++++--
 .../extensions-manager-ui/extensions-manager-ui.c  |   29 ++++++++++++++++---
 2 files changed, 46 insertions(+), 8 deletions(-)
---
diff --git a/extensions/extensions-manager-ui/ephy-extensions-manager-ui-extension.c b/extensions/extensions-manager-ui/ephy-extensions-manager-ui-extension.c
index 4221feb..af60196 100644
--- a/extensions/extensions-manager-ui/ephy-extensions-manager-ui-extension.c
+++ b/extensions/extensions-manager-ui/ephy-extensions-manager-ui-extension.c
@@ -1,6 +1,7 @@
 /*
  *  Copyright © 2003 Marco Pesenti Gritti
  *  Copyright © 2003 Christian Persch
+ *  Copyright © 2010 Igalia S.L.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -176,9 +177,27 @@ static void
 help_cb (GtkAction *action,
 	 EphyWindow *window)
 {
-	ephy_gui_help (GTK_WINDOW (window),
-		       "epiphany-extensions",
-		       "");
+	GdkScreen *screen;
+	GError *error = NULL;
+
+	screen = gtk_widget_get_screen (GTK_WIDGET (window));
+	gtk_show_uri (screen, "ghelp:epiphany-extensions",
+		      gtk_get_current_event_time (), &error);
+
+	if (error)
+	{
+		GtkWidget *errord;
+		errord = gtk_message_dialog_new (GTK_WINDOW (window),
+						 GTK_DIALOG_DESTROY_WITH_PARENT,
+						 GTK_MESSAGE_ERROR,
+						 GTK_BUTTONS_OK,
+						 _("Could not display help: %s"),
+						 error->message);
+		g_error_free (error);
+		g_signal_connect (errord, "response",
+				  G_CALLBACK (gtk_widget_destroy), NULL);
+		gtk_widget_show (errord);
+	}
 }
 
 static void
diff --git a/extensions/extensions-manager-ui/extensions-manager-ui.c b/extensions/extensions-manager-ui/extensions-manager-ui.c
index 3dc961e..f421bf9 100644
--- a/extensions/extensions-manager-ui/extensions-manager-ui.c
+++ b/extensions/extensions-manager-ui/extensions-manager-ui.c
@@ -1,5 +1,6 @@
 /*
  *  Copyright © 2004 Adam Hooper
+ *  Copyright © 2010 Igalia S.L.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -115,15 +116,33 @@ extensions_manager_ui_response_cb (GtkWidget *widget,
 				   int response,
 				   GObject *dialog)
 {
-	if (response == GTK_RESPONSE_HELP)
+	GdkScreen *screen;
+	GError *error = NULL;
+
+	if (response != GTK_RESPONSE_HELP)
 	{
-		ephy_gui_help (GTK_WINDOW (widget),
-			       "epiphany-extensions",
-			       "epi-ext-manager");
+		g_object_unref (dialog);
 		return;
 	}
 
-	g_object_unref (dialog);
+	screen = gtk_widget_get_screen (widget);
+	gtk_show_uri (screen, "ghelp:epiphany-extensions?epi-ext-manager",
+		      gtk_get_current_event_time (), &error);
+
+	if (error)
+	{
+		GtkWidget *errord;
+		errord = gtk_message_dialog_new (GTK_WINDOW (widget),
+						 GTK_DIALOG_DESTROY_WITH_PARENT,
+						 GTK_MESSAGE_ERROR,
+						 GTK_BUTTONS_OK,
+						 _("Could not display help: %s"),
+						 error->message);
+		g_error_free (error);
+		g_signal_connect (errord, "response",
+				  G_CALLBACK (gtk_widget_destroy), NULL);
+		gtk_widget_show (errord);
+	}
 }
 
 static void



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