diff options
author | Elliot Lee <sopwith@src.gnome.org> | 1999-12-07 17:46:29 +0000 |
---|---|---|
committer | Elliot Lee <sopwith@src.gnome.org> | 1999-12-07 17:46:29 +0000 |
commit | 685753b110ed487f68cee6b0d9029f8b2a4b231b (patch) | |
tree | 4baab6d446622afab46630cbf5315047f71769d5 /src/nautilus-object-window.c | |
parent | 1d23907d45a168e45dc65b89b36f30bb094c37ff (diff) | |
download | nautilus-685753b110ed487f68cee6b0d9029f8b2a4b231b.tar.gz |
Add notes.
Add notes.
Pass the content view along with a location-changed message.
Diffstat (limited to 'src/nautilus-object-window.c')
-rw-r--r-- | src/nautilus-object-window.c | 56 |
1 files changed, 51 insertions, 5 deletions
diff --git a/src/nautilus-object-window.c b/src/nautilus-object-window.c index ab0e4a1a8..6f12ec65e 100644 --- a/src/nautilus-object-window.c +++ b/src/nautilus-object-window.c @@ -18,6 +18,9 @@ static void nautilus_window_close (GtkWidget *widget, static void nautilus_window_real_request_location_change (NautilusWindow *window, Nautilus_NavigationRequestInfo *loc, GtkWidget *requesting_view); +static void nautilus_window_real_request_selection_change(NautilusWindow *window, + Nautilus_SelectionRequestInfo *loc, + GtkWidget *requesting_view); #define CONTENTS_AS_HBOX /* six seconds */ @@ -84,6 +87,7 @@ nautilus_window_class_init (NautilusWindowClass *klass) klass->parent_class = gtk_type_class (gtk_type_parent (object_class->type)); klass->request_location_change = nautilus_window_real_request_location_change; + klass->request_selection_change = nautilus_window_real_request_selection_change; i = 0; klass->window_signals[i++] = gtk_signal_new("request_location_change", @@ -499,10 +503,21 @@ nautilus_window_change_location(NautilusWindow *window, signum = gtk_signal_lookup("notify_location_change", nautilus_view_get_type()); /* If we need to load a different IID, do that before sending the location change request */ - if(strcmp(NAUTILUS_VIEW(window->content_view)->iid, loci->content_iid)) - nautilus_view_load_client(NAUTILUS_VIEW(window->content_view), loci->content_iid); + if(strcmp(NAUTILUS_VIEW(window->content_view)->iid, loci->content_iid)) { + NautilusView *new_view; + + if(requesting_view == window->content_view) + requesting_view = NULL; + + new_view = NAUTILUS_VIEW(gtk_widget_new(nautilus_content_view_get_type(), "main_window", window, NULL)); + nautilus_view_load_client(new_view, loci->content_iid); + nautilus_window_set_content_view(window, new_view); + } + + loci->navinfo.content_view = NAUTILUS_VIEW(window->content_view)->view_client; - gtk_signal_emit(GTK_OBJECT(window->content_view), signum, loci, window->content_view, requesting_view); + if(requesting_view != window->content_view) + gtk_signal_emit(GTK_OBJECT(window->content_view), signum, loci); notfound_views = keep_views = discard_views = NULL; for(cur = window->meta_views; cur; cur = cur->next) @@ -510,9 +525,16 @@ nautilus_window_change_location(NautilusWindow *window, NautilusView *view = cur->data; if(g_slist_find_custom(loci->meta_iids, view->iid, (GCompareFunc)strcmp)) - gtk_signal_emit(GTK_OBJECT(view), signum, loci, window->content_view, requesting_view); + { + if(requesting_view != ((GtkWidget *)view)) + gtk_signal_emit(GTK_OBJECT(view), signum, loci); + } else - discard_views = g_slist_prepend(discard_views, view); + { + if(((GtkWidget *)view) == requesting_view) + requesting_view = NULL; + discard_views = g_slist_prepend(discard_views, view); + } } for(cur = loci->meta_iids; cur; cur = cur->next) { @@ -528,6 +550,7 @@ nautilus_window_change_location(NautilusWindow *window, view = NAUTILUS_VIEW(gtk_widget_new(nautilus_meta_view_get_type(), "main_window", window, NULL)); nautilus_view_load_client(view, cur->data); nautilus_window_add_meta_view(window, view); + gtk_signal_emit(GTK_OBJECT(view), signum, loci, window->content_view); } } for(cur = discard_views; cur; cur = cur->next) @@ -544,6 +567,29 @@ nautilus_window_change_location(NautilusWindow *window, nautilus_navinfo_free(loci); } +static void nautilus_window_real_request_selection_change(NautilusWindow *window, + Nautilus_SelectionRequestInfo *loc, + GtkWidget *requesting_view) +{ + GSList *cur; + guint signum; + Nautilus_SelectionInfo selinfo; + + signum = gtk_signal_lookup("notify_selection_change", nautilus_view_get_type()); + + selinfo.selected_uri = loc->selected_uri; + selinfo.content_view = NAUTILUS_VIEW(window->content_view)->view_client; + + if(((GtkWidget *)window->content_view) != requesting_view) + gtk_signal_emit(GTK_OBJECT(window->content_view), signum, &selinfo); + + for(cur = window->meta_views; cur; cur = cur->next) + { + if(cur->data != requesting_view) + gtk_signal_emit(GTK_OBJECT(window->content_view), signum, &selinfo); + } +} + static void nautilus_window_real_request_location_change (NautilusWindow *window, Nautilus_NavigationRequestInfo *loc, |