Changeset 3269

Show
Ignore:
Timestamp:
06/07/06 22:19:51 (2 years ago)
Author:
timothy
Message:

Adds a play sound only if Colloquy is in the backgound. Also makes Chat Room activity fire even if the room is in the front. Fixes #493.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Controllers/JVNotificationController.m

    r3259 r3269  
    5252        NSDictionary *eventPrefs = [[NSUserDefaults standardUserDefaults] dictionaryForKey:[NSString stringWithFormat:@"JVNotificationSettings %@", identifier]]; 
    5353 
    54         if( [[eventPrefs objectForKey:@"playSound"] boolValue] && ! [[NSUserDefaults standardUserDefaults] boolForKey:@"JVChatNotificationsMuted"] ) 
    55                 [self _playSound:[eventPrefs objectForKey:@"soundPath"]]; 
     54        if( [[eventPrefs objectForKey:@"playSound"] boolValue] && ! [[NSUserDefaults standardUserDefaults] boolForKey:@"JVChatNotificationsMuted"] ) { 
     55                if( [[eventPrefs objectForKey:@"playSoundOnlyIfBackground"] boolValue] && ! [[NSApplication sharedApplication] isActive] ) 
     56                        [self _playSound:[eventPrefs objectForKey:@"soundPath"]]; 
     57                else if( ! [[eventPrefs objectForKey:@"playSoundOnlyIfBackground"] boolValue] ) 
     58                        [self _playSound:[eventPrefs objectForKey:@"soundPath"]]; 
     59        } 
    5660 
    5761        if( [[eventPrefs objectForKey:@"bounceIcon"] boolValue] ) { 
  • trunk/Languages/English.lproj/JVNotificationPreferences.nib/classes.nib

    r2744 r3269  
    2424                playSound = NSButton;  
    2525                showBubble = NSButton;  
     26                soundOnlyIfBackground = NSButton;  
    2627                sounds = NSPopUpButton;  
    2728                untilAttention = NSButton;  
  • trunk/Languages/English.lproj/JVNotificationPreferences.nib/info.nib

    r2744 r3269  
    44<dict> 
    55        <key>IBDocumentLocation</key> 
    6         <string>178 107 356 240 0 0 1280 832 </string> 
     6        <string>209 115 356 240 0 0 1440 878 </string> 
    77        <key>IBEditorPositions</key> 
    88        <dict> 
    99                <key>5</key> 
    10                 <string>367 398 545 343 0 0 1280 832 </string> 
     10                <string>447 408 545 363 0 0 1440 878 </string> 
    1111        </dict> 
    1212        <key>IBFramework Version</key> 
    13         <string>437.0</string> 
     13        <string>446.1</string> 
    1414        <key>IBGroupedObjects</key> 
    1515        <dict> 
     
    3333        </array> 
    3434        <key>IBSystem Version</key> 
    35         <string>8B15</string> 
     35        <string>8I1119</string> 
    3636</dict> 
    3737</plist> 
  • trunk/Panels/JVChatRoomPanel.m

    r3246 r3269  
    285285        } 
    286286 
    287         if( [message ignoreStatus] == JVNotIgnored && [[message sender] respondsToSelector:@selector( isLocalUser )] && ! [[message sender] isLocalUser] && ( ! [[[self view] window] isMainWindow] || ! _isActive ) ) { 
     287        if( [message ignoreStatus] == JVNotIgnored && [[message sender] respondsToSelector:@selector( isLocalUser )] && ! [[message sender] isLocalUser] ) { 
    288288                NSMutableDictionary *context = [NSMutableDictionary dictionary]; 
    289289                [context setObject:[NSString stringWithFormat:NSLocalizedString( @"%@ Room Activity", "room activity bubble title" ), [self title]] forKey:@"title"]; 
  • trunk/Preferences/JVNotificationPreferences.h

    r3072 r3269  
    55        IBOutlet NSPopUpButton *chatActions; 
    66        IBOutlet NSButton *playSound; 
     7        IBOutlet NSButton *soundOnlyIfBackground; 
    78        IBOutlet NSPopUpButton *sounds; 
    89        IBOutlet NSButton *bounceIcon; 
  • trunk/Preferences/JVNotificationPreferences.m

    r3259 r3269  
    3232        BOOL boolValue = [[_eventPrefs objectForKey:@"playSound"] boolValue]; 
    3333        [playSound setState:boolValue]; 
     34        [soundOnlyIfBackground setEnabled:boolValue]; 
    3435        [sounds setEnabled:boolValue]; 
     36        if( ! boolValue ) [soundOnlyIfBackground setState:NSOffState]; 
     37        else [soundOnlyIfBackground setState:[[_eventPrefs objectForKey:@"playSoundOnlyIfBackground"] boolValue]]; 
    3538        [self selectSoundWithPath:[_eventPrefs objectForKey:@"soundPath"]]; 
    3639 
     
    176179- (void) playSound:(id) sender { 
    177180        [sounds setEnabled:(BOOL)[sender state]]; 
     181        [soundOnlyIfBackground setEnabled:(BOOL)[sender state]]; 
     182        if( [sender state] == NSOffState ) [soundOnlyIfBackground setState:NSOffState]; 
     183        else [soundOnlyIfBackground setState:[[_eventPrefs objectForKey:@"playSoundOnlyIfBackground"] boolValue]]; 
    178184        [_eventPrefs setObject:[NSNumber numberWithBool:(BOOL)[sender state]] forKey:@"playSound"]; 
    179185        [self switchSound:sounds];