From a4f36118dc3781fcee3e633d2db99127de919c68 Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Fri, 18 Nov 2011 04:46:20 +0000 Subject: DFNet for Mac OS X. Note that DFNet is disabled by default, and there are still a few rough edges. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@72400 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/plugins/DFNet/macsrc/SockDialog.m | 85 ++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 macosx/plugins/DFNet/macsrc/SockDialog.m (limited to 'macosx/plugins/DFNet/macsrc/SockDialog.m') diff --git a/macosx/plugins/DFNet/macsrc/SockDialog.m b/macosx/plugins/DFNet/macsrc/SockDialog.m new file mode 100644 index 00000000..e49ffc3d --- /dev/null +++ b/macosx/plugins/DFNet/macsrc/SockDialog.m @@ -0,0 +1,85 @@ +// +// SockDialog.m +// DFNet +// +// Created by C.W. Betts on 2/18/11. +// Copyright 2011 __MyCompanyName__. All rights reserved. +// + +#import "SockDialog.h" +#include "dfnet.h" + +void SysMessage(const char *fmt, ...) { + va_list list; + char msg[512]; + //char cmd[512]; + + va_start(list, fmt); + vsprintf(msg, fmt, list); + va_end(list); + + //sprintf(cmd, "message %s\n", msg); + NSString *errString = [NSString stringWithUTF8String:msg]; + fprintf(stderr, "%s", msg); + NSAlert *alert = [NSAlert alertWithMessageText:nil defaultButton:@"Exit" alternateButton:nil otherButton:nil informativeTextWithFormat:errString]; + [alert setAlertStyle:NSCriticalAlertStyle]; + //NSInteger result = NSRunAlertPanel(errString, nil, @"Okay", nil, nil); + NSInteger result = [alert runModal]; + if (result == NSAlertDefaultReturn) + { + //TODO: Handle closing the emulator, but not quitting the program. + } +} + + +static SockDialog *globalSock = nil; + +void sockCreateWaitDlg() { + if (globalSock == nil) { + globalSock = [[SockDialog alloc] init]; + } + [globalSock showWindow:nil]; + NSWindow *tempWindow = [globalSock window]; + [tempWindow center]; + [tempWindow makeKeyAndOrderFront:nil]; + +} + +void sockDlgUpdate() { + +} + +long sockOpen() +{ + return 0; +} + +void sockDestroyWaitDlg() { + if (globalSock != nil) { + [globalSock close]; + [globalSock release]; + globalSock = nil; + } +} + +@implementation SockDialog +- (IBAction)cancel:(id)sender { + WaitCancel = 1; + +} + +- (id)init { + if ((self = [super initWithWindowNibName:@"SockDialog"])) { + return self; + } else { + [self autorelease]; + return nil; + } +} + +-(void)dealloc { + + [super dealloc]; +} + +@end -- cgit v1.2.3