[Xfce4-commits] <xfce4-cpufreq-plugin:master> Add a proper "About" dialog.
Harald Judt
noreply at xfce.org
Sun Aug 18 11:32:31 CEST 2013
Updating branch refs/heads/master
to dd8b31632c78fce476e7fa7cb022d45bbca33407 (commit)
from 41af8d0c4fc3a83d0578b337f73d8d1a7db77ab1 (commit)
commit dd8b31632c78fce476e7fa7cb022d45bbca33407
Author: Harald Judt <h.judt at gmx.at>
Date: Sun Aug 18 01:22:40 2013 +0200
Add a proper "About" dialog.
panel-plugin/xfce4-cpufreq-plugin.c | 31 ++++++++++++++++++++++++++++++-
panel-plugin/xfce4-cpufreq-plugin.h | 2 ++
2 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/panel-plugin/xfce4-cpufreq-plugin.c b/panel-plugin/xfce4-cpufreq-plugin.c
index 0474f74..30b8e57 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -537,6 +537,32 @@ cpufreq_set_size (XfcePanelPlugin *plugin, gint size, CpuFreqPlugin *cpufreq)
return TRUE;
}
+cpufreq_show_about(XfcePanelPlugin *plugin,
+ CpuFreqPlugin *cpufreq)
+{
+ GdkPixbuf *icon;
+ const gchar *auth[] = {
+ "Thomas Schreck <shrek at xfce.org>",
+ "Florian Rivoal <frivoal at xfce.org>",
+ "Harald Judt <h.judt at gmx.at>",
+ NULL };
+ icon = xfce_panel_pixbuf_from_source("xfce4-cpufreq-plugin", NULL, 48);
+ gtk_show_about_dialog
+ (NULL,
+ "logo", icon,
+ "license", xfce_get_license_text(XFCE_LICENSE_TEXT_GPL),
+ "version", PACKAGE_VERSION,
+ "program-name", PACKAGE_NAME,
+ "comments", _("Show CPU frequencies and governor"),
+ "website", PLUGIN_WEBSITE,
+ "copyright", _("Copyright (c) 2003-2012\n"),
+ "authors", auth,
+ NULL);
+
+ if (icon)
+ g_object_unref(G_OBJECT(icon));
+}
+
static void
cpufreq_construct (XfcePanelPlugin *plugin)
{
@@ -577,7 +603,10 @@ cpufreq_construct (XfcePanelPlugin *plugin)
/* the configure and about menu items are hidden by default */
xfce_panel_plugin_menu_show_configure (plugin);
g_signal_connect (plugin, "configure-plugin",
- G_CALLBACK (cpufreq_configure), NULL);
+ G_CALLBACK (cpufreq_configure), NULL);
+ xfce_panel_plugin_menu_show_about(plugin);
+ g_signal_connect (G_OBJECT (plugin), "about",
+ G_CALLBACK (cpufreq_show_about), cpuFreq);
}
XFCE_PANEL_PLUGIN_REGISTER (cpufreq_construct);
diff --git a/panel-plugin/xfce4-cpufreq-plugin.h b/panel-plugin/xfce4-cpufreq-plugin.h
index 9daa546..f3589ea 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.h
+++ b/panel-plugin/xfce4-cpufreq-plugin.h
@@ -24,6 +24,8 @@
#include <gtk/gtk.h>
#include <libxfce4panel/xfce-panel-plugin.h>
+#define PLUGIN_WEBSITE ("http://goodies.xfce.org/projects/panel-plugins/xfce4-cpufreq-plugin")
+
#define CPU_MIN (cpuFreq->cpus->len + 0)
#define CPU_AVG (cpuFreq->cpus->len + 1)
#define CPU_MAX (cpuFreq->cpus->len + 2)
More information about the Xfce4-commits
mailing list