scripts.
passwordTextField = NSTextField;
positionMatrix = NSMatrix;
ratingCheckbox = NSButton;
+ runScriptsCheckbox = NSButton;
selectPlayerBox = NSBox;
selectPlayerSheet = NSPanel;
selectSharedPlayerButton = NSButton;
sharingPanelOKButton = NSButton;
sharingTableView = NSTableView;
showOnChangeCheckbox = NSButton;
+ showScriptsButton = NSButton;
songsInAdvance = NSTextField;
trackNumberCheckbox = NSButton;
trackTimeCheckbox = NSButton;
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
- <string>43 33 356 240 0 0 1152 746 </string>
+ <string>34 75 356 240 0 0 1152 746 </string>
<key>IBEditorPositions</key>
<dict>
<key>634</key>
[[PreferencesController sharedPrefs] registerDefaults];
}
- [StatusItemHack install];
- statusItem = [[ITStatusItem alloc]
- initWithStatusBar:[NSStatusBar systemStatusBar]
- withLength:NSSquareStatusItemLength];
+ if ([df boolForKey:@"ITMTNoStatusItem"]) {
+ statusItem = nil;
+ } else {
+ [StatusItemHack install];
+ statusItem = [[ITStatusItem alloc]
+ initWithStatusBar:[NSStatusBar systemStatusBar]
+ withLength:NSSquareStatusItemLength];
+ }
bling = [[MTBlingController alloc] init];
[self blingTime];
IBOutlet NSTextField *passwordTextField;
IBOutlet NSMatrix *positionMatrix;
IBOutlet NSButton *ratingCheckbox;
+ IBOutlet NSButton *runScriptsCheckbox;
IBOutlet NSTextField *selectedPlayerTextField;
IBOutlet NSBox *selectPlayerBox;
IBOutlet NSPanel *selectPlayerSheet;
IBOutlet NSButton *sharingPanelOKButton;
IBOutlet NSTableView *sharingTableView;
IBOutlet NSButton *showOnChangeCheckbox;
+ IBOutlet NSButton *showScriptsButton;
IBOutlet NSTextField *songsInAdvance;
IBOutlet NSButton *trackNumberCheckbox;
IBOutlet NSButton *trackTimeCheckbox;
#import <netinet/in.h>
#import <arpa/inet.h>
#import <openssl/sha.h>
+#import <sys/types.h>
+#import <sys/stat.h>
#import <ITFoundation/ITFoundation.h>
[passwordPanelTitle setStringValue:@"Password Required"];
[passwordPanelMessage setStringValue:[NSString stringWithFormat:@"Please enter a password for access to the MenuTunes player named %@ at %@.", [[[NetworkController sharedController] networkObject] serverName], [[NetworkController sharedController] remoteHost]]];
[passwordPanel setLevel:NSStatusWindowLevel];
- [NSApp activateIgnoringOtherApps: YES];
- [window center];
- [window orderFrontRegardless];
- [window makeKeyWindow];
+ [NSApp activateIgnoringOtherApps:YES];
+ [passwordPanel center];
+ [passwordPanel orderFrontRegardless];
+ [passwordPanel makeKeyWindow];
if ([NSApp runModalForWindow:passwordPanel]) {
return YES;
} else {
[passwordPanelTitle setStringValue:@"Invalid Password"];
[passwordPanelMessage setStringValue:[NSString stringWithFormat:@"The password entered for access to the MenuTunes player named %@ at %@ is invalid. Please provide a new password.", [[[NetworkController sharedController] networkObject] serverName], [[NetworkController sharedController] remoteHost]]];
[passwordPanel setLevel:NSStatusWindowLevel];
- [NSApp activateIgnoringOtherApps: YES];
- [window center];
- [window orderFrontRegardless];
- [window makeKeyWindow];
+ [NSApp activateIgnoringOtherApps:YES];
+ [passwordPanel center];
+ [passwordPanel orderFrontRegardless];
+ [passwordPanel makeKeyWindow];
if ([NSApp runModalForWindow:passwordPanel]) {
return YES;
} else {
}
[self resetRemotePlayerTextFields];
- [NSApp activateIgnoringOtherApps: YES];
+ [launchAtLoginCheckbox becomeFirstResponder];
+ [NSApp activateIgnoringOtherApps:YES];
[window center];
[window orderFrontRegardless];
[window makeKeyWindow];
- [window performSelector:@selector(makeKeyAndOrderFront:) withObject:self afterDelay:0.0];
}
- (IBAction)showTestWindow:(id)sender
[df setBool:SENDER_STATE forKey:@"showTrackRating"];
} else if ( [sender tag] == 1100) {
[df setBool:SENDER_STATE forKey:@"showAlbumArtwork"];
+ } else if ( [sender tag] == 1110) {
+ [df setBool:SENDER_STATE forKey:@"runScripts"];
+ if (SENDER_STATE) {
+ [runScriptsCheckbox setState:NSOnState];
+ [showScriptsButton setEnabled:YES];
+ } else {
+ [showScriptsButton setEnabled:NO];
+ }
+ } else if ( [sender tag] == 1120) {
+ mkdir([[NSHomeDirectory() stringByAppendingPathComponent:@"Library/Application Support/MenuTunes/Scripts"] cString], 0744);
+ [[NSWorkspace sharedWorkspace] openFile:[NSHomeDirectory() stringByAppendingPathComponent:@"Library/Application Support/MenuTunes/Scripts"]];
}
[df synchronize];
}
[ratingCheckbox setState:[df boolForKey:@"showTrackRating"] ? NSOnState : NSOffState];
[albumArtworkCheckbox setState:[df boolForKey:@"showAlbumArtwork"] ? NSOnState : NSOffState];
+ if ([df boolForKey:@"runScripts"]) {
+ [runScriptsCheckbox setState:NSOnState];
+ [showScriptsButton setEnabled:YES];
+ } else {
+ [showScriptsButton setEnabled:NO];
+ }
+
// Set the launch at login checkbox state
ITDebugLog(@"Setting launch at login state.");
[df synchronize];
[[[self contentView] subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
// Setup, position, fill, and add the image view to the content view.
- imageRect = NSMakeRect( (SW_PAD / divisor),
+ imageRect = NSMakeRect( (SW_PAD / divisor) + 4,
((SW_PAD / divisor) + ((contentHeight - imageHeight) / 2)),
imageWidth,
imageHeight );
if ( art != nil ) {
image = art;
NSSize size = [image size];
- if (size.width > 110) {
- [image setScalesWhenResized:YES];
+ [image setScalesWhenResized:YES];
+ [image setSize:NSMakeSize(110, 110)];
+ /*if (size.width > 110 && size.width > size.height) {
[image setSize:NSMakeSize(110, (size.width / size.height) * 110)];
- }
+ } else if (size.height > 110 && size.height > size.width) {
+ [image setSize:NSMakeSize((size.height / size.width) * 110, 110)];
+ }*/
} else if ( source == ITMTRemoteLibrarySource ) {
image = [NSImage imageNamed:@"Library"];
} else if ( source == ITMTRemoteCDSource ) {