From 08948281857bac280ee743045df1c0dbc140b4cc Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Thu, 24 Apr 2014 20:47:22 +0200 Subject: Add about dialog in tray icon This add dependency on libmate-desktop --- src/gpm-tray-icon.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'src/gpm-tray-icon.c') 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 #include #include +#include #include "egg-debug.h" @@ -169,6 +170,37 @@ gpm_tray_icon_show_preferences_cb (GtkMenuItem *item, gpointer data) egg_warning ("Couldn't execute command: %s", command); } +/** + * 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)); -- cgit v1.2.1