Changeset 735 for trunk/macosx
- Timestamp:
- Aug 7, 2006, 2:28:31 AM (16 years ago)
- Location:
- trunk/macosx
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.m
r734 r735 901 901 { 902 902 NSSound * sound; 903 if ((sound = [NSSound soundNamed: @"Glass"]))903 if ((sound = [NSSound soundNamed: [fDefaults stringForKey: @"DownloadSound"]])) 904 904 [sound play]; 905 905 } … … 1348 1348 { 1349 1349 NSSound * sound; 1350 if ((sound = [NSSound soundNamed: @"Submarine"]))1350 if ((sound = [NSSound soundNamed: [fDefaults stringForKey: @"SeedingSound"]])) 1351 1351 [sound play]; 1352 1352 } -
trunk/macosx/Defaults.plist
r734 r735 35 35 <key>DownloadLimit</key> 36 36 <integer>100</integer> 37 <key>DownloadSound</key> 38 <string>Glass</string> 37 39 <key>Filter</key> 38 40 <string>None</string> … … 61 63 <key>SavePrivateTorrent</key> 62 64 <true/> 65 <key>SeedingSound</key> 66 <string>Submarine</string> 63 67 <key>ShowInspector</key> 64 68 <false/> -
trunk/macosx/English.lproj/PrefsWindow.nib/classes.nib
r734 r735 19 19 setRatioCheck = id; 20 20 setShowMessage = id; 21 setSound = id; 21 22 setSpeedLimit = id; 22 23 setStartSetting = id; … … 36 37 fDownloadCheck = NSButton; 37 38 fDownloadField = NSTextField; 39 fDownloadSoundPopUp = NSPopUpButton; 38 40 fFolderPopUp = NSPopUpButton; 39 41 fGeneralView = NSView; … … 49 51 fRemoveCheck = NSButton; 50 52 fRemoveDownloadingCheck = NSButton; 53 fSeedingSoundPopUp = NSPopUpButton; 51 54 fSpeedLimitDownloadField = NSTextField; 52 55 fSpeedLimitUploadField = NSTextField; -
trunk/macosx/English.lproj/PrefsWindow.nib/info.nib
r734 r735 12 12 <string>139 281 538 290 0 0 1152 842 </string> 13 13 <key>41</key> 14 <string> 115 371 538 3780 0 1152 842 </string>14 <string>307 386 538 386 0 0 1152 842 </string> 15 15 <key>66</key> 16 16 <string>353 613 538 104 0 0 1152 842 </string> -
trunk/macosx/PrefsController.h
r734 r735 34 34 IBOutlet NSView * fGeneralView, * fTransfersView, * fBandwidthView, * fNetworkView; 35 35 36 IBOutlet NSPopUpButton * fFolderPopUp, * fImportFolderPopUp; 36 IBOutlet NSPopUpButton * fFolderPopUp, * fImportFolderPopUp, 37 * fDownloadSoundPopUp, * fSeedingSoundPopUp; 37 38 IBOutlet NSButton * fQuitCheck, * fRemoveCheck, 38 39 * fQuitDownloadingCheck, * fRemoveDownloadingCheck, … … 67 68 - (void) setBadge: (id) sender; 68 69 - (void) setPlaySound: (id) sender; 70 - (void) setSound: (id) sender; 69 71 - (void) setUpdate: (id) sender; 70 72 - (void) checkUpdate; -
trunk/macosx/PrefsController.m
r734 r735 193 193 194 194 //set play sound 195 [fPlayDownloadSoundCheck setState: [fDefaults boolForKey: @"PlayDownloadSound"]]; 196 [fPlaySeedingSoundCheck setState: [fDefaults boolForKey: @"PlaySeedingSound"]]; 195 NSMutableArray * sounds = [NSMutableArray array]; 196 NSEnumerator * soundEnumerator, 197 * soundDirectoriesEnumerator = [[NSArray arrayWithObjects: @"System/Library/Sounds", @"Library/Sounds", 198 [NSHomeDirectory() stringByAppendingPathComponent: @"Library/Sounds"], nil] objectEnumerator]; 199 NSString * soundPath, * sound; 200 201 //get list of all sounds and sort alphabetically 202 while ((soundPath = [soundDirectoriesEnumerator nextObject])) 203 if (soundEnumerator = [[NSFileManager defaultManager] enumeratorAtPath: soundPath]) 204 while ((sound = [soundEnumerator nextObject])) 205 { 206 sound = [sound stringByDeletingPathExtension]; 207 if ([NSSound soundNamed: sound]) 208 [sounds addObject: sound]; 209 } 210 211 [sounds sortUsingSelector: @selector(caseInsensitiveCompare:)]; 212 213 //set download sound 214 [fDownloadSoundPopUp removeAllItems]; 215 [fDownloadSoundPopUp addItemsWithTitles: sounds]; 216 217 BOOL playDownloadSound = [fDefaults boolForKey: @"PlayDownloadSound"]; 218 [fPlayDownloadSoundCheck setState: playDownloadSound]; 219 [fDownloadSoundPopUp setEnabled: playDownloadSound]; 220 221 int downloadSoundIndex = [fDownloadSoundPopUp indexOfItemWithTitle: [fDefaults stringForKey: @"DownloadSound"]]; 222 if (downloadSoundIndex >= 0) 223 [fDownloadSoundPopUp selectItemAtIndex: downloadSoundIndex]; 224 else 225 [fDefaults setObject: [fDownloadSoundPopUp titleOfSelectedItem] forKey: @"DownloadSound"]; 226 227 //set seeding sound 228 [fSeedingSoundPopUp removeAllItems]; 229 [fSeedingSoundPopUp addItemsWithTitles: sounds]; 230 231 BOOL playSeedingSound = [fDefaults boolForKey: @"PlaySeedingSound"]; 232 [fPlaySeedingSoundCheck setState: playSeedingSound]; 233 [fSeedingSoundPopUp setEnabled: playSeedingSound]; 234 235 int seedingSoundIndex = [fDownloadSoundPopUp indexOfItemWithTitle: [fDefaults stringForKey: @"SeedingSound"]]; 236 if (seedingSoundIndex >= 0) 237 [fSeedingSoundPopUp selectItemAtIndex: seedingSoundIndex]; 238 else 239 [fDefaults setObject: [fSeedingSoundPopUp titleOfSelectedItem] forKey: @"SeedingSound"]; 197 240 198 241 //set start setting … … 517 560 - (void) setPlaySound: (id) sender 518 561 { 562 BOOL state = [sender state]; 563 519 564 if (sender == fPlayDownloadSoundCheck) 520 [fDefaults setBool: [sender state] forKey: @"PlayDownloadSound"]; 565 { 566 [fDownloadSoundPopUp setEnabled: state]; 567 [fDefaults setBool: state forKey: @"PlayDownloadSound"]; 568 } 521 569 else if (sender == fPlaySeedingSoundCheck) 522 [fDefaults setBool: [sender state] forKey: @"PlaySeedingSound"]; 570 { 571 [fSeedingSoundPopUp setEnabled: state]; 572 [fDefaults setBool: state forKey: @"PlaySeedingSound"]; 573 } 574 else; 575 } 576 577 - (void) setSound: (id) sender 578 { 579 //play sound when selecting 580 NSString * soundName = [sender titleOfSelectedItem]; 581 NSSound * sound; 582 if ((sound = [NSSound soundNamed: soundName])) 583 [sound play]; 584 585 if (sender == fDownloadSoundPopUp) 586 [fDefaults setObject: soundName forKey: @"DownloadSound"]; 587 else if (sender == fSeedingSoundPopUp) 588 [fDefaults setObject: soundName forKey: @"SeedingSound"]; 523 589 else; 524 590 }
Note: See TracChangeset
for help on using the changeset viewer.