Commit abf700ab authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

(merges from stable):

2002-03-06  Alexander Larsson  <alla@lysator.liu.se>

	(merges from stable):

	* libnautilus-private/nautilus-monitor.c:
	(process_fam_notifications): Tweak comment.

	* src/nautilus-window-manage-views.c:
	(cancel_viewed_file_changed_callback), (update_for_new_location):
	Monitor the existence of the currently viewed file, so we notice
	when the file is deleted.

        * src/file-manager/fm-directory-view.h:
	Add emblems_changes method.

        * src/file-manager/fm-directory-view.c:
	(file_changed_callback): Call emblems_changed.
	(fm_directory_view_add_relative_emblems_to_exclude,
	real_get_emblem_names_to_exclude):
	exclude non-writable emblems if directory is not
	writable.

	* src/file-manager/fm-icon-view.c:
	Implement emblem_changes.

	* src/file-manager/fm-list-view.c:
	Add GNOME2_CONVERSION_COMPLETE where the emblem icon
	update is needed.
parent 65086563
2002-03-06 Alexander Larsson <alla@lysator.liu.se>
(merges from stable):
* libnautilus-private/nautilus-monitor.c:
(process_fam_notifications): Tweak comment.
* src/nautilus-window-manage-views.c:
(cancel_viewed_file_changed_callback), (update_for_new_location):
Monitor the existence of the currently viewed file, so we notice
when the file is deleted.
* src/file-manager/fm-directory-view.h:
Add emblems_changes method.
* src/file-manager/fm-directory-view.c:
(file_changed_callback): Call emblems_changed.
(fm_directory_view_add_relative_emblems_to_exclude,
real_get_emblem_names_to_exclude):
exclude non-writable emblems if directory is not
writable.
* src/file-manager/fm-icon-view.c:
Implement emblem_changes.
* src/file-manager/fm-list-view.c:
Add GNOME2_CONVERSION_COMPLETE where the emblem icon
update is needed.
2002-03-06 Darin Adler <darin@bentspoon.com> 2002-03-06 Darin Adler <darin@bentspoon.com>
* src/file-manager/fm-list-model.c: (fm_list_model_remove_file): * src/file-manager/fm-list-model.c: (fm_list_model_remove_file):
......
...@@ -213,9 +213,9 @@ process_fam_notifications (GIOChannel *channel, ...@@ -213,9 +213,9 @@ process_fam_notifications (GIOChannel *channel,
case FAMMoved: case FAMMoved:
/* FAMMoved doesn't need to be handled because /* FAMMoved doesn't need to be handled because
* FAM never seems to generate this event on * FAM never seems to generate this event on
* Linux systems (w/ or w/o IMON). Instead it * Linux systems (with or without kernel
* generates a FAMDeleted followed by a * support). Instead it generates a FAMDeleted
* FAMCreated. * followed by a FAMCreated.
*/ */
g_warning ("unexpected FAMMoved notification"); g_warning ("unexpected FAMMoved notification");
break; break;
......
...@@ -4852,7 +4852,14 @@ fm_directory_view_activate_files (FMDirectoryView *view, ...@@ -4852,7 +4852,14 @@ fm_directory_view_activate_files (FMDirectoryView *view,
static void static void
file_changed_callback (NautilusFile *file, gpointer callback_data) file_changed_callback (NautilusFile *file, gpointer callback_data)
{ {
schedule_update_menus (FM_DIRECTORY_VIEW (callback_data)); FMDirectoryView *view = FM_DIRECTORY_VIEW (callback_data);
schedule_update_menus (view);
/* We might have different capabilities, so we need to update
relative icon emblems . (Writeable etc) */
EEL_CALL_METHOD
(FM_DIRECTORY_VIEW_CLASS, view, emblems_changed, (view));
} }
/** /**
...@@ -4917,7 +4924,7 @@ load_directory (FMDirectoryView *view, ...@@ -4917,7 +4924,7 @@ load_directory (FMDirectoryView *view,
g_list_free (attributes); g_list_free (attributes);
/* If capabilities change, then we need to update the menus /* If capabilities change, then we need to update the menus
* because of New Folder. * because of New Folder, and relative emblems.
*/ */
attributes = g_list_prepend (NULL, NAUTILUS_FILE_ATTRIBUTE_CAPABILITIES); attributes = g_list_prepend (NULL, NAUTILUS_FILE_ATTRIBUTE_CAPABILITIES);
nautilus_file_monitor_add (view->details->directory_as_file, nautilus_file_monitor_add (view->details->directory_as_file,
...@@ -5047,12 +5054,28 @@ fm_directory_view_get_emblem_names_to_exclude (FMDirectoryView *view) ...@@ -5047,12 +5054,28 @@ fm_directory_view_get_emblem_names_to_exclude (FMDirectoryView *view)
get_emblem_names_to_exclude, (view)); get_emblem_names_to_exclude, (view));
} }
static void
fm_directory_view_add_relative_emblems_to_exclude (FMDirectoryView *view,
EelStringList *list)
{
if (!nautilus_file_can_write (view->details->directory_as_file)) {
eel_string_list_prepend (list, NAUTILUS_FILE_EMBLEM_NAME_CANT_WRITE);
eel_string_list_remove_duplicates (list);
}
}
static EelStringList * static EelStringList *
real_get_emblem_names_to_exclude (FMDirectoryView *view) real_get_emblem_names_to_exclude (FMDirectoryView *view)
{ {
EelStringList *list;
g_assert (FM_IS_DIRECTORY_VIEW (view)); g_assert (FM_IS_DIRECTORY_VIEW (view));
return eel_string_list_new_from_string (NAUTILUS_FILE_EMBLEM_NAME_TRASH, TRUE); list = eel_string_list_new_from_string (NAUTILUS_FILE_EMBLEM_NAME_TRASH, TRUE);
fm_directory_view_add_relative_emblems_to_exclude (view, list);
return list;
} }
/** /**
......
...@@ -276,6 +276,8 @@ struct FMDirectoryViewClass { ...@@ -276,6 +276,8 @@ struct FMDirectoryViewClass {
void (* image_display_policy_changed) (FMDirectoryView *view); void (* image_display_policy_changed) (FMDirectoryView *view);
void (* click_policy_changed) (FMDirectoryView *view); void (* click_policy_changed) (FMDirectoryView *view);
void (* sort_directories_first_changed) (FMDirectoryView *view); void (* sort_directories_first_changed) (FMDirectoryView *view);
void (* emblems_changed) (FMDirectoryView *view);
}; };
/* GtkObject support */ /* GtkObject support */
...@@ -346,11 +348,11 @@ void fm_directory_view_queue_file_change (FMDirect ...@@ -346,11 +348,11 @@ void fm_directory_view_queue_file_change (FMDirect
void fm_directory_view_notify_selection_changed (FMDirectoryView *view); void fm_directory_view_notify_selection_changed (FMDirectoryView *view);
Bonobo_UIContainer fm_directory_view_get_bonobo_ui_container (FMDirectoryView *view); Bonobo_UIContainer fm_directory_view_get_bonobo_ui_container (FMDirectoryView *view);
BonoboControl * fm_directory_view_get_bonobo_control (FMDirectoryView *view); BonoboControl * fm_directory_view_get_bonobo_control (FMDirectoryView *view);
EelStringList *fm_directory_view_get_emblem_names_to_exclude (FMDirectoryView *view); EelStringList * fm_directory_view_get_emblem_names_to_exclude (FMDirectoryView *view);
NautilusDirectory *fm_directory_view_get_model (FMDirectoryView *view); NautilusDirectory *fm_directory_view_get_model (FMDirectoryView *view);
GtkWindow *fm_directory_view_get_containing_window (FMDirectoryView *view); GtkWindow *fm_directory_view_get_containing_window (FMDirectoryView *view);
NautilusFile *fm_directory_view_get_directory_as_file (FMDirectoryView *view); NautilusFile *fm_directory_view_get_directory_as_file (FMDirectoryView *view);
EelBackground *fm_directory_view_get_background (FMDirectoryView *view); EelBackground * fm_directory_view_get_background (FMDirectoryView *view);
void fm_directory_view_pop_up_background_context_menu (FMDirectoryView *view, void fm_directory_view_pop_up_background_context_menu (FMDirectoryView *view,
GdkEventButton *event); GdkEventButton *event);
void fm_directory_view_pop_up_selection_context_menu (FMDirectoryView *view, void fm_directory_view_pop_up_selection_context_menu (FMDirectoryView *view,
......
...@@ -2175,6 +2175,14 @@ fm_icon_view_click_policy_changed (FMDirectoryView *directory_view) ...@@ -2175,6 +2175,14 @@ fm_icon_view_click_policy_changed (FMDirectoryView *directory_view)
fm_icon_view_update_click_mode (FM_ICON_VIEW (directory_view)); fm_icon_view_update_click_mode (FM_ICON_VIEW (directory_view));
} }
static void
fm_icon_view_emblems_changed (FMDirectoryView *directory_view)
{
g_assert (FM_IS_ICON_VIEW (directory_view));
nautilus_icon_container_request_update_all (get_icon_container (FM_ICON_VIEW (directory_view)));
}
static void static void
default_sort_order_changed_callback (gpointer callback_data) default_sort_order_changed_callback (gpointer callback_data)
{ {
...@@ -2714,6 +2722,7 @@ fm_icon_view_class_init (FMIconViewClass *klass) ...@@ -2714,6 +2722,7 @@ fm_icon_view_class_init (FMIconViewClass *klass)
fm_directory_view_class->embedded_text_policy_changed = fm_icon_view_embedded_text_policy_changed; fm_directory_view_class->embedded_text_policy_changed = fm_icon_view_embedded_text_policy_changed;
fm_directory_view_class->image_display_policy_changed = fm_icon_view_image_display_policy_changed; fm_directory_view_class->image_display_policy_changed = fm_icon_view_image_display_policy_changed;
fm_directory_view_class->merge_menus = fm_icon_view_merge_menus; fm_directory_view_class->merge_menus = fm_icon_view_merge_menus;
fm_directory_view_class->emblems_changed = fm_icon_view_emblems_changed;
fm_directory_view_class->sort_directories_first_changed = fm_icon_view_sort_directories_first_changed; fm_directory_view_class->sort_directories_first_changed = fm_icon_view_sort_directories_first_changed;
fm_directory_view_class->start_renaming_item = fm_icon_view_start_renaming_item; fm_directory_view_class->start_renaming_item = fm_icon_view_start_renaming_item;
fm_directory_view_class->text_attribute_names_changed = fm_icon_view_text_attribute_names_changed; fm_directory_view_class->text_attribute_names_changed = fm_icon_view_text_attribute_names_changed;
......
...@@ -442,6 +442,19 @@ fm_list_view_finalize (GObject *object) ...@@ -442,6 +442,19 @@ fm_list_view_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object); G_OBJECT_CLASS (parent_class)->finalize (object);
} }
static void
fm_list_view_emblems_changed (FMDirectoryView *directory_view)
{
g_assert (FM_IS_LIST_VIEW (directory_view));
#if GNOME2_CONVERSION_COMPLETE
/* FIXME: This needs to update the emblems of the icons, since
* relative emblems may have changed.
*/
#endif
}
static void static void
fm_list_view_class_init (FMListViewClass *class) fm_list_view_class_init (FMListViewClass *class)
{ {
...@@ -470,6 +483,7 @@ fm_list_view_class_init (FMListViewClass *class) ...@@ -470,6 +483,7 @@ fm_list_view_class_init (FMListViewClass *class)
fm_directory_view_class->remove_file = fm_list_view_remove_file; fm_directory_view_class->remove_file = fm_list_view_remove_file;
fm_directory_view_class->select_all = fm_list_view_select_all; fm_directory_view_class->select_all = fm_list_view_select_all;
fm_directory_view_class->set_selection = fm_list_view_set_selection; fm_directory_view_class->set_selection = fm_list_view_set_selection;
fm_directory_view_class->emblems_changed = fm_list_view_emblems_changed;
fm_directory_view_class->sort_directories_first_changed = fm_list_view_sort_directories_first_changed; fm_directory_view_class->sort_directories_first_changed = fm_list_view_sort_directories_first_changed;
eel_preferences_add_auto_enum (NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_SORT_ORDER, eel_preferences_add_auto_enum (NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_SORT_ORDER,
......
...@@ -536,10 +536,14 @@ viewed_file_changed_callback (NautilusFile *file, ...@@ -536,10 +536,14 @@ viewed_file_changed_callback (NautilusFile *file,
static void static void
cancel_viewed_file_changed_callback (NautilusWindow *window) cancel_viewed_file_changed_callback (NautilusWindow *window)
{ {
if (window->details->viewed_file != NULL) { NautilusFile *file;
g_signal_handlers_disconnect_by_func (window->details->viewed_file,
file = window->details->viewed_file;
if (file != NULL) {
g_signal_handlers_disconnect_by_func (G_OBJECT (file),
G_CALLBACK (viewed_file_changed_callback), G_CALLBACK (viewed_file_changed_callback),
window); window);
nautilus_file_monitor_remove (file, &window->details->viewed_file);
} }
} }
...@@ -594,10 +598,10 @@ update_for_new_location (NautilusWindow *window) ...@@ -594,10 +598,10 @@ update_for_new_location (NautilusWindow *window)
file = nautilus_file_get (window->details->location); file = nautilus_file_get (window->details->location);
nautilus_window_set_viewed_file (window, file); nautilus_window_set_viewed_file (window, file);
window->details->viewed_file_seen = !nautilus_file_is_not_yet_confirmed (file); window->details->viewed_file_seen = !nautilus_file_is_not_yet_confirmed (file);
g_signal_connect (file, nautilus_file_monitor_add (file, &window->details->viewed_file, NULL);
"changed", g_signal_connect (file, "changed",
G_CALLBACK (viewed_file_changed_callback), G_CALLBACK (viewed_file_changed_callback),
window); window);
nautilus_file_unref (file); nautilus_file_unref (file);
/* Check if we can go up. */ /* Check if we can go up. */
......
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