Changeset 7290


Ignore:
Timestamp:
Dec 6, 2008, 1:18:25 AM (12 years ago)
Author:
livings124
Message:

#1395 - patch from Waldorf: Bonjour support for Web Interface

Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEWS

    r7268 r7290  
    99- Mac
    1010   + Groups (moved to preferences) can have a default location when adding transfers
     11   + Bonjour support for web interface
    1112- GTK+
    1213   + Minor display improvements and HIG compliance
  • trunk/macosx/Controller.m

    r7250 r7290  
    4242#import "StatusBarView.h"
    4343#import "FilterButton.h"
     44#import "BonjourController.h"
    4445#import "NSApplicationAdditions.h"
    4546#import "NSStringAdditions.h"
     
    522523    //auto importing
    523524    [self checkAutoImportDirectory];
     525   
     526    //registering the Web UI to Bonjour
     527    if ([fDefaults boolForKey: @"RPC"])
     528        [[BonjourController defaultController] startWithPort: [fDefaults integerForKey: @"RPCPort"]];
    524529}
    525530
     
    572577- (void) applicationWillTerminate: (NSNotification *) notification
    573578{
     579    //stop the Bonjour service
     580    [[BonjourController defaultController] stop];
     581
    574582    //stop blocklist download
    575583    if ([BlocklistDownloader isRunning])
  • trunk/macosx/InfoWindowController.m

    r7246 r7290  
    982982       
    983983        CGFloat progress = [[peer objectForKey: @"Progress"] floatValue];
    984        
    985         NSString * seedStatus;
     984        NSString * progressString = [NSString localizedStringWithFormat: NSLocalizedString(@"Progress: %.1f%%",
     985                                        "Inspector -> Peers tab -> table row tooltip"), progress * 100.0];
    986986        if (progress < 1.0 && [[peer objectForKey: @"Seed"] boolValue])
    987             seedStatus = [NSString stringWithFormat: @" (%@)", NSLocalizedString(@"Partial Seed",
    988                             "Inspector -> Peers tab -> table row tooltip")];
    989         else
    990             seedStatus = @"";
    991        
    992         [components addObject: [NSString localizedStringWithFormat: NSLocalizedString(@"Progress: %.1f%%%@",
    993             "Inspector -> Peers tab -> table row tooltip"), progress * 100.0, seedStatus]];
     987            progressString = [progressString stringByAppendingFormat: @" (%@)", NSLocalizedString(@"Partial Seed",
     988                                "Inspector -> Peers tab -> table row tooltip")];
     989        [components addObject: progressString];
    994990       
    995991        if ([[peer objectForKey: @"Encryption"] boolValue])
  • trunk/macosx/Makefile.am

    r7226 r7290  
    4141    BlocklistScheduler.h \
    4242    BlocklistScheduler.m \
     43    BonjourController.h \
     44    BonjourController.m \
    4345    ButtonToolbarItem.h \
    4446    ButtonToolbarItem.m \
  • trunk/macosx/PrefsController.m

    r7250 r7290  
    2727#import "BlocklistScheduler.h"
    2828#import "PortChecker.h"
     29#import "BonjourController.h"
    2930#import "NSApplicationAdditions.h"
    3031#import "NSStringAdditions.h"
     
    820821- (void) setRPCEnabled: (id) sender
    821822{
    822     tr_sessionSetRPCEnabled(fHandle, [fDefaults boolForKey: @"RPC"]);
     823    BOOL enable = [fDefaults boolForKey: @"RPC"];
     824    tr_sessionSetRPCEnabled(fHandle, enable);
     825   
     826    //Registering the Web UI to Bonjour
     827    if (enable)
     828        [[BonjourController defaultController] startWithPort: [fDefaults integerForKey: @"RPCPort"]];
     829    else
     830        [[BonjourController defaultController] stop];
    823831}
    824832
     
    871879    [fDefaults setInteger: port forKey: @"RPCPort"];
    872880    tr_sessionSetRPCPort(fHandle, port);
     881   
     882    //Registering the Web UI to Bonjour
     883    if ([fDefaults boolForKey:@"RPC"])
     884        [[BonjourController defaultController] startWithPort: port];
    873885}
    874886
Note: See TracChangeset for help on using the changeset viewer.