summaryrefslogtreecommitdiff
path: root/macosx/PluginController.m
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2014-07-20 05:09:43 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2014-07-20 05:09:43 +0000
commitd6942932d64a02aa92b1e04e91f6126f33fdb05e (patch)
tree7cad698308e39abc2b0e1c71674c610ec3ce74dd /macosx/PluginController.m
parentb8d0d24d56dbc0ee64f4ec9a72ab917604d8109d (diff)
downloadpcsxr-d6942932d64a02aa92b1e04e91f6126f33fdb05e.tar.gz
OS X: Move source files to their own folder.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@90999 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/PluginController.m')
-rwxr-xr-xmacosx/PluginController.m83
1 files changed, 0 insertions, 83 deletions
diff --git a/macosx/PluginController.m b/macosx/PluginController.m
deleted file mode 100755
index 2d9b26c9..00000000
--- a/macosx/PluginController.m
+++ /dev/null
@@ -1,83 +0,0 @@
-#import "PluginController.h"
-#import "PcsxrPlugin.h"
-#import "PcsxrController.h"
-
-@interface PluginController ()
-@property (strong) NSArray *plugins;
-@property (strong) NSString *defaultKey;
-@property int pluginType;
-@end
-
-@implementation PluginController
-@synthesize aboutButton;
-@synthesize configureButton;
-@synthesize pluginMenu;
-
-- (IBAction)doAbout:(id)sender
-{
- PcsxrPlugin *plugin = (self.plugins)[[pluginMenu indexOfSelectedItem]];
- [plugin aboutAs:self.pluginType];
-}
-
-- (IBAction)doConfigure:(id)sender
-{
- PcsxrPlugin *plugin = (self.plugins)[[pluginMenu indexOfSelectedItem]];
- [plugin configureAs:self.pluginType];
-}
-
-- (IBAction)selectPlugin:(id)sender
-{
- if (sender == pluginMenu) {
- NSInteger index = [pluginMenu indexOfSelectedItem];
- if (index != -1) {
- PcsxrPlugin *plugin = (self.plugins)[index];
-
- if (![[PluginList list] setActivePlugin:plugin forType:self.pluginType]) {
- /* plugin won't initialize */
- }
-
- // write selection to defaults
- [[NSUserDefaults standardUserDefaults] setObject:[plugin path] forKey:self.defaultKey];
-
- // set button states
- [aboutButton setEnabled:[plugin hasAboutAs:self.pluginType]];
- [configureButton setEnabled:[plugin hasConfigureAs:self.pluginType]];
- } else {
- // set button states
- [aboutButton setEnabled:NO];
- [configureButton setEnabled:NO];
- }
- }
-}
-
-// must be called before anything else
-- (void)setPluginsTo:(NSArray *)list withType:(int)type
-{
- NSString *sel;
-
- // remember the list
- self.pluginType = type;
- self.plugins = list;
- self.defaultKey = [PcsxrPlugin defaultKeyForType:self.pluginType];
-
- // clear the previous menu items
- [pluginMenu removeAllItems];
-
- // load the currently selected plugin
- sel = [[NSUserDefaults standardUserDefaults] stringForKey:self.defaultKey];
-
- // add the menu entries
- for (PcsxrPlugin *plug in self.plugins) {
- NSString *description = [plug description];
- [pluginMenu addItemWithTitle:description];
-
- // make sure the currently selected is set as such
- if ([sel isEqualToString:[plug path]]) {
- [pluginMenu selectItemWithTitle:description];
- }
- }
-
- [self selectPlugin:pluginMenu];
-}
-
-@end