[Xfce4-commits] <xfce4-cpugraph-plugin:master> add about dialog

Landry Breuil noreply at xfce.org
Mon Apr 23 18:18:01 CEST 2012


Updating branch refs/heads/master
         to 4ba9a2d625fdefcf8fdeb5d5e76290b14de8292b (commit)
       from 41cda5a1ac65b73b1211880d015399b3e7218f50 (commit)

commit 4ba9a2d625fdefcf8fdeb5d5e76290b14de8292b
Author: Landry Breuil <landry at xfce.org>
Date:   Mon Apr 23 18:17:53 2012 +0200

    add about dialog

 panel-plugin/cpu.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/cpu.c b/panel-plugin/cpu.c
index 46fd395..d4adeda 100644
--- a/panel-plugin/cpu.c
+++ b/panel-plugin/cpu.c
@@ -47,6 +47,7 @@ static guint init_cpu_data( CpuData **data );
 static void shutdown( XfcePanelPlugin *plugin, CPUGraph *base );
 static void delete_bars( CPUGraph *base );
 static gboolean size_cb( XfcePanelPlugin *plugin, guint size, CPUGraph *base );
+static void about_cb( XfcePanelPlugin *plugin, CPUGraph *base );
 static void set_bars_size( CPUGraph *base, gint size, GtkOrientation orientation );
 #ifdef HAS_PANEL_49
 static void mode_cb( XfcePanelPlugin *plugin, XfcePanelPluginMode mode, CPUGraph *base );
@@ -73,6 +74,9 @@ static void cpugraph_construct( XfcePanelPlugin *plugin )
 	read_settings( plugin, base );
 	xfce_panel_plugin_menu_show_configure( plugin );
 
+	xfce_panel_plugin_menu_show_about( plugin );
+
+	g_signal_connect (plugin, "about", G_CALLBACK (about_cb), base );
 	g_signal_connect( plugin, "free-data", G_CALLBACK( shutdown ), base );
 	g_signal_connect( plugin, "save", G_CALLBACK( write_settings ), base );
 	g_signal_connect( plugin, "configure-plugin", G_CALLBACK( create_options ), base );
@@ -129,6 +133,29 @@ static CPUGraph * create_gui( XfcePanelPlugin * plugin )
 	return base;
 }
 
+static void
+about_cb( XfcePanelPlugin *plugin, CPUGraph *base )
+{
+	GdkPixbuf *icon;
+	const gchar *auth[] = {
+		"Alexander Nordfelth <alex.nordfelth at telia.com>", "gatopeich <gatoguan-os at yahoo.com>",
+		"lidiriel <lidiriel at coriolys.org>","Angelo Miguel Arrifano <miknix at gmail.com>",
+		"Florian Rivoal <frivoal at gmail.com>","Peter Tribble <peter.tribble at gmail.com>", NULL};
+	icon = xfce_panel_pixbuf_from_source("xfce4-cpugraph-plugin", NULL, 32);
+	gtk_show_about_dialog(NULL,
+		"logo", icon,
+		"license", xfce_get_license_text (XFCE_LICENSE_TEXT_GPL),
+		"version", PACKAGE_VERSION,
+		"program-name", PACKAGE_NAME,
+		"comments", _("Graphical representation of the CPU load"),
+		"website", "http://goodies.xfce.org/projects/panel-plugins/xfce4-cpugraph-plugin",
+		"copyright", _("Copyright (c) 2003-2012\n"),
+		"authors", auth, NULL);
+
+	if(icon)
+		g_object_unref(G_OBJECT(icon));
+}
+
 static guint nb_bars( CPUGraph * base )
 {
 	return base->tracked_core == 0 ? base->nr_cores : 1;


More information about the Xfce4-commits mailing list