I had the hotkeys disable on me for some reason. I think this might fix it.
[MenuTunes.git] / StatusWindowController.m
index 2020530..b89d4e4 100755 (executable)
@@ -103,9 +103,11 @@ static StatusWindowController *sharedController;
                                title:            (NSString *)title
                                album:            (NSString *)album
                               artist:            (NSString *)artist
                                title:            (NSString *)title
                                album:            (NSString *)album
                               artist:            (NSString *)artist
+                            composer:            (NSString *)composer
                                 time:            (NSString *)time  // FLOW: Should probably be NSDate or something.
                                track:            (NSString *)track
                               rating:                   (int)rating
                                 time:            (NSString *)time  // FLOW: Should probably be NSDate or something.
                                track:            (NSString *)track
                               rating:                   (int)rating
+                           playCount:                   (int)playCount
                                image:             (NSImage *)art
 {
     NSImage  *image = nil;
                                image:             (NSImage *)art
 {
     NSImage  *image = nil;
@@ -135,12 +137,18 @@ static StatusWindowController *sharedController;
     if ( artist ) {
         text = [text stringByAppendingString:[@"\n" stringByAppendingString:artist]];
     }
     if ( artist ) {
         text = [text stringByAppendingString:[@"\n" stringByAppendingString:artist]];
     }
+    if ( composer ) {
+        text = [text stringByAppendingString:[@"\n" stringByAppendingString:composer]];
+    }
     if ( time ) {
         text = [text stringByAppendingString:[@"\n" stringByAppendingString:time]];
     }
     if ( track ) {
         text = [text stringByAppendingString:[@"\n" stringByAppendingString:track]];
     }
     if ( time ) {
         text = [text stringByAppendingString:[@"\n" stringByAppendingString:time]];
     }
     if ( track ) {
         text = [text stringByAppendingString:[@"\n" stringByAppendingString:track]];
     }
+    if (playCount > -1) {
+        text = [text stringByAppendingString:[NSString stringWithFormat:@"\nPlay Count: %i", playCount]];
+    }
     if ( rating > -1 ) {
 
         NSString *ratingString = [NSString string];
     if ( rating > -1 ) {
 
         NSString *ratingString = [NSString string];
@@ -160,7 +168,6 @@ static StatusWindowController *sharedController;
         text = [text stringByAppendingString:[@"\n" stringByAppendingString:ratingString]];
     }
     
         text = [text stringByAppendingString:[@"\n" stringByAppendingString:ratingString]];
     }
     
-    
     [_window setSizing:(ITTransientStatusWindowSizing)[df integerForKey:@"statusWindowSizing"]];
     [_window buildTextWindowWithString:text];
     [_window appear:self];
     [_window setSizing:(ITTransientStatusWindowSizing)[df integerForKey:@"statusWindowSizing"]];
     [_window buildTextWindowWithString:text];
     [_window appear:self];
@@ -227,13 +234,13 @@ static StatusWindowController *sharedController;
 
 - (void)showSetupQueryWindow
 {
 
 - (void)showSetupQueryWindow
 {
-    NSString *message = @"Would you like MenuTunes to launch\nautomatically at startup?";
+    NSString *message = NSLocalizedString(@"autolaunch_msg", @"Would you like MenuTunes to launch\nautomatically at startup?");
 
     [_window setImage:[NSImage imageNamed:@"Setup"]];
     [_window setSizing:(ITTransientStatusWindowSizing)[df integerForKey:@"statusWindowSizing"]];
     [_window buildDialogWindowWithMessage:message
 
     [_window setImage:[NSImage imageNamed:@"Setup"]];
     [_window setSizing:(ITTransientStatusWindowSizing)[df integerForKey:@"statusWindowSizing"]];
     [_window buildDialogWindowWithMessage:message
-                            defaultButton:@"Launch at Startup"
-                          alternateButton:@"Launch Manually"
+                            defaultButton:NSLocalizedString(@"launch_at_startup", @"Launch at Startup")
+                          alternateButton:NSLocalizedString(@"launch_manually", @"Launch Manually")
                                    target:[PreferencesController sharedPrefs]
                             defaultAction:@selector(autoLaunchOK)
                           alternateAction:@selector(autoLaunchCancel)];
                                    target:[PreferencesController sharedPrefs]
                             defaultAction:@selector(autoLaunchOK)
                           alternateAction:@selector(autoLaunchCancel)];
@@ -245,13 +252,13 @@ static StatusWindowController *sharedController;
 
 - (void)showRegistrationQueryWindow
 {
 
 - (void)showRegistrationQueryWindow
 {
-    NSString *message = @"Your 7-day unlimited trial period has elapsed.\nYou must register to continue using MenuTunes.";
+    NSString *message = NSLocalizedString(@"trialexpired_msg", @"Your 7-day unlimited trial period has elapsed.\nYou must register to continue using MenuTunes.");
 
     [_window setImage:[NSImage imageNamed:@"Register"]];
     [_window setSizing:(ITTransientStatusWindowSizing)[df integerForKey:@"statusWindowSizing"]];
     [_window buildDialogWindowWithMessage:message
 
     [_window setImage:[NSImage imageNamed:@"Register"]];
     [_window setSizing:(ITTransientStatusWindowSizing)[df integerForKey:@"statusWindowSizing"]];
     [_window buildDialogWindowWithMessage:message
-                            defaultButton:@"Register Now"
-                          alternateButton:@"Quit MenuTunes"
+                            defaultButton:NSLocalizedString(@"registernow", @"Register Now")
+                          alternateButton:NSLocalizedString(@"quitmenutunes", @"Quit MenuTunes")
                                    target:[MainController sharedController]
                             defaultAction:@selector(registerNowOK)
                           alternateAction:@selector(registerNowCancel)];
                                    target:[MainController sharedController]
                             defaultAction:@selector(registerNowOK)
                           alternateAction:@selector(registerNowCancel)];
@@ -262,13 +269,13 @@ static StatusWindowController *sharedController;
 
 - (void)showReconnectQueryWindow
 {
 
 - (void)showReconnectQueryWindow
 {
-    NSString *message = @"The selected shared player is available again.\nWould you like to reconnect to it?.";
-
+    NSString *message = NSLocalizedString(@"sharedplayeravailable_msg", @"The selected shared player is available again.\nWould you like to reconnect to it?");
+    [_window setLocked:NO];
     [_window setImage:[NSImage imageNamed:@"Setup"]];
     [_window setSizing:(ITTransientStatusWindowSizing)[df integerForKey:@"statusWindowSizing"]];
     [_window buildDialogWindowWithMessage:message
     [_window setImage:[NSImage imageNamed:@"Setup"]];
     [_window setSizing:(ITTransientStatusWindowSizing)[df integerForKey:@"statusWindowSizing"]];
     [_window buildDialogWindowWithMessage:message
-                            defaultButton:@"Reconnect"
-                          alternateButton:@"Ignore"
+                            defaultButton:NSLocalizedString(@"reconnect", @"Reconnect")
+                          alternateButton:NSLocalizedString(@"ignore", @"Ignore")
                                    target:[MainController sharedController]
                             defaultAction:@selector(reconnect)
                           alternateAction:@selector(cancelReconnect)];
                                    target:[MainController sharedController]
                             defaultAction:@selector(reconnect)
                           alternateAction:@selector(cancelReconnect)];
@@ -277,14 +284,31 @@ static StatusWindowController *sharedController;
     [_window setLocked:YES];
 }
 
     [_window setLocked:YES];
 }
 
+- (void)showNetworkErrorQueryWindow
+{
+    NSString *message = NSLocalizedString(@"sharedplayerunreachable_msg", @"The remote MenuTunes server is unreachable.\nMenuTunes will revert back to the local player.");
+
+    [_window setImage:[NSImage imageNamed:@"Setup"]];
+    [_window setSizing:(ITTransientStatusWindowSizing)[df integerForKey:@"statusWindowSizing"]];
+    [_window buildDialogWindowWithMessage:message
+                            defaultButton:@" OK "
+                          alternateButton:nil
+                                   target:[MainController sharedController]
+                            defaultAction:@selector(cancelReconnect)
+                          alternateAction:nil];
+
+    [_window appear:self];
+    [_window setLocked:YES];
+}
+
 - (void)showPreferencesUpdateWindow
 {
 - (void)showPreferencesUpdateWindow
 {
-    NSString *message = @"The new features in this version of MenuTunes\nrequire you to reconfigure your preferences.";
+    NSString *message = NSLocalizedString(@"reconfigureprefs_msg", @"The new features in this version of MenuTunes\nrequire you to reconfigure your preferences.");
 
     [_window setImage:[NSImage imageNamed:@"Setup"]];
     [_window setSizing:(ITTransientStatusWindowSizing)[df integerForKey:@"statusWindowSizing"]];
     [_window buildDialogWindowWithMessage:message
 
     [_window setImage:[NSImage imageNamed:@"Setup"]];
     [_window setSizing:(ITTransientStatusWindowSizing)[df integerForKey:@"statusWindowSizing"]];
     [_window buildDialogWindowWithMessage:message
-                            defaultButton:@"Show Preferences"
+                            defaultButton:NSLocalizedString(@"showpreferences", @"Show Preferences")
                           alternateButton:@"OK"
                                    target:[MainController sharedController]
                             defaultAction:@selector(showPreferencesAndClose)
                           alternateButton:@"OK"
                                    target:[MainController sharedController]
                             defaultAction:@selector(showPreferencesAndClose)