1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-04 13:32:19 +00:00

Post Growl notification when seeding complete.

New name for notification for torrent auto added.
This commit is contained in:
Mitchell Livingston 2006-07-08 13:32:36 +00:00
parent 2c5bb97b0b
commit 6bcb612a95
3 changed files with 23 additions and 12 deletions

View file

@ -140,6 +140,8 @@
- (void) torrentStartSettingChange: (NSNotification *) notification;
- (void) globalStartSettingChange: (NSNotification *) notification;
- (void) torrentStoppedForRatio: (NSNotification *) notification;
- (void) attemptToStartAuto: (Torrent *) torrent;
- (void) attemptToStartMultipleAuto: (NSArray *) torrents;

View file

@ -241,6 +241,10 @@ static void sleepCallBack(void * controller, io_service_t y,
[nc addObserver: self selector: @selector(torrentStartSettingChange:)
name: @"TorrentStartSettingChange" object: nil];
//check if torrent should now start
[nc addObserver: self selector: @selector(torrentStoppedForRatio:)
name: @"TorrentStoppedForRatio" object: nil];
//change that just impacts the inspector
[nc addObserver: self selector: @selector(reloadInspectorSettings:)
name: @"TorrentSettingChange" object: nil];
@ -459,13 +463,12 @@ static void sleepCallBack(void * controller, io_service_t y,
- (void) openShowSheet: (id) sender
{
NSOpenPanel * panel = [NSOpenPanel openPanel];
NSArray * fileTypes = [NSArray arrayWithObject: @"torrent"];
[panel setAllowsMultipleSelection: YES];
[panel setCanChooseFiles: YES];
[panel setCanChooseDirectories: NO];
[panel beginSheetForDirectory: nil file: nil types: fileTypes
[panel beginSheetForDirectory: nil file: nil types: [NSArray arrayWithObject: @"torrent"]
modalForWindow: fWindow modalDelegate: self didEndSelector:
@selector(openSheetClosed:returnCode:contextInfo:) contextInfo: nil];
}
@ -1050,6 +1053,15 @@ static void sleepCallBack(void * controller, io_service_t y,
}
}
- (void) torrentStartSettingChange: (NSNotification *) notification
{
[self attemptToStartMultipleAuto: [notification object]];
[self updateUI: nil];
[fInfoController updateInfoStatsAndSettings];
[self updateTorrentHistory];
}
- (void) globalStartSettingChange: (NSNotification *) notification
{
[self attemptToStartMultipleAuto: fTorrents];
@ -1059,13 +1071,11 @@ static void sleepCallBack(void * controller, io_service_t y,
[self updateTorrentHistory];
}
- (void) torrentStartSettingChange: (NSNotification *) notification
- (void) torrentStoppedForRatio: (NSNotification *) notification
{
[self attemptToStartMultipleAuto: [notification object]];
[self updateUI: nil];
[fInfoController updateInfoStatsAndSettings];
[self updateTorrentHistory];
[self notifyGrowl: @"Seeding Complete" message: [[notification object] name] identifier: @"Seeding Complete"];
}
- (void) attemptToStartAuto: (Torrent *) torrent
@ -1173,8 +1183,7 @@ static void sleepCallBack(void * controller, io_service_t y,
//import only actually happened if the torrent array is larger
if (oldCount < [fTorrents count])
[self notifyGrowl: [file stringByAppendingString: @" Auto Added"] message: @"Torrent file added"
identifier: @"Automatically Add Torrent"];
[self notifyGrowl: @"Torrent File Auto Added" message: file identifier: @"Torrent Auto Added"];
}
}
@ -1804,8 +1813,8 @@ static void sleepCallBack(void * controller, io_service_t y,
" if exists application process \"GrowlHelperApp\" then\n"
" tell application \"GrowlHelperApp\"\n"
" register as application \"Transmission\" "
" all notifications {\"Download Complete\", \"Automatically Add Torrent\"}"
" default notifications {\"Download Complete\", \"Automatically Add Torrent\"}"
" all notifications {\"Download Complete\", \"Seeding Complete\", \"Torrent Auto Added\"}"
" default notifications {\"Download Complete\", \"Seeding Complete\", \"Torrent Auto Added\"}"
" icon of application \"Transmission\"\n"
" end tell\n"
" end if\n"

View file

@ -152,7 +152,7 @@
fStat = tr_torrentStat(fHandle);
[[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentSettingChange" object: self];
[[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentStoppedForRatio" object: self];
}
[fProgressString setString: @""];