static void cmd_h(key_info_t key_info, keys_info_t *keys_info) { descending = !descending; clear_at_pos(); print_at_pos(); wrefresh(sort_win); }
static void goto_line(int line) { if(line > bottom) line = bottom; if(curr == line) return; clear_at_pos(); curr = line; print_at_pos(); wrefresh(sort_win); }
static void cmd_k(key_info_t key_info, keys_info_t *keys_info) { if(key_info.count == NO_COUNT_GIVEN) key_info.count = 1; clear_at_pos(); curr -= key_info.count; if(curr < top) curr = top; print_at_pos(); wrefresh(sort_win); }
static void cmd_j(key_info_t key_info, keys_info_t *keys_info) { if(key_info.count == NO_COUNT_GIVEN) key_info.count = 1; clear_at_pos(); curr += key_info.count; if(curr > bottom) curr = bottom; print_at_pos(); wrefresh(sort_win); }
static void goto_line(int line) { line = top + (line - 1)*step; if(line > bottom) line = bottom; if(curr == line) return; clear_at_pos(); curr = line; print_at_pos(); wrefresh(change_win); }
void redraw_sort_dialog(void) { int x, y, cy; y = (getmaxy(stdscr) - ((top + SK_COUNT) - 2 + 3))/2; x = (getmaxx(stdscr) - SORT_WIN_WIDTH)/2; wresize(sort_win, MIN(getmaxy(stdscr), SK_COUNT + 6), SORT_WIN_WIDTH); mvwin(sort_win, MAX(0, y), x); werase(sort_win); box(sort_win, 0, 0); mvwaddstr(sort_win, 0, (getmaxx(sort_win) - 6)/2, " Sort "); mvwaddstr(sort_win, top - 2, 2, " Sort files by:"); cy = top; mvwaddstr(sort_win, cy++, 2, " [ ] e Extension"); mvwaddstr(sort_win, cy++, 2, " [ ] f File Extension"); mvwaddstr(sort_win, cy++, 2, " [ ] n Name"); mvwaddstr(sort_win, cy++, 2, " [ ] N Name (ignore case)"); mvwaddstr(sort_win, cy++, 2, " [ ] t Type"); mvwaddstr(sort_win, cy++, 2, " [ ] d Dir"); #ifndef _WIN32 mvwaddstr(sort_win, cy++, 2, " [ ] r Group ID"); mvwaddstr(sort_win, cy++, 2, " [ ] R Group Name"); mvwaddstr(sort_win, cy++, 2, " [ ] M Mode"); mvwaddstr(sort_win, cy++, 2, " [ ] p Permissions"); mvwaddstr(sort_win, cy++, 2, " [ ] o Owner ID"); mvwaddstr(sort_win, cy++, 2, " [ ] O Owner Name"); mvwaddstr(sort_win, cy++, 2, " [ ] L Links Count"); mvwaddstr(sort_win, cy++, 2, " [ ] I Inode"); #endif mvwaddstr(sort_win, cy++, 2, " [ ] s Size"); mvwaddstr(sort_win, cy++, 2, " [ ] i Item Count"); mvwaddstr(sort_win, cy++, 2, " [ ] u Groups"); mvwaddstr(sort_win, cy++, 2, " [ ] T Link Target"); mvwaddstr(sort_win, cy++, 2, " [ ] a Time Accessed"); #ifndef _WIN32 mvwaddstr(sort_win, cy++, 2, " [ ] c Time Changed"); #else mvwaddstr(sort_win, cy++, 2, " [ ] c Time Created"); #endif mvwaddstr(sort_win, cy++, 2, " [ ] m Time Modified"); mvwaddstr(sort_win, cy++, 2, " [ ] S Star Rating"); //add by sim1 assert(cy - top == SK_COUNT && "Sort dialog and sort options should not diverge"); print_at_pos(); ui_refresh_win(sort_win); }
/* Moves cursor to the specified line and updates the dialog. */ static void goto_line(int line) { if(line > bottom) { line = bottom; } if(curr == line) { return; } clear_at_pos(); curr = line; print_at_pos(); ui_refresh_win(sort_win); }