Commit 84e7e225 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Merge remote-tracking branch 'origin/master' into v320a_dev

parents b4081328 0f628a71
Pipeline #3480 passed with stage
in 5 minutes and 25 seconds
......@@ -1759,6 +1759,8 @@ static void parse_sixel_string(struct cterminal *cterm, bool finish)
if (!*p)
continue;
cterm->sx_repeat = strtoul(p, &p, 10);
if (cterm->sx_repeat > 0x7fff)
cterm->sx_repeat = 0x7fff;
break;
case '#': // Colour Introducer
p++;
......
......@@ -1199,6 +1199,9 @@ int main(int argc, char **argv, char** env)
FILE* fp;
char ini_fname[MAX_PATH + 1];
str_list_t ini = NULL;
#ifdef __unix__
struct sigaction sa = {0};
#endif
confp=stdout;
errfp=stderr;
......@@ -1491,12 +1494,10 @@ int main(int argc, char **argv, char** env)
#if defined(_WIN32)
SetConsoleCtrlHandler(ControlHandler, TRUE /* Add */);
#elif defined(__unix__)
signal(SIGQUIT,break_handler);
siginterrupt(SIGQUIT, 1);
signal(SIGINT,break_handler);
siginterrupt(SIGINT, 1);
signal(SIGTERM,break_handler);
siginterrupt(SIGTERM, 1);
sa.sa_handler = break_handler;
sigaction(SIGQUIT, &sa, NULL);
sigaction(SIGINT, &sa, NULL);
sigaction(SIGTERM, &sa, NULL);
signal(SIGHUP,recycle_handler);
......
......@@ -631,7 +631,7 @@ void xmodem_init(xmodem_t* xm, void* cbdata, long* mode
xm->block_size=XMODEM_MAX_BLOCK_SIZE;
xm->max_block_size=XMODEM_MAX_BLOCK_SIZE;
xm->max_errors=9;
xm->g_delay=1;
xm->g_delay=0;
xm->cbdata=cbdata;
xm->mode=mode;
......
......@@ -2175,18 +2175,24 @@ struct bbslist *show_bbslist(char *current, int connected)
,"Current Screen Mode"
,"Font Management"
,"Program Settings"
,"File Locations"
,NULL
};
char *connected_settings_menu[]= {
"Default Connection Settings"
,"Font Management"
,"Program Settings"
,"File Locations"
,NULL
};
int at_settings=0;
struct mouse_event mevent;
struct bbslist defaults;
char shared_list[MAX_PATH+1];
char shared_list[MAX_PATH+1];
char personal_list[MAX_PATH+1];
char setting_file[MAX_PATH+1];
char default_download[MAX_PATH+1];
char cache_path[MAX_PATH+1];
char list_title[30];
int redraw = 0;
......@@ -2545,6 +2551,8 @@ struct bbslist *show_bbslist(char *current, int connected)
" Configure additional font files\n\n"
"~ Program Settings ~\n"
" Modify hardware and screen/video settings\n\n"
"~ File Locations ~\n"
" Display location for config and directory files\n\n"
"~ " ALT_KEY_NAMEP "-B ~\n"
" View scrollback of last session\n";
if(oldopt != -2)
......@@ -2643,6 +2651,24 @@ struct bbslist *show_bbslist(char *current, int connected)
load_bbslist(list, BBSLIST_SIZE, &defaults, settings.list_path, sizeof(settings.list_path), shared_list, sizeof(shared_list), &listcount, &opt, &bar, list[opt]?strdup(list[opt]->name):NULL);
oldopt=-1;
break;
case 4: /* File Locations */
get_syncterm_filename(personal_list, sizeof(personal_list), SYNCTERM_PATH_LIST, FALSE);
get_syncterm_filename(setting_file, sizeof(setting_file), SYNCTERM_PATH_INI, FALSE);
get_syncterm_filename(default_download, sizeof(default_download), SYNCTERM_DEFAULT_TRANSFER_PATH, FALSE);
get_syncterm_filename(cache_path, sizeof(cache_path), SYNCTERM_PATH_CACHE, FALSE);
asprintf(&p, "`SyncTERM File Locations`\n\n"
"~ Global Dialing Directory (Read-Only) ~\n"
" %s\n\n"
"~ Personal Dialing Directory ~\n"
" %s\n\n"
"~ Configuration File ~\n"
" %s\n\n"
"~ Default download Directory ~\n"
" %s\n\n"
"~ Cache Directory ~\n"
" %s\n\n", shared_list, personal_list, setting_file, default_download, cache_path);
uifc.showbuf(WIN_MID | WIN_SAV | WIN_HLP, 0, 0, 60, 21, "File Locations", p, NULL, NULL);
break;
}
}
}
......
......@@ -606,10 +606,12 @@ void conn_binary_mode_on(void)
{
if(conn_api.binary_mode_on)
conn_api.binary_mode_on();
conn_api.binary_mode = true;
}
void conn_binary_mode_off(void)
{
if(conn_api.binary_mode_off)
conn_api.binary_mode_off();
conn_api.binary_mode = false;
}
......@@ -5,6 +5,8 @@
#ifndef _CONN_H_
#define _CONN_H_
#include <stdbool.h>
#include "sockwrap.h"
#include "threadwrap.h"
......@@ -36,6 +38,7 @@ struct conn_api {
int (*close)(void);
void (*binary_mode_on)(void);
void (*binary_mode_off)(void);
bool binary_mode;
void *(*rx_parse_cb)(const void* inbuf, size_t inlen, size_t *olen);
void *(*tx_parse_cb)(const void* inbuf, size_t inlen, size_t *olen);
int log_level;
......
......@@ -391,7 +391,7 @@ int pty_connect(struct bbslist *bbs)
struct winsize ws;
struct termios ts;
char *termcap;
int cols, rows;
int cols, rows, pixelc, pixelr;
int cp;
ts.c_iflag = TTYDEF_IFLAG;
......@@ -401,9 +401,11 @@ int pty_connect(struct bbslist *bbs)
memcpy(ts.c_cc,ttydefchars,sizeof(ts.c_cc));
cfsetspeed(&ts, 115200);
get_term_win_size(&cols, &rows, &bbs->nostatus);
get_term_win_size(&cols, &rows, &pixelc, &pixelr, &bbs->nostatus);
ws.ws_col = cols;
ws.ws_row = rows;
ws.ws_xpixel = pixelc;
ws.ws_ypixel = pixelr;
cp = getcodepage();
child_pid = forkpty(&master, NULL, &ts, &ws);
......
......@@ -9797,7 +9797,7 @@ reinit_screen(uint8_t *font, int fx, int fy)
pthread_mutex_unlock(&vstatlock);
// Initialize it...
clrscr();
get_term_win_size(&term.width, &term.height, &term.nostatus);
get_term_win_size(&term.width, &term.height, NULL, NULL, &term.nostatus);
term.width = cols;
cterm = cterm_init(rows + (term.nostatus ? 0 : -1), cols, oldcterm.x, oldcterm.y, oldcterm.backlines, oldcterm.backwidth, oldcterm.scrollback, oldcterm.emulation);
cterm->apc_handler = oldcterm.apc_handler;
......@@ -14188,7 +14188,7 @@ parse_rip(BYTE *origbuf, unsigned blen, unsigned maxlen)
* TODO: Downloads are broken when RIP is enabled...
* This should certainly be fixed someday.
*/
if (rip.enabled == false) {
if (rip.enabled == false || rip_suspended) {
return blen;
}
 
......@@ -14525,13 +14525,11 @@ suspend_rip(bool suspend)
if (suspend) {
if (rip.enabled) {
rip_suspended = true;
rip.enabled = false;
}
}
else {
if (rip_suspended) {
if (rip.enabled) {
rip_suspended = false;
rip.enabled = true;
}
}
}
......@@ -14587,7 +14585,7 @@ rip_getch(void)
}
return ch;
}
if (rip.enabled == false) {
if (rip.enabled == false || rip_suspended) {
ch = getch();
if(ch==0 || ch==0xe0)
ch |= getch() << 8;
......
......@@ -277,7 +277,7 @@ int ssh_connect(struct bbslist *bbs)
term = get_emulation_str(get_emulation(bbs));
status=cl.SetAttributeString(ssh_session, CRYPT_SESSINFO_SSH_TERMINAL, term, strlen(term));
get_term_win_size(&cols, &rows, &bbs->nostatus);
get_term_win_size(&cols, &rows, NULL, NULL, &bbs->nostatus);
if (!bbs->hidepopups) {
uifc.pop(NULL);
......
......@@ -875,10 +875,12 @@ void parse_url(char *url, struct bbslist *bbs, int dflt_conn_type, int force_def
else
p2 = p1;
}
p3=strrchr(p1,'/');
if(p3!=NULL) {
*p3=0;
SAFECOPY(bbs->ghost_program,p3+1);
if (bbs->conn_type == CONN_TYPE_MBBS_GHOST) {
p3=strrchr(p1,'/');
if(p3!=NULL) {
*p3=0;
SAFECOPY(bbs->ghost_program,p3+1);
}
}
SAFECOPY(bbs->name,p1);
p2=strrchr(p2,':');
......
......@@ -63,7 +63,7 @@ void get_cterm_size(int* cols, int* rows, int ns)
*rows = cterm->height;
}
else {
get_term_win_size(cols, rows, &ns);
get_term_win_size(cols, rows, NULL, NULL, &ns);
}
}
......@@ -1046,11 +1046,12 @@ void ascii_upload(FILE *fp)
fclose(fp);
}
static void transfer_complete(BOOL success)
static void transfer_complete(BOOL success, bool was_binary)
{
int timeout = success ? settings.xfer_success_keypress_timeout : settings.xfer_failure_keypress_timeout;
conn_binary_mode_off();
if (!was_binary)
conn_binary_mode_off();
if(log_fp!=NULL)
fflush(log_fp);
/* TODO: Make this pretty (countdown timer) and don't delay a second between keyboard polls */
......@@ -1074,6 +1075,7 @@ void zmodem_upload(struct bbslist *bbs, FILE *fp, char *path)
zmodem_t zm;
int64_t fsize;
struct zmodem_cbdata cbdata;
bool was_binary = conn_api.binary_mode;
draw_transfer_window("ZMODEM Upload");
......@@ -1081,7 +1083,8 @@ void zmodem_upload(struct bbslist *bbs, FILE *fp, char *path)
cbdata.zm=&zm;
cbdata.bbs=bbs;
conn_binary_mode_on();
if (!was_binary)
conn_binary_mode_on();
transfer_buf_len=0;
zmodem_init(&zm
,/* cbdata */&cbdata
......@@ -1106,7 +1109,7 @@ void zmodem_upload(struct bbslist *bbs, FILE *fp, char *path)
fclose(fp);
transfer_complete(success);
transfer_complete(success, was_binary);
}
BOOL zmodem_duplicate_callback(void *cbdata, void *zm_void)
......@@ -1184,6 +1187,7 @@ void zmodem_download(struct bbslist *bbs)
int files_received;
uint64_t bytes_received;
struct zmodem_cbdata cbdata;
bool was_binary = conn_api.binary_mode;
if(safe_mode)
return;
......@@ -1191,7 +1195,8 @@ void zmodem_download(struct bbslist *bbs)
zmodem_mode=ZMODEM_MODE_RECV;
conn_binary_mode_on();
if (!was_binary)
conn_binary_mode_on();
cbdata.zm=&zm;
cbdata.bbs=bbs;
transfer_buf_len=0;
......@@ -1212,7 +1217,7 @@ void zmodem_download(struct bbslist *bbs)
if(files_received>1)
lprintf(LOG_INFO,"Received %u files (%"PRId64" bytes) successfully", files_received, bytes_received);
transfer_complete(files_received);
transfer_complete(files_received, was_binary);
}
/* End of Zmodem Stuff */
......@@ -1423,8 +1428,10 @@ void xmodem_upload(struct bbslist *bbs, FILE *fp, char *path, long mode, int las
BOOL success;
xmodem_t xm;
int64_t fsize;
bool was_binary = conn_api.binary_mode;
conn_binary_mode_on();
if (!was_binary)
conn_binary_mode_on();
xmodem_init(&xm
,/* cbdata */&xm
......@@ -1476,7 +1483,8 @@ void xmodem_upload(struct bbslist *bbs, FILE *fp, char *path, long mode, int las
}
else {
fclose(fp);
conn_binary_mode_off();
if (!was_binary)
conn_binary_mode_off();
return;
}
......@@ -1499,7 +1507,7 @@ void xmodem_upload(struct bbslist *bbs, FILE *fp, char *path, long mode, int las
fclose(fp);
transfer_complete(success);
transfer_complete(success, was_binary);
}
BOOL xmodem_duplicate(xmodem_t *xm, struct bbslist *bbs, char *path, size_t pathsize, char *fname)
......@@ -1593,6 +1601,7 @@ void xmodem_download(struct bbslist *bbs, long mode, char *path)
time_t t,startfile,ftime=0;
int old_hold=hold_update;
BOOL extra_pass = FALSE;
bool was_binary = conn_api.binary_mode;
if(safe_mode)
return;
......@@ -1611,7 +1620,8 @@ void xmodem_download(struct bbslist *bbs, long mode, char *path)
else
return;
conn_binary_mode_on();
if (!was_binary)
conn_binary_mode_on();
xmodem_init(&xm
,/* cbdata */&xm
,&mode
......@@ -1872,7 +1882,7 @@ void xmodem_download(struct bbslist *bbs, long mode, char *path)
end:
if(fp)
fclose(fp);
transfer_complete(success);
transfer_complete(success, was_binary);
}
/* End of X/Y-MODEM stuff */
......
......@@ -8,7 +8,7 @@
#include "syncterm.h"
void
get_term_win_size(int *width, int *height, int *nostatus)
get_term_win_size(int *width, int *height, int *pixelw, int *pixelh, int *nostatus)
{
struct text_info txtinfo;
int vmode = find_vmode(fake_mode);
......@@ -39,6 +39,19 @@ get_term_win_size(int *width, int *height, int *nostatus)
*height=24;
*nostatus=1;
}
if (vmode == -1) {
if (pixelw)
*pixelw = *width * 8;
if (pixelh)
*pixelh = *height * 16;
}
else {
if (pixelw)
*pixelw = *width * vparams[vmode].charwidth;
if (pixelh)
*pixelh = *height * vparams[vmode].charheight;
}
}
int drawwin(void)
......@@ -53,7 +66,7 @@ int drawwin(void)
strcpy(str," ");
get_term_win_size(&term.width, &term.height, &term.nostatus);
get_term_win_size(&term.width, &term.height, NULL, NULL, &term.nostatus);
if (settings.left_just)
term.x = 2;
......
......@@ -3,7 +3,7 @@
#ifndef _WINDOW_H_
#define _WINDOW_H_
void get_term_win_size(int *width, int *height, int *nostatus);
void get_term_win_size(int *width, int *height, int *pixelw, int *pixelh, int *nostatus);
int drawwin(void);
#endif
......@@ -442,8 +442,10 @@ int filepick(uifcapi_t *api, char *title, struct file_pick *fp, char *dir, char
hold_update=TRUE;
display_current_path(api, cfile);
api->lbclr=api->lclr|(api->bclr<<4);
api->list(WIN_NOBRDR|WIN_FIXEDHEIGHT|WIN_IMM|WIN_REDRAW,1,3,listwidth,&dircur,&dirbar,NULL,dir_list);
api->list(WIN_NOBRDR|WIN_FIXEDHEIGHT|WIN_IMM|WIN_REDRAW,1+listwidth+1,3,listwidth,&filecur,&filebar,NULL,file_list);
if (currfield != DIR_LIST)
api->list(WIN_NOBRDR|WIN_FIXEDHEIGHT|WIN_IMM|WIN_REDRAW,1,3,listwidth,&dircur,&dirbar,NULL,dir_list);
if (currfield != FILE_LIST)
api->list(WIN_NOBRDR|WIN_FIXEDHEIGHT|WIN_IMM|WIN_REDRAW,1+listwidth+1,3,listwidth,&filecur,&filebar,NULL,file_list);
api->lbclr=lbclr;
lastfield=currfield;
fieldmove=0;
......
......@@ -2779,6 +2779,9 @@ void showbuf(uifc_winmode_t mode, int left, int top, int width, int height, cons
if(mode&WIN_DYN && mode&WIN_NODRAW)
is_redraw=0;
last_menu_cur=curp;
last_menu_bar=barp;
vmem_gettext(1,1,api->scrn_width,api->scrn_len,tmp_buffer);
if(!is_redraw) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment