mirror of
https://github.com/sheumann/NetDisk.git
synced 2025-02-17 12:30:32 +00:00
Make sure Marinetti is available before using NetDisk.
Also, add NetDiskError values used by the disk browser.
This commit is contained in:
parent
c4a1733c25
commit
ea0f70fc94
5
cdev.c
5
cdev.c
@ -46,6 +46,7 @@
|
|||||||
#define netDiskMissingError 3000
|
#define netDiskMissingError 3000
|
||||||
#define mountURLError 3001
|
#define mountURLError 3001
|
||||||
#define unsupportedProtocolAlert 3002
|
#define unsupportedProtocolAlert 3002
|
||||||
|
#define marinettiMissingError 3003
|
||||||
#define yesBtn 1 /* number of "Yes" button in alert */
|
#define yesBtn 1 /* number of "Yes" button in alert */
|
||||||
|
|
||||||
extern void FreeAllCDevMem(void);
|
extern void FreeAllCDevMem(void);
|
||||||
@ -169,6 +170,10 @@ long DoMachine(void)
|
|||||||
InitCursor();
|
InitCursor();
|
||||||
AlertWindow(awResource+awButtonLayout, NULL, netDiskMissingError);
|
AlertWindow(awResource+awButtonLayout, NULL, netDiskMissingError);
|
||||||
return 0;
|
return 0;
|
||||||
|
} else if (mountURLRec.result == MARINETTI_NOT_PRESENT) {
|
||||||
|
InitCursor();
|
||||||
|
AlertWindow(awResource+awButtonLayout, NULL, marinettiMissingError);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
7
cdev.rez
7
cdev.rez
@ -287,6 +287,7 @@ resource rTextForLETextBox2 (helpWindow+helpTxt) {
|
|||||||
#define netDiskMissingError 3000
|
#define netDiskMissingError 3000
|
||||||
#define mountURLError 3001
|
#define mountURLError 3001
|
||||||
#define unsupportedProtocolAlert 3002
|
#define unsupportedProtocolAlert 3002
|
||||||
|
#define marinettiMissingError 3003
|
||||||
|
|
||||||
resource rAlertString (netDiskMissingError) {
|
resource rAlertString (netDiskMissingError) {
|
||||||
"62/"
|
"62/"
|
||||||
@ -295,6 +296,12 @@ resource rAlertString (netDiskMissingError) {
|
|||||||
"/^#0\$00"
|
"/^#0\$00"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
resource rAlertString (marinettiMissingError) {
|
||||||
|
"62/"
|
||||||
|
"Marinetti is not available. You must install Marinetti to use NetDisk."
|
||||||
|
"/^#0\$00"
|
||||||
|
};
|
||||||
|
|
||||||
resource rAlertString (mountURLError) {
|
resource rAlertString (mountURLError) {
|
||||||
"32:"
|
"32:"
|
||||||
"MountURL error *0."
|
"MountURL error *0."
|
||||||
|
@ -13,6 +13,9 @@ char *ErrorString(enum NetDiskError err) {
|
|||||||
return "No more disks can be mounted via NetDisk.";
|
return "No more disks can be mounted via NetDisk.";
|
||||||
case OUT_OF_MEMORY:
|
case OUT_OF_MEMORY:
|
||||||
return "Out of memory.";
|
return "Out of memory.";
|
||||||
|
case MARINETTI_NOT_PRESENT:
|
||||||
|
return "Marinetti is not available. You must install Marinetti to use "
|
||||||
|
"NetDisk.";
|
||||||
|
|
||||||
/* SetURL errors */
|
/* SetURL errors */
|
||||||
case URL_TOO_LONG:
|
case URL_TOO_LONG:
|
||||||
|
@ -8,6 +8,7 @@ enum NetDiskError {
|
|||||||
DISK_ALREADY_MOUNTED,
|
DISK_ALREADY_MOUNTED,
|
||||||
NO_DIBS_AVAILABLE,
|
NO_DIBS_AVAILABLE,
|
||||||
OUT_OF_MEMORY,
|
OUT_OF_MEMORY,
|
||||||
|
MARINETTI_NOT_PRESENT,
|
||||||
|
|
||||||
/* SetURL errors */
|
/* SetURL errors */
|
||||||
URL_TOO_LONG = 200,
|
URL_TOO_LONG = 200,
|
||||||
@ -39,8 +40,12 @@ enum NetDiskError {
|
|||||||
/* File format errors */
|
/* File format errors */
|
||||||
UNSUPPORTED_2IMG_FILE = 600,
|
UNSUPPORTED_2IMG_FILE = 600,
|
||||||
NOT_MULTIPLE_OF_BLOCK_SIZE,
|
NOT_MULTIPLE_OF_BLOCK_SIZE,
|
||||||
NOT_SPECIFIED_IMAGE_TYPE
|
NOT_SPECIFIED_IMAGE_TYPE,
|
||||||
|
UNSUPPORTED_IMAGE_TYPE,
|
||||||
|
|
||||||
|
/* Errors related to processing JSON result in the disk browser */
|
||||||
|
JSON_PARSING_ERROR = 900,
|
||||||
|
NOT_EXPECTED_CONTENTS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -182,6 +182,11 @@ static void notificationProc(void) {
|
|||||||
#pragma databank 0
|
#pragma databank 0
|
||||||
|
|
||||||
static void doMountURL(struct MountURLRec *mountURLRec) {
|
static void doMountURL(struct MountURLRec *mountURLRec) {
|
||||||
|
if (!TCPIPStatus() || toolerror()) {
|
||||||
|
mountURLRec->result = MARINETTI_NOT_PRESENT;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
DAccessRecGS controlRec = {5};
|
DAccessRecGS controlRec = {5};
|
||||||
controlRec.code = MountURL;
|
controlRec.code = MountURL;
|
||||||
controlRec.list = (pointer)mountURLRec;
|
controlRec.list = (pointer)mountURLRec;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user