From 9b319d7b77056cf7e45af42090c50f4c56fb613e Mon Sep 17 00:00:00 2001 From: cy384 Date: Thu, 23 Jul 2020 19:51:33 -0400 Subject: [PATCH] add alert for failure to find thread manager --- ssheven-constants.r | 6 ++++++ ssheven.c | 5 +++++ ssheven.r | 24 ++++++++++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/ssheven-constants.r b/ssheven-constants.r index 5d639b8..1857088 100644 --- a/ssheven-constants.r +++ b/ssheven-constants.r @@ -26,11 +26,17 @@ * "vanilla" supports basically nothing, which is good for us here */ #define SSHEVEN_TERMINAL_TYPE "vanilla" +/* alert for failure to find OT */ #define ALRT_OT 128 #define DITL_OT 129 +/* dialog for getting connection info */ #define DLOG_CONNECT 128 #define DITL_CONNECT 128 +/* alert for failure to find thread manager */ +#define ALRT_TM 128 +#define DITL_TM 129 + #endif diff --git a/ssheven.c b/ssheven.c index 45afdfd..4f3206b 100644 --- a/ssheven.c +++ b/ssheven.c @@ -476,6 +476,7 @@ int safety_checks(void) // bit one is prescence of thread manager if (err != noErr || (thread_manager_gestalt & (1 << gestaltThreadMgrPresent)) == 0) { + StopAlert(ALRT_TM, nil); print_string_i("Thread Manager not available!\n"); return 0; } @@ -567,6 +568,10 @@ int main(int argc, char** argv) if (!safety_checks()) return 0; + BeginUpdate(con.win); + draw_screen(&(con.win->portRect)); + EndUpdate(con.win); + if (!intro_dialog(hostname, username, password)) ok = 0; if (ok) diff --git a/ssheven.r b/ssheven.r index 40d8fd7..f7b773d 100644 --- a/ssheven.r +++ b/ssheven.r @@ -68,6 +68,30 @@ resource 'ALRT' (ALRT_OT, purgeable) { alertPositionMainScreen }; +resource 'DITL' (DITL_TM) { + { + { 50, 260, 70, 340 }, + Button { enabled, "Exit" }; + + { 10, 70, 30, 340 }, + StaticText { enabled, "Thread Manager required but not found!" }; + } +}; + +resource 'ALRT' (ALRT_TM, purgeable) { + { 50, 100, 50+80, 100+350 }, + ALRT_TM, + + /* OK means draw default border on first button */ + { + OK, visible, silent, + OK, visible, silent, + OK, visible, silent, + OK, visible, silent + }, + alertPositionMainScreen +}; + #include "Processes.r" resource 'SIZE' (-1) {