static void peer_print_dir (void *msg) { fs_msg_s *m = msg; FN; dir_print(m->dir_id, m->dir_indent); }
void wd_hndlmenu(int item, int keystate) { WINDOW *w; int object; char path[4]; /* DjV 020 120103 drive path only */ int ii,jj; /* DjV 020 120103 do nothing */ int n, *list; /* DjV 029 160203 moved here from several places below */ switch (item) { case MOPEN: w = selection.w; object = selection.selected; if ((w != NULL) || (object >= 0)) { if (itm_open(w, object, keystate) == TRUE) itm_select(w, object, 2, TRUE); itm_set_menu(selection.w); } /* DjV 028 280103 ---vvv--- */ /* If nothing else is selected, open form to enter item specification */ else item_open( NULL, 0, 0 ); /* DjV 028 280103 ---^^^--- */ break; case MSHOWINF: if ((w = selection.w) != NULL) { if ((itm_list(w, &n, &list) == TRUE) && (n > 0)) { ((ITM_WINDOW *) w)->itm_func->itm_showinfo(w, n, list, FALSE); /* DjV 017 150103 (FALSE) */ free(list); } } /* DjV 020 120103 * Show info on drive for top window if nothing else selected; * TOS >=2.06 does it this way; info on current folder would * have been better but somewhat more complicated; even more so * info on file open in a text window? */ else if ( ( w=xw_top() ) != NULL && xw_type(w) == DIR_WIND ) { strsncpy (path, wd_toppath(), sizeof(path)); /* HR 120203: secure cpy */ si_drive( path, &ii, &jj ); closeinfo(); /* DjV 022 120103 */ } break; case MSEARCH: /* DjV 016 050103 */ if ((w = selection.w) != NULL) { if ((itm_list(w, &n, &list) == TRUE) && (n > 0)) { ((ITM_WINDOW *) w)->itm_func->itm_showinfo(w, n, list, TRUE); free(list); } } break; case MNEWDIR: if (((w = xw_top()) != NULL) && (xw_type(w) == DIR_WIND)) ((ITM_WINDOW *) w)->itm_func->wd_newfolder(w); break; /* DjV 029 030103 150203 160203 ---vvv--- */ case MPRINT: if ((w = selection.w) != NULL) { if ((itm_list(w, &n, &list) == TRUE) && (n > 0)) { boolean item_print(WINDOW *w, int n, int *list); item_print(w, n, list); free(list); } } else if ( ( w=xw_top() ) != NULL ) { if ( xw_type(w) == DIR_WIND ) { itm_select(w, 0, 4, TRUE); if ( itm_list(w, &n, &list) ) { dir_print(w, n, list); free(list); } wd_deselect_all(); dir_always_update(w); } else if ( xw_type(w) == TEXT_WIND ) { /* Perhaps here print the file currently in a text window ? */ } } break; /* DJV 029 030103 150203 160203 ---^^^--- */ case MDELETE: /* HR 151102 */ if ((w = selection.w) != NULL) { if ((itm_list(w, &n, &list) == TRUE) && (n > 0)) { itm_delete(w, n, list); free(list); } } break; case MCLOSE: case MCLOSEW: if ((w = xw_top()) != NULL) { switch(xw_type(w)) { case DIR_WIND : dir_close(w, (item == MCLOSEW) ? 1 : 0); break; case TEXT_WIND : txt_closed(w); break; } } break; case MSELALL: if (((w = xw_top()) != NULL) && (xw_type(w) == DIR_WIND)) { if (selection.w != w) desel_old(); itm_select(w, 0, 4, TRUE); itm_set_menu(w); } break; case MCYCLE: xw_cycle(); break; #if MFFORMAT /* HR 050303 */ case MFCOPY: /* DjV 006 291202 */ formatfloppy(floppy, FALSE); break; case MFFORMAT: /* DjV 006 291202 */ formatfloppy(floppy,TRUE); break; #endif case MSETMASK: if (((w = xw_top()) != NULL) && (xw_type(w) == DIR_WIND)) wd_set_filemask(w); else /* DjV 004 290103 */ wd_filemask(NULL); /* DjV 004 290103 */ break; case MSHOWTXT: case MSHOWICN: wd_mode(item - MSHOWTXT); break; case MSNAME: case MSEXT: case MSDATE: case MSSIZE: case MSUNSORT: wd_sort(item - MSNAME); break; /* DjV 010 261202 ---vvv--- */ case MSHSIZ: options.V2_2.fields ^= WD_SHSIZ; wd_fields(); break; case MSHDAT: options.V2_2.fields ^= WD_SHDAT; wd_fields(); break; case MSHTIM: options.V2_2.fields ^= WD_SHTIM; wd_fields(); break; case MSHATT: options.V2_2.fields ^= WD_SHATT; wd_fields(); break; /* DjV 010 261202 ---^^^--- */ /* DjV 004 020103 ---vvv--- case MHIDDEN: options.attribs ^= FA_HIDDEN; wd_attrib(); break; case MSYSTEM: options.attribs ^= FA_SYSTEM; wd_attrib(); break; DjV 004 020103 ---^^^--- */ } }