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

Add new loadable module for batch file transfer menu

You want to replace the built-in batch file transfer menu with your own
loadable module across all command shells? Now you can.
parent eb8ecbae
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #3862 passed
...@@ -37,6 +37,13 @@ void sbbs_t::batchmenu() ...@@ -37,6 +37,13 @@ void sbbs_t::batchmenu()
str_list_t ini; str_list_t ini;
str_list_t filenames; str_list_t filenames;
if(cfg.batxfer_mod[0] && !batchmenu_inside) {
batchmenu_inside = true;
exec_bin(cfg.batxfer_mod, &main_csi);
batchmenu_inside = false;
return;
}
if(batdn_total() < 1 && batup_total() < 1 && cfg.upload_dir==INVALID_DIR) { if(batdn_total() < 1 && batup_total() < 1 && cfg.upload_dir==INVALID_DIR) {
bputs(text[NoFilesInBatchQueue]); bputs(text[NoFilesInBatchQueue]);
return; return;
......
...@@ -1086,6 +1086,7 @@ public: ...@@ -1086,6 +1086,7 @@ public:
/* bat_xfer.cpp */ /* bat_xfer.cpp */
void batchmenu(void); void batchmenu(void);
bool batchmenu_inside = false;
void batch_add_list(char *list); void batch_add_list(char *list);
bool create_batchup_lst(void); bool create_batchup_lst(void);
bool create_batchdn_lst(bool native); bool create_batchdn_lst(bool native);
......
...@@ -2618,6 +2618,7 @@ void sys_cfg(void) ...@@ -2618,6 +2618,7 @@ void sys_cfg(void)
sprintf(opt[i++],"%-16.16s%s","Scan Dirs",cfg.scandirs_mod); sprintf(opt[i++],"%-16.16s%s","Scan Dirs",cfg.scandirs_mod);
sprintf(opt[i++],"%-16.16s%s","List Files",cfg.listfiles_mod); sprintf(opt[i++],"%-16.16s%s","List Files",cfg.listfiles_mod);
sprintf(opt[i++],"%-16.16s%s","View File Info",cfg.fileinfo_mod); sprintf(opt[i++],"%-16.16s%s","View File Info",cfg.fileinfo_mod);
sprintf(opt[i++],"%-16.16s%s","Batch Transfer",cfg.batxfer_mod);
sprintf(opt[i++],"%-16.16s%s","Temp Transfer",cfg.tempxfer_mod); sprintf(opt[i++],"%-16.16s%s","Temp Transfer",cfg.tempxfer_mod);
opt[i][0]=0; opt[i][0]=0;
uifc.helpbuf= uifc.helpbuf=
...@@ -2651,6 +2652,7 @@ void sys_cfg(void) ...@@ -2651,6 +2652,7 @@ void sys_cfg(void)
"`Scan Dirs` User scans one or more directories for files\n" "`Scan Dirs` User scans one or more directories for files\n"
"`List Files` User lists files within a file directory\n" "`List Files` User lists files within a file directory\n"
"`View File Info` User views detailed information on files in a directory\n" "`View File Info` User views detailed information on files in a directory\n"
"`Batch Transfer` Batch file transfer menu\n"
"`Temp Transfer` Temporary/archive file transfer menu\n" "`Temp Transfer` Temporary/archive file transfer menu\n"
"\n" "\n"
"`Note:` JavaScript modules take precedence over Baja modules if both exist\n" "`Note:` JavaScript modules take precedence over Baja modules if both exist\n"
...@@ -2760,6 +2762,10 @@ void sys_cfg(void) ...@@ -2760,6 +2762,10 @@ void sys_cfg(void)
,cfg.fileinfo_mod,sizeof(cfg.fileinfo_mod)-1,K_EDIT); ,cfg.fileinfo_mod,sizeof(cfg.fileinfo_mod)-1,K_EDIT);
break; break;
case 24: case 24:
uifc.input(WIN_MID|WIN_SAV,0,0,"Batch File Transfer Module"
,cfg.batxfer_mod, sizeof(cfg.batxfer_mod)-1, K_EDIT);
break;
case 25:
uifc.input(WIN_MID|WIN_SAV,0,0,"Temporary File Transfer Module" uifc.input(WIN_MID|WIN_SAV,0,0,"Temporary File Transfer Module"
,cfg.tempxfer_mod, sizeof(cfg.tempxfer_mod)-1, K_EDIT); ,cfg.tempxfer_mod, sizeof(cfg.tempxfer_mod)-1, K_EDIT);
break; break;
......
...@@ -619,6 +619,7 @@ typedef struct ...@@ -619,6 +619,7 @@ typedef struct
char prextrn_mod[LEN_CMD+1]; /* External Program pre-execution module */ char prextrn_mod[LEN_CMD+1]; /* External Program pre-execution module */
char postxtrn_mod[LEN_CMD+1]; /* External Program post-execution module */ char postxtrn_mod[LEN_CMD+1]; /* External Program post-execution module */
char tempxfer_mod[LEN_CMD+1]; char tempxfer_mod[LEN_CMD+1];
char batxfer_mod[LEN_CMD+1];
uchar smb_retry_time; /* Seconds to retry on SMBs */ uchar smb_retry_time; /* Seconds to retry on SMBs */
uint16_t sec_warn; /* Seconds before inactivity warning */ uint16_t sec_warn; /* Seconds before inactivity warning */
uint16_t sec_hangup; /* Seconds before inactivity hang-up */ uint16_t sec_hangup; /* Seconds before inactivity hang-up */
......
...@@ -252,6 +252,7 @@ BOOL read_main_cfg(scfg_t* cfg, char* error, size_t maxerrlen) ...@@ -252,6 +252,7 @@ BOOL read_main_cfg(scfg_t* cfg, char* error, size_t maxerrlen)
SAFECOPY(cfg->scandirs_mod, iniGetString(section, NULL, "scandirs", "", value)); SAFECOPY(cfg->scandirs_mod, iniGetString(section, NULL, "scandirs", "", value));
SAFECOPY(cfg->listfiles_mod, iniGetString(section, NULL, "listfiles", "", value)); SAFECOPY(cfg->listfiles_mod, iniGetString(section, NULL, "listfiles", "", value));
SAFECOPY(cfg->fileinfo_mod, iniGetString(section, NULL, "fileinfo", "", value)); SAFECOPY(cfg->fileinfo_mod, iniGetString(section, NULL, "fileinfo", "", value));
SAFECOPY(cfg->batxfer_mod, iniGetString(section, NULL, "batxfer", "", value));
SAFECOPY(cfg->tempxfer_mod, iniGetString(section, NULL, "tempxfer", "tempxfer", value)); SAFECOPY(cfg->tempxfer_mod, iniGetString(section, NULL, "tempxfer", "tempxfer", value));
/*******************/ /*******************/
......
...@@ -261,6 +261,7 @@ BOOL write_main_cfg(scfg_t* cfg, int backup_level) ...@@ -261,6 +261,7 @@ BOOL write_main_cfg(scfg_t* cfg, int backup_level)
iniSetString(&ini, name, "scandirs", cfg->scandirs_mod, NULL); iniSetString(&ini, name, "scandirs", cfg->scandirs_mod, NULL);
iniSetString(&ini, name, "listfiles", cfg->listfiles_mod, NULL); iniSetString(&ini, name, "listfiles", cfg->listfiles_mod, NULL);
iniSetString(&ini, name, "fileinfo", cfg->fileinfo_mod, NULL); iniSetString(&ini, name, "fileinfo", cfg->fileinfo_mod, NULL);
iniSetString(&ini, name, "batxfer", cfg->batxfer_mod, NULL);
iniSetString(&ini, name, "tempxfer", cfg->tempxfer_mod, NULL); iniSetString(&ini, name, "tempxfer", cfg->tempxfer_mod, NULL);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment