Changeset 548


Ignore:
Timestamp:
Jul 8, 2006, 1:32:36 PM (16 years ago)
Author:
livings124
Message:

Post Growl notification when seeding complete.
New name for notification for torrent auto added.

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.h

    r542 r548  
    141141- (void) globalStartSettingChange: (NSNotification *) notification;
    142142
     143- (void) torrentStoppedForRatio: (NSNotification *) notification;
     144
    143145- (void) attemptToStartAuto: (Torrent *) torrent;
    144146- (void) attemptToStartMultipleAuto: (NSArray *) torrents;
  • trunk/macosx/Controller.m

    r546 r548  
    242242                    name: @"TorrentStartSettingChange" object: nil];
    243243   
     244    //check if torrent should now start
     245    [nc addObserver: self selector: @selector(torrentStoppedForRatio:)
     246                    name: @"TorrentStoppedForRatio" object: nil];
     247   
    244248    //change that just impacts the inspector
    245249    [nc addObserver: self selector: @selector(reloadInspectorSettings:)
     
    460464{
    461465    NSOpenPanel * panel = [NSOpenPanel openPanel];
    462     NSArray * fileTypes = [NSArray arrayWithObject: @"torrent"];
    463466
    464467    [panel setAllowsMultipleSelection: YES];
     
    466469    [panel setCanChooseDirectories: NO];
    467470
    468     [panel beginSheetForDirectory: nil file: nil types: fileTypes
     471    [panel beginSheetForDirectory: nil file: nil types: [NSArray arrayWithObject: @"torrent"]
    469472        modalForWindow: fWindow modalDelegate: self didEndSelector:
    470473        @selector(openSheetClosed:returnCode:contextInfo:) contextInfo: nil];
     
    10511054}
    10521055
    1053 - (void) globalStartSettingChange: (NSNotification *) notification
    1054 {
    1055     [self attemptToStartMultipleAuto: fTorrents];
    1056    
     1056- (void) torrentStartSettingChange: (NSNotification *) notification
     1057{
     1058    [self attemptToStartMultipleAuto: [notification object]];
     1059
    10571060    [self updateUI: nil];
    10581061    [fInfoController updateInfoStatsAndSettings];
     
    10601063}
    10611064
    1062 - (void) torrentStartSettingChange: (NSNotification *) notification
    1063 {
    1064     [self attemptToStartMultipleAuto: [notification object]];
    1065 
     1065- (void) globalStartSettingChange: (NSNotification *) notification
     1066{
     1067    [self attemptToStartMultipleAuto: fTorrents];
     1068   
    10661069    [self updateUI: nil];
    10671070    [fInfoController updateInfoStatsAndSettings];
    10681071    [self updateTorrentHistory];
     1072}
     1073
     1074- (void) torrentStoppedForRatio: (NSNotification *) notification
     1075{
     1076    [fInfoController updateInfoStatsAndSettings];
     1077   
     1078    [self notifyGrowl: @"Seeding Complete" message: [[notification object] name] identifier: @"Seeding Complete"];
    10691079}
    10701080
     
    11741184            //import only actually happened if the torrent array is larger
    11751185            if (oldCount < [fTorrents count])
    1176                 [self notifyGrowl: [file stringByAppendingString: @" Auto Added"] message: @"Torrent file added"
    1177                                 identifier: @"Automatically Add Torrent"];
     1186                [self notifyGrowl: @"Torrent File Auto Added" message: file identifier: @"Torrent Auto Added"];
    11781187        }
    11791188}
     
    18051814         "    tell application \"GrowlHelperApp\"\n"
    18061815         "      register as application \"Transmission\" "
    1807          "        all notifications {\"Download Complete\", \"Automatically Add Torrent\"}"
    1808          "        default notifications {\"Download Complete\", \"Automatically Add Torrent\"}"
     1816         "        all notifications {\"Download Complete\", \"Seeding Complete\", \"Torrent Auto Added\"}"
     1817         "        default notifications {\"Download Complete\", \"Seeding Complete\", \"Torrent Auto Added\"}"
    18091818         "        icon of application \"Transmission\"\n"
    18101819         "    end tell\n"
  • trunk/macosx/Torrent.m

    r536 r548  
    153153        fStat = tr_torrentStat(fHandle);
    154154       
    155         [[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentSettingChange" object: self];
     155        [[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentStoppedForRatio" object: self];
    156156    }
    157157
Note: See TracChangeset for help on using the changeset viewer.