diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-11-18 04:46:20 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-11-18 04:46:20 +0000 |
| commit | a4f36118dc3781fcee3e633d2db99127de919c68 (patch) | |
| tree | aca2b0c5e96609da798acb5b2bae696ee45444fd /macosx/plugins/DFNet/macsrc/SockDialog.m | |
| parent | 8a299835645bef784c8c468def91031e2e5e4400 (diff) | |
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
Diffstat (limited to 'macosx/plugins/DFNet/macsrc/SockDialog.m')
| -rw-r--r-- | macosx/plugins/DFNet/macsrc/SockDialog.m | 85 |
1 files changed, 85 insertions, 0 deletions
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 |
