summaryrefslogtreecommitdiff
path: root/macosx/PluginController.m
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-08-24 02:19:14 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-08-24 02:19:14 +0000
commit8b64ca8414e1dcf56b1d3d3a481090e551499445 (patch)
treeec0ca496628d928ab03f4488626cb30bfab8593a /macosx/PluginController.m
parent0fe00d6450e7f0288cad751d46fff70118857859 (diff)
downloadpcsxr-8b64ca8414e1dcf56b1d3d3a481090e551499445.tar.gz
Continual improvement to OS X code.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@86890 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/PluginController.m')
-rwxr-xr-xmacosx/PluginController.m30
1 files changed, 18 insertions, 12 deletions
diff --git a/macosx/PluginController.m b/macosx/PluginController.m
index 1d74f9cc..27ff6f01 100755
--- a/macosx/PluginController.m
+++ b/macosx/PluginController.m
@@ -3,7 +3,14 @@
#import "PcsxrController.h"
#import "ARCBridge.h"
+@interface PluginController ()
+@property (arcstrong) NSArray *plugins;
+@property (arcstrong) NSString *defaultKey;
+@end
+
@implementation PluginController
+@synthesize defaultKey;
+@synthesize plugins;
- (IBAction)doAbout:(id)sender
{
@@ -14,13 +21,12 @@
- (IBAction)doConfigure:(id)sender
{
PcsxrPlugin *plugin = [plugins objectAtIndex:[pluginMenu indexOfSelectedItem]];
-
[plugin configureAs:pluginType];
}
- (IBAction)selectPlugin:(id)sender
{
- if (sender==pluginMenu) {
+ if (sender == pluginMenu) {
NSInteger index = [pluginMenu indexOfSelectedItem];
if (index != -1) {
PcsxrPlugin *plugin = [plugins objectAtIndex:index];
@@ -47,12 +53,11 @@
- (void)setPluginsTo:(NSArray *)list withType:(int)type
{
NSString *sel;
- NSUInteger i;
// remember the list
pluginType = type;
- plugins = RETAINOBJ(list);
- defaultKey = RETAINOBJ([PcsxrPlugin defaultKeyForType:pluginType]);
+ self.plugins = list;
+ self.defaultKey = [PcsxrPlugin defaultKeyForType:pluginType];
// clear the previous menu items
[pluginMenu removeAllItems];
@@ -61,12 +66,13 @@
sel = [[NSUserDefaults standardUserDefaults] stringForKey:defaultKey];
// add the menu entries
- for (i = 0; i < [plugins count]; i++) {
- [pluginMenu addItemWithTitle:[[plugins objectAtIndex:i] description]];
-
+ for (PcsxrPlugin *plug in plugins) {
+ NSString *description = [plug description];
+ [pluginMenu addItemWithTitle:description];
+
// make sure the currently selected is set as such
- if ([sel isEqualToString:[[plugins objectAtIndex:i] path]]) {
- [pluginMenu selectItemAtIndex:i];
+ if ([sel isEqualToString:[plug path]]) {
+ [pluginMenu selectItemWithTitle:description];
}
}
@@ -76,8 +82,8 @@
#if !__has_feature(objc_arc)
- (void)dealloc
{
- [plugins release];
- [defaultKey release];
+ self.plugins = nil;
+ self.defaultKey = nil;
[super dealloc];
}