Updating OS X plug-in code.
Now the net plug-in will warn you if you have a too large or non-ASCII characters. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@85926 e17a0e51-4ae3-4d35-97c3-1a29b211df97
This commit is contained in:
parent
2062efdfed
commit
c912deb4e7
|
@ -93,7 +93,6 @@
|
|||
<string key="NSFrame">{{236, 13}, {65, 32}}</string>
|
||||
<reference key="NSSuperview" ref="127793487"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="764681236">
|
||||
<int key="NSCellFlags">67108864</int>
|
||||
|
@ -1536,7 +1535,7 @@
|
|||
<string key="212.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="213.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1041" key="220.IBNumberFormatterBehaviorMetadataKey"/>
|
||||
<boolean value="YES" key="220.IBNumberFormatterLocalizesFormatMetadataKey"/>
|
||||
<boolean value="NO" key="220.IBNumberFormatterLocalizesFormatMetadataKey"/>
|
||||
<string key="220.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="NO" key="221.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
|
||||
<string key="221.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
- (IBAction)toggleEnabled:(id)sender;
|
||||
- (IBAction)resetPreferences:(id)sender;
|
||||
|
||||
|
||||
- (void)loadValues;
|
||||
|
||||
@end
|
||||
|
|
|
@ -121,14 +121,18 @@ void ReadConfig()
|
|||
NSMutableDictionary *writeDic = [NSMutableDictionary dictionaryWithDictionary:keyValues];
|
||||
|
||||
NSString *theAddress = [ipAddressField stringValue];
|
||||
if ([theAddress lengthOfBytesUsingEncoding:NSASCIIStringEncoding] > (sizeof(settings.ip) - 1)) {
|
||||
NSBeginAlertSheet(@"Address too long", nil, nil, nil, [self window], nil, NULL, NULL, NULL, @"The address is too long. Try to use only the IP address and not a host name.");
|
||||
NSInteger asciiLen = [theAddress lengthOfBytesUsingEncoding:NSASCIIStringEncoding];
|
||||
if (asciiLen > (sizeof(settings.ip) - 1)) {
|
||||
NSBeginAlertSheet(@"Address too long", nil, nil, nil, [self window], nil, NULL, NULL, NULL, @"The address is too long.\n\nTry to use only the IP address and not a host name.");
|
||||
return;
|
||||
} else if (asciiLen == 0) {
|
||||
NSBeginAlertSheet(@"Blank address", nil, nil, nil, [self window], nil, NULL, NULL, NULL, @"The address specified is either blank, or can't be converted to ASCII.\n\nTry connecting directly using the IP address using latin numerals.");
|
||||
return;
|
||||
}
|
||||
|
||||
[writeDic setObject:(([enabledButton state] == NSOnState) ? @YES : @NO) forKey:kSioEnabled];
|
||||
[writeDic setObject:theAddress forKey:kSioIPAddress];
|
||||
[writeDic setObject:@((unsigned short)[portField intValue]) forKey:kSioPort];
|
||||
[writeDic setObject:@((u16)[portField intValue]) forKey:kSioPort];
|
||||
|
||||
{
|
||||
int player;
|
||||
|
@ -202,12 +206,5 @@ void ReadConfig()
|
|||
|
||||
@end
|
||||
|
||||
char* PLUGLOC(char *toloc)
|
||||
{
|
||||
NSBundle *mainBundle = [NSBundle bundleForClass:[PluginConfigController class]];
|
||||
NSString *origString = nil, *transString = nil;
|
||||
origString = @(toloc);
|
||||
transString = [mainBundle localizedStringForKey:origString value:nil table:nil];
|
||||
return (char*)[transString UTF8String];
|
||||
}
|
||||
|
||||
#import "OSXPlugLocalization.h"
|
||||
PLUGLOCIMP([PluginConfigController class]);
|
||||
|
|
|
@ -37,14 +37,3 @@ void settingsRead() {
|
|||
|
||||
ReadConfig();
|
||||
}
|
||||
|
||||
#if 0
|
||||
extern long SIO1configure() {
|
||||
ConfDlgProc();
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern void SIO1about() {
|
||||
AboutDlgProc();
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -165,12 +165,5 @@ void ReadConfig()
|
|||
|
||||
@end
|
||||
|
||||
char* PLUGLOC(char *toloc)
|
||||
{
|
||||
NSBundle *mainBundle = [NSBundle bundleForClass:[PluginConfigController class]];
|
||||
NSString *origString = nil, *transString = nil;
|
||||
origString = @(toloc);
|
||||
transString = [mainBundle localizedStringForKey:origString value:nil table:nil];
|
||||
return (char*)[transString UTF8String];
|
||||
}
|
||||
|
||||
#import "OSXPlugLocalization.h"
|
||||
PLUGLOCIMP([PluginConfigController class]);
|
||||
|
|
|
@ -145,11 +145,5 @@ long DoConfiguration() {
|
|||
|
||||
@end
|
||||
|
||||
char* PLUGLOC(char *toloc)
|
||||
{
|
||||
NSBundle *mainBundle = [NSBundle bundleForClass:[PadController class]];
|
||||
NSString *origString = nil, *transString = nil;
|
||||
origString = @(toloc);
|
||||
transString = [mainBundle localizedStringForKey:origString value:nil table:nil];
|
||||
return (char*)[transString UTF8String];
|
||||
}
|
||||
#import "OSXPlugLocalization.h"
|
||||
PLUGLOCIMP([padController class]);
|
||||
|
|
|
@ -2,22 +2,23 @@
|
|||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1060</int>
|
||||
<string key="IBDocument.SystemVersion">11C74</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
|
||||
<string key="IBDocument.AppKitVersion">1138.23</string>
|
||||
<string key="IBDocument.HIToolboxVersion">567.00</string>
|
||||
<string key="IBDocument.SystemVersion">12E55</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
|
||||
<string key="IBDocument.AppKitVersion">1187.39</string>
|
||||
<string key="IBDocument.HIToolboxVersion">626.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">1938</string>
|
||||
<string key="NS.object.0">3084</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>NSButton</string>
|
||||
<string>NSButtonCell</string>
|
||||
<string>NSCustomObject</string>
|
||||
<string>NSNumberFormatter</string>
|
||||
<string>NSTextField</string>
|
||||
<string>NSTextFieldCell</string>
|
||||
<string>NSView</string>
|
||||
<string>NSWindowTemplate</string>
|
||||
<string>NSTextFieldCell</string>
|
||||
<string>NSButtonCell</string>
|
||||
<string>NSButton</string>
|
||||
<string>NSCustomObject</string>
|
||||
</array>
|
||||
<array key="IBDocument.PluginDependencies">
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
|
@ -39,24 +40,26 @@
|
|||
<object class="NSWindowTemplate" id="1005">
|
||||
<int key="NSWindowStyleMask">15</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{196, 240}, {372, 270}}</string>
|
||||
<string key="NSWindowRect">{{196, 240}, {340, 151}}</string>
|
||||
<int key="NSWTFlags">544735232</int>
|
||||
<string key="NSWindowTitle">Settings</string>
|
||||
<string key="NSWindowClass">NSWindow</string>
|
||||
<nil key="NSViewClass"/>
|
||||
<nil key="NSUserInterfaceItemIdentifier"/>
|
||||
<string key="NSWindowContentMinSize">{340, 151}</string>
|
||||
<object class="NSView" key="NSWindowView" id="1006">
|
||||
<nil key="NSNextResponder"/>
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<array class="NSMutableArray" key="NSSubviews">
|
||||
<object class="NSButton" id="199511368">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{262, 12}, {96, 32}}</string>
|
||||
<string key="NSFrame">{{230, 13}, {96, 32}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="77267016">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags">67108864</int>
|
||||
<int key="NSCellFlags2">134217728</int>
|
||||
<string key="NSContents">Okay</string>
|
||||
<object class="NSFont" key="NSSupport" id="638482190">
|
||||
|
@ -65,22 +68,25 @@
|
|||
<int key="NSfFlags">1044</int>
|
||||
</object>
|
||||
<reference key="NSControlView" ref="199511368"/>
|
||||
<int key="NSButtonFlags">-2038284033</int>
|
||||
<int key="NSButtonFlags">-2038284288</int>
|
||||
<int key="NSButtonFlags2">129</int>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">200</int>
|
||||
<int key="NSPeriodicInterval">25</int>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSTextField" id="898087221">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{126, 228}, {96, 22}}</string>
|
||||
<string key="NSFrame">{{126, 109}, {194, 22}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="578306678"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="642817145">
|
||||
<int key="NSCellFlags">-1804468671</int>
|
||||
<int key="NSCellFlags">-1804599231</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents">127.0.0.1</string>
|
||||
<reference key="NSSupport" ref="638482190"/>
|
||||
|
@ -105,52 +111,100 @@
|
|||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSButton" id="691737833">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{154, 12}, {96, 32}}</string>
|
||||
<string key="NSFrame">{{134, 13}, {96, 32}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="199511368"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="124429728">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags">67108864</int>
|
||||
<int key="NSCellFlags2">134217728</int>
|
||||
<string key="NSContents">Cancel</string>
|
||||
<reference key="NSSupport" ref="638482190"/>
|
||||
<reference key="NSControlView" ref="691737833"/>
|
||||
<int key="NSButtonFlags">-2038284033</int>
|
||||
<int key="NSButtonFlags">-2038284288</int>
|
||||
<int key="NSButtonFlags2">129</int>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string type="base64-UTF8" key="NSKeyEquivalent">Gw</string>
|
||||
<int key="NSPeriodicDelay">200</int>
|
||||
<int key="NSPeriodicInterval">25</int>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSTextField" id="241801086">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{126, 198}, {96, 22}}</string>
|
||||
<string key="NSFrame">{{126, 79}, {194, 22}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="762877023"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="994761013">
|
||||
<int key="NSCellFlags">-1804468671</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<int key="NSCellFlags">-1804599231</int>
|
||||
<int key="NSCellFlags2">-1874852864</int>
|
||||
<string key="NSContents">33306</string>
|
||||
<reference key="NSSupport" ref="638482190"/>
|
||||
<object class="NSNumberFormatter" key="NSFormatter" id="268768333">
|
||||
<dictionary class="NSMutableDictionary" key="NS.attributes">
|
||||
<boolean value="YES" key="allowsFloats"/>
|
||||
<integer value="1040" key="formatterBehavior"/>
|
||||
<object class="NSLocale" key="locale" id="258451440">
|
||||
<string key="NS.identifier"/>
|
||||
</object>
|
||||
<integer value="65535" key="maximum"/>
|
||||
<integer value="1" key="minimum"/>
|
||||
<string key="negativeInfinitySymbol">-∞</string>
|
||||
<string key="nilSymbol"/>
|
||||
<string key="positiveInfinitySymbol">+∞</string>
|
||||
</dictionary>
|
||||
<string key="NS.positiveformat">#</string>
|
||||
<string key="NS.negativeformat">#</string>
|
||||
<nil key="NS.positiveattrs"/>
|
||||
<nil key="NS.negativeattrs"/>
|
||||
<nil key="NS.zero"/>
|
||||
<object class="NSAttributedString" key="NS.nil">
|
||||
<string key="NSString"/>
|
||||
</object>
|
||||
<object class="NSAttributedString" key="NS.nan">
|
||||
<string key="NSString">NaN</string>
|
||||
<dictionary key="NSAttributes" id="24888233"/>
|
||||
</object>
|
||||
<integer value="1" key="NS.min"/>
|
||||
<integer value="65535" key="NS.max"/>
|
||||
<object class="NSDecimalNumberHandler" key="NS.rounding">
|
||||
<int key="NS.roundingmode">3</int>
|
||||
<bool key="NS.raise.overflow">YES</bool>
|
||||
<bool key="NS.raise.underflow">YES</bool>
|
||||
<bool key="NS.raise.dividebyzero">YES</bool>
|
||||
</object>
|
||||
<string key="NS.decimal">.</string>
|
||||
<string key="NS.thousand">,</string>
|
||||
<bool key="NS.hasthousands">NO</bool>
|
||||
<bool key="NS.localized">NO</bool>
|
||||
<bool key="NS.allowsfloats">YES</bool>
|
||||
</object>
|
||||
<reference key="NSControlView" ref="241801086"/>
|
||||
<bool key="NSDrawsBackground">YES</bool>
|
||||
<reference key="NSBackgroundColor" ref="14663110"/>
|
||||
<reference key="NSTextColor" ref="202277391"/>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSTextField" id="300903308">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 230}, {75, 17}}</string>
|
||||
<string key="NSFrame">{{17, 111}, {75, 17}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="898087221"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="871000838">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags">68157504</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents">IP Address:</string>
|
||||
<reference key="NSSupport" ref="638482190"/>
|
||||
|
@ -171,15 +225,18 @@
|
|||
<reference key="NSColor" ref="922126131"/>
|
||||
</object>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSTextField" id="578306678">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 200}, {38, 17}}</string>
|
||||
<string key="NSFrame">{{17, 81}, {38, 17}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="241801086"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="820109644">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags">68157504</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents">Port:</string>
|
||||
<reference key="NSSupport" ref="638482190"/>
|
||||
|
@ -187,15 +244,18 @@
|
|||
<reference key="NSBackgroundColor" ref="865466005"/>
|
||||
<reference key="NSTextColor" ref="2780984"/>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSTextField" id="762877023">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 170}, {101, 17}}</string>
|
||||
<string key="NSFrame">{{17, 51}, {101, 17}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="975640728"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="295724552">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags">68157504</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents">Player Number:</string>
|
||||
<reference key="NSSupport" ref="638482190"/>
|
||||
|
@ -203,28 +263,73 @@
|
|||
<reference key="NSBackgroundColor" ref="865466005"/>
|
||||
<reference key="NSTextColor" ref="2780984"/>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSTextField" id="975640728">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{126, 168}, {96, 22}}</string>
|
||||
<string key="NSFrame">{{126, 49}, {194, 22}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="691737833"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="123591098">
|
||||
<int key="NSCellFlags">-1804468671</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<int key="NSCellFlags">-1804599231</int>
|
||||
<int key="NSCellFlags2">-1874852864</int>
|
||||
<string key="NSContents">1</string>
|
||||
<reference key="NSSupport" ref="638482190"/>
|
||||
<object class="NSNumberFormatter" key="NSFormatter" id="630529634">
|
||||
<dictionary class="NSMutableDictionary" key="NS.attributes">
|
||||
<boolean value="YES" key="allowsFloats"/>
|
||||
<integer value="1040" key="formatterBehavior"/>
|
||||
<reference key="locale" ref="258451440"/>
|
||||
<integer value="2" key="maximum"/>
|
||||
<real value="1" key="minimum"/>
|
||||
<string key="negativeInfinitySymbol">-∞</string>
|
||||
<string key="nilSymbol"/>
|
||||
<string key="positiveInfinitySymbol">+∞</string>
|
||||
</dictionary>
|
||||
<string key="NS.positiveformat">#</string>
|
||||
<string key="NS.negativeformat">#</string>
|
||||
<nil key="NS.positiveattrs"/>
|
||||
<nil key="NS.negativeattrs"/>
|
||||
<nil key="NS.zero"/>
|
||||
<object class="NSAttributedString" key="NS.nil">
|
||||
<string key="NSString"/>
|
||||
</object>
|
||||
<object class="NSAttributedString" key="NS.nan">
|
||||
<string key="NSString">NaN</string>
|
||||
<reference key="NSAttributes" ref="24888233"/>
|
||||
</object>
|
||||
<real value="1" key="NS.min"/>
|
||||
<integer value="2" key="NS.max"/>
|
||||
<object class="NSDecimalNumberHandler" key="NS.rounding">
|
||||
<int key="NS.roundingmode">3</int>
|
||||
<bool key="NS.raise.overflow">YES</bool>
|
||||
<bool key="NS.raise.underflow">YES</bool>
|
||||
<bool key="NS.raise.dividebyzero">YES</bool>
|
||||
</object>
|
||||
<string key="NS.decimal">.</string>
|
||||
<string key="NS.thousand">,</string>
|
||||
<bool key="NS.hasthousands">NO</bool>
|
||||
<bool key="NS.localized">NO</bool>
|
||||
<bool key="NS.allowsfloats">YES</bool>
|
||||
</object>
|
||||
<reference key="NSControlView" ref="975640728"/>
|
||||
<bool key="NSDrawsBackground">YES</bool>
|
||||
<reference key="NSBackgroundColor" ref="14663110"/>
|
||||
<reference key="NSTextColor" ref="202277391"/>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{372, 270}</string>
|
||||
<string key="NSFrameSize">{340, 151}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="300903308"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {1920, 1058}}</string>
|
||||
<string key="NSMinSize">{340, 173}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
</object>
|
||||
|
@ -318,7 +423,6 @@
|
|||
<int key="objectID">2</int>
|
||||
<reference key="object" ref="1006"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="199511368"/>
|
||||
<reference ref="300903308"/>
|
||||
<reference ref="762877023"/>
|
||||
<reference ref="578306678"/>
|
||||
|
@ -326,6 +430,7 @@
|
|||
<reference ref="241801086"/>
|
||||
<reference ref="975640728"/>
|
||||
<reference ref="691737833"/>
|
||||
<reference ref="199511368"/>
|
||||
</array>
|
||||
<reference key="parent" ref="1005"/>
|
||||
</object>
|
||||
|
@ -379,6 +484,9 @@
|
|||
<object class="IBObjectRecord">
|
||||
<int key="objectID">18</int>
|
||||
<reference key="object" ref="994761013"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="268768333"/>
|
||||
</array>
|
||||
<reference key="parent" ref="241801086"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
|
@ -431,8 +539,21 @@
|
|||
<object class="IBObjectRecord">
|
||||
<int key="objectID">27</int>
|
||||
<reference key="object" ref="123591098"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="630529634"/>
|
||||
</array>
|
||||
<reference key="parent" ref="975640728"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">29</int>
|
||||
<reference key="object" ref="268768333"/>
|
||||
<reference key="parent" ref="994761013"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">30</int>
|
||||
<reference key="object" ref="630529634"/>
|
||||
<reference key="parent" ref="123591098"/>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
|
@ -463,6 +584,12 @@
|
|||
<string key="25.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="26.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="27.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1041" key="29.IBNumberFormatterBehaviorMetadataKey"/>
|
||||
<boolean value="NO" key="29.IBNumberFormatterLocalizesFormatMetadataKey"/>
|
||||
<string key="29.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1041" key="30.IBNumberFormatterBehaviorMetadataKey"/>
|
||||
<boolean value="NO" key="30.IBNumberFormatterLocalizesFormatMetadataKey"/>
|
||||
<string key="30.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="7.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="9.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
|
@ -471,32 +598,13 @@
|
|||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">28</int>
|
||||
<int key="maxID">30</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">DFNetPlayPluginConfigController</string>
|
||||
<string key="superclassName">NSWindowController</string>
|
||||
<dictionary class="NSMutableDictionary" key="outlets">
|
||||
<string key="ipAddress">NSTextField</string>
|
||||
<string key="playerNum">NSTextField</string>
|
||||
<string key="portNum">NSTextField</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<object class="IBToOneOutletInfo" key="ipAddress">
|
||||
<string key="name">ipAddress</string>
|
||||
<string key="candidateClassName">NSTextField</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="playerNum">
|
||||
<string key="name">playerNum</string>
|
||||
<string key="candidateClassName">NSTextField</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="portNum">
|
||||
<string key="name">portNum</string>
|
||||
<string key="candidateClassName">NSTextField</string>
|
||||
</object>
|
||||
</dictionary>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/DFNetPlayPluginConfigController.h</string>
|
||||
|
@ -510,10 +618,6 @@
|
|||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
|
||||
<real value="1060" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
|
||||
<real value="1060" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
</data>
|
||||
|
|
|
@ -40,12 +40,14 @@
|
|||
<object class="NSWindowTemplate" id="1005">
|
||||
<int key="NSWindowStyleMask">15</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{196, 371}, {382, 139}}</string>
|
||||
<string key="NSWindowRect">{{196, 371}, {380, 140}}</string>
|
||||
<int key="NSWTFlags">544735232</int>
|
||||
<string key="NSWindowTitle">Window</string>
|
||||
<string key="NSWindowClass">NSWindow</string>
|
||||
<nil key="NSViewClass"/>
|
||||
<nil key="NSUserInterfaceItemIdentifier"/>
|
||||
<string key="NSWindowContentMaxSize">{380, 140}</string>
|
||||
<string key="NSWindowContentMinSize">{380, 140}</string>
|
||||
<object class="NSView" key="NSWindowView" id="1006">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
|
@ -53,9 +55,10 @@
|
|||
<object class="NSTextField" id="150785340">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 102}, {348, 17}}</string>
|
||||
<string key="NSFrame">{{78, 103}, {225, 17}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="308883112"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="993388181">
|
||||
<int key="NSCellFlags">68157504</int>
|
||||
|
@ -90,19 +93,21 @@
|
|||
</object>
|
||||
<object class="NSProgressIndicator" id="308883112">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">1292</int>
|
||||
<string key="NSFrame">{{104, 61}, {174, 20}}</string>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{103, 60}, {174, 20}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="105187407"/>
|
||||
<int key="NSpiFlags">24586</int>
|
||||
<double key="NSMaxValue">100</double>
|
||||
</object>
|
||||
<object class="NSButton" id="105187407">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{143, 12}, {96, 32}}</string>
|
||||
<string key="NSFrame">{{142, 13}, {96, 32}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="857910789">
|
||||
<int key="NSCellFlags">67108864</int>
|
||||
|
@ -120,12 +125,14 @@
|
|||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{382, 139}</string>
|
||||
<string key="NSFrameSize">{380, 140}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="150785340"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {1920, 1058}}</string>
|
||||
<string key="NSMinSize">{380, 162}</string>
|
||||
<string key="NSMaxSize">{380, 162}</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
</object>
|
||||
</array>
|
||||
|
@ -186,9 +193,9 @@
|
|||
<int key="objectID">2</int>
|
||||
<reference key="object" ref="1006"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="150785340"/>
|
||||
<reference ref="308883112"/>
|
||||
<reference ref="105187407"/>
|
||||
<reference ref="150785340"/>
|
||||
</array>
|
||||
<reference key="parent" ref="1005"/>
|
||||
</object>
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
#include "dfnet.h"
|
||||
#import "ARCBridge.h"
|
||||
|
||||
NSString * const kIPADDRKEY = @"IP Address";
|
||||
NSString * const kIPPORT = @"IP Port";
|
||||
NSString * const kPLAYERNUM = @"Player Number";
|
||||
#define kIPADDRKEY @"IP Address"
|
||||
#define kIPPORT @"IP Port"
|
||||
#define kPLAYERNUM @"Player Number"
|
||||
|
||||
#define APP_ID @"net.codeplex.pcsxr.DFNet"
|
||||
#define PrefsKey APP_ID @" Settings"
|
||||
|
@ -90,9 +90,9 @@ void ReadConfig()
|
|||
|
||||
[defaults registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
@"127.0.0.1",kIPADDRKEY,
|
||||
[NSNumber numberWithInt:33306], kIPPORT,
|
||||
[NSNumber numberWithInt:1], kPLAYERNUM,
|
||||
@"127.0.0.1", kIPADDRKEY,
|
||||
@((unsigned short)33306), kIPPORT,
|
||||
@1, kPLAYERNUM,
|
||||
nil], PrefsKey, nil]];
|
||||
|
||||
keyValues = [defaults dictionaryForKey:PrefsKey];
|
||||
|
@ -113,10 +113,21 @@ void ReadConfig()
|
|||
{
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
NSString *theAddress = [ipAddress stringValue];
|
||||
NSInteger asciiLen = [theAddress lengthOfBytesUsingEncoding:NSASCIIStringEncoding];
|
||||
if (asciiLen > (sizeof(conf.ipAddress) - 1)) {
|
||||
NSBeginAlertSheet(@"Address too long", nil, nil, nil, [self window], nil, NULL, NULL, NULL, @"The address is too long.\n\nTry to use only the IP address and not a host name.");
|
||||
return;
|
||||
} else if (asciiLen == 0) {
|
||||
NSBeginAlertSheet(@"Blank address", nil, nil, nil, [self window], nil, NULL, NULL, NULL, @"The address specified is either blank, or can't be converted to ASCII.\n\nTry connecting directly using the IP address using latin numerals.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
NSMutableDictionary *writeDic = [NSMutableDictionary dictionaryWithDictionary:[defaults dictionaryForKey:PrefsKey]];
|
||||
[writeDic setObject:[NSNumber numberWithInt:[portNum intValue]] forKey:kIPPORT];
|
||||
[writeDic setObject:[NSNumber numberWithInt:[playerNum intValue]] forKey:kPLAYERNUM];
|
||||
[writeDic setObject:[ipAddress stringValue] forKey:kIPADDRKEY];
|
||||
[writeDic setObject:@((unsigned short)[portNum intValue]) forKey:kIPPORT];
|
||||
[writeDic setObject:@([playerNum intValue]) forKey:kPLAYERNUM];
|
||||
[writeDic setObject:theAddress forKey:kIPADDRKEY];
|
||||
|
||||
// write to defaults
|
||||
[defaults setObject:writeDic forKey:PrefsKey];
|
||||
|
@ -135,18 +146,11 @@ void ReadConfig()
|
|||
NSDictionary *keyValues = [defaults dictionaryForKey:PrefsKey];
|
||||
|
||||
[ipAddress setStringValue:[keyValues objectForKey:kIPADDRKEY]];
|
||||
[portNum setStringValue:[[keyValues objectForKey:kIPPORT] stringValue]];
|
||||
[playerNum setStringValue:[[keyValues objectForKey:kPLAYERNUM] stringValue]];
|
||||
[portNum setIntValue:[[keyValues objectForKey:kIPPORT] unsignedShortValue]];
|
||||
[playerNum setIntValue:[[keyValues objectForKey:kPLAYERNUM] intValue]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
char* PLUGLOC(char *toloc)
|
||||
{
|
||||
NSBundle *mainBundle = [NSBundle bundleForClass:[PluginConfigController class]];
|
||||
NSString *origString = nil, *transString = nil;
|
||||
origString = @(toloc);
|
||||
transString = [mainBundle localizedStringForKey:origString value:nil table:nil];
|
||||
return (char*)[transString UTF8String];
|
||||
}
|
||||
|
||||
#import "OSXPlugLocalization.h"
|
||||
PLUGLOCIMP([PluginConfigController class]);
|
||||
|
|
|
@ -216,11 +216,5 @@ void ReadConfig(void)
|
|||
|
||||
@end
|
||||
|
||||
char* PLUGLOC(char *toloc)
|
||||
{
|
||||
NSBundle *mainBundle = [NSBundle bundleForClass:[PluginController class]];
|
||||
NSString *origString = nil, *transString = nil;
|
||||
origString = @(toloc);
|
||||
transString = [mainBundle localizedStringForKey:origString value:@"" table:nil];
|
||||
return (char*)[transString UTF8String];
|
||||
}
|
||||
#import "OSXPlugLocalization.h"
|
||||
PLUGLOCIMP([PluginController class]);
|
||||
|
|
|
@ -354,12 +354,5 @@ void ReadConfig(void)
|
|||
|
||||
@end
|
||||
|
||||
char* PLUGLOC(char *toloc)
|
||||
{
|
||||
NSBundle *mainBundle = [NSBundle bundleForClass:[PluginConfigController class]];
|
||||
NSString *origString = nil, *transString = nil;
|
||||
origString = @(toloc);
|
||||
transString = [mainBundle localizedStringForKey:origString value:nil table:nil];
|
||||
return (char*)[transString UTF8String];
|
||||
}
|
||||
|
||||
#import "OSXPlugLocalization.h"
|
||||
PLUGLOCIMP([PluginConfigController class]);
|
||||
|
|
|
@ -362,11 +362,5 @@ void ReadConfig(void)
|
|||
|
||||
@end
|
||||
|
||||
char* PLUGLOC(char *toloc)
|
||||
{
|
||||
NSBundle *mainBundle = [NSBundle bundleForClass:[PluginConfigController class]];
|
||||
NSString *origString = nil, *transString = nil;
|
||||
origString = @(toloc);
|
||||
transString = [mainBundle localizedStringForKey:origString value:nil table:nil];
|
||||
return (char*)[transString UTF8String];
|
||||
}
|
||||
#import "OSXPlugLocalization.h"
|
||||
PLUGLOCIMP([PluginConfigController class]);
|
||||
|
|
Loading…
Reference in New Issue
Block a user