Ticket #1395: bonjour_mac_patch.diff

File bonjour_mac_patch.diff, 5.3 KB (added by Waldorf, 12 years ago)
  • Transmission.xcodeproj/project.pbxproj

     
    310310                D4AF3B300C41F7A600D46B6B /* list.h in Headers */ = {isa = PBXBuildFile; fileRef = D4AF3B2E0C41F7A500D46B6B /* list.h */; };
    311311                E138A9770C04D88F00C5426C /* CTGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = E138A9740C04D88F00C5426C /* CTGradient.m */; };
    312312                E138A9780C04D88F00C5426C /* ProgressGradients.m in Sources */ = {isa = PBXBuildFile; fileRef = E138A9760C04D88F00C5426C /* ProgressGradients.m */; };
     313                FE5658B20EE9E12900E4E808 /* BonjourController.m in Sources */ = {isa = PBXBuildFile; fileRef = FE5658B10EE9E12900E4E808 /* BonjourController.m */; };
    313314/* End PBXBuildFile section */
    314315
    315316/* Begin PBXContainerItemProxy section */
     
    785786                E138A9740C04D88F00C5426C /* CTGradient.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CTGradient.m; path = macosx/CTGradient/CTGradient.m; sourceTree = "<group>"; };
    786787                E138A9750C04D88F00C5426C /* ProgressGradients.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ProgressGradients.h; path = macosx/ProgressGradients.h; sourceTree = "<group>"; };
    787788                E138A9760C04D88F00C5426C /* ProgressGradients.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = ProgressGradients.m; path = macosx/ProgressGradients.m; sourceTree = "<group>"; };
     789                FE5658B00EE9E12900E4E808 /* BonjourController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BonjourController.h; path = macosx/BonjourController.h; sourceTree = "<group>"; };
     790                FE5658B10EE9E12900E4E808 /* BonjourController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BonjourController.m; path = macosx/BonjourController.m; sourceTree = "<group>"; };
    788791/* End PBXFileReference section */
    789792
    790793/* Begin PBXFrameworksBuildPhase section */
     
    950953                                A2DF567C0DE323D3000795D5 /* QuickLook.h */,
    951954                                A2DF57720DE46A6A000795D5 /* QuickLookController.h */,
    952955                                A2DF57730DE46A6A000795D5 /* QuickLookController.m */,
     956                                FE5658B00EE9E12900E4E808 /* BonjourController.h */,
     957                                FE5658B10EE9E12900E4E808 /* BonjourController.m */,
    953958                        );
    954959                        name = Sources;
    955960                        sourceTree = "<group>";
     
    19271932                                A27F0F330E19AD9800B2DB97 /* TorrentGroup.m in Sources */,
    19281933                                A222E9870E6B21D9009FB003 /* BlocklistDownloaderViewController.m in Sources */,
    19291934                                A222EA7B0E6C32C4009FB003 /* BlocklistScheduler.m in Sources */,
     1935                                FE5658B20EE9E12900E4E808 /* BonjourController.m in Sources */,
    19301936                        );
    19311937                        runOnlyForDeploymentPostprocessing = 0;
    19321938                };
  • macosx/PrefsController.m

     
    2323 *****************************************************************************/
    2424
    2525#import "PrefsController.h"
     26#import "BonjourController.h"
    2627#import "BlocklistDownloaderViewController.h"
    2728#import "BlocklistScheduler.h"
    2829#import "PortChecker.h"
     
    820821- (void) setRPCEnabled: (id) sender
    821822{
    822823    tr_sessionSetRPCEnabled(fHandle, [fDefaults boolForKey: @"RPC"]);
     824
     825    //Registering the Web UI to Bonjour
     826    if ( [fDefaults boolForKey:@"RPC"] )
     827    {
     828        [[BonjourController defaultController] startWithPort:[fDefaults integerForKey:@"RPCPort"]];
     829    } else {
     830        [[BonjourController defaultController] stop];
     831    }
    823832}
    824833
    825834- (void) linkWebUI: (id) sender
     
    870879    int port = [sender intValue];
    871880    [fDefaults setInteger: port forKey: @"RPCPort"];
    872881    tr_sessionSetRPCPort(fHandle, port);
     882   
     883    //Registering the Web UI to Bonjour
     884    if ( [fDefaults boolForKey:@"RPC"] )
     885        [[BonjourController defaultController] startWithPort: port];
    873886}
    874887
    875888- (void) setRPCUseWhitelist: (id) sender
  • macosx/Controller.m

     
    4949#import "SpeedLimitToTurtleIconTransformer.h"
    5050#import "utils.h"
    5151
     52#import "BonjourController.h"
     53
    5254#import "UKKQueue.h"
    5355#import <Sparkle/Sparkle.h>
    5456
     
    271273            [updater setAutomaticallyChecksForUpdates: [fDefaults boolForKey: @"CheckForUpdates"]];
    272274            [fDefaults removeObjectForKey: @"CheckForUpdates"];
    273275        }
    274     }
     276}
    275277    return self;
    276278}
    277279
     
    521523   
    522524    //auto importing
    523525    [self checkAutoImportDirectory];
     526   
     527    //Registering the Web UI to Bonjour
     528    if ( [fDefaults boolForKey:@"RPC"] )
     529        [[BonjourController defaultController] startWithPort:[fDefaults integerForKey:@"RPCPort"]];
    524530}
    525531
    526532- (BOOL) applicationShouldHandleReopen: (NSApplication *) app hasVisibleWindows: (BOOL) visibleWindows
     
    631637    tr_sessionClose(fLib);
    632638   
    633639    [fBadger release]; //clears dock icon on Tiger
     640   
     641    //stopping the bonjour service
     642    [[BonjourController defaultController] stop];
    634643}
    635644
    636645- (void) handleOpenContentsEvent: (NSAppleEventDescriptor *) event replyEvent: (NSAppleEventDescriptor *) replyEvent
     
    43544363   
    43554364    [torrent release];
    43564365}
    4357 
    43584366@end