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

Simplify the node config menu, eliminating Toggles/Advanced Options menus

There's only one toggle left (Leave node file open) and not very many advanced
options.

Unfortuantely, can't easily do the cool left-right cycle through nodes since
each node file has to be saved/loaded, but still, easier to visualize any
differences between node configs with all the settings on one menu.
parent bb492723
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
Pipeline #6285 passed
...@@ -192,16 +192,17 @@ void node_menu() ...@@ -192,16 +192,17 @@ void node_menu()
void node_cfg() void node_cfg()
{ {
static int node_dflt; static int node_dflt;
char done,str[81]; char str[81];
static int adv_dflt,tog_dflt,tog_bar;
int i; int i;
while(1) { while(1) {
i=0; i=0;
snprintf(opt[i++], MAX_OPLN, "%-27.27s%s","Phone Number",cfg.node_phone); snprintf(opt[i++], MAX_OPLN, "%-27.27s%s","Phone Number",cfg.node_phone);
snprintf(opt[i++], MAX_OPLN, "%-27.27s%s","Logon Requirements",cfg.node_arstr); snprintf(opt[i++], MAX_OPLN, "%-27.27s%s","Logon Requirements",cfg.node_arstr);
strcpy(opt[i++],"Toggle Options..."); snprintf(opt[i++], MAX_OPLN, "%-27.27s%s","Keep Node File Open",cfg.node_misc&NM_CLOSENODEDAB ? "No":"Yes");
strcpy(opt[i++],"Advanced Options..."); snprintf(opt[i++], MAX_OPLN, "%-27.27s%s","Daily Event",cfg.node_daily);
snprintf(opt[i++], MAX_OPLN, "%-27.27s%s","Node Directory",cfg.node_path[cfg.node_num-1]);
snprintf(opt[i++], MAX_OPLN, "%-27.27s%s","Text Directory",cfg.text_dir);
opt[i][0]=0; opt[i][0]=0;
sprintf(str,"Node %d Configuration",cfg.node_num); sprintf(str,"Node %d Configuration",cfg.node_num);
uifc.helpbuf= uifc.helpbuf=
...@@ -221,7 +222,7 @@ void node_cfg() ...@@ -221,7 +222,7 @@ void node_cfg()
if(i!=-1) if(i!=-1)
return; return;
break; break;
case 0: case __COUNTER__:
uifc.helpbuf= uifc.helpbuf=
"`Node Phone Number:`\n" "`Node Phone Number:`\n"
"\n" "\n"
...@@ -230,32 +231,11 @@ void node_cfg() ...@@ -230,32 +231,11 @@ void node_cfg()
; ;
uifc.input(WIN_MID|WIN_SAV,0,10,"Phone Number",cfg.node_phone,sizeof(cfg.node_phone)-1,K_EDIT); uifc.input(WIN_MID|WIN_SAV,0,10,"Phone Number",cfg.node_phone,sizeof(cfg.node_phone)-1,K_EDIT);
break; break;
case 1: case __COUNTER__:
sprintf(str,"Node %u Logon",cfg.node_num); sprintf(str,"Node %u Logon",cfg.node_num);
getar(str,cfg.node_arstr); getar(str,cfg.node_arstr);
break; break;
case 2: case __COUNTER__:
done=0;
while(!done) {
i=0;
snprintf(opt[i++], MAX_OPLN, "%-27.27s%s","Keep Node File Open"
,cfg.node_misc&NM_CLOSENODEDAB ? "No":"Yes");
opt[i][0]=0;
uifc.helpbuf=
"`Node Toggle Options:`\n"
"\n"
"This is the toggle options menu for the selected node's configuration.\n"
"\n"
"The available options from this menu can all be toggled between two or\n"
"more states, such as `Yes` and `No``.\n"
;
switch(uifc.list(WIN_BOT|WIN_RHT|WIN_ACT|WIN_SAV,3,2,35,&tog_dflt
,&tog_bar,"Toggle Options",opt)) {
case -1:
done=1;
break;
case 0:
i=cfg.node_misc&NM_CLOSENODEDAB ? 1:0; i=cfg.node_misc&NM_CLOSENODEDAB ? 1:0;
uifc.helpbuf= uifc.helpbuf=
"`Keep Node File Open:`\n" "`Keep Node File Open:`\n"
...@@ -276,29 +256,6 @@ void node_cfg() ...@@ -276,29 +256,6 @@ void node_cfg()
uifc.changes=1; uifc.changes=1;
} }
break; break;
}
}
break;
case 3:
done=0;
while(!done) {
i=0;
snprintf(opt[i++], MAX_OPLN, "%-27.27s%s","Daily Event",cfg.node_daily);
snprintf(opt[i++], MAX_OPLN, "%-27.27s%s","Node Directory",cfg.node_path[cfg.node_num-1]);
snprintf(opt[i++], MAX_OPLN, "%-27.27s%s","Text Directory",cfg.text_dir);
opt[i][0]=0;
uifc.helpbuf=
"`Node Advanced Options:`\n"
"\n"
"This is the advanced options menu for the selected node. The available\n"
"options are of an advanced nature and should not be modified unless you\n"
"are sure of the consequences and necessary preparation.\n"
;
switch(uifc.list(WIN_T2B|WIN_RHT|WIN_ACT|WIN_SAV,2,0,60,&adv_dflt,0
,"Advanced Options",opt)) {
case -1:
done=1;
break;
case __COUNTER__: case __COUNTER__:
uifc.helpbuf= uifc.helpbuf=
"`Daily Event:`\n" "`Daily Event:`\n"
...@@ -334,7 +291,4 @@ void node_cfg() ...@@ -334,7 +291,4 @@ void node_cfg()
break; break;
} }
} }
break;
}
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment