add alert for failure to find thread manager

This commit is contained in:
cy384 2020-07-23 19:51:33 -04:00
parent f183af48f1
commit 9b319d7b77
3 changed files with 35 additions and 0 deletions

View File

@ -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

View File

@ -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)

View File

@ -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) {