Changeset 4793
- Timestamp:
- 05/27/07 14:57:16 (2 years ago)
- Files:
-
- WiredClient/trunk/WCApplicationController.m (modified) (2 diffs)
- WiredClient/trunk/WCPreferences.m (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
WiredClient/trunk/WCApplicationController.m
r4792 r4793 474 474 - (void)serverConnectionTriggeredEvent:(NSNotification *)notification { 475 475 NSDictionary *event; 476 NSString *sound; 477 NSNumber *clickContext; 476 478 WCServerConnection *connection; 477 NSNumber *clickContext;478 479 id info1, info2; 479 480 … … 483 484 info2 = [[notification userInfo] objectForKey:WCServerConnectionEventInfo2Key]; 484 485 485 if([event boolForKey:WCEventsPlaySound]) 486 [NSSound playSoundNamed:[event objectForKey:WCEventsSound]]; 486 if([event boolForKey:WCEventsPlaySound]) { 487 sound = [event objectForKey:WCEventsSound]; 488 489 if(sound) 490 [NSSound playSoundNamed:sound]; 491 } 487 492 488 493 if([event boolForKey:WCEventsBounceInDock]) WiredClient/trunk/WCPreferences.m
r4789 r4793 547 547 [event setInt:tag forKey:WCEventsEvent]; 548 548 [event setBool:[_playSoundButton state] forKey:WCEventsPlaySound]; 549 [event setObject:[_soundsPopUpButton titleOfSelectedItem] forKey:WCEventsSound]; 549 550 string = [_soundsPopUpButton titleOfSelectedItem]; 551 552 if(string) 553 [event setObject:string forKey:WCEventsSound]; 554 550 555 [event setBool:[_bounceInDockButton state] forKey:WCEventsBounceInDock]; 551 556 [event setBool:[_postInChatButton state] forKey:WCEventsPostInChat]; … … 675 680 - (void)_selectEvent { 676 681 NSDictionary *event; 682 NSString *sound; 677 683 int tag; 678 684 BOOL on; … … 682 688 [_playSoundButton setState:[event boolForKey:WCEventsPlaySound]]; 683 689 684 if([(NSString *) [event objectForKey:WCEventsSound] length] > 0) 685 [_soundsPopUpButton selectItemWithTitle:[event objectForKey:WCEventsSound]]; 690 sound = [event objectForKey:WCEventsSound]; 691 692 if(sound && [_soundsPopUpButton indexOfItemWithTitle:sound] != -1) 693 [_soundsPopUpButton selectItemWithTitle:sound]; 694 else if ([_soundsPopUpButton numberOfItems] > 0) 695 [_soundsPopUpButton selectItemAtIndex:0]; 686 696 687 697 [_bounceInDockButton setState:[event boolForKey:WCEventsBounceInDock]]; … … 1151 1161 1152 1162 - (IBAction)touchEvent:(id)sender { 1163 NSString *sound; 1164 1153 1165 [self _touchEvents]; 1154 1166 1155 if(sender == _playSoundButton && [_playSoundButton state]) 1156 [NSSound playSoundNamed:[_soundsPopUpButton titleOfSelectedItem]]; 1167 if(sender == _playSoundButton && [_playSoundButton state]) { 1168 sound = [_soundsPopUpButton titleOfSelectedItem]; 1169 1170 if(sound) 1171 [NSSound playSoundNamed:sound]; 1172 } 1157 1173 1158 1174 [self _saveSettings]; … … 1162 1178 1163 1179 - (IBAction)selectSound:(id)sender { 1164 [NSSound playSoundNamed:[_soundsPopUpButton titleOfSelectedItem]]; 1180 NSString *sound; 1181 1182 sound = [_soundsPopUpButton titleOfSelectedItem]; 1183 1184 if(sound) 1185 [NSSound playSoundNamed:sound]; 1165 1186 1166 1187 [self _saveSettings];
