static void
real_sync_location_widgets (CajaWindowPane *pane)
{
    CajaNavigationWindowSlot *navigation_slot;
    CajaNavigationWindowPane *navigation_pane;
    CajaWindowSlot *slot;

    slot = pane->active_slot;
    navigation_pane = CAJA_NAVIGATION_WINDOW_PANE (pane);

    /* Change the location bar and path bar to match the current location. */
    if (slot->location != NULL)
    {
        char *uri;

        /* this may be NULL if we just created the slot */
        uri = caja_window_slot_get_location_uri (slot);
        caja_location_bar_set_location (CAJA_LOCATION_BAR (navigation_pane->navigation_bar), uri);
        g_free (uri);
        caja_path_bar_set_path (CAJA_PATH_BAR (navigation_pane->path_bar), slot->location);
    }

    /* Update window global UI if this is the active pane */
    if (pane == pane->window->details->active_pane)
    {
        caja_window_update_up_button (pane->window);

        /* Check if the back and forward buttons need enabling or disabling. */
        navigation_slot = CAJA_NAVIGATION_WINDOW_SLOT (pane->window->details->active_pane->active_slot);
        caja_navigation_window_allow_back (CAJA_NAVIGATION_WINDOW (pane->window),
                                           navigation_slot->back_list != NULL);
        caja_navigation_window_allow_forward (CAJA_NAVIGATION_WINDOW (pane->window),
                                              navigation_slot->forward_list != NULL);
    }
}
static void
caja_navigation_window_init (CajaNavigationWindow *window)
{
    GtkUIManager *ui_manager;
    GtkWidget *toolbar;
    CajaWindow *win;
    CajaNavigationWindowPane *pane;
    GtkWidget *hpaned;
    GtkWidget *vbox;

    win = CAJA_WINDOW (window);

    window->details = G_TYPE_INSTANCE_GET_PRIVATE (window, CAJA_TYPE_NAVIGATION_WINDOW, CajaNavigationWindowDetails);

    pane = caja_navigation_window_pane_new (win);
    win->details->panes = g_list_prepend (win->details->panes, pane);

    window->details->header_size_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
    gtk_size_group_set_ignore_hidden (window->details->header_size_group, FALSE);

#if GTK_CHECK_VERSION(3, 0, 0)
    window->details->content_paned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
#else
    window->details->content_paned = gtk_hpaned_new ();
#endif
    gtk_table_attach (GTK_TABLE (CAJA_WINDOW (window)->details->table),
                      window->details->content_paned,
                      /* X direction */                   /* Y direction */
                      0, 1,                               3, 4,
                      GTK_EXPAND | GTK_FILL | GTK_SHRINK, GTK_EXPAND | GTK_FILL | GTK_SHRINK,
                      0,                                  0);
    gtk_widget_show (window->details->content_paned);

    vbox = gtk_vbox_new (FALSE, 0);
    gtk_paned_pack2 (GTK_PANED (window->details->content_paned), vbox,
    		     TRUE, FALSE);
    gtk_widget_show (vbox);

#if GTK_CHECK_VERSION(3, 0, 0)    
    hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
#else
    hpaned = gtk_hpaned_new ();
#endif
    gtk_box_pack_start (GTK_BOX (vbox), hpaned, TRUE, TRUE, 0);
    gtk_widget_show (hpaned);
    window->details->split_view_hpane = hpaned;

    gtk_box_pack_start (GTK_BOX (vbox), win->details->statusbar, FALSE, FALSE, 0);
    gtk_widget_show (win->details->statusbar);

    caja_navigation_window_pane_setup (pane);

    gtk_paned_pack1 (GTK_PANED(hpaned), pane->widget, TRUE, FALSE);
    gtk_widget_show (pane->widget);

    /* this has to be done after the location bar has been set up,
     * but before menu stuff is being called */
    caja_window_set_active_pane (win, CAJA_WINDOW_PANE (pane));

    caja_navigation_window_initialize_actions (window);

    caja_navigation_window_initialize_menus (window);

    ui_manager = caja_window_get_ui_manager (CAJA_WINDOW (window));
    toolbar = gtk_ui_manager_get_widget (ui_manager, "/Toolbar");
#if GTK_CHECK_VERSION(3, 0, 0)
    gtk_style_context_add_class (gtk_widget_get_style_context (toolbar), GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
#endif
    window->details->toolbar = toolbar;
    gtk_table_attach (GTK_TABLE (CAJA_WINDOW (window)->details->table),
                      toolbar,
                      /* X direction */                   /* Y direction */
                      0, 1,                               1, 2,
                      GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0,
                      0,                                  0);
    gtk_widget_show (toolbar);

    caja_navigation_window_initialize_toolbars (window);

    /* Set initial sensitivity of some buttons & menu items
     * now that they're all created.
     */
    caja_navigation_window_allow_back (window, FALSE);
    caja_navigation_window_allow_forward (window, FALSE);

    g_signal_connect_swapped (caja_preferences,
                              "changed::" CAJA_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY,
                              G_CALLBACK(always_use_location_entry_changed),
                              window);

    g_signal_connect_swapped (caja_preferences,
                              "changed::" CAJA_PREFERENCES_ALWAYS_USE_BROWSER,
                              G_CALLBACK(always_use_browser_changed),
                              window);
}