Example #1
0
File: layout.c Project: artzub/mc
static Widget *
restore_into_right_dir_panel (int idx, Widget * from_widget)
{
    Widget *new_widget = NULL;
    const char *saved_dir = panels[idx].last_saved_dir;
    gboolean last_was_panel = (from_widget && get_display_type (idx) != view_listing);
    const char *p_name = get_nth_panel_name (idx);

    if (last_was_panel)
        new_widget = (Widget *) panel_new_with_dir (p_name, saved_dir);
    else
        new_widget = (Widget *) panel_new (p_name);

    return new_widget;
}
Example #2
0
File: layout.c Project: m32/mc
static Widget *
restore_into_right_dir_panel (int idx, Widget * from_widget)
{
    WPanel *new_widget;
    const char *saved_dir = panels[idx].last_saved_dir;
    gboolean last_was_panel = (from_widget && get_display_type (idx) != view_listing);
    const char *p_name = get_nth_panel_name (idx);

    if (last_was_panel)
    {
        vfs_path_t *saved_dir_vpath;

        saved_dir_vpath = vfs_path_from_str (saved_dir);
        new_widget = panel_new_with_dir (p_name, saved_dir_vpath);
        vfs_path_free (saved_dir_vpath);
    }
    else
        new_widget = panel_new (p_name);

    return WIDGET (new_widget);
}