summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-04-24 20:47:22 +0200
committerStefano Karapetsas <[email protected]>2014-04-24 20:47:22 +0200
commit08948281857bac280ee743045df1c0dbc140b4cc (patch)
tree551f776db27494bed20090c0075baaa5d106d86e /src
parent50deefc72f9d23e770c74d8a65bec0ab75c5834d (diff)
downloadmate-power-manager-08948281857bac280ee743045df1c0dbc140b4cc.tar.bz2
mate-power-manager-08948281857bac280ee743045df1c0dbc140b4cc.tar.xz
Add about dialog in tray icon
This add dependency on libmate-desktop
Diffstat (limited to 'src')
-rw-r--r--src/gpm-tray-icon.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/gpm-tray-icon.c b/src/gpm-tray-icon.c
index f2c26f7..ec6aea6 100644
--- a/src/gpm-tray-icon.c
+++ b/src/gpm-tray-icon.c
@@ -39,6 +39,7 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <libupower-glib/upower.h>
+#include <libmate-desktop/mate-aboutdialog.h>
#include "egg-debug.h"
@@ -170,6 +171,37 @@ gpm_tray_icon_show_preferences_cb (GtkMenuItem *item, gpointer data)
}
/**
+ * gpm_tray_icon_show_about_cb:
+ * @action: A valid GtkAction
+ **/
+static void
+gpm_tray_icon_show_about_cb (GtkMenuItem *item, gpointer data)
+{
+ const gchar *authors[] =
+ {
+ "Perberos",
+ "Steve Zesch",
+ "Stefano Karapetsas",
+ NULL
+ };
+
+ mate_show_about_dialog (NULL,
+ "program-name", _("Power Manager"),
+ "version", VERSION,
+ "comments", _("Power management daemon"),
+ "copyright", _("Copyright \xC2\xA9 2011-2014 MATE developers"),
+ "authors", authors,
+ /* Translators should localize the following string
+ * which will be displayed at the bottom of the about
+ * box to give credit to the translator(s).
+ */
+ "translator-credits", _("translator-credits"),
+ "logo-icon-name", "mate-power-manager",
+ "website", "http://www.mate-desktop.org",
+ NULL);
+}
+
+/**
* gpm_tray_icon_popup_cleared_cd:
* @widget: The popup Gtkwidget
*
@@ -300,6 +332,12 @@ gpm_tray_icon_create_menu (GpmTrayIcon *icon, guint32 timestamp)
G_CALLBACK (gpm_tray_icon_show_preferences_cb), icon);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+ /* about */
+ item = gtk_image_menu_item_new_from_stock (GTK_STOCK_ABOUT, NULL);
+ g_signal_connect (G_OBJECT (item), "activate",
+ G_CALLBACK (gpm_tray_icon_show_about_cb), icon);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+
skip_prefs:
/* show the menu */
gtk_widget_show_all (GTK_WIDGET (menu));