Commit a126790b authored by Dave Camp's avatar Dave Camp Committed by Dave Camp

Show the directory as a selection in spatial mode when Alt+Up is selected.

2004-10-18  Dave Camp  <dave@novell.com>

	* src/file-manager/fm-directory-view.c:
	(selection_changed_callback):
	* src/nautilus-application.c:
	(nautilus_application_present_spatial_window),
	(nautilus_application_present_spatial_window_with_selection):
	* src/nautilus-application.h:
	* src/nautilus-window-manage-views.c: (open_location),
	(load_directory_metadata_callback):
	* src/nautilus-window.c: (nautilus_window_go_to_with_selection):
	* src/nautilus-window.h:  Show the directory as a selection in
	spatial mode when Alt+Up is selected.

	Patch from Jimmy Do <crispyleaves@gmail.com>
parent 28bb1db5
2004-10-18 Dave Camp <dave@novell.com>
* src/file-manager/fm-directory-view.c:
(selection_changed_callback):
* src/nautilus-application.c:
(nautilus_application_present_spatial_window),
(nautilus_application_present_spatial_window_with_selection):
* src/nautilus-application.h:
* src/nautilus-window-manage-views.c: (open_location),
(load_directory_metadata_callback):
* src/nautilus-window.c: (nautilus_window_go_to_with_selection):
* src/nautilus-window.h: Show the directory as a selection in
spatial mode when Alt+Up is selected.
Patch from Jimmy Do <crispyleaves@gmail.com>
2004-10-18 Marco Pesenti Gritti <marco@gnome.org>
reviewed by: Alexander Larsson <alexl@redhat.com>
......
......@@ -1921,20 +1921,23 @@ selection_changed_callback (NautilusView *nautilus_view,
{
GList *selection;
if (view->details->loading) {
eel_g_list_free_deep (view->details->pending_uris_selected);
view->details->pending_uris_selected = NULL;
}
if (!view->details->loading) {
/* If we aren't still loading, set the selection right now. */
/* If we aren't still loading, set the selection right now,
* and reveal the new selection.
*/
selection = file_list_from_uri_list (selection_uris);
view->details->selection_change_is_due_to_shell = TRUE;
fm_directory_view_set_selection (view, selection);
view->details->selection_change_is_due_to_shell = FALSE;
fm_directory_view_reveal_selection (view);
nautilus_file_list_free (selection);
} else {
/* If we are still loading, add to the list of pending URIs instead. */
/* If we are still loading, set the list of pending URIs instead.
* done_loading() will eventually select the pending URIs and reveal them.
*/
eel_g_list_free_deep (view->details->pending_uris_selected);
view->details->pending_uris_selected = NULL;
view->details->pending_uris_selected =
g_list_concat (view->details->pending_uris_selected,
eel_g_str_list_copy (selection_uris));
......
......@@ -964,6 +964,20 @@ nautilus_application_present_spatial_window (NautilusApplication *application,
NautilusWindow *requesting_window,
const char *location,
GdkScreen *screen)
{
return nautilus_application_present_spatial_window_with_selection (application,
requesting_window,
location,
NULL,
screen);
}
NautilusWindow *
nautilus_application_present_spatial_window_with_selection (NautilusApplication *application,
NautilusWindow *requesting_window,
const char *location,
GList *new_selection,
GdkScreen *screen)
{
NautilusWindow *window;
GList *l;
......@@ -984,6 +998,9 @@ nautilus_application_present_spatial_window (NautilusApplication *application,
if (eel_uris_match (existing_location, location)) {
gtk_window_present (GTK_WINDOW (existing_window));
if (new_selection) {
nautilus_view_frame_selection_changed (existing_window->content_view, new_selection);
}
return existing_window;
}
}
......@@ -1016,7 +1033,7 @@ nautilus_application_present_spatial_window (NautilusApplication *application,
g_object_weak_ref (G_OBJECT (window),
spatial_window_destroyed_callback, NULL);
nautilus_window_go_to (window, location);
nautilus_window_go_to_with_selection (window, location, new_selection);
return window;
}
......
......@@ -76,6 +76,12 @@ NautilusWindow * nautilus_application_present_spatial_window (NautilusAp
NautilusWindow *requesting_window,
const char *location,
GdkScreen *screen);
NautilusWindow * nautilus_application_present_spatial_window_with_selection (NautilusApplication *application,
NautilusWindow *requesting_window,
const char *location,
GList *new_selection,
GdkScreen *screen);
NautilusWindow * nautilus_application_create_navigation_window (NautilusApplication *application,
GdkScreen *screen);
......
......@@ -680,10 +680,11 @@ open_location (NautilusWindow *window,
}
} else if (NAUTILUS_IS_SPATIAL_WINDOW (window)) {
if (!NAUTILUS_SPATIAL_WINDOW (window)->affect_spatial_window_on_next_location_change) {
target_window = nautilus_application_present_spatial_window (
target_window = nautilus_application_present_spatial_window_with_selection (
window->application,
window,
location,
new_selection,
gtk_window_get_screen (GTK_WINDOW (window)));
do_load_location = FALSE;
} else {
......@@ -1230,10 +1231,18 @@ load_directory_metadata_callback (NautilusFile *file,
}
g_free (geometry_string);
/* load the saved scroll position */
scroll_string = nautilus_file_get_metadata
(file, NAUTILUS_METADATA_KEY_WINDOW_SCROLL_POSITION,
NULL);
if (window->details->pending_selection == NULL) {
/* If there is no pending selection, then load the saved scroll position. */
scroll_string = nautilus_file_get_metadata
(file, NAUTILUS_METADATA_KEY_WINDOW_SCROLL_POSITION,
NULL);
} else {
/* If there is a pending selection, we want to scroll to an item in
* the pending selection list. */
scroll_string = g_strdup (window->details->pending_selection->data);
}
/* scroll_string might be NULL if there was no saved scroll position. */
if (scroll_string != NULL) {
window->details->pending_scroll_to = scroll_string;
}
......
......@@ -356,6 +356,12 @@ nautilus_window_go_to (NautilusWindow *window, const char *uri)
nautilus_window_open_location (window, uri, FALSE);
}
void
nautilus_window_go_to_with_selection (NautilusWindow *window, const char *uri, GList *new_selection)
{
nautilus_window_open_location_with_selection (window, uri, new_selection, FALSE);
}
void
nautilus_window_go_up (NautilusWindow *window, gboolean close_behind)
{
......
......@@ -119,6 +119,9 @@ void nautilus_window_close (NautilusWindow *window
char * nautilus_window_get_location (NautilusWindow *window);
void nautilus_window_go_to (NautilusWindow *window,
const char *location);
void nautilus_window_go_to_with_selection (NautilusWindow *window,
const char *location,
GList *new_selection);
void nautilus_window_go_home (NautilusWindow *window);
void nautilus_window_go_up (NautilusWindow *window,
gboolean close_behind);
......
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