Skip to content
Snippets Groups Projects
Commit fa6b8ca2 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Experimental summary thing... disabled, will be deleted

I just want this in the history in case I ever want to play with
the concept again.
parent f55039de
No related branches found
No related tags found
No related merge requests found
......@@ -2086,6 +2086,89 @@ del_bbs(char *listpath, struct bbslist *bbs)
}
}
#if 0
static int
entry_summary(struct bbslist *entry, char *buf, size_t bufsz)
{
if (entry == NULL) {
buf[0] = 0;
return 0;
}
#define HBCHECK() if (++lc >= 7 || hblen >= bufsz) return lc
size_t hblen = 0;
int lc = 0;
bool is_ansi = true;
bool is_serial = ((entry->conn_type == CONN_TYPE_MODEM) || (entry->conn_type == CONN_TYPE_SERIAL)
|| (entry->conn_type == CONN_TYPE_SERIAL_NORTS));
if (get_emulation(entry) != CTERM_EMULATION_ANSI_BBS)
is_ansi = false;
hblen += snprintf(&buf[hblen], bufsz - hblen, "Name: %.28s\r\n", entry->name);
HBCHECK();
switch (entry->conn_type) {
case CONN_TYPE_MODEM:
hblen += snprintf(&buf[hblen], bufsz - hblen, "Phone Number: %.20s\r\n", entry->addr);
break;
case CONN_TYPE_SERIAL:
case CONN_TYPE_SERIAL_NORTS:
hblen += snprintf(&buf[hblen], bufsz - hblen, "Device Name: %.21s\r\n", entry->addr);
break;
case CONN_TYPE_SHELL:
hblen += snprintf(&buf[hblen], bufsz - hblen, "Command: %.25s\r\n", entry->addr);
break;
default:
hblen += snprintf(&buf[hblen], bufsz - hblen, "Address: %.25s\r\n", entry->addr);
break;
}
HBCHECK();
hblen += snprintf(&buf[hblen], bufsz - hblen, "Connection Type: %.17s\r\n", conn_types[entry->conn_type]);
HBCHECK();
if (is_serial) {
// TODO: Speed/n81/etc.
}
else if (entry->conn_type != CONN_TYPE_SHELL) {
hblen += snprintf(&buf[hblen], bufsz - hblen, "Port: %hu\r\n", entry->port);
HBCHECK();
}
if (entry->conn_type == CONN_TYPE_MBBS_GHOST) {
}
else if (entry->conn_type == CONN_TYPE_SSHNA) {
hblen += snprintf(&buf[hblen], bufsz - hblen, "BBS Username: %.20s\r\n", entry->password);
HBCHECK();
}
else {
hblen += snprintf(&buf[hblen], bufsz - hblen, "Username: %.24s\r\n", entry->user);
HBCHECK();
}
hblen += snprintf(&buf[hblen], bufsz - hblen, "Screen Mode: %.21s\r\n", screen_modes[entry->screen_mode]);
HBCHECK();
#undef HBCHECK
hblen += snprintf(&buf[hblen], bufsz - hblen, "Font: %.28s\r\n", entry->font);
return lc;
}
static void
update_summary(struct bbslist *entry)
{
char buf[40*9];
int opt = 0;
int bar = 0;
int lc = entry_summary(entry, buf, sizeof(buf));
uifc.showbuf(WIN_PACK | WIN_T2B | WIN_RHT | WIN_EXTKEYS | WIN_DYN | WIN_ACT | WIN_INACT, -5, 0, 32, 11, "Summary", buf, &opt, &bar);
}
#else
static void
update_summary(struct bbslist *entry) {}
#endif
static int
settings_list(int *opt, int *bar, char **opts, uifc_winmode_t extra_opts)
{
uifc_winmode_t wm = WIN_T2B | WIN_RHT | WIN_EXTKEYS | WIN_DYN | WIN_ACT | extra_opts;
return uifc.list(wm, 0, 0, 0, opt, bar, "SyncTERM Settings", opts);
}
/*
* This is pretty sketchy...
* These are pointers to automatic variables in show_bbslist() which are
......@@ -2148,8 +2231,7 @@ custom_mode_adjusted(int *cur, char **opt)
0, 0, 0, glob_opt, glob_bar, glob_list_title, (char **)*glob_list);
// Draw settings menu
uifc.list(WIN_T2B | WIN_RHT | WIN_EXTKEYS | WIN_DYN | WIN_ACT | WIN_INACT,
0, 0, 0, glob_sopt, glob_sbar, "SyncTERM Settings", glob_settings_menu);
settings_list(glob_sopt, glob_sbar, glob_settings_menu, WIN_INACT);
// Draw program settings
uifc.list(WIN_MID | WIN_SAV | WIN_ACT | WIN_DYN | WIN_SEL | WIN_INACT,
......@@ -3157,8 +3239,7 @@ show_bbslist(char *current, int connected)
sizeof(shared_list), &listcount, &opt, &bar, current ? strdup(current) : NULL);
uifc.helpbuf = "Help Button Hack";
uifc.list(WIN_T2B | WIN_RHT | WIN_EXTKEYS | WIN_DYN | WIN_ACT | WIN_INACT,
0, 0, 0, &sopt, &sbar, "SyncTERM Settings", connected ? connected_settings_menu : settings_menu);
settings_list(&sopt, &sbar, connected ? connected_settings_menu : settings_menu, WIN_INACT);
last_mode = cio_api.mode;
for (;;) {
if (quitting) {
......@@ -3229,6 +3310,7 @@ show_bbslist(char *current, int connected)
else
SAFECOPY(title, syncterm_version);
settitle(title);
update_summary(list[opt]);
}
oldopt = opt;
uifc.list_height = listcount + 5;
......@@ -3297,15 +3379,7 @@ show_bbslist(char *current, int connected)
case -2 - 0x3000: /* ALT-B - Scrollback */
if (!connected) {
viewofflinescroll();
uifc.list(WIN_T2B | WIN_RHT | WIN_EXTKEYS | WIN_DYN | WIN_ACT | WIN_INACT
,
0,
0,
0,
&sopt,
&sbar,
"SyncTERM Settings",
settings_menu);
settings_list(&sopt, &sbar, settings_menu, WIN_INACT);
}
break;
case -11: /* TAB */
......@@ -3759,22 +3833,16 @@ show_bbslist(char *current, int connected)
" Display compile options selected at build time\n\n"
"~ " ALT_KEY_NAMEP "-B ~\n"
" View scrollback of last session\n";
if (oldopt != -2)
if (oldopt != -2) {
settitle(syncterm_version);
update_summary(NULL);
}
oldopt = -2;
if (!nowait) {
kbwait();
nowait = true;
}
val = uifc.list(WIN_T2B | WIN_RHT | WIN_EXTKEYS | WIN_DYN | WIN_UNGETMOUSE | WIN_ACT | WIN_ESC
,
0,
0,
0,
&sopt,
&sbar,
"SyncTERM Settings",
connected ? connected_settings_menu : settings_menu);
val = settings_list(&sopt, &sbar, connected ? connected_settings_menu : settings_menu, WIN_UNGETMOUSE | WIN_ESC);
if (connected && (val >= 2))
val++;
switch (val) {
......@@ -3818,15 +3886,7 @@ show_bbslist(char *current, int connected)
case -2 - 0x4b00: /* Left Arrow */
case -2 - 0x4d00: /* Right Arrow */
case -11: /* TAB */
uifc.list(WIN_T2B | WIN_RHT | WIN_EXTKEYS | WIN_DYN | WIN_ACT | WIN_SEL
,
0,
0,
0,
&sopt,
&sbar,
"SyncTERM Settings",
connected ? connected_settings_menu : settings_menu);
settings_list(&sopt, &sbar, connected ? connected_settings_menu : settings_menu, WIN_SEL);
at_settings = !at_settings;
break;
case -2:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment