[gnome-panel] panel: Remove more obsolete help code



commit abe4720d00bcc5538bf2d66b578e6f0758e799b3
Author: Vincent Untz <vuntz gnome org>
Date:   Wed Feb 8 09:26:44 2012 +0100

    panel: Remove more obsolete help code

 gnome-panel/libpanel-util/panel-show.c |   66 --------------------------------
 gnome-panel/libpanel-util/panel-show.h |    5 --
 gnome-panel/panel-addto.c              |    1 -
 gnome-panel/panel-ditem-editor.c       |   17 --------
 gnome-panel/panel-menu-bar.c           |    1 -
 gnome-panel/panel-menu-button.c        |    6 +--
 gnome-panel/panel-properties-dialog.c  |    5 --
 gnome-panel/panel-run-dialog.c         |    4 --
 8 files changed, 1 insertions(+), 104 deletions(-)
---
diff --git a/gnome-panel/libpanel-util/panel-show.c b/gnome-panel/libpanel-util/panel-show.c
index fdf1c0f..a1d4f11 100644
--- a/gnome-panel/libpanel-util/panel-show.c
+++ b/gnome-panel/libpanel-util/panel-show.c
@@ -228,69 +228,3 @@ panel_show_uri_force_mime_type (GdkScreen    *screen,
 
 	return ret;
 }
-
-static void
-_panel_show_help_error_dialog (const gchar *doc,
-			       GdkScreen   *screen,
-			       const gchar *message)
-{
-	char *primary;
-
-	primary = g_markup_printf_escaped (_("Could not display help document '%s'"),
-					   doc);
-	panel_error_dialog (NULL, screen, "cannot_show_help", TRUE,
-			    primary, message);
-	g_free (primary);
-}
-
-static gboolean
-_panel_show_help_handle_error (const gchar  *doc,
-			       GdkScreen    *screen,
-			       GError       *local_error,
-			       GError      **error)
-{
-	if (local_error == NULL)
-		return TRUE;
-
-	else if (g_error_matches (local_error,
-				  G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
-		g_error_free (local_error);
-		return TRUE;
-	}
-
-	else if (error != NULL)
-		g_propagate_error (error, local_error);
-
-	else {
-		_panel_show_help_error_dialog (doc, screen,
-					       local_error->message);
-		g_error_free (local_error);
-	}
-
-	return FALSE;
-}
-
-gboolean
-panel_show_help (GdkScreen    *screen,
-		 const gchar  *doc,
-		 const gchar  *link,
-		 GError      **error)
-{
-	GError *local_error = NULL;
-	char   *uri;
-
-	g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
-	g_return_val_if_fail (doc != NULL, FALSE);
-	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-
-	if (link)
-		uri = g_strdup_printf ("ghelp:%s?%s", doc, link);
-	else
-		uri = g_strdup_printf ("ghelp:%s", doc);
-
-	gtk_show_uri (screen, uri, gtk_get_current_event_time (), &local_error);
-
-	g_free (uri);
-
-	return _panel_show_help_handle_error (doc, screen, local_error, error);
-}
diff --git a/gnome-panel/libpanel-util/panel-show.h b/gnome-panel/libpanel-util/panel-show.h
index ba43fd0..a7b52d1 100644
--- a/gnome-panel/libpanel-util/panel-show.h
+++ b/gnome-panel/libpanel-util/panel-show.h
@@ -40,11 +40,6 @@ gboolean panel_show_uri_force_mime_type (GdkScreen    *screen,
 					 guint32       timestamp,
 					 GError      **error);
 
-gboolean panel_show_help (GdkScreen    *screen,
-			  const gchar  *doc,
-			  const gchar  *link,
-			  GError      **error);
-
 G_END_DECLS
 
 #endif /* PANEL_SHOW_H */
diff --git a/gnome-panel/panel-addto.c b/gnome-panel/panel-addto.c
index 8d6b5cb..32a14f5 100644
--- a/gnome-panel/panel-addto.c
+++ b/gnome-panel/panel-addto.c
@@ -30,7 +30,6 @@
 #include <gmenu-tree.h>
 
 #include <libpanel-util/panel-glib.h>
-#include <libpanel-util/panel-show.h>
 
 #include "launcher.h"
 #include "panel.h"
diff --git a/gnome-panel/panel-ditem-editor.c b/gnome-panel/panel-ditem-editor.c
index 1c1cabb..079e416 100644
--- a/gnome-panel/panel-ditem-editor.c
+++ b/gnome-panel/panel-ditem-editor.c
@@ -32,7 +32,6 @@
 
 #include <libpanel-util/panel-icon-chooser.h>
 #include <libpanel-util/panel-keyfile.h>
-#include <libpanel-util/panel-show.h>
 #include <libpanel-util/panel-xdg.h>
 
 #include "panel-ditem-editor.h"
@@ -76,7 +75,6 @@ struct _PanelDItemEditorPrivate
 	GtkWidget *comment_entry;
 	GtkWidget *icon_chooser;
 
-	GtkWidget *help_button;
 	GtkWidget *revert_button;
 	GtkWidget *close_button;
 	GtkWidget *cancel_button;
@@ -662,9 +660,6 @@ panel_ditem_editor_make_ui (PanelDItemEditor *dialog)
 	gtk_label_set_mnemonic_widget (GTK_LABEL (priv->comment_label),
 				       priv->comment_entry);
 
-	priv->help_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
-						   GTK_STOCK_HELP,
-						   GTK_RESPONSE_HELP);
 	priv->revert_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
 						     GTK_STOCK_REVERT_TO_SAVED,
 						     REVERT_BUTTON);
@@ -1448,19 +1443,7 @@ static void
 response_cb (GtkDialog *dialog,
 	     gint       response_id)
 {
-	GError *error = NULL;
-
 	switch (response_id) {
-	case GTK_RESPONSE_HELP:
-		if (!panel_show_help (gtk_window_get_screen (GTK_WINDOW (dialog)),
-				      "user-guide", "gospanel-52", &error)) {
-			g_signal_emit (G_OBJECT (dialog),
-				       ditem_edit_signals[ERROR_REPORTED], 0,
-				       _("Could not display help document"),
-				       error->message);
-			g_error_free (error);
-		}
-		break;
 	case REVERT_BUTTON:
 		panel_ditem_editor_revert (PANEL_DITEM_EDITOR (dialog));
 		gtk_dialog_set_response_sensitive (dialog,
diff --git a/gnome-panel/panel-menu-bar.c b/gnome-panel/panel-menu-bar.c
index acb1217..a466d20 100644
--- a/gnome-panel/panel-menu-bar.c
+++ b/gnome-panel/panel-menu-bar.c
@@ -33,7 +33,6 @@
 
 #include <libpanel-util/panel-error.h>
 #include <libpanel-util/panel-launch.h>
-#include <libpanel-util/panel-show.h>
 
 #include "applet.h"
 #include "menu.h"
diff --git a/gnome-panel/panel-menu-button.c b/gnome-panel/panel-menu-button.c
index c852189..3b34fe1 100644
--- a/gnome-panel/panel-menu-button.c
+++ b/gnome-panel/panel-menu-button.c
@@ -34,7 +34,6 @@
 #include <libpanel-util/panel-error.h>
 #include <libpanel-util/panel-glib.h>
 #include <libpanel-util/panel-launch.h>
-#include <libpanel-util/panel-show.h>
 
 #include "applet.h"
 #include "panel-widget.h"
@@ -847,10 +846,7 @@ panel_menu_button_invoke_menu (PanelMenuButton *button,
 
 	screen = gtk_widget_get_screen (GTK_WIDGET (button));
 
-	if (!strcmp (callback_name, "help")) {
-		panel_show_help (screen, "user-guide", "gospanel-37", NULL);
-
-	} else if (!strcmp (callback_name, "edit")) {
+	if (!strcmp (callback_name, "edit")) {
                 GError *error = NULL;
 
 		panel_launch_desktop_file_with_fallback ("alacarte.desktop",
diff --git a/gnome-panel/panel-properties-dialog.c b/gnome-panel/panel-properties-dialog.c
index 4320679..e9b42be 100644
--- a/gnome-panel/panel-properties-dialog.c
+++ b/gnome-panel/panel-properties-dialog.c
@@ -30,7 +30,6 @@
 #include <libpanel-util/panel-glib.h>
 #include <libpanel-util/panel-gtk.h>
 #include <libpanel-util/panel-icon-chooser.h>
-#include <libpanel-util/panel-show.h>
 
 #include "panel-icon-names.h"
 #include "panel-schemas.h"
@@ -690,10 +689,6 @@ panel_properties_dialog_response (PanelPropertiesDialog *dialog,
 	case GTK_RESPONSE_CLOSE:
 		gtk_widget_destroy (properties_dialog);
 		break;
-	case GTK_RESPONSE_HELP:
-		panel_show_help (gtk_window_get_screen (GTK_WINDOW (properties_dialog)),
-				 "user-guide", "gospanel-28", NULL);
-		break;
 	default:
 		break;
 	}
diff --git a/gnome-panel/panel-run-dialog.c b/gnome-panel/panel-run-dialog.c
index 7b5a8dc..35905ef 100644
--- a/gnome-panel/panel-run-dialog.c
+++ b/gnome-panel/panel-run-dialog.c
@@ -470,10 +470,6 @@ panel_run_dialog_response (PanelRunDialog *dialog,
 	case GTK_RESPONSE_CANCEL:
 		gtk_widget_destroy (dialog->run_dialog);
 		break;
-	case GTK_RESPONSE_HELP:
-		panel_show_help (gtk_window_get_screen (GTK_WINDOW (run_dialog)),
-				 "user-guide", "gospanel-23", NULL);
-		break;
 	default:
 		break;
 	}



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