summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-12-04 06:34:43 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-12-04 06:34:43 +0000
commit6c94af779d3a6a2ddc46e2c69935bbe58a5c5302 (patch)
tree84da4e19542ee3299db6009b4a68f216e37b0cc1
parent3bd6d16afd6b068de6b061a87cba955f5ca3ff88 (diff)
downloadpcsxr-6c94af779d3a6a2ddc46e2c69935bbe58a5c5302.tar.gz
Added PcsxrMemCardController to those listening for changes in the memory card.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@72845 e17a0e51-4ae3-4d35-97c3-1a29b211df97
-rw-r--r--macosx/ConfigurationController.h2
-rw-r--r--macosx/ConfigurationController.m3
-rw-r--r--macosx/PcsxrMemCardController.m16
3 files changed, 18 insertions, 3 deletions
diff --git a/macosx/ConfigurationController.h b/macosx/ConfigurationController.h
index d6ef4491..87c68b2f 100644
--- a/macosx/ConfigurationController.h
+++ b/macosx/ConfigurationController.h
@@ -4,6 +4,8 @@
#import "PluginController.h"
#import "PluginList.h"
+extern NSString *memChangeNotifier;
+
@class PcsxrMemCardController;
@interface ConfigurationController : NSWindowController
diff --git a/macosx/ConfigurationController.m b/macosx/ConfigurationController.m
index ab3dc22c..a89775e3 100644
--- a/macosx/ConfigurationController.m
+++ b/macosx/ConfigurationController.m
@@ -8,7 +8,6 @@
NSString *memChangeNotifier = @"PcsxrMemoryCardDidChangeNotifier";
-
@implementation ConfigurationController
+ (void)setMemoryCard:(int)theCard toPath:(NSString *)theFile
@@ -76,7 +75,6 @@ NSString *memChangeNotifier = @"PcsxrMemoryCardDidChangeNotifier";
NSString *mcdPath = [[urls objectAtIndex:0] path];
[ConfigurationController setMemoryCard:tag toPath:mcdPath];
- [label setTitleWithMnemonic:mcdPath];
}
[openDlg release];
}
@@ -103,7 +101,6 @@ NSString *memChangeNotifier = @"PcsxrMemoryCardDidChangeNotifier";
NSString *mcdPath = [[openDlg URL] path];
[ConfigurationController setMemoryCard:tag toPath:mcdPath];
- [label setTitleWithMnemonic:mcdPath];
CreateMcd(mcd);
}
diff --git a/macosx/PcsxrMemCardController.m b/macosx/PcsxrMemCardController.m
index c842c4ea..9160d4cf 100644
--- a/macosx/PcsxrMemCardController.m
+++ b/macosx/PcsxrMemCardController.m
@@ -8,6 +8,7 @@
#import "PcsxrMemCardController.h"
#import "PcsxrMemoryObject.h"
+#import "ConfigurationController.h"
#include "sio.h"
#define MAX_MEMCARD_BLOCKS 15
@@ -159,12 +160,20 @@ static inline void CopyMemcardData(char *from, char *to, int *i, char *str, int
[newArray release];
}
+- (void)memoryCardDidChangeNotification:(NSNotification *)aNote
+{
+ [self loadMemoryCardInfoForCard:1];
+ [self loadMemoryCardInfoForCard:2];
+}
+
- (void)windowDidLoad
{
[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];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(memoryCardDidChangeNotification:) name:memChangeNotifier object:nil];
+
}
- (void)windowDidBecomeKey:(NSNotification *)notification
@@ -337,4 +346,11 @@ static inline void CopyMemcardData(char *from, char *to, int *i, char *str, int
}
}
+- (void)dealloc
+{
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+
+ [super dealloc];
+}
+
@end