Skip to content
Snippets Groups Projects
Commit 318d1797 authored by rswindell's avatar rswindell
Browse files

Overhaul the "System FidoNet Addresses" configuration menu - mainly just

to add CUT/COPY/PASTE support, but also some beautification and sensible
updates.
parent 679fbb8f
No related branches found
No related tags found
No related merge requests found
...@@ -162,6 +162,7 @@ void net_cfg() ...@@ -162,6 +162,7 @@ void net_cfg()
,qhub_dflt,phub_dflt; ,qhub_dflt,phub_dflt;
char str[81],done; char str[81],done;
int i,j,k,l; int i,j,k,l;
int mode;
while(1) { while(1) {
i=0; i=0;
...@@ -280,6 +281,7 @@ void net_cfg() ...@@ -280,6 +281,7 @@ void net_cfg()
} }
else if(i==2) { /* FidoNet Stuff */ else if(i==2) { /* FidoNet Stuff */
static faddr_t savfaddr;
done=0; done=0;
while(!done) { while(!done) {
i=0; i=0;
...@@ -335,9 +337,13 @@ void net_cfg() ...@@ -335,9 +337,13 @@ void net_cfg()
uifc.helpbuf= uifc.helpbuf=
"`System FidoNet Addresses:`\n" "`System FidoNet Addresses:`\n"
"\n" "\n"
"This is the FidoNet address of this system used to receive NetMail.\n" "These are the FidoNet-style addresses of your system, used to receive\n"
"The Main address is also used as the default address for sub-boards.\n" "FidoNet-style NetMail and EchoMail over FidoNet Technology Networks.\n"
"Format: `Zone:Net/Node[.Point]`\n" "\n"
"The `Main` address is also used as the default address for Fido-Networked\n"
"sub-boards (EchoMail areas).\n"
"\n"
"The supported address format (so-called 3D or 4D): `Zone:Net/Node[.Point]`\n"
; ;
k=l=0; k=l=0;
while(1) { while(1) {
...@@ -346,29 +352,32 @@ void net_cfg() ...@@ -346,29 +352,32 @@ void net_cfg()
strcpy(str,"Main"); strcpy(str,"Main");
else else
sprintf(str,"AKA %u",i); sprintf(str,"AKA %u",i);
sprintf(opt[i],"%-8.8s %-16s" sprintf(opt[i],"%-8.8s %16s"
,str,smb_faddrtoa(&cfg.faddr[i],tmp)); ,str,smb_faddrtoa(&cfg.faddr[i],tmp));
} }
opt[i][0]=0; opt[i][0]=0;
j=WIN_RHT|WIN_SAV|WIN_ACT|WIN_INSACT; mode=WIN_RHT|WIN_SAV|WIN_ACT|WIN_INSACT;
if(cfg.total_faddrs<MAX_OPTS) if(cfg.total_faddrs<MAX_OPTS)
j|=WIN_INS|WIN_XTR; mode |= WIN_INS|WIN_XTR;
if(cfg.total_faddrs) if(cfg.total_faddrs)
j|=WIN_DEL; mode |= WIN_DEL|WIN_COPY|WIN_CUT;
i=uifc.list(j,0,0,0,&k,&l if(savfaddr.zone)
mode |= WIN_PASTE | WIN_PASTEXTR;
i=uifc.list(mode,0,0,0,&k,&l
,"System Addresses",opt); ,"System Addresses",opt);
if(i==-1) if(i==-1)
break; break;
int msk = i & MSK_ON; int msk = i & MSK_ON;
i &= MSK_OFF; i &= MSK_OFF;
if (msk == MSK_INS) { if (msk == MSK_INS || msk == MSK_PASTE) {
if(!cfg.total_faddrs) faddr_t newfaddr;
strcpy(str,"1:1/0"); if(msk == MSK_INS) {
else if(uifc.input(WIN_MID|WIN_SAV,0,0,"Address (e.g. 1:2/3 or 1:2/3.4)"
smb_faddrtoa(&cfg.faddr[0],str); ,str,25,K_UPPER) < 1)
if(!uifc.input(WIN_MID|WIN_SAV,0,0,"Address" continue;
,str,25,K_EDIT|K_UPPER)) newfaddr = atofaddr(str);
continue; } else
newfaddr = savfaddr;
if((cfg.faddr=(faddr_t *)realloc(cfg.faddr if((cfg.faddr=(faddr_t *)realloc(cfg.faddr
,sizeof(faddr_t)*(cfg.total_faddrs+1)))==NULL) { ,sizeof(faddr_t)*(cfg.total_faddrs+1)))==NULL) {
...@@ -382,12 +391,18 @@ void net_cfg() ...@@ -382,12 +391,18 @@ void net_cfg()
for(j=cfg.total_faddrs;j>i;j--) for(j=cfg.total_faddrs;j>i;j--)
cfg.faddr[j]=cfg.faddr[j-1]; cfg.faddr[j]=cfg.faddr[j-1];
cfg.faddr[i]=atofaddr(str); cfg.faddr[i]=newfaddr;
cfg.total_faddrs++; cfg.total_faddrs++;
uifc.changes=1; uifc.changes=1;
continue; continue;
} }
if (msk == MSK_DEL) { if (msk == MSK_COPY) {
savfaddr = cfg.faddr[i];
continue;
}
if (msk == MSK_DEL || msk == MSK_CUT) {
if(msk == MSK_CUT)
savfaddr = cfg.faddr[i];
cfg.total_faddrs--; cfg.total_faddrs--;
while(i<cfg.total_faddrs) { while(i<cfg.total_faddrs) {
cfg.faddr[i]=cfg.faddr[i+1]; cfg.faddr[i]=cfg.faddr[i+1];
...@@ -397,9 +412,9 @@ void net_cfg() ...@@ -397,9 +412,9 @@ void net_cfg()
continue; continue;
} }
smb_faddrtoa(&cfg.faddr[i],str); smb_faddrtoa(&cfg.faddr[i],str);
uifc.input(WIN_MID|WIN_SAV,0,0,"Address" if(uifc.input(WIN_MID|WIN_SAV,0,0,"Address"
,str,25,K_EDIT); ,str,25,K_EDIT|K_UPPER) >= 1)
cfg.faddr[i]=atofaddr(str); cfg.faddr[i]=atofaddr(str);
} }
break; break;
case 1: case 1:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment