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

Freeze icon view updates while renaming to avoid things moving around on

2006-12-04  Alexander Larsson  <alexl@redhat.com>

	* libnautilus-private/nautilus-icon-container.[ch]:
	* src/file-manager/fm-icon-container.c:
	Freeze icon view updates while renaming to avoid things
	moving around on file changes. (#318373)
	Patch from Nelson Benítez
parent 77925f70
2006-12-04 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-icon-container.[ch]:
* src/file-manager/fm-icon-container.c:
Freeze icon view updates while renaming to avoid things
moving around on file changes. (#318373)
Patch from Nelson Benítez
2006-12-04 Luca Ferretti <elle.uca@libero.it>
* icons/nautilus-server-connect.png
......
......@@ -5565,6 +5565,28 @@ nautilus_icon_container_get_icon_text (NautilusIconContainer *container,
klass->get_icon_text (container, data, editable_text, additional_text);
}
static void
nautilus_icon_container_freeze_updates (NautilusIconContainer *container)
{
NautilusIconContainerClass *klass;
klass = NAUTILUS_ICON_CONTAINER_GET_CLASS (container);
g_return_if_fail (klass->freeze_updates != NULL);
klass->freeze_updates (container);
}
static void
nautilus_icon_container_unfreeze_updates (NautilusIconContainer *container)
{
NautilusIconContainerClass *klass;
klass = NAUTILUS_ICON_CONTAINER_GET_CLASS (container);
g_return_if_fail (klass->unfreeze_updates != NULL);
klass->unfreeze_updates (container);
}
static void
nautilus_icon_container_start_monitor_top_left (NautilusIconContainer *container,
NautilusIconData *data,
......@@ -6926,6 +6948,9 @@ nautilus_icon_container_start_renaming_selected_item (NautilusIconContainer *con
}
details->original_text = g_strdup (editable_text);
/* Freeze updates so files added while renaming don't cause rename to loose focus, bug #318373 */
nautilus_icon_container_freeze_updates (container);
/* Create text renaming widget, if it hasn't been created already.
* We deal with the broken icon text item widget by keeping it around
......@@ -7022,6 +7047,8 @@ end_renaming_mode (NautilusIconContainer *container, gboolean commit)
/* We are not in renaming mode */
container->details->renaming = FALSE;
nautilus_icon_canvas_item_set_renaming (icon->item, FALSE);
nautilus_icon_container_unfreeze_updates (container);
if (commit) {
set_pending_icon_to_reveal (container, icon);
......
......@@ -146,6 +146,8 @@ typedef struct {
int (* compare_icons_by_name) (NautilusIconContainer *container,
NautilusIconData *icon_a,
NautilusIconData *icon_b);
void (* freeze_updates) (NautilusIconContainer *container);
void (* unfreeze_updates) (NautilusIconContainer *container);
void (* start_monitor_top_left) (NautilusIconContainer *container,
NautilusIconData *data,
gconstpointer client,
......
......@@ -467,6 +467,24 @@ fm_icon_container_compare_icons_by_name (NautilusIconContainer *container,
FALSE, FALSE);
}
static void
fm_icon_container_freeze_updates (NautilusIconContainer *container)
{
FMIconView *icon_view;
icon_view = get_icon_view (container);
g_return_if_fail (icon_view != NULL);
fm_directory_view_freeze_updates (FM_DIRECTORY_VIEW (icon_view));
}
static void
fm_icon_container_unfreeze_updates (NautilusIconContainer *container)
{
FMIconView *icon_view;
icon_view = get_icon_view (container);
g_return_if_fail (icon_view != NULL);
fm_directory_view_unfreeze_updates (FM_DIRECTORY_VIEW (icon_view));
}
static void
fm_icon_container_dispose (GObject *object)
{
......@@ -495,6 +513,8 @@ fm_icon_container_class_init (FMIconContainerClass *klass)
ic_class->compare_icons = fm_icon_container_compare_icons;
ic_class->compare_icons_by_name = fm_icon_container_compare_icons_by_name;
ic_class->freeze_updates = fm_icon_container_freeze_updates;
ic_class->unfreeze_updates = fm_icon_container_unfreeze_updates;
G_OBJECT_CLASS (klass)->dispose = fm_icon_container_dispose;
}
......
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