[gnome-applets/wip/muktupavels/help-about: 2/3] accessx-status: use gp_applet_show_help
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets/wip/muktupavels/help-about: 2/3] accessx-status: use gp_applet_show_help
- Date: Tue, 31 Mar 2020 18:41:22 +0000 (UTC)
commit 5f0e92c64fdc3c4b4bf27b54d7b1f9a758b72344
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Tue Mar 31 21:26:47 2020 +0300
accessx-status: use gp_applet_show_help
configure.ac | 2 +-
.../accessx-status/accessx-status-applet.c | 32 +---------------------
gnome-applets/ga-module.c | 8 ++++++
3 files changed, 10 insertions(+), 32 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ba2049fe9..1e32fc15b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,7 +63,7 @@ GTK_REQUIRED=3.20.0
GLIB_REQUIRED=2.44.0
GIO_REQUIRED=2.26.0
LIBPANEL_REQUIRED=3.24.1
-LIBGNOME_PANEL_REQUIRED=3.36.0
+LIBGNOME_PANEL_REQUIRED=3.37.0
LIBGTOP_REQUIRED=2.11.92
LIBWNCK_REQUIRED=3.14.1
LIBNOTIFY_REQUIRED=0.7
diff --git a/gnome-applets/accessx-status/accessx-status-applet.c
b/gnome-applets/accessx-status/accessx-status-applet.c
index 53c724ae5..6d80078b1 100644
--- a/gnome-applets/accessx-status/accessx-status-applet.c
+++ b/gnome-applets/accessx-status/accessx-status-applet.c
@@ -215,37 +215,7 @@ help_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- AccessxStatusApplet *sapplet = (AccessxStatusApplet *) user_data;
- GError *error = NULL;
-
- gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (sapplet)),
- "help:accessx-status",
- gtk_get_current_event_time (),
- &error);
-
- if (error) {
- GtkWidget *parent =
- gtk_widget_get_parent (GTK_WIDGET (sapplet));
-
- GtkWidget *dialog =
- gtk_message_dialog_new (GTK_WINDOW (parent),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_CLOSE,
- _("There was an error launching the help viewer: %s"),
- error->message);
-
- g_signal_connect (G_OBJECT (dialog),
- "response",
- G_CALLBACK (gtk_widget_destroy), NULL);
-
- gtk_window_set_screen (GTK_WINDOW (dialog),
- gtk_widget_get_screen (GTK_WIDGET (sapplet)));
- gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
-
- gtk_widget_show (dialog);
- g_error_free (error);
- }
+ gp_applet_show_help (GP_APPLET (user_data), NULL);
}
static void
diff --git a/gnome-applets/ga-module.c b/gnome-applets/ga-module.c
index 4cb08afd2..cf0eb1823 100644
--- a/gnome-applets/ga-module.c
+++ b/gnome-applets/ga-module.c
@@ -53,14 +53,19 @@ ga_get_applet_info (const char *id)
const char *name;
const char *description;
const char *icon_name;
+ const char *help_uri;
GpAppletInfo *info;
+ help_uri = NULL;
+
if (g_strcmp0 (id, "accessx-status") == 0)
{
type_func = accessx_status_applet_get_type;
name = _("Keyboard Accessibility Status");
description = _("Shows the status of keyboard accessibility features");
icon_name = "ax-applet";
+
+ help_uri = "help:accessx-status";
}
else if (g_strcmp0 (id, "battstat") == 0)
{
@@ -207,6 +212,9 @@ ga_get_applet_info (const char *id)
info = gp_applet_info_new (type_func, name, description, icon_name);
+ if (help_uri != NULL)
+ gp_applet_info_set_help_uri (info, help_uri);
+
return info;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]