Commit def1d44a authored by Cosimo Cecchi's avatar Cosimo Cecchi Committed by Cosimo Cecchi

Update the trash icon on the pathbar according to the trash state.

2008-02-21  Cosimo Cecchi  <cosimoc@gnome.org>

	* src/nautilus-pathbar.c: (trash_state_changed_cb),
	(nautilus_path_bar_init):
	Update the trash icon on the pathbar according to the trash state.
	(#332162).

svn path=/trunk/; revision=13790
parent bf4014d1
2008-02-21 Cosimo Cecchi <cosimoc@gnome.org>
* src/nautilus-pathbar.c: (trash_state_changed_cb),
(nautilus_path_bar_init):
Update the trash icon on the pathbar according to the trash state.
(#332162).
2008-02-20 Cosimo Cecchi <cosimoc@gnome.org>
* libnautilus-private/nautilus-mime-application-chooser.c:
......
......@@ -38,6 +38,7 @@
#include <libnautilus-private/nautilus-file-utilities.h>
#include <libnautilus-private/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-icon-names.h>
#include <libnautilus-private/nautilus-trash-monitor.h>
#include "nautilus-pathbar.h"
enum {
......@@ -196,6 +197,32 @@ desktop_location_changed_callback (gpointer user_data)
update_button_types (path_bar);
}
static void
trash_state_changed_cb (NautilusTrashMonitor *monitor,
gboolean state,
NautilusPathBar *path_bar)
{
GFile *file;
GList *list;
file = g_file_new_for_uri ("trash:///");
for (list = path_bar->button_list; list; list = list->next) {
ButtonData *button_data;
button_data = BUTTON_DATA (list->data);
if (g_file_equal (file, button_data->path)) {
GIcon *icon;
NautilusIconInfo *icon_info;
GdkPixbuf *pixbuf;
icon = nautilus_trash_monitor_get_icon ();
icon_info = nautilus_icon_info_lookup (icon, NAUTILUS_PATH_BAR_ICON_SIZE);
pixbuf = nautilus_icon_info_get_pixbuf_at_size (icon_info, NAUTILUS_PATH_BAR_ICON_SIZE);
gtk_image_set_from_pixbuf (GTK_IMAGE (button_data->image), pixbuf);
}
}
g_object_unref (file);
}
static void
nautilus_path_bar_init (NautilusPathBar *path_bar)
{
......@@ -228,6 +255,11 @@ nautilus_path_bar_init (NautilusPathBar *path_bar)
g_signal_connect (path_bar->up_slider_button, "button_release_event", G_CALLBACK (nautilus_path_bar_slider_button_release), path_bar);
g_signal_connect (path_bar->down_slider_button, "button_press_event", G_CALLBACK (nautilus_path_bar_slider_button_press), path_bar);
g_signal_connect (path_bar->down_slider_button, "button_release_event", G_CALLBACK (nautilus_path_bar_slider_button_release), path_bar);
g_signal_connect (nautilus_trash_monitor_get (),
"trash_state_changed",
G_CALLBACK (trash_state_changed_cb),
path_bar);
}
static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment