Commit 1fb31834 authored by rswindell's avatar rswindell
Browse files

When importing an EchoList or Area File into a message group, automatically

set the "Networked via FidoNet" flag for the newly created subs.
Similarly, for QWKnet and importing a control.dat file.
Also fixed a cosmetic issue with the import/export file type window
disappearing before the file path/name intput box appears.
parent 73f34ddb
......@@ -142,7 +142,7 @@ int export_mdm(char *fname);
int code_ok(char *str);
int bits(long l);
void getar(char *desc, char *ar);
bool new_sub(unsigned new_subnum, unsigned group_num, sub_t* pasted_sub);
bool new_sub(unsigned new_subnum, unsigned group_num, sub_t* pasted_sub, long misc);
bool new_qhub_sub(qhub_t*, unsigned qsubnum, sub_t*, unsigned confnum);
void remove_sub(scfg_t*, unsigned subnum, bool cut);
void sort_subs(int grpnum);
......
......@@ -112,6 +112,7 @@ long import_msg_areas(enum import_list_type type, FILE* stream, unsigned grpnum
size_t grpname_len = strlen(cfg.grp[grpnum]->sname);
char duplicate_code[LEN_CODE+1]="";
uint duplicate_codes = 0; // consecutive duplicate codes
long new_sub_misc = 0;
if(added != NULL)
*added = 0;
......@@ -223,8 +224,10 @@ long import_msg_areas(enum import_list_type type, FILE* stream, unsigned grpnum
SAFECOPY(tmpsub.lname, p);
SAFECOPY(tmpsub.sname, p);
SAFECOPY(tmpsub.qwkname, p);
new_sub_misc = SUB_QNET;
}
else {
new_sub_misc = SUB_FIDO;
char* p=str;
SKIP_WHITESPACE(p);
if(!*p || *p==';')
......@@ -329,7 +332,7 @@ long import_msg_areas(enum import_list_type type, FILE* stream, unsigned grpnum
return -2;
if(j==cfg.total_subs) {
if(!new_sub(j, grpnum, /* pasted_sub: */NULL))
if(!new_sub(j, grpnum, /* pasted_sub: */NULL, new_sub_misc))
return -3;
if(added != NULL)
(*added)++;
......@@ -720,7 +723,7 @@ void msgs_cfg()
" and (optional) descriptions.\n"
;
k = uifc.list(WIN_MID|WIN_SAV,0,0,0,&export_list_type,0
k = uifc.list(WIN_MID|WIN_ACT,0,0,0,&export_list_type,0
,"Export Area File Format",opt);
if(k==-1)
break;
......@@ -851,7 +854,7 @@ void msgs_cfg()
" FidoNet standard EchoList containing standardized echo `Area Tags`\n"
" and (optional) descriptions.\n"
;
k=uifc.list(WIN_MID|WIN_SAV,0,0,0,&import_list_type,0
k=uifc.list(WIN_MID|WIN_ACT,0,0,0,&import_list_type,0
,"Import Area File Format",opt);
if(k < 0)
break;
......
......@@ -35,7 +35,7 @@
static sub_t** cut_qhub_sub;
bool new_sub(unsigned new_subnum, unsigned group_num, sub_t* pasted_sub)
bool new_sub(unsigned new_subnum, unsigned group_num, sub_t* pasted_sub, long misc)
{
sub_t* new_subboard;
if ((new_subboard = (sub_t *)malloc(sizeof(*new_subboard))) == NULL) {
......@@ -47,6 +47,7 @@ bool new_sub(unsigned new_subnum, unsigned group_num, sub_t* pasted_sub)
new_subboard->faddr = cfg.faddr[0];
/* ToDo: Define these defaults somewhere else: */
new_subboard->misc = (SUB_NSDEF | SUB_SSDEF | SUB_QUOTE | SUB_TOUSER | SUB_FAST);
new_subboard->misc |= misc;
new_subboard->maxmsgs = 500;
/* Use last sub in group (if exists) as a template for new subs */
......@@ -273,7 +274,7 @@ void sub_cfg(uint grpnum)
continue;
}
if (!new_sub(subnum[i], grpnum, /* pasted_sub: */NULL))
if (!new_sub(subnum[i], grpnum, /* pasted_sub: */NULL, /* misc: */0))
continue;
SAFECOPY(cfg.sub[subnum[i]]->code_suffix,code);
......@@ -325,7 +326,7 @@ void sub_cfg(uint grpnum)
continue;
}
if(msk == MSK_PASTE) {
if (!new_sub(subnum[i], grpnum, &savsub))
if (!new_sub(subnum[i], grpnum, &savsub, /* misc: */0))
continue;
uifc.changes = TRUE;
continue;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment