summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--macosx/ConfigurationController.h1
-rw-r--r--macosx/ConfigurationController.m10
-rw-r--r--macosx/English.lproj/MemCardManager.xib43
-rw-r--r--macosx/PcsxrController.h5
-rw-r--r--macosx/PcsxrController.m5
-rw-r--r--macosx/PcsxrMemCardController.h2
-rw-r--r--macosx/PcsxrMemCardController.m11
-rw-r--r--macosx/PcsxrMemoryObject.h2
8 files changed, 50 insertions, 29 deletions
diff --git a/macosx/ConfigurationController.h b/macosx/ConfigurationController.h
index 068941e7..964e4eda 100644
--- a/macosx/ConfigurationController.h
+++ b/macosx/ConfigurationController.h
@@ -42,6 +42,7 @@
- (IBAction)mcdChangeClicked:(id)sender;
- (IBAction)mcdNewClicked:(id)sender;
- (IBAction)mcdEditClicked:(id)sender;
+- (BOOL)memoryCardWindowIsVisible;
- (NSString *)keyForSender:(id)sender;
diff --git a/macosx/ConfigurationController.m b/macosx/ConfigurationController.m
index d7f4cc76..288f56e3 100644
--- a/macosx/ConfigurationController.m
+++ b/macosx/ConfigurationController.m
@@ -220,7 +220,17 @@
if (!memCardEdit) {
memCardEdit = [[PcsxrMemCardController alloc] init];
}
+ [[memCardEdit window] center];
[memCardEdit showWindow:nil];
}
+- (BOOL)memoryCardWindowIsVisible
+{
+ if (!memCardEdit) {
+ return NO;
+ } else {
+ return [[memCardEdit window] isVisible];
+ }
+}
+
@end
diff --git a/macosx/English.lproj/MemCardManager.xib b/macosx/English.lproj/MemCardManager.xib
index 229d928a..f661d0a0 100644
--- a/macosx/English.lproj/MemCardManager.xib
+++ b/macosx/English.lproj/MemCardManager.xib
@@ -50,13 +50,14 @@
<object class="NSWindowTemplate" id="1005">
<int key="NSWindowStyleMask">15</int>
<int key="NSWindowBacking">2</int>
- <string key="NSWindowRect">{{196, 240}, {469, 329}}</string>
+ <string key="NSWindowRect">{{196, 240}, {469, 316}}</string>
<int key="NSWTFlags">544735232</int>
<string key="NSWindowTitle">Memory Card Manager</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
<nil key="NSUserInterfaceItemIdentifier"/>
- <string key="NSWindowContentMinSize">{469, 329}</string>
+ <string key="NSWindowContentMaxSize">{469, 316}</string>
+ <string key="NSWindowContentMinSize">{469, 316}</string>
<object class="NSView" key="NSWindowView" id="1006">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
@@ -64,8 +65,8 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSButton" id="146799775">
<reference key="NSNextResponder" ref="1006"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{203, 228}, {63, 32}}</string>
+ <int key="NSvFlags">269</int>
+ <string key="NSFrame">{{203, 215}, {63, 32}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="589069415"/>
@@ -93,8 +94,8 @@
</object>
<object class="NSButton" id="589069415">
<reference key="NSNextResponder" ref="1006"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{203, 94}, {63, 32}}</string>
+ <int key="NSvFlags">293</int>
+ <string key="NSFrame">{{203, 81}, {63, 32}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="3271293"/>
@@ -118,7 +119,7 @@
</object>
<object class="NSScrollView" id="3271293">
<reference key="NSNextResponder" ref="1006"/>
- <int key="NSvFlags">268</int>
+ <int key="NSvFlags">275</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSClipView" id="461514026">
@@ -196,7 +197,7 @@
<double key="NSPercent">0.63157892227172852</double>
</object>
</object>
- <string key="NSFrame">{{268, 61}, {181, 248}}</string>
+ <string key="NSFrame">{{268, 48}, {181, 248}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="461514026"/>
@@ -208,7 +209,7 @@
</object>
<object class="NSScrollView" id="61726387">
<reference key="NSNextResponder" ref="1006"/>
- <int key="NSvFlags">268</int>
+ <int key="NSvFlags">278</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSClipView" id="959059855">
@@ -273,7 +274,7 @@
<double key="NSPercent">0.63157892227172852</double>
</object>
</object>
- <string key="NSFrame">{{20, 61}, {181, 248}}</string>
+ <string key="NSFrame">{{20, 48}, {181, 248}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="959059855"/>
@@ -285,8 +286,8 @@
</object>
<object class="NSButton" id="487496353">
<reference key="NSNextResponder" ref="1006"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{262, 25}, {98, 32}}</string>
+ <int key="NSvFlags">289</int>
+ <string key="NSFrame">{{262, 12}, {98, 32}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="740252127"/>
@@ -310,8 +311,8 @@
</object>
<object class="NSButton" id="585997809">
<reference key="NSNextResponder" ref="1006"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{14, 25}, {98, 32}}</string>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{14, 12}, {98, 32}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="19827681"/>
@@ -335,8 +336,8 @@
</object>
<object class="NSButton" id="19827681">
<reference key="NSNextResponder" ref="1006"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{114, 25}, {93, 32}}</string>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{114, 12}, {93, 32}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="487496353"/>
@@ -360,8 +361,8 @@
</object>
<object class="NSButton" id="740252127">
<reference key="NSNextResponder" ref="1006"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{362, 25}, {93, 32}}</string>
+ <int key="NSvFlags">289</int>
+ <string key="NSFrame">{{362, 12}, {93, 32}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
@@ -384,14 +385,14 @@
</object>
</object>
</object>
- <string key="NSFrameSize">{469, 329}</string>
+ <string key="NSFrameSize">{469, 316}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="61726387"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
- <string key="NSMinSize">{469, 351}</string>
- <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
+ <string key="NSMinSize">{469, 338}</string>
+ <string key="NSMaxSize">{469, 338}</string>
<bool key="NSWindowIsRestorable">YES</bool>
</object>
<object class="NSCollectionViewItem" id="613808531"/>
diff --git a/macosx/PcsxrController.h b/macosx/PcsxrController.h
index 77e3011a..b6d46e9a 100644
--- a/macosx/PcsxrController.h
+++ b/macosx/PcsxrController.h
@@ -4,10 +4,11 @@
#import "EmuThread.h"
#import "PluginList.h"
+@class ConfigurationController;
+
@interface PcsxrController : NSObject
{
- NSWindowController *preferencesController;
- NSWindowController *memCardController;
+ ConfigurationController *preferencesController;
PluginList *pluginList;
IBOutlet NSWindow *preferenceWindow;
diff --git a/macosx/PcsxrController.m b/macosx/PcsxrController.m
index eff82832..bfea695a 100644
--- a/macosx/PcsxrController.m
+++ b/macosx/PcsxrController.m
@@ -166,6 +166,11 @@ NSString *saveStatePath;
if ([preferenceWindow isVisible])
return NO;
+ if (preferencesController != nil) {
+ if ([preferencesController memoryCardWindowIsVisible] == YES)
+ return NO;
+ }
+
if ([menuItem action] == @selector(runBios:) && strcmp(Config.Bios, "HLE") == 0)
return NO;
diff --git a/macosx/PcsxrMemCardController.h b/macosx/PcsxrMemCardController.h
index ea4fce9f..ae8d939f 100644
--- a/macosx/PcsxrMemCardController.h
+++ b/macosx/PcsxrMemCardController.h
@@ -9,7 +9,7 @@
#import <Cocoa/Cocoa.h>
-@interface PcsxrMemCardController : NSWindowController
+@interface PcsxrMemCardController : NSWindowController <NSWindowDelegate>
{
IBOutlet NSCollectionView *memCard1view;
IBOutlet NSCollectionView *memCard2view;
diff --git a/macosx/PcsxrMemCardController.m b/macosx/PcsxrMemCardController.m
index df04fb4b..de918f74 100644
--- a/macosx/PcsxrMemCardController.m
+++ b/macosx/PcsxrMemCardController.m
@@ -164,11 +164,16 @@ static inline void CopyMemcardData(char *from, char *to, int *i, char *str, int
[super windowDidLoad];
// Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
+ [[self window] setDelegate:self];
+}
+
+- (void)windowDidBecomeKey:(NSNotification *)notification
+{
[self loadMemoryCardInfoForCard:1];
[self loadMemoryCardInfoForCard:2];
}
-- (int)findFreeMemCardSlot:(int)target_card
+- (int)findFreeMemCardSlotInCard:(int)target_card
{
BOOL found = NO;
NSString *blockName;
@@ -237,15 +242,13 @@ static inline void CopyMemcardData(char *from, char *to, int *i, char *str, int
NSInteger selectedIndex = [selection firstIndex];
- freeSlot = [self findFreeMemCardSlot:toCard];
+ freeSlot = [self findFreeMemCardSlotInCard:toCard];
if (freeSlot == -1) {
NSRunCriticalAlertPanel(NSLocalizedString(@"No Free Space", nil), [NSString stringWithFormat:NSLocalizedString(@"Memory card %d doesn't have a free block on it. Please remove some blocks on that card to continue", nil), toCard], NSLocalizedString(@"Okay", nil), nil, nil);
return;
}
CopyMemcardData(source, destination, &freeSlot, str, selectedIndex);
-
-
if (toCard == 1) {
LoadMcd(1, Config.Mcd1);
diff --git a/macosx/PcsxrMemoryObject.h b/macosx/PcsxrMemoryObject.h
index 7c3421b4..6f3bacb6 100644
--- a/macosx/PcsxrMemoryObject.h
+++ b/macosx/PcsxrMemoryObject.h
@@ -22,7 +22,7 @@
@property(copy, readwrite) NSString *englishName;
@property(copy, readwrite) NSString *sjisName;
@property(retain, readwrite) NSImage *memImage;
-@property(readwrite) BOOL notDeleted;
+@property(readwrite, getter = isNotDeleted) BOOL notDeleted;
@property(readwrite) short memNumber;
@property(readwrite) unsigned char memFlags;