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); }
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; }
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); }
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); }
/* 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; }
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)); } }
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); } }
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; }
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); } } }
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); }
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; }
struct WPanel * get_other_panel (void) { return (struct WPanel *) get_panel_widget (get_other_index ()); }
WPanel * get_other_panel (void) { return PANEL (get_panel_widget (get_other_index ())); }