Ignore:
Timestamp:
Feb 27, 2008, 7:34:55 PM (14 years ago)
Author:
livings124
Message:

show amount selected in open window

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/AddWindowController.m

    r5030 r5149  
    7070- (void) awakeFromNib
    7171{
     72    [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(updateStatusField:)
     73        name: @"TorrentFileCheckChange" object: fTorrent];
     74   
    7275    [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(updateGroupMenu:)
    7376        name: @"UpdateGroups" object: nil];
     
    8487    [icon release];
    8588   
    86     NSString * statusString = [NSString stringForFileSize: [fTorrent size]];
    87     if ([fTorrent folder])
    88     {
    89         NSString * fileString;
    90         int count = [fTorrent fileCount];
    91         if (count != 1)
    92             fileString = [NSString stringWithFormat: NSLocalizedString(@"%d Files, ", "Add torrent -> info"), count];
    93         else
    94             fileString = NSLocalizedString(@"1 File, ", "Add torrent -> info");
    95         statusString = [fileString stringByAppendingString: statusString];
    96     }
    97     [fStatusField setStringValue: statusString];
     89    [self updateStatusField: nil];
    9890   
    9991    [self setGroupsMenu];
     
    213205}
    214206
     207- (void) updateStatusField: (NSNotification *) notification
     208{
     209    NSString * statusString = [NSString stringForFileSize: [fTorrent size]];
     210    if ([fTorrent folder])
     211        statusString = [statusString stringByAppendingFormat: NSLocalizedString(@" (%@ selected)", "Add torrent -> info"),
     212                        [NSString stringForFileSize: [fTorrent totalSizeSelected]]];
     213   
     214    if ([fTorrent folder])
     215    {
     216        NSString * fileString;
     217        int count = [fTorrent fileCount];
     218        if (count != 1)
     219            fileString = [NSString stringWithFormat: NSLocalizedString(@"%d Files, ", "Add torrent -> info"), count];
     220        else
     221            fileString = NSLocalizedString(@"1 File, ", "Add torrent -> info");
     222        statusString = [fileString stringByAppendingString: statusString];
     223    }
     224   
     225    [fStatusField setStringValue: statusString];
     226}
     227
    215228- (void) updateGroupMenu: (NSNotification *) notification
    216229{
Note: See TracChangeset for help on using the changeset viewer.