105 |
|
|
106 |
|
@end |
107 |
|
|
108 |
– |
@implementation PrefsEditor |
109 |
– |
|
108 |
|
#import <AppKit/NSImage.h> // For [NSBundle pathForImageResource:] proto |
109 |
|
|
110 |
|
#include <string> |
114 |
|
#import "sysdeps.h" // Types used in Basilisk C++ code |
115 |
|
#import "video_macosx.h" // some items that we edit here |
116 |
|
#import "misc_macosx.h" // WarningSheet() prototype |
117 |
+ |
#import "main_macosx.h" // ChoiceAlert() prototype |
118 |
+ |
|
119 |
|
|
120 |
|
#import <prefs.h> |
121 |
|
|
122 |
|
#define DEBUG 0 |
123 |
|
#import <debug.h> |
124 |
|
|
125 |
+ |
@implementation PrefsEditor |
126 |
+ |
|
127 |
|
- (PrefsEditor *) init |
128 |
|
{ |
129 |
|
self = [super init]; |
261 |
|
|
262 |
|
- (IBAction) ChangeBootFrom: (NSMatrix *)sender |
263 |
|
{ |
264 |
< |
if ( [sender selectedCell] == bootFromCD ) |
264 |
> |
if ( [sender selectedCell] == (id)bootFromCD ) |
265 |
|
PrefsReplaceInt32("bootdriver", CDROMRefNum); |
266 |
|
else |
267 |
|
PrefsReplaceInt32("bootdriver", 0); |
441 |
|
size = [newVolumeSize intValue]; |
442 |
|
|
443 |
|
sprintf(cmd, "dd if=/dev/zero \"of=%s\" bs=1024k count=%d", filename, size); |
444 |
+ |
|
445 |
|
retVal = system(cmd); |
446 |
|
if (retVal != 0) |
447 |
|
{ |
476 |
|
{ |
477 |
|
NSString *Path = [self RemoveVolumeEntry]; |
478 |
|
|
479 |
+ |
if ( ! Path ) |
480 |
+ |
return; |
481 |
+ |
|
482 |
|
if ( ! [[NSFileManager defaultManager] removeFileAtPath: Path |
483 |
|
handler: self] ) |
484 |
|
{ |
588 |
|
PrefsRemoveItem(pref, 1); |
589 |
|
} |
590 |
|
|
585 |
– |
//- (const char *) RemoveVolumeEntry |
591 |
|
- (NSString *) RemoveVolumeEntry |
592 |
|
{ |
593 |
|
int row = [diskImages selectedRow]; |
599 |
|
*str; |
600 |
|
int tmp = 0; |
601 |
|
|
602 |
+ |
NSString *prompt = [NSString stringWithFormat: @"%s\n%s", |
603 |
+ |
"Are you sure you want to delete the file", |
604 |
+ |
path]; |
605 |
+ |
|
606 |
+ |
if ( ! ChoiceAlert([prompt cString], "Delete", "Cancel") ) |
607 |
+ |
return NULL; |
608 |
+ |
|
609 |
|
while ( (str = PrefsFindString("disk", tmp) ) != NULL ) |
610 |
|
{ |
611 |
|
if ( strcmp(str, path) == 0 ) |