[gnome-applets/wip/muktupavels/help-about] netspeed: 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] netspeed: use gp_applet_show_about
- Date: Fri, 3 Apr 2020 14:24:46 +0000 (UTC)
commit 09d1535f964e42603fc81d029252ea1e5d294ffc
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Fri Apr 3 16:26:25 2020 +0300
netspeed: use gp_applet_show_about
gnome-applets/ga-module.c | 2 ++
gnome-applets/netspeed/netspeed-applet.c | 53 +++++++++++++++++---------------
gnome-applets/netspeed/netspeed-applet.h | 2 ++
3 files changed, 33 insertions(+), 24 deletions(-)
---
diff --git a/gnome-applets/ga-module.c b/gnome-applets/ga-module.c
index 115e38d1d..2b8fceabe 100644
--- a/gnome-applets/ga-module.c
+++ b/gnome-applets/ga-module.c
@@ -185,6 +185,8 @@ ga_get_applet_info (const char *id)
name = _("Network Monitor");
description = _("Netspeed Applet");
icon_name = "netspeed-applet";
+
+ about_func = netspeed_applet_setup_about;
}
else if (g_strcmp0 (id, "sticky-notes") == 0)
{
diff --git a/gnome-applets/netspeed/netspeed-applet.c b/gnome-applets/netspeed/netspeed-applet.c
index 4018360ba..5311354f1 100644
--- a/gnome-applets/netspeed/netspeed-applet.c
+++ b/gnome-applets/netspeed/netspeed-applet.c
@@ -49,7 +49,6 @@ static const char* wireless_quality_icon[] = {
static const char IN_ICON[] = "go-down";
static const char OUT_ICON[] = "go-up";
static const char ERROR_ICON[] = "gtk-dialog-error";
-static const char LOGO_ICON[] = "netspeed-applet";
/* How many old in out values do we store?
* The value actually shown in the applet is the average
@@ -599,34 +598,12 @@ help_cb (GSimpleAction *action,
netspeed_applet_display_help (netspeed, NULL);
}
-/* Just the about window... If it's already open, just fokus it
- */
static void
about_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- const char *authors[] =
- {
- "Jörgen Scheibengruber <mfcn gmx de>",
- "Dennis Cranston <dennis_cranston yahoo com>",
- "Pedro Villavicencio Garrido <pvillavi gnome org>",
- "Benoît Dejean <benoit placenet org>",
- NULL
- };
-
- gtk_show_about_dialog (NULL,
- "version", VERSION,
- "copyright", "Copyright 2002 - 2010 Jörgen Scheibengruber",
- "comments", _("A little applet that displays some information on the traffic
on the specified network device"),
- "authors", authors,
- "documenters", NULL,
- "translator-credits", _("translator-credits"),
- "website", "http://www.gnome.org/projects/netspeed/",
- "website-label", _("Netspeed Website"),
- "logo-icon-name", LOGO_ICON,
- NULL);
-
+ gp_applet_show_about (GP_APPLET (user_data));
}
static void
@@ -1556,3 +1533,31 @@ netspeed_applet_get_auto_device_name (void)
return g_strdup ("lo");
}
+
+void
+netspeed_applet_setup_about (GtkAboutDialog *dialog)
+{
+ const char *comments;
+ const char **authors;
+ const char *copyright;
+
+ comments = _("A little applet that displays some information on the "
+ "traffic on the specified network device");
+
+ authors = (const char *[])
+ {
+ "Jörgen Scheibengruber <mfcn gmx de>",
+ "Dennis Cranston <dennis_cranston yahoo com>",
+ "Pedro Villavicencio Garrido <pvillavi gnome org>",
+ "Benoît Dejean <benoit placenet org>",
+ NULL
+ };
+
+ copyright = "Copyright 2002 - 2010 Jörgen Scheibengruber";
+
+ gtk_about_dialog_set_comments (dialog, comments);
+
+ gtk_about_dialog_set_authors (dialog, authors);
+ gtk_about_dialog_set_translator_credits (dialog, _("translator-credits"));
+ gtk_about_dialog_set_copyright (dialog, copyright);
+}
diff --git a/gnome-applets/netspeed/netspeed-applet.h b/gnome-applets/netspeed/netspeed-applet.h
index e13f607b6..949dcbaa5 100644
--- a/gnome-applets/netspeed/netspeed-applet.h
+++ b/gnome-applets/netspeed/netspeed-applet.h
@@ -36,4 +36,6 @@ GSettings *netspeed_applet_get_settings (NetspeedApplet *netspeed);
const gchar *netspeed_applet_get_current_device_name (NetspeedApplet *netspeed);
gchar *netspeed_applet_get_auto_device_name (void);
+void netspeed_applet_setup_about (GtkAboutDialog *dialog);
+
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]