wck-plugin.c 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* $Id$
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation; either version 3 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License along
  14. * with this program; if not, write to the Free Software Foundation, Inc.,
  15. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  16. *
  17. * Copyright (C) 2013 Cedric Leporcq <cedl38@gmail.com>
  18. *
  19. */
  20. #ifdef HAVE_CONFIG_H
  21. #include <config.h>
  22. #endif
  23. #include <string.h>
  24. #include <gtk/gtk.h>
  25. #include <libxfce4ui/libxfce4ui.h>
  26. #include "wck-plugin.h"
  27. void
  28. wck_about (XfcePanelPlugin *plugin, const gchar *icon_name)
  29. {
  30. /* about dialog code. you can use the GtkAboutDialog
  31. * or the XfceAboutInfo widget */
  32. GdkPixbuf *icon;
  33. const gchar *auth[] =
  34. {
  35. "Alessio Piccoli <alepic@geckoblu.net>",
  36. "Cedric Leporcq <cedl38@gmail.com>",
  37. "",
  38. "This code is derived from 'Window Applets' from Andrej Belcijan.",
  39. "See http://gnome-look.org/content/show.php?content=103732 for details.",
  40. NULL
  41. };
  42. icon = xfce_panel_pixbuf_from_source(icon_name, NULL, 32);
  43. gtk_show_about_dialog (NULL,
  44. "logo", icon,
  45. "license", xfce_get_license_text(XFCE_LICENSE_TEXT_GPL),
  46. "version", PACKAGE_VERSION,
  47. "program-name", xfce_panel_plugin_get_display_name (plugin),
  48. "comments", xfce_panel_plugin_get_comment (plugin),
  49. "website", PLUGIN_WEBSITE,
  50. "copyright", "Copyright \302\251 2013\n",
  51. "authors", auth,
  52. NULL );
  53. // TODO: add translators.
  54. if (icon)
  55. g_object_unref(G_OBJECT(icon) );
  56. }
  57. GtkWidget *show_refresh_item (XfcePanelPlugin *plugin)
  58. {
  59. GtkWidget *refresh;
  60. refresh = gtk_image_menu_item_new_from_stock (GTK_STOCK_REFRESH, NULL);
  61. xfce_panel_plugin_menu_insert_item(plugin, GTK_MENU_ITEM(refresh));
  62. gtk_widget_show(GTK_WIDGET(refresh));
  63. return refresh;
  64. }