Changeset 7666


Ignore:
Timestamp:
Jan 11, 2009, 6:04:45 PM (12 years ago)
Author:
livings124
Message:

(1.5x) really fix mac build

Location:
branches/1.5x/macosx
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • branches/1.5x/macosx/BadgeView.h

    r6959 r7666  
    2828@interface BadgeView : NSView
    2929{
    30     tr_handle * fLib;
     30    tr_session * fLib;
    3131   
    3232    NSDictionary * fAttributes;
     
    3636}
    3737
    38 - (id) initWithFrame: (NSRect) frame lib: (tr_handle *) lib;
     38- (id) initWithFrame: (NSRect) frame lib: (tr_session *) lib;
    3939
    4040- (BOOL) setRatesWithDownload: (CGFloat) downloadRate upload: (CGFloat) uploadRate;
  • branches/1.5x/macosx/BadgeView.m

    r7077 r7666  
    3636@implementation BadgeView
    3737
    38 - (id) initWithFrame: (NSRect) frame lib: (tr_handle *) lib
     38- (id) initWithFrame: (NSRect) frame lib: (tr_session *) lib
    3939{
    4040    if ((self = [super initWithFrame: frame]))
  • branches/1.5x/macosx/Badger.h

    r7032 r7666  
    2828@interface Badger : NSObject
    2929{
    30     tr_handle * fLib;
     30    tr_session * fLib;
    3131   
    3232    NSUInteger fCompleted;
     
    3939}
    4040
    41 - (id) initWithLib: (tr_handle *) lib;
     41- (id) initWithLib: (tr_session *) lib;
    4242
    4343- (void) updateBadge;
  • branches/1.5x/macosx/Badger.m

    r7077 r7666  
    4141@implementation Badger
    4242
    43 - (id) initWithLib: (tr_handle *) lib
     43- (id) initWithLib: (tr_session *) lib
    4444{
    4545    if ((self = [super init]))
  • branches/1.5x/macosx/Controller.h

    r7017 r7666  
    5050@interface Controller : NSObject <GrowlApplicationBridgeDelegate>
    5151{
    52     tr_handle                       * fLib;
     52    tr_session                       * fLib;
    5353   
    5454    NSMutableArray                  * fTorrents, * fDisplayedTorrents;
  • branches/1.5x/macosx/Controller.m

    r7084 r7666  
    5050#import "ExpandedPathToIconTransformer.h"
    5151#import "SpeedLimitToTurtleIconTransformer.h"
    52 #import "metainfo.h"
     52
     53#import "bencode.h"
    5354#import "utils.h"
    5455
     
    148149#define DONATE_URL  @"http://www.transmissionbt.com/donate.php"
    149150
    150 static tr_rpc_callback_status rpcCallback(tr_handle * handle UNUSED, tr_rpc_callback_type type, struct tr_torrent * torrentStruct, void * controller)
     151static tr_rpc_callback_status rpcCallback(tr_session * handle UNUSED, tr_rpc_callback_type type, struct tr_torrent * torrentStruct, void * controller)
    151152{
    152153    [(Controller *)controller rpcCallback: type forTorrentStruct: torrentStruct];
     
    210211        fDefaults = [NSUserDefaults standardUserDefaults];
    211212       
    212         fLib = tr_sessionInitFull(NULL, /* use default config directory (Application Support) */
    213                                 "macosx",
    214 #warning update when changing in prefs
    215                                 [[[fDefaults stringForKey: @"DownloadFolder"] stringByExpandingTildeInPath] UTF8String],
    216                                 [fDefaults boolForKey: @"PEXGlobal"],
    217                                 [fDefaults boolForKey: @"NatTraversal"],
    218                                 [fDefaults integerForKey: @"BindPort"],
    219                                 TR_DEFAULT_ENCRYPTION, /* reset in prefs */
    220                                 TR_DEFAULT_LAZY_BITFIELD_ENABLED,
    221                                 NO, /* reset in prefs */
    222                                 -1, /* reset in prefs */
    223                                 NO, /* reset in prefs */
    224                                 -1, /* reset in prefs */
    225                                 [fDefaults integerForKey: @"PeersTotal"],
    226                                 [fDefaults integerForKey: @"MessageLevel"],
    227                                 YES,
    228                                 [fDefaults boolForKey: @"Blocklist"],
    229                                 [fDefaults integerForKey: @"PeerSocketTOS"], /* hidden pref - default is TR_DEFAULT_PEER_SOCKET_TOS */
    230                                 [fDefaults boolForKey: @"RPC"],
    231                                 [fDefaults integerForKey: @"RPCPort"],
    232                                 [fDefaults boolForKey: @"RPCUseWhitelist"],
    233                                 NULL, /* reset in prefs */
    234                                 [fDefaults boolForKey: @"RPCAuthorize"],
    235                                 [[fDefaults stringForKey: @"RPCUsername"] UTF8String],
    236                                 "", /* reset in prefs - from Keychain */
    237                                 [fDefaults boolForKey: @"Proxy"],
    238                                 [[fDefaults stringForKey: @"ProxyAddress"] UTF8String],
    239                                 [fDefaults integerForKey: @"ProxyPort"],
    240                                 TR_DEFAULT_PROXY_TYPE, /* reset in prefs */
    241                                 [fDefaults boolForKey: @"ProxyAuthorize"],
    242                                 [[fDefaults stringForKey: @"ProxyUsername"] UTF8String],
    243                                 ""); /* reset in prefs - from Keychain */
    244        
     213        tr_benc settings;
     214        tr_bencInitDict(&settings, 21);
     215        tr_sessionGetDefaultSettings(&settings);
     216       
     217        tr_bencDictAddInt(&settings, TR_PREFS_KEY_BLOCKLIST_ENABLED, [fDefaults boolForKey: @"Blocklist"]);
     218       
     219        #warning update when changing in prefs
     220        tr_bencDictAddStr(&settings, TR_PREFS_KEY_DOWNLOAD_DIR, [[[fDefaults stringForKey: @"DownloadFolder"]
     221                                                                    stringByExpandingTildeInPath] UTF8String]);
     222       
     223        tr_bencDictAddInt(&settings, TR_PREFS_KEY_MSGLEVEL, [fDefaults boolForKey: @"MessageLevel"]);
     224        tr_bencDictAddInt(&settings, TR_PREFS_KEY_PEER_LIMIT_GLOBAL, [fDefaults integerForKey: @"PeersTotal"]);
     225        tr_bencDictAddInt(&settings, TR_PREFS_KEY_PEER_LIMIT_TORRENT, [fDefaults integerForKey: @"PeersTorrent"]);
     226       
     227        const BOOL randomPort = /*[fDefaults boolForKey: @"RandomPort"]*/NO;
     228        tr_bencDictAddInt(&settings, TR_PREFS_KEY_PEER_PORT_RANDOM_ENABLED, randomPort);
     229        if (!randomPort)
     230            tr_bencDictAddInt(&settings, TR_PREFS_KEY_PEER_PORT, [fDefaults integerForKey: @"BindPort"]);
     231       
     232        //hidden pref
     233        if ([fDefaults objectForKey: @"PeerSocketTOS"])
     234            tr_bencDictAddInt(&settings, TR_PREFS_KEY_PEER_SOCKET_TOS, [fDefaults integerForKey: @"PeerSocketTOS"]);
     235       
     236        tr_bencDictAddInt(&settings, TR_PREFS_KEY_PEX_ENABLED, [fDefaults boolForKey: @"PEXGlobal"]);
     237        tr_bencDictAddInt(&settings, TR_PREFS_KEY_PORT_FORWARDING, [fDefaults boolForKey: @"NatTraversal"]);
     238        tr_bencDictAddInt(&settings, TR_PREFS_KEY_PROXY_AUTH_ENABLED, [fDefaults boolForKey: @"ProxyAuthorize"]);
     239        tr_bencDictAddInt(&settings, TR_PREFS_KEY_PROXY_ENABLED, [fDefaults boolForKey: @"Proxy"]);
     240        tr_bencDictAddInt(&settings, TR_PREFS_KEY_PROXY_PORT, [fDefaults integerForKey: @"ProxyPort"]);
     241        tr_bencDictAddStr(&settings, TR_PREFS_KEY_PROXY, [[fDefaults stringForKey: @"ProxyAddress"] UTF8String]);
     242        tr_bencDictAddStr(&settings, TR_PREFS_KEY_PROXY_USERNAME,  [[fDefaults stringForKey: @"ProxyUsername"] UTF8String]);
     243        tr_bencDictAddInt(&settings, TR_PREFS_KEY_RPC_AUTH_REQUIRED,  [fDefaults boolForKey: @"RPCAuthorize"]);
     244        tr_bencDictAddInt(&settings, TR_PREFS_KEY_RPC_ENABLED,  [fDefaults boolForKey: @"RPC"]);
     245        tr_bencDictAddInt(&settings, TR_PREFS_KEY_RPC_PORT,  [fDefaults integerForKey: @"RPCPort"]);
     246        tr_bencDictAddStr(&settings, TR_PREFS_KEY_RPC_USERNAME,  [[fDefaults stringForKey: @"RPCUsername"] UTF8String]);
     247        tr_bencDictAddInt(&settings, TR_PREFS_KEY_RPC_WHITELIST_ENABLED,  [fDefaults boolForKey: @"RPCUseWhitelist"]);
     248       
     249        fLib = tr_sessionInit("macosx", tr_getDefaultConfigDir("Transmission"), YES, &settings);
     250        tr_bencFree(&settings);       
    245251        [NSApp setDelegate: self];
    246252       
  • branches/1.5x/macosx/CreatorWindowController.h

    r6038 r7666  
    5050}
    5151
    52 + (void) createTorrentFile: (tr_handle *) handle;
    53 + (void) createTorrentFile: (tr_handle *) handle forFile: (NSString *) file;
     52+ (void) createTorrentFile: (tr_session *) handle;
     53+ (void) createTorrentFile: (tr_session *) handle forFile: (NSString *) file;
    5454
    55 - (id) initWithHandle: (tr_handle *) handle path: (NSString *) path;
     55- (id) initWithHandle: (tr_session *) handle path: (NSString *) path;
    5656
    5757- (void) toggleOpenCheck: (id) sender;
  • branches/1.5x/macosx/CreatorWindowController.m

    r7032 r7666  
    4646@implementation CreatorWindowController
    4747
    48 + (void) createTorrentFile: (tr_handle *) handle
     48+ (void) createTorrentFile: (tr_session *) handle
    4949{
    5050    //get file/folder for torrent
     
    5757}
    5858
    59 + (void) createTorrentFile: (tr_handle *) handle forFile: (NSString *) file
     59+ (void) createTorrentFile: (tr_session *) handle forFile: (NSString *) file
    6060{
    6161    CreatorWindowController * creator = [[self alloc] initWithHandle: handle path: file];
     
    6363}
    6464
    65 - (id) initWithHandle: (tr_handle *) handle path: (NSString *) path
     65- (id) initWithHandle: (tr_session *) handle path: (NSString *) path
    6666{
    6767    if ((self = [super initWithWindowNibName: @"Creator"]))
  • branches/1.5x/macosx/DragOverlayWindow.h

    r4423 r7666  
    2828@interface DragOverlayWindow : NSWindow
    2929{
    30     tr_handle * fLib;
     30    tr_session * fLib;
    3131   
    3232    NSViewAnimation * fFadeInAnimation, * fFadeOutAnimation;
    3333}
    3434
    35 - (id) initWithLib: (tr_handle *) lib forWindow: (NSWindow *) window;
     35- (id) initWithLib: (tr_session *) lib forWindow: (NSWindow *) window;
    3636
    3737- (void) setTorrents: (NSArray *) files;
  • branches/1.5x/macosx/DragOverlayWindow.m

    r7013 r7666  
    2626#import "DragOverlayView.h"
    2727#import "NSStringAdditions.h"
    28 #import "metainfo.h"
    2928
    3029@implementation DragOverlayWindow
    3130
    32 - (id) initWithLib: (tr_handle *) lib forWindow: (NSWindow *) window
     31- (id) initWithLib: (tr_session *) lib forWindow: (NSWindow *) window
    3332{
    3433    if ((self = ([super initWithContentRect: NSMakeRect(0, 0, 1.0, 1.0) styleMask: NSBorderlessWindowMask
  • branches/1.5x/macosx/PrefsController.h

    r7007 r7666  
    6363}
    6464
    65 + (void) setHandle: (tr_handle *) handle;
    66 + (tr_handle *) handle;
     65+ (void) setHandle: (tr_session *) handle;
     66+ (tr_session *) handle;
    6767
    6868- (void) setPort: (id) sender;
  • branches/1.5x/macosx/PrefsController.m

    r7081 r7666  
    7171@implementation PrefsController
    7272
    73 tr_handle * fHandle;
    74 + (void) setHandle: (tr_handle *) handle
     73tr_session * fHandle;
     74+ (void) setHandle: (tr_session *) handle
    7575{
    7676    fHandle = handle;
    7777}
    7878
    79 + (tr_handle *) handle
     79+ (tr_session *) handle
    8080{
    8181    return fHandle;
  • branches/1.5x/macosx/StatsWindowController.h

    r5668 r7666  
    3535}
    3636
    37 + (StatsWindowController *) statsWindow: (tr_handle *) lib;
     37+ (StatsWindowController *) statsWindow: (tr_session *) lib;
    3838
    3939- (void) resetStats: (id) sender;
  • branches/1.5x/macosx/StatsWindowController.m

    r6974 r7666  
    4141
    4242StatsWindowController * fStatsWindowInstance = nil;
    43 tr_handle * fLib;
    44 + (StatsWindowController *) statsWindow: (tr_handle *) lib
     43tr_session * fLib;
     44+ (StatsWindowController *) statsWindow: (tr_session *) lib
    4545{
    4646    if (!fStatsWindowInstance)
  • branches/1.5x/macosx/Torrent.h

    r7661 r7666  
    7878
    7979- (id) initWithPath: (NSString *) path location: (NSString *) location deleteTorrentFile: (torrentFileState) torrentDelete
    80         lib: (tr_handle *) lib;
    81 - (id) initWithTorrentStruct: (tr_torrent *) torrentStruct location: (NSString *) location lib: (tr_handle *) lib;
    82 - (id) initWithHistory: (NSDictionary *) history lib: (tr_handle *) lib;
     80        lib: (tr_session *) lib;
     81- (id) initWithTorrentStruct: (tr_torrent *) torrentStruct location: (NSString *) location lib: (tr_session *) lib;
     82- (id) initWithHistory: (NSDictionary *) history lib: (tr_session *) lib;
    8383
    8484- (NSDictionary *) history;
  • branches/1.5x/macosx/Torrent.m

    r7661 r7666  
    3232@interface Torrent (Private)
    3333
    34 - (id) initWithHash: (NSString *) hashString path: (NSString *) path torrentStruct: (tr_torrent *) torrentStruct lib: (tr_handle *) lib
     34- (id) initWithHash: (NSString *) hashString path: (NSString *) path torrentStruct: (tr_torrent *) torrentStruct lib: (tr_session *) lib
    3535        publicTorrent: (NSNumber *) publicTorrent
    3636        downloadFolder: (NSString *) downloadFolder
     
    7777
    7878- (id) initWithPath: (NSString *) path location: (NSString *) location deleteTorrentFile: (torrentFileState) torrentDelete
    79         lib: (tr_handle *) lib
     79        lib: (tr_session *) lib
    8080{
    8181    self = [self initWithHash: nil path: path torrentStruct: NULL lib: lib
     
    102102}
    103103
    104 - (id) initWithTorrentStruct: (tr_torrent *) torrentStruct location: (NSString *) location lib: (tr_handle *) lib
     104- (id) initWithTorrentStruct: (tr_torrent *) torrentStruct location: (NSString *) location lib: (tr_session *) lib
    105105{
    106106    self = [self initWithHash: nil path: nil torrentStruct: torrentStruct lib: lib
     
    114114}
    115115
    116 - (id) initWithHistory: (NSDictionary *) history lib: (tr_handle *) lib
     116- (id) initWithHistory: (NSDictionary *) history lib: (tr_session *) lib
    117117{
    118118    self = [self initWithHash: [history objectForKey: @"TorrentHash"]
     
    16201620
    16211621//if a hash is given, attempt to load that; otherwise, attempt to open file at path
    1622 - (id) initWithHash: (NSString *) hashString path: (NSString *) path torrentStruct: (tr_torrent *) torrentStruct lib: (tr_handle *) lib
     1622- (id) initWithHash: (NSString *) hashString path: (NSString *) path torrentStruct: (tr_torrent *) torrentStruct lib: (tr_session *) lib
    16231623        publicTorrent: (NSNumber *) publicTorrent
    16241624        downloadFolder: (NSString *) downloadFolder
  • branches/1.5x/macosx/version.sh

    r7492 r7666  
    88#         "0" for stable, supported releases
    99# these should be the only two lines you need to change
    10 PEERID_PREFIX="-TR1420-"
    11 USERAGENT_PREFIX="1.42"
     10PEERID_PREFIX="-TR142X-"
     11USERAGENT_PREFIX="1.50b1"
    1212
    1313SVN_REVISION=`find ./libtransmission -name "*\.[chmp]" -o -name "*\.cpp" -o -name "*\.po" -o -name "*\.sh" | \
Note: See TracChangeset for help on using the changeset viewer.