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 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];

View File

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

View File

@ -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;

View File

@ -9,14 +9,18 @@
<key>153</key>
<string>155 441 554 217 0 0 1152 842 </string>
<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>
<string>125 133 554 321 0 0 1152 842 </string>
<string>161 333 584 355 0 0 1152 842 </string>
<key>66</key>
<string>353 613 538 104 0 0 1152 842 </string>
</dict>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBOpenObjects</key>
<array>
<integer>41</integer>
</array>
<key>IBSystem Version</key>
<string>8J135</string>
</dict>

View File

@ -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;

View File

@ -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];