[gnome-applets/wip/muktupavels/help-about] battstat: 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] battstat: use gp_applet_show_help
- Date: Tue, 31 Mar 2020 19:20:25 +0000 (UTC)
commit 3edd8da579c1432a25a3003172c36b348aa794c0
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Tue Mar 31 22:14:07 2020 +0300
battstat: use gp_applet_show_help
gnome-applets/battstat/battstat-applet.c | 37 +-------------------------------
gnome-applets/battstat/battstat.h | 1 -
gnome-applets/battstat/properties.c | 4 ++--
3 files changed, 3 insertions(+), 39 deletions(-)
---
diff --git a/gnome-applets/battstat/battstat-applet.c b/gnome-applets/battstat/battstat-applet.c
index 20c6df816..85886295d 100644
--- a/gnome-applets/battstat/battstat-applet.c
+++ b/gnome-applets/battstat/battstat-applet.c
@@ -1063,40 +1063,6 @@ check_for_updates( gpointer data )
return TRUE;
}
-/* Common function invoked by the 'Help' context menu item and the 'Help'
- * button in the preferences dialog.
- */
-void
-battstat_show_help( ProgressData *battstat, const char *section )
-{
- GError *error = NULL;
- char *uri;
-
- if (section)
- uri = g_strdup_printf ("help:battstat/%s", section);
- else
- uri = g_strdup ("help:battstat");
-
- gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (battstat)),
- uri,
- gtk_get_current_event_time (),
- &error);
-
- g_free (uri);
-
- if( error )
- {
- char *message;
-
- message = g_strdup_printf( _("There was an error displaying help: %s"),
- error->message );
- battstat_error_dialog (GTK_WIDGET (battstat), message);
- g_error_free( error );
- g_free( message );
- }
-}
-
-
/* Called when the user selects the 'help' menu item.
*/
static void
@@ -1104,8 +1070,7 @@ help_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- ProgressData *battstat = (ProgressData *) user_data;
- battstat_show_help( battstat, NULL );
+ gp_applet_show_help (GP_APPLET (user_data), NULL);
}
/* Called when the user selects the 'about' menu item.
diff --git a/gnome-applets/battstat/battstat.h b/gnome-applets/battstat/battstat.h
index 0ccf427e5..79935b6d9 100644
--- a/gnome-applets/battstat/battstat.h
+++ b/gnome-applets/battstat/battstat.h
@@ -160,6 +160,5 @@ void prop_cb (GSimpleAction *, GVariant *, gpointer);
/* battstat_applet.c */
void reconfigure_layout( ProgressData *battstat );
-void battstat_show_help( ProgressData *battstat, const char *section );
#endif /* _battstat_h_ */
diff --git a/gnome-applets/battstat/properties.c b/gnome-applets/battstat/properties.c
index 8a2bf58a4..ff85fece4 100644
--- a/gnome-applets/battstat/properties.c
+++ b/gnome-applets/battstat/properties.c
@@ -185,9 +185,9 @@ static void
response_cb (GtkDialog *dialog, gint id, gpointer data)
{
ProgressData *battstat = data;
-
+
if (id == GTK_RESPONSE_HELP)
- battstat_show_help (battstat, "battstat-appearance");
+ gp_applet_show_help (GP_APPLET (battstat), "battstat-appearance");
else
gtk_widget_hide (GTK_WIDGET (battstat->prop_win));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]