[gnome-applets/wip/muktupavels/help-about: 2/9] battstat: use gp_applet_show_about
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets/wip/muktupavels/help-about: 2/9] battstat: use gp_applet_show_about
- Date: Fri, 3 Apr 2020 01:50:39 +0000 (UTC)
commit b2e208db9570193400823283b3dac24616ed21fe
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Tue Mar 31 22:10:23 2020 +0300
battstat: use gp_applet_show_about
gnome-applets/battstat/battstat-applet.c | 79 +++++++++++++++++---------------
gnome-applets/battstat/battstat-applet.h | 2 +
gnome-applets/ga-module.c | 2 +
3 files changed, 47 insertions(+), 36 deletions(-)
---
diff --git a/gnome-applets/battstat/battstat-applet.c b/gnome-applets/battstat/battstat-applet.c
index 952a20d83..b8f6156b7 100644
--- a/gnome-applets/battstat/battstat-applet.c
+++ b/gnome-applets/battstat/battstat-applet.c
@@ -1115,42 +1115,7 @@ about_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- ProgressData *battstat = (ProgressData *) user_data;
- const gchar *authors[] = {
- "J\xC3\xB6rgen Pehrson <jp spektr eu org>",
- "Lennart Poettering <lennart poettering de> (Linux ACPI support)",
- "Seth Nickell <snickell stanford edu> (GNOME2 port)",
- "Davyd Madeley <davyd madeley id au>",
- "Ryan Lortie <desrt desrt ca>",
- "Joe Marcus Clarke <marcus FreeBSD org> (FreeBSD ACPI support)",
- NULL
- };
-
- const gchar *documenters[] = {
- "J\xC3\xB6rgen Pehrson <jp spektr eu org>",
- "Trevor Curtis <tcurtis somaradio ca>",
- "Davyd Madeley <davyd madeley id au>",
- NULL
- };
-
- char *comments = g_strdup_printf ("%s\n\n%s",
- _("This utility shows the status of your laptop battery."),
- _("upower backend enabled.")
- );
-
- gtk_show_about_dialog( NULL,
- "version", VERSION,
- "copyright", "\xC2\xA9 2000 The Gnulix Society, "
- "\xC2\xA9 2002-2005 Free Software Foundation and "
- "others",
- "comments", comments,
- "authors", authors,
- "documenters", documenters,
- "translator-credits", _("translator-credits"),
- "logo-icon-name", "battery",
- NULL );
-
- g_free (comments);
+ gp_applet_show_about (GP_APPLET (user_data));
}
/* Rotate text on side panels. Called on initial startup and when the
@@ -1572,3 +1537,45 @@ battstat_applet_init (BattstatApplet *self)
{
gp_applet_set_flags (GP_APPLET (self), GP_APPLET_FLAGS_EXPAND_MINOR);
}
+
+void
+battstat_applet_setup_about (GtkAboutDialog *dialog)
+{
+ const char *comments;
+ const char **authors;
+ const char **documenters;
+ const char *copyright;
+
+ comments = _("This utility shows the status of your laptop battery.\n\n"
+ "UPower backend enabled.");
+
+ authors = (const char *[])
+ {
+ "J\xC3\xB6rgen Pehrson <jp spektr eu org>",
+ "Lennart Poettering <lennart poettering de> (Linux ACPI support)",
+ "Seth Nickell <snickell stanford edu> (GNOME2 port)",
+ "Davyd Madeley <davyd madeley id au>",
+ "Ryan Lortie <desrt desrt ca>",
+ "Joe Marcus Clarke <marcus FreeBSD org> (FreeBSD ACPI support)",
+ NULL
+ };
+
+ documenters = (const char *[])
+ {
+ "J\xC3\xB6rgen Pehrson <jp spektr eu org>",
+ "Trevor Curtis <tcurtis somaradio ca>",
+ "Davyd Madeley <davyd madeley id au>",
+ NULL
+ };
+
+ copyright = "\xC2\xA9 2000 The Gnulix Society, "
+ "\xC2\xA9 2002-2005 Free Software Foundation and "
+ "others";
+
+ gtk_about_dialog_set_comments (dialog, comments);
+
+ gtk_about_dialog_set_authors (dialog, authors);
+ gtk_about_dialog_set_documenters (dialog, documenters);
+ gtk_about_dialog_set_translator_credits (dialog, _("translator-credits"));
+ gtk_about_dialog_set_copyright (dialog, copyright);
+}
diff --git a/gnome-applets/battstat/battstat-applet.h b/gnome-applets/battstat/battstat-applet.h
index 2a4768b8c..043e10621 100644
--- a/gnome-applets/battstat/battstat-applet.h
+++ b/gnome-applets/battstat/battstat-applet.h
@@ -26,6 +26,8 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (BattstatApplet, battstat_applet,
BATTSTAT, APPLET, GpApplet)
+void battstat_applet_setup_about (GtkAboutDialog *dialog);
+
G_END_DECLS
#endif
diff --git a/gnome-applets/ga-module.c b/gnome-applets/ga-module.c
index 676915677..80756deb5 100644
--- a/gnome-applets/ga-module.c
+++ b/gnome-applets/ga-module.c
@@ -76,6 +76,8 @@ ga_get_applet_info (const char *id)
name = _("Battery Charge Monitor");
description = _("Monitor a laptop's remaining power");
icon_name = "battery";
+
+ about_func = battstat_applet_setup_about;
}
else if (g_strcmp0 (id, "brightness") == 0)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]