diff options
author | dynaflash <[email protected]> | 2010-08-03 15:43:25 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2010-08-03 15:43:25 +0000 |
commit | c041c30ca962d7d13bde5e37e5c8e0b3983d33aa (patch) | |
tree | 159b50569f751462a697017402aad414376863a2 /macosx | |
parent | 929d41f09db038381bfb7dfe0463cc1cf9c54de6 (diff) |
MacGui: Re-locate logic for encode done notifications as per user preferences.
- Fixes an issue where a system beep would occur after every encode when Alert Window was chosen.
- Also means less calls to showGrowlDoneNotification as we were calling it after every encode and then checking the user prefs instead of checking prefs before calling it.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3468 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/Controller.m | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/macosx/Controller.m b/macosx/Controller.m index d0b5c9dd2..5bba38c54 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -1003,8 +1003,17 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It pathOfFinishedEncode = [[QueueFileArray objectAtIndex:currentQueueEncodeIndex] objectForKey:@"DestinationPath"]; /* Both the Growl Alert and Sending to MetaX can be done as encodes roll off the queue */ - /* Growl alert */ - [self showGrowlDoneNotification:pathOfFinishedEncode]; + if ([[[NSUserDefaults standardUserDefaults] stringForKey:@"AlertWhenDone"] isEqualToString: @"Growl Notification"] || + [[[NSUserDefaults standardUserDefaults] stringForKey:@"AlertWhenDone"] isEqualToString: @"Alert Window And Growl"]) + { + /* If Play System Alert has been selected in Preferences */ + if( [[NSUserDefaults standardUserDefaults] boolForKey:@"AlertWhenDoneSound"] == YES ) + { + NSBeep(); + } + [self showGrowlDoneNotification:pathOfFinishedEncode]; + } + /* Send to MetaX */ [self sendToMetaX:pathOfFinishedEncode]; @@ -1382,30 +1391,19 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It -(void)showGrowlDoneNotification:(NSString *) filePath { /* This end of encode action is called as each encode rolls off of the queue */ - - /* If Play System Alert has been selected in Preferences */ - if( [[NSUserDefaults standardUserDefaults] boolForKey:@"AlertWhenDoneSound"] == YES ) - { - NSBeep(); - } /* Setup the Growl stuff ... */ NSString * finishedEncode = filePath; /* strip off the path to just show the file name */ finishedEncode = [finishedEncode lastPathComponent]; - if ([[[NSUserDefaults standardUserDefaults] stringForKey:@"AlertWhenDone"] isEqualToString: @"Growl Notification"] || - [[[NSUserDefaults standardUserDefaults] stringForKey:@"AlertWhenDone"] isEqualToString: @"Alert Window And Growl"]) - { - NSString * growlMssg = [NSString stringWithFormat: @"your HandBrake encode %@ is done!",finishedEncode]; - [GrowlApplicationBridge - notifyWithTitle:@"Put down that cocktail..." - description:growlMssg - notificationName:SERVICE_NAME - iconData:nil - priority:0 - isSticky:1 - clickContext:nil]; - } - + NSString * growlMssg = [NSString stringWithFormat: @"your HandBrake encode %@ is done!",finishedEncode]; + [GrowlApplicationBridge + notifyWithTitle:@"Put down that cocktail..." + description:growlMssg + notificationName:SERVICE_NAME + iconData:nil + priority:0 + isSticky:1 + clickContext:nil]; } -(void)sendToMetaX:(NSString *) filePath { |