mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
when unchecking all files in the add dialog window, don't do finished events
This commit is contained in:
@@ -1593,32 +1593,33 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
||||
return desired;
|
||||
}
|
||||
|
||||
#warning migrate to Torrent.m
|
||||
- (void) torrentFinishedDownloading: (NSNotification *) notification
|
||||
{
|
||||
Torrent * torrent = [notification object];
|
||||
|
||||
if (!fSoundPlaying && [fDefaults boolForKey: @"PlayDownloadSound"])
|
||||
{
|
||||
NSSound * sound;
|
||||
if ((sound = [NSSound soundNamed: [fDefaults stringForKey: @"DownloadSound"]]))
|
||||
{
|
||||
[sound setDelegate: self];
|
||||
fSoundPlaying = YES;
|
||||
[sound play];
|
||||
}
|
||||
}
|
||||
|
||||
NSDictionary * clickContext = [NSDictionary dictionaryWithObjectsAndKeys: GROWL_DOWNLOAD_COMPLETE, @"Type",
|
||||
[torrent dataLocation] , @"Location", nil];
|
||||
[GrowlApplicationBridge notifyWithTitle: NSLocalizedString(@"Download Complete", "Growl notification title")
|
||||
description: [torrent name] notificationName: GROWL_DOWNLOAD_COMPLETE
|
||||
iconData: nil priority: 0 isSticky: NO clickContext: clickContext];
|
||||
|
||||
if (![fWindow isMainWindow])
|
||||
[fBadger incrementCompleted];
|
||||
|
||||
if ([torrent isActive])
|
||||
{
|
||||
if (!fSoundPlaying && [fDefaults boolForKey: @"PlayDownloadSound"])
|
||||
{
|
||||
NSSound * sound;
|
||||
if ((sound = [NSSound soundNamed: [fDefaults stringForKey: @"DownloadSound"]]))
|
||||
{
|
||||
[sound setDelegate: self];
|
||||
fSoundPlaying = YES;
|
||||
[sound play];
|
||||
}
|
||||
}
|
||||
|
||||
NSDictionary * clickContext = [NSDictionary dictionaryWithObjectsAndKeys: GROWL_DOWNLOAD_COMPLETE, @"Type",
|
||||
[torrent dataLocation] , @"Location", nil];
|
||||
[GrowlApplicationBridge notifyWithTitle: NSLocalizedString(@"Download Complete", "Growl notification title")
|
||||
description: [torrent name] notificationName: GROWL_DOWNLOAD_COMPLETE
|
||||
iconData: nil priority: 0 isSticky: NO clickContext: clickContext];
|
||||
|
||||
if (![fWindow isMainWindow])
|
||||
[fBadger incrementCompleted];
|
||||
|
||||
if ([fDefaults boolForKey: @"QueueSeed"] && [self numToStartFromQueue: NO] <= 0)
|
||||
{
|
||||
[torrent stopTransfer];
|
||||
@@ -1644,6 +1645,32 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
||||
[self updateTorrentsInQueue];
|
||||
}
|
||||
|
||||
- (void) torrentStoppedForRatio: (NSNotification *) notification
|
||||
{
|
||||
Torrent * torrent = [notification object];
|
||||
|
||||
[self updateTorrentsInQueue];
|
||||
[fInfoController updateInfoStats];
|
||||
[fInfoController updateOptions];
|
||||
|
||||
if (!fSoundPlaying && [fDefaults boolForKey: @"PlaySeedingSound"])
|
||||
{
|
||||
NSSound * sound;
|
||||
if ((sound = [NSSound soundNamed: [fDefaults stringForKey: @"SeedingSound"]]))
|
||||
{
|
||||
[sound setDelegate: self];
|
||||
fSoundPlaying = YES;
|
||||
[sound play];
|
||||
}
|
||||
}
|
||||
|
||||
NSDictionary * clickContext = [NSDictionary dictionaryWithObjectsAndKeys: GROWL_SEEDING_COMPLETE, @"Type",
|
||||
[torrent dataLocation], @"Location", nil];
|
||||
[GrowlApplicationBridge notifyWithTitle: NSLocalizedString(@"Seeding Complete", "Growl notification title")
|
||||
description: [torrent name] notificationName: GROWL_SEEDING_COMPLETE
|
||||
iconData: nil priority: 0 isSticky: NO clickContext: clickContext];
|
||||
}
|
||||
|
||||
- (void) updateTorrentHistory
|
||||
{
|
||||
NSMutableArray * history = [NSMutableArray arrayWithCapacity: [fTorrents count]];
|
||||
@@ -2341,32 +2368,6 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
||||
[fPrefsController updateRatioStopField];
|
||||
}
|
||||
|
||||
- (void) torrentStoppedForRatio: (NSNotification *) notification
|
||||
{
|
||||
Torrent * torrent = [notification object];
|
||||
|
||||
[self updateTorrentsInQueue];
|
||||
[fInfoController updateInfoStats];
|
||||
[fInfoController updateOptions];
|
||||
|
||||
if (!fSoundPlaying && [fDefaults boolForKey: @"PlaySeedingSound"])
|
||||
{
|
||||
NSSound * sound;
|
||||
if ((sound = [NSSound soundNamed: [fDefaults stringForKey: @"SeedingSound"]]))
|
||||
{
|
||||
[sound setDelegate: self];
|
||||
fSoundPlaying = YES;
|
||||
[sound play];
|
||||
}
|
||||
}
|
||||
|
||||
NSDictionary * clickContext = [NSDictionary dictionaryWithObjectsAndKeys: GROWL_SEEDING_COMPLETE, @"Type",
|
||||
[torrent dataLocation], @"Location", nil];
|
||||
[GrowlApplicationBridge notifyWithTitle: NSLocalizedString(@"Seeding Complete", "Growl notification title")
|
||||
description: [torrent name] notificationName: GROWL_SEEDING_COMPLETE
|
||||
iconData: nil priority: 0 isSticky: NO clickContext: clickContext];
|
||||
}
|
||||
|
||||
- (void) sound: (NSSound *) sound didFinishPlaying: (BOOL) finishedPlaying
|
||||
{
|
||||
fSoundPlaying = NO;
|
||||
|
||||
Reference in New Issue
Block a user