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

If file already in download queue, don't display protocol selection

Use localizable [Q]uit key

Removed trailing whitespace
parent 673210b0
Branches
Tags
No related merge requests found
Pipeline #6919 failed
......@@ -835,7 +835,7 @@ int sbbs_t::listfileinfo(const int dirnum, const char *filespec, const int mode)
|| mode==FI_OFFLINE) {
sync();
// CRLF;
SAFECOPY(str, "VDEQRN\r");
SAFEPRINTF(str, "VDERN\r%c", quit_key());
if(m > 1)
SAFECAT(str, "P-\b");
if(dir_op(dirnum)) {
......@@ -848,7 +848,13 @@ int sbbs_t::listfileinfo(const int dirnum, const char *filespec, const int mode)
}
else
mnemonics(text[UserRemoveFilePrompt]);
switch(getkeys(str,0)) {
char key = getkeys(str, 0);
if(key == quit_key()) {
found=-1;
done=1;
break;
}
switch(key) {
case 'V':
viewfilecontents(f);
CRLF;
......@@ -951,18 +957,16 @@ int sbbs_t::listfileinfo(const int dirnum, const char *filespec, const int mode)
if(m)
m--;
break;
case 'Q': /* quit */
found=-1;
done=1;
break;
}
}
else if(mode==FI_DOWNLOAD || mode==FI_USERXFER) {
char keys[128];
SAFEPRINTF(keys, "\r%c", quit_key());
getfilepath(&cfg, f, path);
if(getfilesize(&cfg, f) < 1L) { /* getfilesize will set this to -1 if non-existant */
sync(); /* and 0 byte files shouldn't be d/led */
mnemonics(text[QuitOrNext]);
if(getkeys("\rQ",0)=='Q') {
if(getkeys(keys,0)==quit_key()) {
found=-1;
break;
}
......@@ -974,7 +978,7 @@ int sbbs_t::listfileinfo(const int dirnum, const char *filespec, const int mode)
bprintf(text[YouOnlyHaveNCredits]
,u64toac(user_available_credits(&useron),tmp));
mnemonics(text[QuitOrNext]);
if(getkeys("\rQ",0)=='Q') {
if(getkeys(keys,0)==quit_key()) {
found=-1;
break;
}
......@@ -984,7 +988,7 @@ int sbbs_t::listfileinfo(const int dirnum, const char *filespec, const int mode)
sync();
bputs(text[CantDownloadFromDir]);
mnemonics(text[QuitOrNext]);
if(getkeys("\rQ",0)=='Q') {
if(getkeys(keys,0)==quit_key()) {
found=-1;
break;
}
......@@ -996,7 +1000,17 @@ int sbbs_t::listfileinfo(const int dirnum, const char *filespec, const int mode)
sync();
bputs(text[NotEnoughTimeToDl]);
mnemonics(text[QuitOrNext]);
if(getkeys("\rQ",0)=='Q') {
if(getkeys(keys,0)==quit_key()) {
found=-1;
break;
}
continue;
}
if(batch_file_exists(&cfg, useron.number, XFER_BATCH_DOWNLOAD, f->name)) {
sync();
bprintf(text[FileAlreadyInQueue], f->name);
mnemonics(text[QuitOrNext]);
if(getkeys(keys,0)==quit_key()) {
found=-1;
break;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment