Commit b43b09c8 authored by Ettore Perazzoli's avatar Ettore Perazzoli
Browse files

Update the selection information at idle time for the directory view at

idle time.
parent cee6d77c
......@@ -133,18 +133,53 @@ view_has_icon_container (ExplorerDirectoryView *view)
return mode_uses_icon_container (view->mode);
}
static void
icon_container_selection_changed_cb (GnomeIconContainer *container,
gpointer data)
static GnomeIconContainer *
get_icon_container (ExplorerDirectoryView *view)
{
GtkBin *bin;
g_return_val_if_fail (view_has_icon_container (view), NULL);
bin = GTK_BIN (view);
if (bin->child == NULL)
return NULL; /* Avoid GTK+ complaints. */
else
return GNOME_ICON_CONTAINER (bin->child);
}
static gint
display_icon_container_selection_info_idle_cb (gpointer data)
{
ExplorerDirectoryView *view;
GnomeIconContainer *icon_container;
GList *selection;
puts (__FUNCTION__);
view = EXPLORER_DIRECTORY_VIEW (data);
icon_container = get_icon_container (view);
selection = gnome_icon_container_get_selection (container);
selection = gnome_icon_container_get_selection (icon_container);
display_selection_info (view, selection);
g_list_free (selection);
view->display_selection_idle_id = 0;
return FALSE;
}
static void
icon_container_selection_changed_cb (GnomeIconContainer *container,
gpointer data)
{
ExplorerDirectoryView *view;
view = EXPLORER_DIRECTORY_VIEW (data);
if (view->display_selection_idle_id == 0)
view->display_selection_idle_id = gtk_idle_add
(display_icon_container_selection_info_idle_cb,
view);
}
static void
......@@ -166,21 +201,6 @@ icon_container_activate_cb (GnomeIconContainer *icon_container,
gnome_vfs_uri_unref (new_uri);
}
static GnomeIconContainer *
get_icon_container (ExplorerDirectoryView *view)
{
GtkBin *bin;
g_return_val_if_fail (view_has_icon_container (view), NULL);
bin = GTK_BIN (view);
if (bin->child == NULL)
return NULL; /* Avoid GTK+ complaints. */
else
return GNOME_ICON_CONTAINER (bin->child);
}
static void
add_to_icon_container (ExplorerDirectoryView *view,
ExplorerIconManager *icon_manager,
......@@ -307,18 +327,51 @@ view_has_flist (ExplorerDirectoryView *view)
return mode_uses_flist (view->mode);
}
static void
flist_selection_changed_cb (GtkFList *flist,
gpointer data)
static GtkFList *
get_flist (ExplorerDirectoryView *view)
{
GtkBin *bin;
g_return_val_if_fail (view_has_flist (view), NULL);
bin = GTK_BIN (view);
if (bin->child == NULL)
return NULL; /* Avoid GTK+ complaints. */
else
return GTK_FLIST (bin->child);
}
static gint
display_flist_selection_info_idle_cb (gpointer data)
{
ExplorerDirectoryView *view;
GtkFList *flist;
GList *selection;
view = EXPLORER_DIRECTORY_VIEW (data);
flist = get_flist (view);
selection = gtk_flist_get_selection (flist);
display_selection_info (view, selection);
g_list_free (selection);
view->display_selection_idle_id = 0;
return FALSE;
}
static void
flist_selection_changed_cb (GtkFList *flist,
gpointer data)
{
ExplorerDirectoryView *view;
view = EXPLORER_DIRECTORY_VIEW (data);
if (view->display_selection_idle_id == 0)
view->display_selection_idle_id
= gtk_idle_add (display_flist_selection_info_idle_cb,
view);
}
static void
......@@ -339,21 +392,6 @@ flist_activate_cb (GtkFList *flist,
gnome_vfs_uri_unref (new_uri);
}
static GtkFList *
get_flist (ExplorerDirectoryView *view)
{
GtkBin *bin;
g_return_val_if_fail (view_has_flist (view), NULL);
bin = GTK_BIN (view);
if (bin->child == NULL)
return NULL; /* Avoid GTK+ complaints. */
else
return GTK_FLIST (bin->child);
}
static void
add_to_flist (ExplorerIconManager *icon_manager,
GtkFList *flist,
......@@ -607,6 +645,8 @@ init (ExplorerDirectoryView *directory_view)
directory_view->icon_layout = NULL;
directory_view->icons_not_in_layout = NULL;
directory_view->display_selection_idle_id = 0;
scroll_frame = GTK_SCROLL_FRAME (directory_view);
gtk_scroll_frame_set_hadjustment (scroll_frame, NULL);
......
......@@ -77,6 +77,10 @@ struct _ExplorerDirectoryView {
const GnomeIconContainerLayout *icon_layout;
GList *icons_not_in_layout;
/* Idle ID for displaying information about the current selection at
idle time. */
gint display_selection_idle_id;
};
struct _ExplorerDirectoryViewClass {
......
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