diff options
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/gpm-tray-icon.c | 38 |
2 files changed, 40 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index d85e690..15b2343 100644 --- a/configure.ac +++ b/configure.ac @@ -126,6 +126,7 @@ LIBPANEL_REQUIRED=1.5.0 XRANDR_REQUIRED=1.2.0 CANBERRA_REQUIRED=0.10 UPOWER_REQUIRED=0.9.1 +MATE_DESKTOP_REQUIRED=1.9.0 dnl ---------------------------------------------------------------------------- dnl GTK library version @@ -166,6 +167,7 @@ PKG_CHECK_MODULES(DBUS,[ PKG_CHECK_MODULES(MATE, [ gtk+-$GTK_API_VERSION >= $GTK_REQUIRED + mate-desktop-2.0 >= $MATE_DESKTOP_REQUIRED cairo >= $CAIRO_REQUIRED]) PKG_CHECK_MODULES(GDK, [ 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)); |