Tweaked the image position in the status window a bit. Added base of the
authorKent Sutherland <ksuther@ithinksw.com>
Fri, 30 Jan 2004 02:15:32 +0000 (02:15 +0000)
committerKent Sutherland <ksuther@ithinksw.com>
Fri, 30 Jan 2004 02:15:32 +0000 (02:15 +0000)
scripts.

English.lproj/Preferences.nib/classes.nib
English.lproj/Preferences.nib/info.nib
English.lproj/Preferences.nib/keyedobjects.nib
MainController.m
PreferencesController.h
PreferencesController.m
StatusWindow.m
StatusWindowController.m

index f19b4b9..56e143d 100755 (executable)
@@ -43,6 +43,7 @@
                 passwordTextField = NSTextField; 
                 positionMatrix = NSMatrix; 
                 ratingCheckbox = NSButton; 
+                runScriptsCheckbox = NSButton; 
                 selectPlayerBox = NSBox; 
                 selectPlayerSheet = NSPanel; 
                 selectSharedPlayerButton = NSButton; 
@@ -51,6 +52,7 @@
                 sharingPanelOKButton = NSButton; 
                 sharingTableView = NSTableView; 
                 showOnChangeCheckbox = NSButton; 
+                showScriptsButton = NSButton; 
                 songsInAdvance = NSTextField; 
                 trackNumberCheckbox = NSButton; 
                 trackTimeCheckbox = NSButton; 
index 9d098d2..21ef348 100755 (executable)
@@ -3,7 +3,7 @@
 <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>
index a97e923..b133fd3 100755 (executable)
Binary files a/English.lproj/Preferences.nib/keyedobjects.nib and b/English.lproj/Preferences.nib/keyedobjects.nib differ
index f0ca0f8..307800f 100755 (executable)
@@ -92,10 +92,14 @@ static MainController *sharedController;
         [[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];
index d409e8b..0730977 100755 (executable)
@@ -45,6 +45,7 @@
     IBOutlet NSTextField *passwordTextField;
     IBOutlet NSMatrix *positionMatrix;
     IBOutlet NSButton *ratingCheckbox;
+    IBOutlet NSButton *runScriptsCheckbox;
     IBOutlet NSTextField *selectedPlayerTextField;
     IBOutlet NSBox *selectPlayerBox;
     IBOutlet NSPanel *selectPlayerSheet;
@@ -53,6 +54,7 @@
     IBOutlet NSButton *sharingPanelOKButton;
     IBOutlet NSTableView *sharingTableView;
     IBOutlet NSButton *showOnChangeCheckbox;
+    IBOutlet NSButton *showScriptsButton;
     IBOutlet NSTextField *songsInAdvance;
     IBOutlet NSButton *trackNumberCheckbox;
     IBOutlet NSButton *trackTimeCheckbox;
index d731bd2..67cdd56 100755 (executable)
@@ -9,6 +9,8 @@
 #import <netinet/in.h>
 #import <arpa/inet.h>
 #import <openssl/sha.h>
+#import <sys/types.h>
+#import <sys/stat.h>
 
 #import <ITFoundation/ITFoundation.h>
 
@@ -147,10 +149,10 @@ static PreferencesController *prefs = nil;
     [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 {
@@ -165,10 +167,10 @@ static PreferencesController *prefs = nil;
     [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 {
@@ -197,11 +199,11 @@ static PreferencesController *prefs = nil;
     }
 
     [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
@@ -234,6 +236,17 @@ static PreferencesController *prefs = nil;
         [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];
 }
@@ -783,6 +796,13 @@ static PreferencesController *prefs = nil;
     [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];
index a456861..8e88f47 100755 (executable)
     [[[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 );
index 85d94df..3e7522e 100755 (executable)
@@ -116,10 +116,13 @@ static StatusWindowController *sharedController;
     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 ) {