Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 811d14fa31
Fetching contributors…

Cannot retrieve contributors at this time

38 lines (33 sloc) 0.912 kB
#import "TCOSPreferences.h"
@implementation TCOSPreferences
+(TCOSPreferences*)sharedInstance
{
static TCOSPreferences* pref = nil;
if (pref == nil) {
pref = [[TCOSPreferences alloc] init];
}
return pref;
}
-(id)init
{
self = [super init];
[NSBundle loadNibNamed:@"TCOSPreferences.nib" owner:self];
return self;
}
-(void)awakeFromNib
{
BOOL copyOnSelect = [[NSUserDefaults standardUserDefaults] boolForKey:USER_DEFAULTS_KEY];
NSMenu* applicationMenu = [[[[NSApplication sharedApplication] mainMenu] itemAtIndex: 0] submenu];
for(NSMenuItem* menuItem in [terminalMenuAdditions itemArray]){
menuItem.state = copyOnSelect;
[terminalMenuAdditions removeItem:menuItem];
[applicationMenu insertItem:menuItem atIndex:3];
}
}
-(IBAction)
toggle:(NSMenuItem *)sender
{
sender.state = 1 - sender.state;
[[NSUserDefaults standardUserDefaults] setBool:sender.state forKey:USER_DEFAULTS_KEY];
}
@end
Jump to Line
Something went wrong with that request. Please try again.