void
caja_navigation_window_pane_show_location_bar_temporarily (CajaNavigationWindowPane *pane)
{
    if (!caja_navigation_window_pane_location_bar_showing (pane))
    {
        caja_navigation_window_pane_show_location_bar (pane, FALSE);
        pane->temporary_location_bar = TRUE;
    }
}
Example #2
0
/**
 * caja_navigation_window_show:
 * @widget: a #GtkWidget.
 *
 * Call parent and then show/hide window items
 * base on user prefs.
 */
static void
caja_navigation_window_show (GtkWidget *widget)
{
    CajaNavigationWindow *window;
    gboolean show_location_bar;
    gboolean always_use_location_entry;
    GList *walk;

    window = CAJA_NAVIGATION_WINDOW (widget);

    /* Initially show or hide views based on preferences; once the window is displayed
     * these can be controlled on a per-window basis from View menu items.
     */

    if (g_settings_get_boolean (caja_window_state, CAJA_WINDOW_STATE_START_WITH_TOOLBAR))
    {
        caja_navigation_window_show_toolbar (window);
    }
    else
    {
        caja_navigation_window_hide_toolbar (window);
    }

    show_location_bar = g_settings_get_boolean (caja_window_state, CAJA_WINDOW_STATE_START_WITH_LOCATION_BAR);
    always_use_location_entry = g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY);
    for (walk = CAJA_WINDOW(window)->details->panes; walk; walk = walk->next)
    {
        CajaNavigationWindowPane *pane = walk->data;
        if (show_location_bar)
        {
            caja_navigation_window_pane_show_location_bar (pane, FALSE);
        }
        else
        {
            caja_navigation_window_pane_hide_location_bar (pane, FALSE);
        }

        if (always_use_location_entry)
        {
            caja_navigation_window_pane_set_bar_mode (pane, CAJA_BAR_NAVIGATION);
        }
        else
        {
            caja_navigation_window_pane_set_bar_mode (pane, CAJA_BAR_PATH);
        }
    }

    if (g_settings_get_boolean (caja_window_state, CAJA_WINDOW_STATE_START_WITH_SIDEBAR))
    {
        caja_navigation_window_show_sidebar (window);
    }
    else
    {
        caja_navigation_window_hide_sidebar (window);
    }

    if (g_settings_get_boolean (caja_window_state, CAJA_WINDOW_STATE_START_WITH_STATUS_BAR))
    {
        caja_navigation_window_show_status_bar (window);
    }
    else
    {
        caja_navigation_window_hide_status_bar (window);
    }

    GTK_WIDGET_CLASS (parent_class)->show (widget);
}