Option to play sound when downloads finish (for now the sound is "Glass").

This commit is contained in:
Mitchell Livingston 2006-08-07 00:46:47 +00:00
parent 8f43dd1da9
commit accc03084c
7 changed files with 27 additions and 2 deletions

View File

@ -897,6 +897,13 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
[self applyFilter: nil]; [self applyFilter: nil];
[self checkToStartWaiting: torrent]; [self checkToStartWaiting: torrent];
if ([fDefaults boolForKey: @"PlayDownloadSound"])
{
NSSound * sound;
if ((sound = [NSSound soundNamed: @"Glass"]))
[sound play];
}
[GrowlApplicationBridge notifyWithTitle: @"Download Complete" description: [torrent name] [GrowlApplicationBridge notifyWithTitle: @"Download Complete" description: [torrent name]
notificationName: GROWL_DOWNLOAD_COMPLETE iconData: nil priority: 0 isSticky: NO clickContext: nil]; notificationName: GROWL_DOWNLOAD_COMPLETE iconData: nil priority: 0 isSticky: NO clickContext: nil];

View File

@ -50,6 +50,8 @@
<string>Constant</string> <string>Constant</string>
<key>MoveFolder</key> <key>MoveFolder</key>
<string>~/Desktop</string> <string>~/Desktop</string>
<key>PlayDownloadSound</key>
<true/>
<key>RatioCheck</key> <key>RatioCheck</key>
<false/> <false/>
<key>RatioLimit</key> <key>RatioLimit</key>

View File

@ -13,6 +13,7 @@
setLimit = id; setLimit = id;
setLimitCheck = id; setLimitCheck = id;
setMoveTorrent = id; setMoveTorrent = id;
setPlaySound = id;
setPort = id; setPort = id;
setRatio = id; setRatio = id;
setRatioCheck = id; setRatioCheck = id;
@ -38,6 +39,7 @@
fGeneralView = NSView; fGeneralView = NSView;
fImportFolderPopUp = NSPopUpButton; fImportFolderPopUp = NSPopUpButton;
fNetworkView = NSView; fNetworkView = NSView;
fPlayDownloadSoundCheck = NSButton;
fPortField = NSTextField; fPortField = NSTextField;
fQuitCheck = NSButton; fQuitCheck = NSButton;
fQuitDownloadingCheck = NSButton; fQuitDownloadingCheck = NSButton;

View File

@ -9,14 +9,18 @@
<key>153</key> <key>153</key>
<string>155 441 554 217 0 0 1152 842 </string> <string>155 441 554 217 0 0 1152 842 </string>
<key>28</key> <key>28</key>
<string>229 409 554 290 0 0 1152 842 </string> <string>139 281 538 290 0 0 1152 842 </string>
<key>41</key> <key>41</key>
<string>125 133 554 321 0 0 1152 842 </string> <string>161 333 584 355 0 0 1152 842 </string>
<key>66</key> <key>66</key>
<string>353 613 538 104 0 0 1152 842 </string> <string>353 613 538 104 0 0 1152 842 </string>
</dict> </dict>
<key>IBFramework Version</key> <key>IBFramework Version</key>
<string>446.1</string> <string>446.1</string>
<key>IBOpenObjects</key>
<array>
<integer>41</integer>
</array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>8J135</string> <string>8J135</string>
</dict> </dict>

View File

@ -37,6 +37,7 @@
IBOutlet NSButton * fQuitCheck, * fRemoveCheck, IBOutlet NSButton * fQuitCheck, * fRemoveCheck,
* fQuitDownloadingCheck, * fRemoveDownloadingCheck, * fQuitDownloadingCheck, * fRemoveDownloadingCheck,
* fBadgeDownloadRateCheck, * fBadgeUploadRateCheck, * fBadgeDownloadRateCheck, * fBadgeUploadRateCheck,
* fPlayDownloadSoundCheck,
* fCopyTorrentCheck, * fDeleteOriginalTorrentCheck, * fCopyTorrentCheck, * fDeleteOriginalTorrentCheck,
* fAutoImportCheck, * fAutoSizeCheck; * fAutoImportCheck, * fAutoSizeCheck;
@ -64,6 +65,7 @@
- (void) setShowMessage: (id) sender; - (void) setShowMessage: (id) sender;
- (void) setBadge: (id) sender; - (void) setBadge: (id) sender;
- (void) setPlaySound: (id) sender;
- (void) setUpdate: (id) sender; - (void) setUpdate: (id) sender;
- (void) checkUpdate; - (void) checkUpdate;

View File

@ -191,6 +191,9 @@
[fBadgeDownloadRateCheck setState: [fDefaults boolForKey: @"BadgeDownloadRate"]]; [fBadgeDownloadRateCheck setState: [fDefaults boolForKey: @"BadgeDownloadRate"]];
[fBadgeUploadRateCheck setState: [fDefaults boolForKey: @"BadgeUploadRate"]]; [fBadgeUploadRateCheck setState: [fDefaults boolForKey: @"BadgeUploadRate"]];
//set play sound
[fPlayDownloadSoundCheck setState: [fDefaults boolForKey: @"PlayDownloadSound"]];
//set start setting //set start setting
NSString * startSetting = [fDefaults stringForKey: @"StartSetting"]; NSString * startSetting = [fDefaults stringForKey: @"StartSetting"];
int tag; int tag;
@ -510,6 +513,11 @@
[[NSNotificationCenter defaultCenter] postNotificationName: @"DockBadgeChange" object: self]; [[NSNotificationCenter defaultCenter] postNotificationName: @"DockBadgeChange" object: self];
} }
- (void) setPlaySound: (id) sender
{
[fDefaults setBool: [sender state] forKey: @"PlayDownloadSound"];
}
- (void) setUpdate: (id) sender - (void) setUpdate: (id) sender
{ {
int index = [fUpdatePopUp indexOfSelectedItem]; int index = [fUpdatePopUp indexOfSelectedItem];