diff --git a/src/syncterm/bbslist.c b/src/syncterm/bbslist.c index 86fa6c41fa30637dba8c80e6b4de17598bc2da4a..b4690d56b23c0d3fcf8f3499adb53233d457da69 100644 --- a/src/syncterm/bbslist.c +++ b/src/syncterm/bbslist.c @@ -76,6 +76,8 @@ void write_list(struct bbslist **list) fclose(listfile); } else { + uifc.helpbuf= "`Can't save list`\n\n" + "The system is unable to save your dialing list\n"; sprintf(str,"Can't save list to %.*s",MAX_PATH-20,listpath); uifc.msg(str); } @@ -122,6 +124,9 @@ int edit_list(struct bbslist *item) for(i=0;i<6;i++) opts[i]=opt[i]; if(item->type==SYSTEM_BBSLIST) { + uifc.helpbuf= "`Cannot edit system BBS list`\n\n" + "SyncTERM supports system-wide and per-user lists. You may only edit entries" + "in your own personal list.\n"; uifc.msg("Cannot edit system BBS list"); return(0); } @@ -133,18 +138,33 @@ int edit_list(struct bbslist *item) sprintf(opt[3],"Username: %s",item->user); sprintf(opt[4],"Password"); uifc.changes=0; + + uifc.helpbuf= "`Edit BBS`\n\n" + "Select item to edit."; switch(uifc.list(WIN_MID|WIN_SAV,0,0,0,&copt,NULL,"Edit Entry",opts)) { case -1: return(changed); case 0: + uifc.helpbuf= "`BBS Name`\n\n" + "Enter the BBS name as it is to appear in the list."; uifc.input(WIN_MID|WIN_SAV,0,0,"BBS Name",item->name,LIST_NAME_MAX,K_EDIT); break; case 1: + uifc.helpbuf= "`RLogin address`\n\n" + "Enter the domain name of the system to connect to ie:\n" + "nix.synchro.net"; uifc.input(WIN_MID|WIN_SAV,0,0,"RLogin Address",item->addr,LIST_ADDR_MAX,K_EDIT); break; case 2: i=item->port; sprintf(str,"%hu",item->port?item->port:513); + uifc.helpbuf= "`RLogin port`\n\n" + "Enter the port which RLogin is listening to on the remote system\n\n" + "~ NOTE:~\n" + "Connecting to telnet ports currently appears to work... however, if an\n" + "ASCII 255 char is sent by either end, it will be handled incorreclty by\n" + "the remote system. Further, if the remote system follows the RFC, some\n" + "Terminal weirdness should be expected. This program DOES NOT do telnet."; uifc.input(WIN_MID|WIN_SAV,0,0,"RLogin Port",str,5,K_EDIT|K_NUMBER); j=atoi(str); if(j<1 || j>65535) @@ -156,9 +176,13 @@ int edit_list(struct bbslist *item) uifc.changes=0; break; case 3: + uifc.helpbuf= "`Username`\n\n" + "Enter the username to attempt auto-login to the remote with."; uifc.input(WIN_MID|WIN_SAV,0,0,"Username",item->user,MAX_USER_LEN,K_EDIT); break; case 4: + uifc.helpbuf= "`Password`\n\n" + "Enter your password for auto-login."; uifc.input(WIN_MID|WIN_SAV,0,0,"Password",item->password,MAX_PASSWD_LEN,K_EDIT); break; } @@ -209,6 +233,11 @@ struct bbslist *show_bbslist(int mode) sort_list(list); for(;;) { + uifc.helpbuf= "`SyncTERM Dialing List`\n\n" + "Commands:\n" + "~ CTRL-E ~ Switch listing to Edit mode\n" + "~ CTRL-D ~ Switch listing to Dial mode\n" + "Select a bbs to edit/dial an entry."; val=uifc.list((listcount<MAX_OPTS?WIN_XTR:0)|WIN_SAV|WIN_MID|WIN_INS|WIN_DEL|WIN_EXTKEYS,0,0,0,&opt,&bar,mode==BBSLIST_SELECT?"Select BBS":"Edit BBS",(char **)list); if(val==listcount) val=listcount|MSK_INS; @@ -228,6 +257,9 @@ struct bbslist *show_bbslist(int mode) switch(val&MSK_ON) { case MSK_INS: if(listcount>=MAX_OPTS) { + uifc.helpbuf= "`Max List size reached`\n\n" + "The total combined size of loaded BBS lists is currently the highest\n" + "Supported size. You must delete entries before adding more."; uifc.msg("Max List size reached!"); break; } @@ -237,9 +269,14 @@ struct bbslist *show_bbslist(int mode) memset(list[listcount-1],0,sizeof(struct bbslist)); list[listcount-1]->id=listcount-1; uifc.changes=0; + uifc.helpbuf= "`BBS Name`\n\n" + "Enter the BBS name as it is to appear in the list."; uifc.input(WIN_MID|WIN_SAV,0,0,"BBS Name",list[listcount-1]->name,LIST_NAME_MAX,K_EDIT); if(uifc.changes) { uifc.changes=0; + uifc.helpbuf= "`RLogin address`\n\n" + "Enter the domain name of the system to connect to ie:\n" + "nix.synchro.net"; uifc.input(WIN_MID|WIN_SAV,0,0,"RLogin Address",list[listcount-1]->addr,LIST_ADDR_MAX,K_EDIT); } if(!uifc.changes) { @@ -251,13 +288,24 @@ struct bbslist *show_bbslist(int mode) while(!list[listcount-1]->port) { list[listcount-1]->port=513; sprintf(str,"%hu",list[listcount-1]->port); + uifc.helpbuf= "`RLogin port`\n\n" + "Enter the port which RLogin is listening to on the remote system\n\n" + "~ NOTE:~\n" + "Connecting to telnet ports currently appears to work... however, if an\n" + "ASCII 255 char is sent by either end, it will be handled incorreclty by\n" + "the remote system. Further, if the remote system follows the RFC, some\n" + "Terminal weirdness should be expected. This program DOES NOT do telnet."; uifc.input(WIN_MID|WIN_SAV,0,0,"RLogin Port",str,5,K_EDIT|K_NUMBER); j=atoi(str); if(j<1 || j>65535) j=0; list[listcount-1]->port=j; } + uifc.helpbuf= "`Username`\n\n" + "Enter the username to attempt auto-login to the remote with."; uifc.input(WIN_MID|WIN_SAV,0,0,"User Name",list[listcount-1]->user,MAX_USER_LEN,K_EDIT); + uifc.helpbuf= "`Password`\n\n" + "Enter your password for auto-login."; uifc.input(WIN_MID|WIN_SAV,0,0,"Password",list[listcount-1]->password,MAX_PASSWD_LEN,K_EDIT); sort_list(list); for(j=0;list[j]->name[0];j++) { @@ -268,7 +316,20 @@ struct bbslist *show_bbslist(int mode) } break; case MSK_DEL: + uifc.msg("Huh?"); if(!list[opt]->name[0]) { + uifc.helpbuf= "`Calming down`\n\n"; + "~ Some handy tips on calming down ~\n" + "Close your eyes, imagine yourself alone on a brilliant white beach...\n" + "Picture the palm trees up towards the small town...\n" + "Glory in the deep blue of the perfectly clean ocean...\n" + "Feel the plush comfort of your beach towel...\n" + "Enjoy the shade of your satellite internet feed which envelops\n" + "your head, keeping you cool...\n" + "Set your TEMPEST rated laptop aside on the beach, knowing it's\n" + "completely impervious to anything on the beach...\n" + "Reach over to your fridge, grab a cold one...\n" + "Watch the seagulls in their dance...\n"; uifc.msg("It's gone, calm down man!"); break; } diff --git a/src/syncterm/rlogin.c b/src/syncterm/rlogin.c index 5445e6a5131314a3d62029c0d1b2c14fa3b1a7e8..ddb318aa9c90d513849709c6890e1ea83ceec414 100644 --- a/src/syncterm/rlogin.c +++ b/src/syncterm/rlogin.c @@ -61,14 +61,19 @@ int rlogin_connect(char *addr, int port, char *ruser, char *passwd) char str[LIST_ADDR_MAX+17]; sprintf(str,"Cannot resolve %s!",addr); - uifcmsg(str); + uifcmsg(str, "`Cannot Resolve Host`\n\n" + "The system is unable to resolve the hostname... double check the spelling.\n" + "If it's not an issue with your DNS settings, the issue is probobly\n" + "with the DNS settings of the system you are trying to contact."); return(-1); } neta=*((unsigned int*)ent->h_addr_list[0]); } rlogin_socket=socket(PF_INET, SOCK_STREAM, IPPROTO_IP); if(rlogin_socket==INVALID_SOCKET) { - uifcmsg("Cannot create socket!"); + uifcmsg("Cannot create socket!", "`Unable to create socket`\n\n" + "Your system is either dangerously low on resources, or there" + "is a problem with your TCP/IP stack."); return(-1); } memset(&saddr,0,sizeof(saddr)); @@ -80,7 +85,8 @@ int rlogin_connect(char *addr, int port, char *ruser, char *passwd) rlogin_close(); sprintf(str,"Cannot connect to %s!",addr); - uifcmsg(str); + uifcmsg(str, "`Unable to connect`\n\n" + "Cannot connect to the remost system... it is down or unreachable."); return(-1); } diff --git a/src/syncterm/uifcinit.c b/src/syncterm/uifcinit.c index 6e6ccc21ef6d335ac494b21d2fcc8d92500fad2e..cd10cf72096a6c4c18be6d75784085092e4266a9 100644 --- a/src/syncterm/uifcinit.c +++ b/src/syncterm/uifcinit.c @@ -38,7 +38,7 @@ void uifcbail(void) uifc_initialized=0; } -void uifcmsg(char *msg) +void uifcmsg(char *msg, char *helpbuf) { int i; char *buf; @@ -51,8 +51,10 @@ void uifcmsg(char *msg) gettext(1,1,txtinfo.screenwidth,txtinfo.screenheight,buf); } init_uifc(); - if(uifc_initialized) + if(uifc_initialized) { + uifc.helpbuf=helpbuf; uifc.msg(msg); + } else fprintf(stderr,"%s\n",msg); if(!i) { diff --git a/src/syncterm/window.c b/src/syncterm/window.c index 0d39f42d8a070807d5b60e8616b7ea17a5d2a7d0..b9ca414da601062dbd667dd309dd7634ae83b371 100644 --- a/src/syncterm/window.c +++ b/src/syncterm/window.c @@ -21,7 +21,9 @@ int drawwin(void) term.x=(txtinfo.screenwidth-term.width)/2; term.y=(txtinfo.screenheight-term.height)/2; if((winbuf=(char *)malloc(txtinfo.screenheight*txtinfo.screenwidth*2))==NULL) { - uifcmsg("Cannot allocate memory for terminal buffer"); + uifcmsg("Cannot allocate memory for terminal buffer". "`Memory error`\n\n" + "Either your system is dangerously low on resources or your\n" + "window is farking huge!"); return(-1); } p=str;