diff options
author | Alec Murphy <alec@checksum.fail> | 2017-07-15 01:58:56 -0400 |
---|---|---|
committer | Alec Murphy <alec@checksum.fail> | 2017-07-15 01:58:56 -0400 |
commit | c629021a5df736a30e34dbbd99f64851c085982d (patch) | |
tree | 66dd0e3ae3350593f584f50bddc1d8486ad99660 | |
parent | e2950629431577e2510fadfd20124ef5f6036f08 (diff) |
Add prompt to disconnect
-rwxr-xr-x | Load.HC | 30 |
1 files changed, 24 insertions, 6 deletions
@@ -1,6 +1,9 @@ #include "::/Apps/TempleTerm/Bookmarks" #include "::/Apps/TempleTerm/ZModem" +#define PROMPT_Q 0xFFFF +#define REMOTE_Q 0xFFFE + I64 in_rz=0; I64 abort_rz=0; @@ -281,7 +284,7 @@ U0 TempleTermSession(I64 sock) if (rz_ibpos==3) { - progress1=rz_dpos; + progress1=rz_dpos; }; // get length of subpacket @@ -895,7 +898,7 @@ U0 TempleTermSession(I64 sock) Sleep(1); }; - PostMsg(Fs->parent_task,MSG_KEY_DOWN_UP,255,0); + PostMsg(Fs->parent_task,MSG_KEY_DOWN_UP,REMOTE_Q,0); } I64 TempleTermConnect(U8 *host, I64 port=23) @@ -929,7 +932,7 @@ I64 TempleTermConnect(U8 *host, I64 port=23) if (sock>=0) { MenuPush("File{" - " Disconnect(,255);" + " Disconnect(,PROMPT_Q);" "}"); Fs->draw_it=&TDrawIt; @@ -950,7 +953,7 @@ I64 TempleTermConnect(U8 *host, I64 port=23) if (in_rz==0 || abort_rz==1) { // Send username - if ((kbd.scan_code & 0xFFFF) == 2070) + if ((kbd.scan_code & 0xFFFF) == 2070) { sendString(sock, conn_entries[res].user, 0); key=0; @@ -1000,14 +1003,29 @@ I64 TempleTermConnect(U8 *host, I64 port=23) key=0; }; - if (key==255) { break; }; + if (key==PROMPT_Q) + { + ProgressBarsRst; + if (PopUpCancelOk("OK to disconnect?")==1) + { + break; + }; + }; + + if (key==REMOTE_Q) { break; }; if (key==10) { key=13; }; if (key==0) { key=kbd.scan_code & 0xFF; - if (key==SC_F12) { ProgressBarsRst; break; }; + if (key==SC_F12) { + ProgressBarsRst; + if (PopUpCancelOk("OK to disconnect?")==1) + { + break; + }; + }; if (key==72) { |