Changeset 177


Ignore:
Timestamp:
Apr 2, 2006, 7:24:20 PM (16 years ago)
Author:
titer
Message:

Now runs on Jaguar

Location:
branches/compat-10.2/macosx
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/compat-10.2/macosx/Badger.h

    r103 r177  
    1313@interface Badger : NSObject {
    1414
    15     NSImage         * fDockIcon, * fBadgedDockIcon,
    16                     * fBadge, * fUploadBadge, * fDownloadBadge;
     15    NSImage             * fDockIcon, * fBadgedDockIcon,
     16                        * fBadge, * fUploadBadge, * fDownloadBadge;
    1717                   
    18     NSDictionary    * fAttributes;
     18    NSMutableDictionary * fAttributes;
    1919   
    20     int             fCompleted;
    21     BOOL            fSpeedShown;
     20    int                 fCompleted;
     21    BOOL                fSpeedShown;
    2222}
    2323
  • branches/compat-10.2/macosx/Badger.m

    r175 r177  
    2323#import "Badger.h"
    2424#import "StringAdditions.h"
     25#import "Utils.h"
    2526
    2627@interface Badger (Private)
     
    4243        fDownloadBadge = [NSImage imageNamed: @"DownloadBadge"];
    4344       
    44 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
    45         NSShadow * stringShadow = [[NSShadow alloc] init];
    46         [stringShadow setShadowOffset: NSMakeSize(2, -2)];
    47         [stringShadow setShadowBlurRadius: 4];
    48 #endif
    49        
    50         fAttributes = [[NSDictionary dictionaryWithObjectsAndKeys:
    51                             [NSColor whiteColor], NSForegroundColorAttributeName,
    52                             [NSFont fontWithName: @"Helvetica-Bold" size: 28], NSFontAttributeName,
    53 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
    54                             stringShadow, NSShadowAttributeName,
    55 #endif
    56                             nil] retain];
    57 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
    58         [stringShadow release];
    59 #endif
     45       
     46        fAttributes = [[NSMutableDictionary dictionaryWithObjectsAndKeys:
     47            [NSColor whiteColor], NSForegroundColorAttributeName,
     48            [NSFont fontWithName: @"Helvetica-Bold" size: 28], NSFontAttributeName,
     49            nil] retain];
     50
     51        if( OSX_VERSION >= 10.3 )
     52        {
     53            NSShadow * stringShadow = [[NSShadow alloc] init];
     54            [stringShadow setShadowOffset: NSMakeSize(2, -2)];
     55            [stringShadow setShadowBlurRadius: 4];
     56            [fAttributes setObject: stringShadow
     57                forKey: NSShadowAttributeName];
     58            [stringShadow release];
     59        }
    6060       
    6161        fCompleted = 0;
  • branches/compat-10.2/macosx/Controller.m

    r175 r177  
    329329
    330330            [panel setPrompt: @"Select Download Folder"];
    331 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
    332             [panel setMessage: [NSString stringWithFormat:
    333                                 @"Select the download folder for %@",
    334                                 [torrentPath lastPathComponent]]];
    335 #endif
    336331            [panel setAllowsMultipleSelection: NO];
    337332            [panel setCanChooseFiles: NO];
    338333            [panel setCanChooseDirectories: YES];
     334
     335            if( [panel respondsToSelector: @selector(setMessage:)] )
     336                /* >= 10.3 */
     337                [panel setMessage: [NSString stringWithFormat:
     338                                    @"Select the download folder for %@",
     339                                    [torrentPath lastPathComponent]]];
    339340
    340341            [panel beginSheetForDirectory: NULL file: NULL types: NULL
     
    11441145        if (!fCheckIsAutomatic)
    11451146        {
    1146 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 /* FIXME */
    1147             NSAlert * dialog = [[NSAlert alloc] init];
    1148             [dialog addButtonWithTitle: @"OK"];
    1149             [dialog setMessageText: @"Error checking for updates."];
    1150             [dialog setInformativeText:
    1151                     @"Transmission was not able to check the latest version available."];
    1152             [dialog setAlertStyle: NSInformationalAlertStyle];
    1153 
    1154             [dialog runModal];
    1155             [dialog release];
    1156 #endif
     1147            if( OSX_VERSION >= 10.3 )
     1148            {
     1149                NSAlert * dialog = [[NSAlert alloc] init];
     1150                [dialog addButtonWithTitle: @"OK"];
     1151                [dialog setMessageText: @"Error checking for updates."];
     1152                [dialog setInformativeText:
     1153                        @"Transmission was not able to check the latest version available."];
     1154                [dialog setAlertStyle: NSInformationalAlertStyle];
     1155
     1156                [dialog runModal];
     1157                [dialog release];
     1158            }
     1159            else
     1160                /* XXX */;
    11571161        }
    11581162        return;
     
    11761180        }
    11771181
    1178 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
    1179         result = [currentSub compare: webSub options: NSNumericSearch];
    1180         if (result != NSOrderedSame)
    1181         {
    1182             if (result == NSOrderedAscending)
    1183                 webGreater = YES;
    1184             break;
    1185         }
    1186 #endif
     1182        if( OSX_VERSION >= 10.3 )
     1183        {
     1184            result = [currentSub compare: webSub options: NSNumericSearch];
     1185            if (result != NSOrderedSame)
     1186            {
     1187                if (result == NSOrderedAscending)
     1188                    webGreater = YES;
     1189                break;
     1190            }
     1191        }
     1192        else
     1193            /* XXX */;
    11871194    }
    11881195
    11891196    if (webGreater)
    11901197    {
    1191 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 /* FIXME */
    1192         NSAlert * dialog = [[NSAlert alloc] init];
    1193         [dialog addButtonWithTitle: @"Go to Website"];
    1194         [dialog addButtonWithTitle:@"Cancel"];
    1195         [dialog setMessageText: @"New version is available!"];
    1196         [dialog setInformativeText: [NSString stringWithFormat:
    1197             @"A newer version (%@) is available for download from the Transmission website.", webVersion]];
    1198         [dialog setAlertStyle: NSInformationalAlertStyle];
    1199 
    1200         if ([dialog runModal] == NSAlertFirstButtonReturn)
    1201             [self linkHomepage: nil];
    1202 
    1203         [dialog release];
    1204 #endif
     1198        if( OSX_VERSION >= 10.3 )
     1199        {
     1200            NSAlert * dialog = [[NSAlert alloc] init];
     1201            [dialog addButtonWithTitle: @"Go to Website"];
     1202            [dialog addButtonWithTitle:@"Cancel"];
     1203            [dialog setMessageText: @"New version is available!"];
     1204            [dialog setInformativeText: [NSString stringWithFormat:
     1205                @"A newer version (%@) is available for download from the Transmission website.", webVersion]];
     1206            [dialog setAlertStyle: NSInformationalAlertStyle];
     1207
     1208            if ([dialog runModal] == NSAlertFirstButtonReturn)
     1209                [self linkHomepage: nil];
     1210
     1211            [dialog release];
     1212        }
     1213        else
     1214            /* XXX */;
    12051215    }
    12061216    else if (!fCheckIsAutomatic)
    12071217    {
    1208 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 /* FIXME */
    1209         NSAlert * dialog = [[NSAlert alloc] init];
    1210         [dialog addButtonWithTitle: @"OK"];
    1211         [dialog setMessageText: @"No new versions are available."];
    1212         [dialog setInformativeText: [NSString stringWithFormat:
    1213             @"You are running the most current version of Transmission (%@).", currentVersion]];
    1214         [dialog setAlertStyle: NSInformationalAlertStyle];
    1215 
    1216         [dialog runModal];
    1217         [dialog release];
    1218 #endif
     1218        if( OSX_VERSION >= 10.3 )
     1219        {
     1220            NSAlert * dialog = [[NSAlert alloc] init];
     1221            [dialog addButtonWithTitle: @"OK"];
     1222            [dialog setMessageText: @"No new versions are available."];
     1223            [dialog setInformativeText: [NSString stringWithFormat:
     1224                @"You are running the most current version of Transmission (%@).", currentVersion]];
     1225            [dialog setAlertStyle: NSInformationalAlertStyle];
     1226
     1227            [dialog runModal];
     1228            [dialog release];
     1229        }
     1230        else
     1231            /* XXX */;
    12191232    }
    12201233    else;
  • branches/compat-10.2/macosx/TorrentTableView.m

    r175 r177  
    2424#import "Controller.h"
    2525#import "Torrent.h"
     26#import "Utils.h"
    2627
    2728@implementation TorrentTableView
     
    101102        if( row >= 0 )
    102103        {
    103 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
    104             [self selectRowIndexes: [NSIndexSet indexSetWithIndex: row]
    105                 byExtendingSelection: NO];
    106 #endif
     104            if( OSX_VERSION >= 10.3 )
     105                [self selectRowIndexes: [NSIndexSet indexSetWithIndex: row]
     106                    byExtendingSelection: NO];
     107            else
     108                [self selectRow: row byExtendingSelection: NO];
    107109        }
    108110        else
     
    154156    if( row >= 0 )
    155157    {
    156 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
    157         [self selectRowIndexes: [NSIndexSet indexSetWithIndex: row]
    158             byExtendingSelection: NO];
    159 #endif
     158        if( OSX_VERSION >= 10.3 )
     159            [self selectRowIndexes: [NSIndexSet indexSetWithIndex: row]
     160                byExtendingSelection: NO];
     161        else
     162            [self selectRow: row byExtendingSelection: NO];
    160163        return fContextRow;
    161164    }
  • branches/compat-10.2/macosx/Transmission.xcodeproj/project.pbxproj

    r175 r177  
    4646                4D1838FC09DEC4380047D688 /* transmission.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D1838F809DEC4380047D688 /* transmission.h */; };
    4747                4D1838FD09DEC4380047D688 /* transmission.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D1838F909DEC4380047D688 /* transmission.c */; };
    48                 4D2617FD09DECE6200D08EFA /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D2617F709DECE3D00D08EFA /* libcrypto.dylib */; };
    4948                4D2784370905709500687951 /* Transmission.icns in Resources */ = {isa = PBXBuildFile; fileRef = 4D2784360905709500687951 /* Transmission.icns */; };
    5049                4D364DA0091FBB2C00377D12 /* TorrentTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D364D9F091FBB2C00377D12 /* TorrentTableView.m */; };
    5150                4D3EA0AA08AE13C600EA10C2 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D3EA0A908AE13C600EA10C2 /* IOKit.framework */; };
     51                4D4B7F6109E055660053C1EB /* libcrypto.0.9.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D2617F709DECE3D00D08EFA /* libcrypto.0.9.dylib */; };
    5252                4D6DAAC6090CE00500F43C22 /* RevealOff.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D6DAAC4090CE00500F43C22 /* RevealOff.png */; };
    5353                4D6DAAC7090CE00500F43C22 /* RevealOn.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D6DAAC5090CE00500F43C22 /* RevealOn.png */; };
     
    145145                4D1838F809DEC4380047D688 /* transmission.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = transmission.h; path = ../libtransmission/transmission.h; sourceTree = SOURCE_ROOT; };
    146146                4D1838F909DEC4380047D688 /* transmission.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = transmission.c; path = ../libtransmission/transmission.c; sourceTree = SOURCE_ROOT; };
    147                 4D2617F709DECE3D00D08EFA /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = /usr/lib/libcrypto.dylib; sourceTree = "<absolute>"; };
     147                4D2617F709DECE3D00D08EFA /* libcrypto.0.9.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.0.9.dylib; path = /usr/lib/libcrypto.0.9.dylib; sourceTree = "<absolute>"; };
    148148                4D2784360905709500687951 /* Transmission.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = Transmission.icns; path = Images/Transmission.icns; sourceTree = "<group>"; };
    149149                4D364D9E091FBB2C00377D12 /* TorrentTableView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TorrentTableView.h; sourceTree = "<group>"; };
     
    196196                                4D3EA0AA08AE13C600EA10C2 /* IOKit.framework in Frameworks */,
    197197                                4D1838DD09DEC0E80047D688 /* libtransmission.a in Frameworks */,
    198                                 4D2617FD09DECE6200D08EFA /* libcrypto.dylib in Frameworks */,
     198                                4D4B7F6109E055660053C1EB /* libcrypto.0.9.dylib in Frameworks */,
    199199                        );
    200200                        runOnlyForDeploymentPostprocessing = 0;
     
    288288                        children = (
    289289                                1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
    290                                 4D2617F709DECE3D00D08EFA /* libcrypto.dylib */,
     290                                4D2617F709DECE3D00D08EFA /* libcrypto.0.9.dylib */,
    291291                                4D3EA0A908AE13C600EA10C2 /* IOKit.framework */,
    292292                                29B97324FDCFA39411CA2CEA /* AppKit.framework */,
     
    579579                                MACOSX_DEPLOYMENT_TARGET_i386 = 10.4;
    580580                                MACOSX_DEPLOYMENT_TARGET_ppc = 10.2;
    581                                 SDKROOT_i386 = /Developer/SDKs/MacOSX10.4u.sdk;
    582                                 SDKROOT_ppc = /Developer/SDKs/MacOSX10.2.8.sdk;
     581                                SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
    583582                        };
    584583                        name = Debug;
  • branches/compat-10.2/macosx/Utils.h

    r34 r177  
    2222
    2323#define NS_ELLIPSIS [NSString stringWithUTF8String: "\xE2\x80\xA6"]
     24#define OSX_VERSION [[[NSDictionary dictionaryWithContentsOfFile: \
     25    @"/System/Library/CoreServices/SystemVersion.plist"] \
     26    objectForKey: @"ProductVersion"] floatValue]
Note: See TracChangeset for help on using the changeset viewer.