~noskcaj/ubuntu/vivid/thunar/1.6.4

« back to all changes in this revision

Viewing changes to plugins/thunar-tpa/main.c

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc
  • Date: 2010-12-04 16:46:20 UTC
  • mto: (2.1.3 experimental) (1.3.1)
  • mto: This revision was merged to the branch mainline in revision 69.
  • Revision ID: james.westby@ubuntu.com-20101204164620-h7p4t2e9z6hfhz6l
Tags: upstream-1.1.4
ImportĀ upstreamĀ versionĀ 1.1.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id$ */
2
 
/*-
3
 
 * Copyright (c) 2006 Benedikt Meurer <benny@xfce.org>
4
 
 *
5
 
 * This program is free software; you can redistribute it and/or modify it
6
 
 * under the terms of the GNU General Public License as published by the Free
7
 
 * Software Foundation; either version 2 of the License, or (at your option)
8
 
 * any later version.
9
 
 *
10
 
 * This program is distributed in the hope that it will be useful, but WITHOUT
11
 
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
 
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13
 
 * more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License along with
16
 
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
17
 
 * Place, Suite 330, Boston, MA  02111-1307  USA
18
 
 */
19
 
 
20
 
#ifdef HAVE_CONFIG_H
21
 
#include <config.h>
22
 
#endif
23
 
 
24
 
#include <thunar-tpa/thunar-tpa-icon.h>
25
 
 
26
 
#include <libxfce4panel/xfce-panel-plugin.h>
27
 
 
28
 
 
29
 
 
30
 
static void thunar_tpa_construct (XfcePanelPlugin *panel_plugin);
31
 
 
32
 
 
33
 
 
34
 
static void
35
 
thunar_tpa_construct (XfcePanelPlugin *panel_plugin)
36
 
{
37
 
  GtkWidget *icon;
38
 
  GtkWidget *item;
39
 
 
40
 
  xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
41
 
 
42
 
  /* setup the trash icon */
43
 
  icon = thunar_tpa_icon_new ();
44
 
  gtk_container_add (GTK_CONTAINER (panel_plugin), icon);
45
 
  xfce_panel_plugin_add_action_widget (panel_plugin, gtk_bin_get_child (GTK_BIN (icon)));
46
 
  gtk_widget_show (icon);
47
 
 
48
 
  /* add the "Empty Trash" menu item */
49
 
  item = gtk_menu_item_new_with_mnemonic (_("_Empty Trash"));
50
 
  exo_binding_new (G_OBJECT (icon), "full", G_OBJECT (item), "sensitive");
51
 
  g_signal_connect_swapped (G_OBJECT (item), "activate", G_CALLBACK (thunar_tpa_icon_empty_trash), icon);
52
 
  xfce_panel_plugin_menu_insert_item (panel_plugin, GTK_MENU_ITEM (item));
53
 
  gtk_widget_show (item);
54
 
 
55
 
  /* configure the plugin */
56
 
  g_signal_connect_swapped (G_OBJECT (panel_plugin), "size-changed", G_CALLBACK (thunar_tpa_icon_set_size), icon);
57
 
}
58
 
 
59
 
 
60
 
 
61
 
XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL (thunar_tpa_construct);