[gnome-applets/wip/muktupavels/help-about] trash: use gp_applet_show_help



commit bdbd82c00f853df45f45ddbb0e1b8544432ebea3
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Apr 3 17:05:13 2020 +0300

    trash: use gp_applet_show_help

 gnome-applets/ga-module.c          |  1 +
 gnome-applets/trash/trash-applet.c | 34 ++++++++--------------------------
 2 files changed, 9 insertions(+), 26 deletions(-)
---
diff --git a/gnome-applets/ga-module.c b/gnome-applets/ga-module.c
index cca31eabe..24fcbae00 100644
--- a/gnome-applets/ga-module.c
+++ b/gnome-applets/ga-module.c
@@ -227,6 +227,7 @@ ga_get_applet_info (const char *id)
       icon_name = "user-trash-full";
 
       about_func = trash_applet_setup_about;
+      help_uri = "help:trashapplet";
     }
   else if (g_strcmp0 (id, "window-buttons") == 0)
     {
diff --git a/gnome-applets/trash/trash-applet.c b/gnome-applets/trash/trash-applet.c
index 8c2a26cab..a18cdc630 100644
--- a/gnome-applets/trash/trash-applet.c
+++ b/gnome-applets/trash/trash-applet.c
@@ -50,9 +50,14 @@ static void trash_applet_do_empty    (GSimpleAction *action,
 static void trash_applet_open_folder (GSimpleAction *action,
                                       GVariant      *parameter,
                                       gpointer       user_data);
-static void trash_applet_show_help   (GSimpleAction *action,
-                                      GVariant      *parameter,
-                                      gpointer       user_data);
+
+static void
+trash_applet_show_help (GSimpleAction *action,
+                        GVariant      *parameter,
+                        gpointer       user_data)
+{
+  gp_applet_show_help (GP_APPLET (user_data), NULL);
+}
 
 static void
 trash_applet_show_about (GSimpleAction *action,
@@ -329,29 +334,6 @@ trash_applet_open_folder (GSimpleAction *action,
     }
 }
 
-static void
-trash_applet_show_help (GSimpleAction *action,
-                        GVariant      *parameter,
-                        gpointer       user_data)
-{
-  TrashApplet *applet = (TrashApplet *) user_data;
-  GError *err = NULL;
-
-  /* FIXME - Actually, we need a user guide */
-  gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (applet)),
-                "help:trashapplet",
-                gtk_get_current_event_time (),
-                &err);
-
-  if (err)
-    {
-      error_dialog (applet,
-                    _("There was an error displaying help: %s"),
-                    err->message);
-      g_error_free (err);
-    }
-}
-
 static gboolean
 confirm_delete_immediately (GtkWidget *parent_view,
                             gint num_files,


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