Skip to content
Snippets Groups Projects
Commit 84b1451e authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Make (D)esc command short-cut to just edit file descriptions

Now, just 'E', then 'D' from the batch flag prompt has you editing a file description - rather than going through all the prompts for uploader name/date, etc.
parent 1f96cc0b
No related branches found
No related tags found
No related merge requests found
......@@ -304,10 +304,8 @@ bool sbbs_t::editfilename(file_t* f)
return true;
}
bool sbbs_t::editfileinfo(file_t* f)
bool sbbs_t::editfiledesc(file_t* f)
{
char str[MAX_PATH + 1];
// Description
bputs(text[EditDescription]);
char fdesc[LEN_FDESC + 1];
......@@ -318,6 +316,13 @@ bool sbbs_t::editfileinfo(file_t* f)
if(strcmp(fdesc, f->desc))
smb_new_hfield_str(f, SMB_FILEDESC, fdesc);
return updatefile(&cfg, f);
}
bool sbbs_t::editfileinfo(file_t* f)
{
char str[MAX_PATH + 1];
// Tags
if((cfg.dir[f->dir]->misc & DIR_FILETAGS) || dir_op(f->dir)) {
char tags[64] = "";
......
......@@ -811,7 +811,7 @@ int sbbs_t::listfileinfo(uint dirnum, const char *filespec, long mode)
|| mode==FI_OFFLINE) {
SYNC;
// CRLF;
SAFECOPY(str, "VEQRN\r");
SAFECOPY(str, "VDEQRN\r");
if(m > 1)
SAFECAT(str, "P-\b");
if(dir_op(dirnum)) {
......@@ -832,12 +832,16 @@ int sbbs_t::listfileinfo(uint dirnum, const char *filespec, long mode)
pause();
m--;
continue;
case 'D': /* edit file description */
editfiledesc(f);
break;
case 'E': /* edit file information */
if(dir_op(dirnum)) {
if(!editfilename(f))
break;
}
editfileinfo(f);
if(editfiledesc(f))
editfileinfo(f);
break;
case 'F': /* delete file only */
SAFEPRINTF2(str,"%s%s",dirpath,f->name);
......
......@@ -1047,6 +1047,7 @@ public:
bool clearbatdl(void);
bool clearbatul(void);
bool editfilename(file_t*);
bool editfiledesc(file_t*);
bool editfileinfo(file_t*);
long delfiles(const char *inpath, const char *spec, size_t keep = 0);
......
......@@ -377,16 +377,16 @@ const char * const text_defaults[TOTAL_TEXT]={
"\x6c\x6f\x61\x64\x20\x71\x75\x65\x75\x65\x01\x63\x20\x2d\x20\x46\x69\x6c\x65\x73\x3a\x20\x01\x68\x25\x75\x20\x01\x6e\x01\x63\x28"
"\x01\x68\x25\x75\x01\x6e\x01\x63\x20\x4d\x61\x78\x29\x0d\x0a" // 230 FileAddedToUlQueue
,"\x01\x6e\x01\x3f\x01\x67\x01\x68\x25\x73\x01\x79\x3a\x20\x01\x77\x7e\x42\x01\x79\x61\x74\x63\x68\x20\x64\x6f\x77\x6e\x6c\x6f\x61"
"\x64\x2c\x20\x01\x77\x7e\x45\x01\x79\x64\x69\x74\x20\x69\x6e\x66\x6f\x2c\x20\x01\x77\x7e\x56\x01\x79\x69\x65\x77\x20\x66\x69\x6c"
"\x65\x2c\x20\x01\x77\x7e\x51\x01\x79\x75\x69\x74\x2c\x20\x01\x77\x7e\x50\x01\x79\x72\x65\x76\x20\x6f\x72\x20\x5b\x7e\x4e\x65\x78"
"\x74\x5d\x3a\x20\x01\x77" // 231 FileInfoEditPrompt
"\x64\x2c\x20\x01\x77\x7e\x45\x01\x79\x64\x69\x74\x20\x69\x6e\x66\x6f\x2f\x01\x77\x7e\x44\x01\x79\x65\x73\x63\x2c\x20\x01\x77\x7e"
"\x56\x01\x79\x69\x65\x77\x20\x66\x69\x6c\x65\x2c\x20\x01\x77\x7e\x51\x01\x79\x75\x69\x74\x2c\x20\x01\x77\x7e\x50\x01\x79\x72\x65"
"\x76\x20\x6f\x72\x20\x5b\x7e\x4e\x65\x78\x74\x5d\x3a\x20\x01\x77" // 231 FileInfoEditPrompt
,"\x01\x6e\x01\x3f\x01\x67\x01\x68\x25\x73\x01\x79\x3a\x20\x01\x77\x7e\x42\x01\x79\x61\x74\x63\x68\x20\x64\x6f\x77\x6e\x6c\x6f\x61"
"\x64\x2c\x20\x01\x77\x7e\x45\x01\x79\x78\x74\x65\x6e\x64\x65\x64\x20\x69\x6e\x66\x6f\x2c\x20\x01\x77\x7e\x56\x01\x79\x69\x65\x77"
"\x20\x66\x69\x6c\x65\x2c\x20\x01\x77\x7e\x51\x01\x79\x75\x69\x74\x2c\x20\x01\x77\x7e\x50\x01\x79\x72\x65\x76\x20\x6f\x72\x20\x5b"
"\x7e\x4e\x65\x78\x74\x5d\x3a\x20\x01\x77" // 232 FileInfoPrompt
,"\x0d\x0a\x7e\x51\x75\x69\x74\x20\x6f\x72\x20\x5b\x7e\x4e\x65\x78\x74\x5d\x3a\x20" // 233 QuitOrNext
,"\x7e\x52\x65\x6d\x6f\x76\x65\x2c\x20\x7e\x4d\x6f\x76\x65\x2c\x20\x7e\x45\x64\x69\x74\x2c\x20\x7e\x56\x69\x65\x77\x2c\x20\x7e\x51"
"\x75\x69\x74\x2c\x20\x7e\x50\x72\x65\x76\x20\x6f\x72\x20\x5b\x7e\x4e\x65\x78\x74\x5d\x3a\x20" // 234 RExemptRemoveFilePrompt
,"\x7e\x52\x65\x6d\x6f\x76\x65\x2c\x20\x7e\x4d\x6f\x76\x65\x2c\x20\x7e\x45\x64\x69\x74\x2c\x20\x7e\x44\x65\x73\x63\x2c\x20\x7e\x56"
"\x69\x65\x77\x2c\x20\x7e\x51\x75\x69\x74\x2c\x20\x7e\x50\x72\x65\x76\x20\x6f\x72\x20\x5b\x7e\x4e\x65\x78\x74\x5d\x3a\x20" // 234 RExemptRemoveFilePrompt
,"\x01\x6e\x28\x25\x64\x29\x20\x25\x73\x0d\x0a" // 235 MoveToLibLstFmt
,"\x01\x5f\x0d\x0a\x01\x79\x01\x68\x4c\x69\x62\x72\x61\x72\x79\x20\x5b\x25\x64\x5d\x3a\x20\x01\x6e" // 236 MoveToLibPrompt
,"\x01\x6e\x28\x25\x64\x29\x20\x25\x73\x0d\x0a" // 237 MoveToDirLstFmt
......@@ -394,10 +394,10 @@ const char * const text_defaults[TOTAL_TEXT]={
,"\x25\x73\x20\x6d\x6f\x76\x65\x64\x20\x74\x6f\x20\x25\x73\x20\x25\x73\x2e\x0d\x0a" // 239 MovedFile
,"\x0d\x0a\x43\x6c\x6f\x73\x65\x20\x66\x69\x6c\x65\x20\x72\x65\x63\x6f\x72\x64" // 240 CloseFileRecordQ
,"\x7e\x52\x65\x6d\x6f\x76\x65\x2c\x20\x7e\x43\x72\x65\x64\x69\x74\x73\x20\x6f\x6e\x6c\x79\x2c\x20\x7e\x46\x69\x6c\x65\x20\x6f\x6e"
"\x6c\x79\x2c\x20\x7e\x4d\x6f\x76\x65\x2c\x20\x7e\x45\x64\x69\x74\x2c\x20\x7e\x56\x69\x65\x77\x2c\x20\x7e\x51\x75\x69\x74\x2c\x20"
"\x7e\x50\x72\x65\x76\x20\x6f\x72\x20\x5b\x7e\x4e\x65\x78\x74\x5d\x3a\x20" // 241 SysopRemoveFilePrompt
,"\x7e\x52\x65\x6d\x6f\x76\x65\x2c\x20\x7e\x45\x64\x69\x74\x2c\x20\x7e\x56\x69\x65\x77\x2c\x20\x7e\x51\x75\x69\x74\x2c\x20\x7e\x50"
"\x72\x65\x76\x20\x6f\x72\x20\x5b\x7e\x4e\x65\x78\x74\x5d\x3a\x20" // 242 UserRemoveFilePrompt
"\x6c\x79\x2c\x20\x7e\x4d\x6f\x76\x65\x2c\x20\x7e\x45\x64\x69\x74\x2c\x20\x7e\x44\x65\x73\x63\x2c\x20\x7e\x56\x69\x65\x77\x2c\x20"
"\x7e\x51\x75\x69\x74\x2c\x20\x7e\x50\x72\x65\x76\x20\x6f\x72\x20\x5b\x7e\x4e\x65\x78\x74\x5d\x3a\x20" // 241 SysopRemoveFilePrompt
,"\x7e\x52\x65\x6d\x6f\x76\x65\x2c\x20\x7e\x45\x64\x69\x74\x2c\x20\x7e\x44\x65\x73\x63\x2c\x20\x7e\x56\x69\x65\x77\x2c\x20\x7e\x51"
"\x75\x69\x74\x2c\x20\x7e\x50\x72\x65\x76\x20\x6f\x72\x20\x5b\x7e\x4e\x65\x78\x74\x5d\x3a\x20" // 242 UserRemoveFilePrompt
,"\x0d\x0a\x01\x6e\x01\x72\x01\x68\x46\x69\x6c\x65\x20\x64\x6f\x65\x73\x20\x6e\x6f\x74\x20\x65\x78\x69\x73\x74\x3a\x20\x01\x63\x25"
"\x73\x01\x6e\x0d\x0a" // 243 FileDoesNotExist
,"\x07\x0d\x0a\x01\x72\x01\x68\x01\x69\x43\x6f\x75\x6c\x64\x6e\x27\x74\x20\x72\x65\x6d\x6f\x76\x65\x20\x27\x25\x73\x27\x2e\x01\x6e"
......
......@@ -47,7 +47,10 @@ int sbbs_t::viewfile(file_t* f, bool ext)
viewfilecontents(f);
ASYNC;
mnemonics(str);
ch=(char)getkeys("BEVQPN\b-\r",0);
SAFECOPY(str, "BEVQPN\b-\r");
if(can_edit)
SAFECAT(str, "D");
ch=(char)getkeys(str, 0);
if(ch=='Q' || sys_status&SS_ABORT)
return(0);
switch(ch) {
......@@ -55,10 +58,15 @@ int sbbs_t::viewfile(file_t* f, bool ext)
addtobatdl(f);
CRLF;
return(-1);
case 'D':
editfiledesc(f);
continue;
case 'E':
if(ext && can_edit)
if(ext && can_edit) {
if(!editfiledesc(f))
continue;
editfileinfo(f);
else
} else
ext = true;
continue;
case 'V':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment