mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-01-12 16:30:44 +00:00
Started including 10.4 compile fixed from Kirk Kerekes,
Confirmation on disk image Delete requested by Markus Gail.
This commit is contained in:
parent
e694311703
commit
ffb2e01535
@ -105,8 +105,6 @@
|
||||
|
||||
@end
|
||||
|
||||
@implementation PrefsEditor
|
||||
|
||||
#import <AppKit/NSImage.h> // For [NSBundle pathForImageResource:] proto
|
||||
|
||||
#include <string>
|
||||
@ -116,12 +114,16 @@ extern string UserPrefsPath; // from prefs_unix.cpp
|
||||
#import "sysdeps.h" // Types used in Basilisk C++ code
|
||||
#import "video_macosx.h" // some items that we edit here
|
||||
#import "misc_macosx.h" // WarningSheet() prototype
|
||||
#import "main_macosx.h" // ChoiceAlert() prototype
|
||||
|
||||
|
||||
#import <prefs.h>
|
||||
|
||||
#define DEBUG 0
|
||||
#import <debug.h>
|
||||
|
||||
@implementation PrefsEditor
|
||||
|
||||
- (PrefsEditor *) init
|
||||
{
|
||||
self = [super init];
|
||||
@ -259,7 +261,7 @@ extern string UserPrefsPath; // from prefs_unix.cpp
|
||||
|
||||
- (IBAction) ChangeBootFrom: (NSMatrix *)sender
|
||||
{
|
||||
if ( [sender selectedCell] == bootFromCD )
|
||||
if ( [sender selectedCell] == (id)bootFromCD )
|
||||
PrefsReplaceInt32("bootdriver", CDROMRefNum);
|
||||
else
|
||||
PrefsReplaceInt32("bootdriver", 0);
|
||||
@ -439,6 +441,7 @@ extern string UserPrefsPath; // from prefs_unix.cpp
|
||||
size = [newVolumeSize intValue];
|
||||
|
||||
sprintf(cmd, "dd if=/dev/zero \"of=%s\" bs=1024k count=%d", filename, size);
|
||||
|
||||
retVal = system(cmd);
|
||||
if (retVal != 0)
|
||||
{
|
||||
@ -473,6 +476,9 @@ shouldProceedAfterError: (NSDictionary *) errorDict
|
||||
{
|
||||
NSString *Path = [self RemoveVolumeEntry];
|
||||
|
||||
if ( ! Path )
|
||||
return;
|
||||
|
||||
if ( ! [[NSFileManager defaultManager] removeFileAtPath: Path
|
||||
handler: self] )
|
||||
{
|
||||
@ -582,7 +588,6 @@ shouldProceedAfterError: (NSDictionary *) errorDict
|
||||
PrefsRemoveItem(pref, 1);
|
||||
}
|
||||
|
||||
//- (const char *) RemoveVolumeEntry
|
||||
- (NSString *) RemoveVolumeEntry
|
||||
{
|
||||
int row = [diskImages selectedRow];
|
||||
@ -594,6 +599,13 @@ shouldProceedAfterError: (NSDictionary *) errorDict
|
||||
*str;
|
||||
int tmp = 0;
|
||||
|
||||
NSString *prompt = [NSString stringWithFormat: @"%s\n%s",
|
||||
"Are you sure you want to delete the file",
|
||||
path];
|
||||
|
||||
if ( ! ChoiceAlert([prompt cString], "Delete", "Cancel") )
|
||||
return NULL;
|
||||
|
||||
while ( (str = PrefsFindString("disk", tmp) ) != NULL )
|
||||
{
|
||||
if ( strcmp(str, path) == 0 )
|
||||
|
Loading…
x
Reference in New Issue
Block a user