예제 #1
0
void
quick_view_cmd (void)
{
    if (PANEL (get_panel_widget (MENU_PANEL_IDX)) == current_panel)
        change_panel ();
    set_display_type (MENU_PANEL_IDX, view_quick);
}
예제 #2
0
파일: layout.c 프로젝트: artzub/mc
const char *
get_panel_dir_for (const WPanel * widget)
{
    int i;

    for (i = 0; i < MAX_VIEWS; i++)
        if ((WPanel *) get_panel_widget (i) == widget)
            break;

    if (i >= MAX_VIEWS)
        return ".";

    if (get_display_type (i) == view_listing)
        return ((WPanel *) get_panel_widget (i))->cwd;

    return panels[i].last_saved_dir;
}
예제 #3
0
void
toggle_listing_cmd (void)
{
    int current = get_current_index ();
    WPanel *p = (WPanel *) get_panel_widget (current);

    set_basic_panel_listing_to (current, (p->list_type + 1) % LIST_TYPES);
}
예제 #4
0
파일: layout.c 프로젝트: m32/mc
char *
get_panel_dir_for (const WPanel * widget)
{
    int i;

    for (i = 0; i < MAX_VIEWS; i++)
        if (PANEL (get_panel_widget (i)) == widget)
            break;

    if (i >= MAX_VIEWS)
        return g_strdup (".");

    if (get_display_type (i) == view_listing)
    {
        vfs_path_t *cwd_vpath;

        cwd_vpath = PANEL (get_panel_widget (i))->cwd_vpath;
        return g_strdup (vfs_path_as_str (cwd_vpath));
    }

    return g_strdup (panels[i].last_saved_dir);
}
예제 #5
0
파일: cmd.c 프로젝트: GalaxyTab4/workbench
/* Handle the tree internal listing modes switching */
static int
set_basic_panel_listing_to (int panel_index, int listing_mode)
{
    WPanel *p = (WPanel *) get_panel_widget (panel_index);

    switch_to_listing (panel_index);
    p->list_type = listing_mode;
    if (set_panel_formats (p))
	return 0;
	
    do_refresh ();
    return 1;
}
예제 #6
0
파일: layout.c 프로젝트: m32/mc
void
save_panel_dir (int idx)
{
    panel_view_mode_t type = get_display_type (idx);
    Widget *widget = get_panel_widget (idx);

    if ((type == view_listing) && (widget != NULL))
    {
        WPanel *w = PANEL (widget);

        g_free (panels[idx].last_saved_dir);    /* last path no needed */
        /* Because path can be nonlocal */
        panels[idx].last_saved_dir = g_strdup (vfs_path_as_str (w->cwd_vpath));
    }
}
예제 #7
0
파일: layout.c 프로젝트: artzub/mc
void
save_panel_dir (int idx)
{
    panel_view_mode_t type = get_display_type (idx);
    Widget *widget = get_panel_widget (idx);

    if ((type == view_listing) && (widget != NULL))
    {
        WPanel *w = (WPanel *) widget;
        char *widget_work_dir = w->cwd;

        g_free (panels[idx].last_saved_dir);    /* last path no needed */
        /* Because path can be nonlocal */
        panels[idx].last_saved_dir = g_strdup (widget_work_dir);
    }
}
예제 #8
0
static gboolean
set_basic_panel_listing_to (int panel_index, int listing_mode)
{
    WPanel *p = (WPanel *) get_panel_widget (panel_index);
    gboolean ok;

    switch_to_listing (panel_index);
    p->list_type = listing_mode;

    ok = set_panel_formats (p) == 0;

    if (ok)
        do_refresh ();

    return ok;
}
예제 #9
0
static void
switch_to_listing (int panel_index)
{
    if (get_display_type (panel_index) != view_listing)
        set_display_type (panel_index, view_listing);
    else
    {
        WPanel *p;

        p = PANEL (get_panel_widget (panel_index));
        if (p->is_panelized)
        {
            p->is_panelized = FALSE;
            panel_reload (p);
        }
    }
}
예제 #10
0
파일: cmd.c 프로젝트: GalaxyTab4/workbench
void
toggle_listing_cmd (void)
{
    int current = get_current_index ();
    WPanel *p = (WPanel *) get_panel_widget (current);
    int list_mode = p->list_type;
    int m;
    
    switch (list_mode){
    case list_full:
    case list_brief:
	m = list_long;
	break;
    case list_long:
	m = list_user;
	break;
    default:
	m = list_full;
    }
    if (set_basic_panel_listing_to (current, m))
	return;
    set_basic_panel_listing_to (current, list_full);
}
예제 #11
0
파일: layout.c 프로젝트: artzub/mc
void
panel_update_cols (Widget * widget, panel_display_t frame_size)
{
    int cols, origin;

    /* don't touch panel if it is not in dialog yet */
    /* if panel is not in dialog it is not in widgets list
       and cannot be compared with get_panel_widget() result */
    if (widget->owner == NULL)
        return;

    if (horizontal_split)
    {
        widget->cols = COLS;
        return;
    }

    if (frame_size == frame_full)
    {
        cols = COLS;
        origin = 0;
    }
    else if (widget == get_panel_widget (0))
    {
        cols = first_panel_size;
        origin = 0;
    }
    else
    {
        cols = COLS - first_panel_size;
        origin = first_panel_size;
    }

    widget->cols = cols;
    widget->x = origin;
}
예제 #12
0
struct WPanel *
get_other_panel (void)
{
    return (struct WPanel *) get_panel_widget (get_other_index ());
}
예제 #13
0
파일: layout.c 프로젝트: m32/mc
WPanel *
get_other_panel (void)
{
    return PANEL (get_panel_widget (get_other_index ()));
}