diff --git a/macosx/Controller.m b/macosx/Controller.m index 6ed2b9b95..5424927a7 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -897,6 +897,13 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy [self applyFilter: nil]; [self checkToStartWaiting: torrent]; + if ([fDefaults boolForKey: @"PlayDownloadSound"]) + { + NSSound * sound; + if ((sound = [NSSound soundNamed: @"Glass"])) + [sound play]; + } + [GrowlApplicationBridge notifyWithTitle: @"Download Complete" description: [torrent name] notificationName: GROWL_DOWNLOAD_COMPLETE iconData: nil priority: 0 isSticky: NO clickContext: nil]; diff --git a/macosx/Defaults.plist b/macosx/Defaults.plist index 0158b74fc..d958552d8 100644 --- a/macosx/Defaults.plist +++ b/macosx/Defaults.plist @@ -50,6 +50,8 @@ Constant MoveFolder ~/Desktop + PlayDownloadSound + RatioCheck RatioLimit diff --git a/macosx/English.lproj/PrefsWindow.nib/classes.nib b/macosx/English.lproj/PrefsWindow.nib/classes.nib index 9991ce4a3..b01522eae 100644 --- a/macosx/English.lproj/PrefsWindow.nib/classes.nib +++ b/macosx/English.lproj/PrefsWindow.nib/classes.nib @@ -13,6 +13,7 @@ setLimit = id; setLimitCheck = id; setMoveTorrent = id; + setPlaySound = id; setPort = id; setRatio = id; setRatioCheck = id; @@ -38,6 +39,7 @@ fGeneralView = NSView; fImportFolderPopUp = NSPopUpButton; fNetworkView = NSView; + fPlayDownloadSoundCheck = NSButton; fPortField = NSTextField; fQuitCheck = NSButton; fQuitDownloadingCheck = NSButton; diff --git a/macosx/English.lproj/PrefsWindow.nib/info.nib b/macosx/English.lproj/PrefsWindow.nib/info.nib index 3faf15992..c4fe712c7 100644 --- a/macosx/English.lproj/PrefsWindow.nib/info.nib +++ b/macosx/English.lproj/PrefsWindow.nib/info.nib @@ -9,14 +9,18 @@ 153 155 441 554 217 0 0 1152 842 28 - 229 409 554 290 0 0 1152 842 + 139 281 538 290 0 0 1152 842 41 - 125 133 554 321 0 0 1152 842 + 161 333 584 355 0 0 1152 842 66 353 613 538 104 0 0 1152 842 IBFramework Version 446.1 + IBOpenObjects + + 41 + IBSystem Version 8J135 diff --git a/macosx/English.lproj/PrefsWindow.nib/keyedobjects.nib b/macosx/English.lproj/PrefsWindow.nib/keyedobjects.nib index ce5679229..2b5b59ea2 100644 Binary files a/macosx/English.lproj/PrefsWindow.nib/keyedobjects.nib and b/macosx/English.lproj/PrefsWindow.nib/keyedobjects.nib differ diff --git a/macosx/PrefsController.h b/macosx/PrefsController.h index 37a7e72e4..e4f080c00 100644 --- a/macosx/PrefsController.h +++ b/macosx/PrefsController.h @@ -37,6 +37,7 @@ IBOutlet NSButton * fQuitCheck, * fRemoveCheck, * fQuitDownloadingCheck, * fRemoveDownloadingCheck, * fBadgeDownloadRateCheck, * fBadgeUploadRateCheck, + * fPlayDownloadSoundCheck, * fCopyTorrentCheck, * fDeleteOriginalTorrentCheck, * fAutoImportCheck, * fAutoSizeCheck; @@ -64,6 +65,7 @@ - (void) setShowMessage: (id) sender; - (void) setBadge: (id) sender; +- (void) setPlaySound: (id) sender; - (void) setUpdate: (id) sender; - (void) checkUpdate; diff --git a/macosx/PrefsController.m b/macosx/PrefsController.m index df5cb902f..c41189c36 100644 --- a/macosx/PrefsController.m +++ b/macosx/PrefsController.m @@ -191,6 +191,9 @@ [fBadgeDownloadRateCheck setState: [fDefaults boolForKey: @"BadgeDownloadRate"]]; [fBadgeUploadRateCheck setState: [fDefaults boolForKey: @"BadgeUploadRate"]]; + //set play sound + [fPlayDownloadSoundCheck setState: [fDefaults boolForKey: @"PlayDownloadSound"]]; + //set start setting NSString * startSetting = [fDefaults stringForKey: @"StartSetting"]; int tag; @@ -510,6 +513,11 @@ [[NSNotificationCenter defaultCenter] postNotificationName: @"DockBadgeChange" object: self]; } +- (void) setPlaySound: (id) sender +{ + [fDefaults setBool: [sender state] forKey: @"PlayDownloadSound"]; +} + - (void) setUpdate: (id) sender { int index = [fUpdatePopUp indexOfSelectedItem];