diff --git a/src/syncterm/CHANGES b/src/syncterm/CHANGES index 14715c096b44262f11339652246ed661db547422..d330d9de5895f2588070245e49d1aa94ddf9270e 100644 --- a/src/syncterm/CHANGES +++ b/src/syncterm/CHANGES @@ -1,3 +1,8 @@ +Version 1.4a +------------ +Re-order BBS list entry fields +Fix various Prestel mode bugs + Version 1.3 ----------- Fix critical bug when editing a BBS listing diff --git a/src/syncterm/bbslist.c b/src/syncterm/bbslist.c index 943cbe820f3bf6037ae1fcf7db900290ec057dad..a2547c4aef7c3b5599a55445fb47d9d50649492d 100644 --- a/src/syncterm/bbslist.c +++ b/src/syncterm/bbslist.c @@ -1171,6 +1171,8 @@ build_edit_list(struct bbslist *item, char opt[][69], int *optmap, char **opts, { int i = 0; char str[64]; + bool is_ansi = true; + bool is_serial = ((item->conn_type == CONN_TYPE_MODEM) || (item->conn_type == CONN_TYPE_SERIAL) || (item->conn_type == CONN_TYPE_SERIAL_NORTS)); if (!isdefault) { optmap[i] = BBSLIST_FIELD_NAME; @@ -1194,9 +1196,19 @@ build_edit_list(struct bbslist *item, char opt[][69], int *optmap, char **opts, } optmap[i] = BBSLIST_FIELD_CONN_TYPE; sprintf(opt[i++], "Connection Type %s", conn_types[item->conn_type]); - if ((item->conn_type == CONN_TYPE_MODEM) || (item->conn_type == CONN_TYPE_SERIAL) || (item->conn_type == CONN_TYPE_SERIAL_NORTS)) { + if (IS_NETWORK_CONN(item->conn_type)) { + optmap[i] = BBSLIST_FIELD_ADDRESS_FAMILY; + sprintf(opt[i++], "Address Family %s", address_family_names[item->address_family]); + } + if (is_serial) { optmap[i] = BBSLIST_FIELD_FLOW_CONTROL; fc_str(opt[i++], item->flow_control); + if (item->bpsrate) + sprintf(str, "%ubps", item->bpsrate); + else + strcpy(str, "Current"); + optmap[i] = BBSLIST_FIELD_BPSRATE; + sprintf(opt[i++], "Comm Rate %s", str); optmap[i] = BBSLIST_FIELD_STOP_BITS; sprintf(opt[i++], "Stop Bits %hu", item->stop_bits); optmap[i] = BBSLIST_FIELD_DATA_BITS; @@ -1235,8 +1247,26 @@ build_edit_list(struct bbslist *item, char opt[][69], int *optmap, char **opts, optmap[i] = BBSLIST_FIELD_SYSPASS; sprintf(opt[i++], "System Password %s", item->syspass[0] ? "********" : "<none>"); } + if (item->conn_type == CONN_TYPE_SSH || item->conn_type == CONN_TYPE_SSHNA) { + optmap[i] = BBSLIST_FIELD_SFTP_PUBLIC_KEY; + sprintf(opt[i++], "SFTP Public Key %s", item->sftp_public_key ? "Yes" : "No"); + } optmap[i] = BBSLIST_FIELD_SCREEN_MODE; sprintf(opt[i++], "Screen Mode %s", screen_modes[item->screen_mode]); + optmap[i] = BBSLIST_FIELD_FONT; + sprintf(opt[i++], "Font %s", item->font); + if (get_emulation(item) != CTERM_EMULATION_ANSI_BBS) + is_ansi = false; + if (is_ansi) { + optmap[i] = BBSLIST_FIELD_MUSIC; + sprintf(opt[i++], "ANSI Music %s", music_names[item->music]); + optmap[i] = BBSLIST_FIELD_RIP; + sprintf(opt[i++], "RIP %s", rip_versions[item->rip]); + optmap[i] = BBSLIST_FIELD_FORCE_LCF; + sprintf(opt[i++], "Force LCF Mode %s", item->force_lcf ? "Yes" : "No"); + optmap[i] = BBSLIST_FIELD_YELLOW_IS_YELLOW; + sprintf(opt[i++], "Yellow is Yellow %s", item->yellow_is_yellow ? "Yes" : "No"); + } optmap[i] = BBSLIST_FIELD_NOSTATUS; sprintf(opt[i++], "Hide Status Line %s", item->nostatus ? "Yes" : "No"); optmap[i] = BBSLIST_FIELD_DLDIR; @@ -1247,30 +1277,16 @@ build_edit_list(struct bbslist *item, char opt[][69], int *optmap, char **opts, i++; optmap[i] = BBSLIST_FIELD_LOGFILE; strcpy(opt[i++], "Log Configuration"); - if (item->bpsrate) - sprintf(str, "%ubps", item->bpsrate); - else - strcpy(str, "Current"); - optmap[i] = BBSLIST_FIELD_BPSRATE; - sprintf(opt[i++], "Comm Rate %s", str); - optmap[i] = BBSLIST_FIELD_MUSIC; - sprintf(opt[i++], "ANSI Music %s", music_names[item->music]); - optmap[i] = BBSLIST_FIELD_ADDRESS_FAMILY; - sprintf(opt[i++], "Address Family %s", address_family_names[item->address_family]); - optmap[i] = BBSLIST_FIELD_FONT; - sprintf(opt[i++], "Font %s", item->font); + if (!is_serial) { + if (item->bpsrate) + sprintf(str, "%ubps", item->bpsrate); + else + strcpy(str, "Current"); + optmap[i] = BBSLIST_FIELD_BPSRATE; + sprintf(opt[i++], "Fake Comm Rate %s", str); + } optmap[i] = BBSLIST_FIELD_HIDEPOPUPS; sprintf(opt[i++], "Hide Popups %s", item->hidepopups ? "Yes" : "No"); - optmap[i] = BBSLIST_FIELD_RIP; - sprintf(opt[i++], "RIP %s", rip_versions[item->rip]); - optmap[i] = BBSLIST_FIELD_FORCE_LCF; - sprintf(opt[i++], "Force LCF Mode %s", item->force_lcf ? "Yes" : "No"); - optmap[i] = BBSLIST_FIELD_YELLOW_IS_YELLOW; - sprintf(opt[i++], "Yellow is Yellow %s", item->yellow_is_yellow ? "Yes" : "No"); - if (item->conn_type == CONN_TYPE_SSH || item->conn_type == CONN_TYPE_SSHNA) { - optmap[i] = BBSLIST_FIELD_SFTP_PUBLIC_KEY; - sprintf(opt[i++], "SFTP Public Key %s", item->sftp_public_key ? "Yes" : "No"); - } opt[i][0] = 0; } @@ -1278,6 +1294,11 @@ void build_edit_help(struct bbslist *item, int isdefault, char *helpbuf, size_t hbsz) { size_t hblen = 0; + bool is_ansi = true; + bool is_serial = ((item->conn_type == CONN_TYPE_MODEM) || (item->conn_type == CONN_TYPE_SERIAL) || (item->conn_type == CONN_TYPE_SERIAL_NORTS)); + + if (get_emulation(item) != CTERM_EMULATION_ANSI_BBS) + is_ansi = false; /* * Not using strncpy() here because memset()ing the whole thing @@ -1317,8 +1338,14 @@ build_edit_help(struct bbslist *item, int isdefault, char *helpbuf, size_t hbsz) } hblen += strlcat(helpbuf + hblen, "~ Conection Type ~\n" " Type of connection\n\n", hbsz - hblen); - if ((item->conn_type == CONN_TYPE_MODEM) || (item->conn_type == CONN_TYPE_SERIAL) || (item->conn_type == CONN_TYPE_SERIAL_NORTS)) { - hblen += strlcat(helpbuf + hblen, "~ Flow Control ~\n" + if (IS_NETWORK_CONN(item->conn_type)) { + hblen += strlcat(helpbuf + hblen, "~ Address Family ~\n" + " IPv4 or IPv6\n\n", hbsz - hblen); + } + if (is_serial) { + hblen += strlcat(helpbuf + hblen, "~ Comm Rate ~\n" + " Port speed\n\n" + "~ Flow Control ~\n" " Type of flow control to use\n\n" "~ Stop Bits ~\n" " Number of stop bits for each byte\n\n" @@ -1355,9 +1382,29 @@ build_edit_help(struct bbslist *item, int isdefault, char *helpbuf, size_t hbsz) "~ System Password ~\n" " System Password sent by auto-login command (not securely stored)\n\n", hbsz - hblen); } + if (item->conn_type == CONN_TYPE_SSH || item->conn_type == CONN_TYPE_SSHNA) { + hblen += strlcat(helpbuf + hblen, "~ SFTP Public Key ~\n" + " Open an SFTP channel and transfer the public key to\n" + " .ssh/authorized_keys\n\n", hbsz - hblen); + } hblen += strlcat(helpbuf + hblen, "~ Screen Mode ~\n" - " Display mode to use\n\n" - "~ Hide Status Line ~\n" + " Display mode to use\n\n", hbsz - hblen); + hblen += strlcat(helpbuf + hblen, "~ Font ~\n" + " Select font to use for the entry\n\n" + "~ Hide Popups ~\n" + " Hide all popup dialogs (i.e., Connecting, Disconnected, etc.)\n\n", hbsz - hblen); + if (is_ansi) { + hblen += strlcat(helpbuf + hblen, "~ ANSI Music ~\n" + " ANSI music type selection\n\n" + "~ RIP ~\n" + " Enable/Disable RIP modes\n\n" + "~ Force LCF Mode ~\n" + " Force Last Column Flag mode as used in VT terminals\n\n" + "~ Yellow Is Yellow ~\n" + " Make the dark yellow colour actually yellow instead of the brown\n" + " used in IBM CGA monitors\n\n", hbsz - hblen); + } + hblen += strlcat(helpbuf + hblen, "~ Hide Status Line ~\n" " Selects if the status line should be hidden, giving an extra\n" " display row\n\n" "~ Download Path ~\n" @@ -1365,28 +1412,10 @@ build_edit_help(struct bbslist *item, int isdefault, char *helpbuf, size_t hbsz) "~ Upload Path ~\n" " Default path for uploads\n\n" "~ Log Configuration ~\n" - " Configure logging settings\n\n" - "~ Comm Rate ~\n" - " Display speed\n\n" - "~ ANSI Music ~\n" - " ANSI music type selection\n\n" - "~ Address Family ~\n" - " IPv4 or IPv6\n\n" - "~ Font ~\n" - " Select font to use for the entry\n\n" - "~ Hide Popups ~\n" - " Hide all popup dialogs (i.e., Connecting, Disconnected, etc.)\n\n" - "~ RIP ~\n" - " Enable/Disable RIP modes\n\n" - "~ Force LCF Mode ~\n" - " Force Last Column Flag mode as used in VT terminals\n\n" - "~ Yellow Is Yellow ~\n" - " Make the dark yellow colour actually yellow instead of the brown\n" - " used in IBM CGA monitors\n\n", hbsz - hblen); - if (item->conn_type == CONN_TYPE_SSH || item->conn_type == CONN_TYPE_SSHNA) { - hblen += strlcat(helpbuf + hblen, "~ SFTP Public Key ~\n" - " Open an SFTP channel and transfer the public key to\n" - " .ssh/authorized_keys\n\n", hbsz - hblen); + " Configure logging settings\n\n", hbsz - hblen); + if (!is_serial) { + hblen += strlcat(helpbuf + hblen, "~ Fake Comm Rate ~\n" + " Display speed\n\n", hbsz - hblen); } } diff --git a/src/syncterm/term.c b/src/syncterm/term.c index f8902b2af9f22afc09da0f89a12b21214e4fbd1a..a35cd2c95134d43d33ad70833dd7ded7644c7a83 100644 --- a/src/syncterm/term.c +++ b/src/syncterm/term.c @@ -3681,6 +3681,22 @@ send_login(struct bbslist *bbs) { } } +static void +normalize_entry(struct bbslist *bbs) +{ + cterm_emulation_t emu = get_emulation(bbs); + + switch (emu) { + case CTERM_EMULATION_ANSI_BBS: + break; + default: + bbs->rip = RIP_VERSION_NONE; + bbs->force_lcf = false; + bbs->yellow_is_yellow = false; + break; + } +} + bool doterm(struct bbslist *bbs) { @@ -3732,6 +3748,7 @@ doterm(struct bbslist *bbs) int speedwatch = 0; bool atascii_inverse = false; + normalize_entry(bbs); freepixels(pixmap_buffer[0]); freepixels(pixmap_buffer[1]); pixmap_buffer[0] = NULL;