Changeset 191


Ignore:
Timestamp:
Apr 3, 2006, 7:29:09 PM (16 years ago)
Author:
titer
Message:

Merge compat-10.2 branch. This adds Jaguar compatibility on OS X, and
completes the Jam -> Make/XCode switch. Hope it doesn't break too much.

Location:
trunk
Files:
7 deleted
10 edited
4 copied

Legend:

Unmodified
Added
Removed
  • trunk/Makefile

    r134 r191  
    11include Makefile.config
    22include Makefile.common
     3
     4ifneq ($(SYSTEM),Darwin)
    35
    46SRCS = transmissioncli.c
     
    79CFLAGS += -Ilibtransmission
    810
    9 all: transmissioncli
    10 ifeq ($(SYSTEM),Darwin)
    11         $(MAKE) -C macosx
    12 endif
     11all: transmissioncli transmission-gtk transmission-beos
     12
     13lib:
     14        $(MAKE) -C libtransmission
    1315
    1416transmissioncli: lib $(OBJS)
    1517        $(CC) -o $@ $(OBJS) libtransmission/libtransmission.a $(LDFLAGS)
    1618
    17 lib:
    18         $(MAKE) -C libtransmission
     19transmission-gtk:
     20ifeq ($(GTK),yes)
     21        $(MAKE) -C gtk
     22endif
     23
     24transmission-beos:
     25ifeq ($(SYSTEM),BeOS)
     26        $(MAKE) -C beos
     27endif
    1928
    2029%.o: %.c Makefile.config Makefile.common Makefile
    2130        $(CC) $(CFLAGS) -o $@ -c $<
    2231
    23 package-macosx:
    24         $(RM) tmp "Transmission $(VERSION_STRING)" \
    25             Transmission-$(VERSION_STRING).dmg && \
    26           mkdir -p tmp/Transmission.app && \
    27           ditto macosx/build/Debug/Transmission.app tmp/Transmission.app && \
    28           ditto AUTHORS tmp/AUTHORS.txt && \
    29           ditto LICENSE tmp/LICENSE.txt && \
    30           ditto NEWS tmp/NEWS.txt && \
    31           strip -S tmp/Transmission.app/Contents/MacOS/Transmission && \
    32           ( echo "[InternetShortcut]"; \
    33             echo "URL=http://transmission.m0k.org/" ) > \
    34                 tmp/Homepage.url && \
    35           ( echo "[InternetShortcut]"; \
    36             echo "URL=http://transmission.m0k.org/forum/" ) > \
    37                 tmp/Forums.url && \
    38           ( echo "[InternetShortcut]"; \
    39             echo "URL=http://transmission.m0k.org/contribute.php" ) > \
    40             tmp/Contribute.url && \
    41           mv tmp "Transmission $(VERSION_STRING)" && \
    42           hdiutil create -format UDZO -srcfolder \
    43             "Transmission $(VERSION_STRING)" Transmission-$(VERSION_STRING).dmg && \
    44           rm -rf "Transmission $(VERSION_STRING)"
    45 
    4632clean:
    4733        $(RM) transmissioncli $(OBJS)
    4834        $(MAKE) -C libtransmission clean
    49 ifeq ($(SYSTEM),Darwin)
    50         $(MAKE) -C macosx clean
     35ifeq ($(GTK),yes)
     36        $(MAKE) -C gtk clean
     37endif
     38ifeq ($(SYSTEM),BeOS)
     39        $(MAKE) -C beos clean
    5140endif
    5241
     
    5645
    5746include .depend
     47
     48else
     49
     50all:
     51        make -C macosx
     52        xcodebuild -alltargets -activeconfiguration | grep -v "^$$"
     53
     54clean:
     55        xcodebuild -alltargets -activeconfiguration clean | grep -v "^$$"
     56        make -C macosx clean
     57
     58MAKELINK = printf "[InternetShortcut]\nURL=http://%s\n"
     59
     60package:
     61        $(RM) tmp "Transmission $(VERSION_STRING)" \
     62            Transmission-$(VERSION_STRING).dmg && \
     63          mkdir -p tmp && \
     64          cp -r Transmission.app tmp/ && \
     65          cp AUTHORS tmp/AUTHORS.txt && \
     66          cp LICENSE tmp/LICENSE.txt && \
     67          cp NEWS tmp/NEWS.txt && \
     68          strip -S tmp/Transmission.app/Contents/MacOS/Transmission && \
     69          $(MAKELINK) "transmission.m0k.org/" > tmp/Homepage.url && \
     70          $(MAKELINK) "transmission.m0k.org/forum" > tmp/Forums.url && \
     71          $(MAKELINK) "transmission.m0k.org/contribute.php" > tmp/Contribute.url && \
     72          mv tmp "Transmission $(VERSION_STRING)" && \
     73          hdiutil create -format UDZO -srcfolder \
     74            "Transmission $(VERSION_STRING)" Transmission-$(VERSION_STRING).dmg && \
     75          rm -rf "Transmission $(VERSION_STRING)"
     76
     77endif
  • trunk/Makefile.common

    r134 r191  
    33VERSION_STRING = 0.6-svn
    44
    5 RM      = rm -Rf
    6 CFLAGS += -g -Wall -W -O3 -funroll-loops
    7 CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
    8 CFLAGS += -DVERSION_MAJOR=$(VERSION_MAJOR)
    9 CFLAGS += -DVERSION_MINOR=$(VERSION_MINOR)
    10 CFLAGS += -DVERSION_STRING=\"$(VERSION_STRING)\"
    11 CFLAGS += -DSYS_$(shell echo $(SYSTEM) | dd conv=ucase 2>/dev/null)
     5RM        = rm -Rf
     6MOREFLAGS = -g -Wall -W -O3 -funroll-loops -D_FILE_OFFSET_BITS=64 \
     7            -D_LARGEFILE_SOURCE -D_GNU_SOURCE \
     8            -DVERSION_MAJOR=$(VERSION_MAJOR) \
     9            -DVERSION_MINOR=$(VERSION_MINOR) \
     10            -DVERSION_STRING=\"$(VERSION_STRING)\" \
     11            -DSYS_$(shell echo $(SYSTEM) | tr a-z A-Z)
     12CFLAGS   += $(MOREFLAGS)
     13CXXFLAGS += $(MOREFLAGS)
    1214
    1315ifeq ($(SYSTEM),BeOS)
     16CXXFLAGS += -Wno-multichar
    1417ifeq ($(BEOS_NETSERVER),yes)
    1518CFLAGS  += -DBEOS_NETSERVER
     
    1821LDFLAGS += -lbind -lsocket
    1922endif
    20 endif
    21 ifeq ($(SYSTEM),Darwin)
    22 CFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386
    23 endif
    24 
    25 ifeq ($(MATH),yes)
    26 LDFLAGS += -lm
    2723endif
    2824
  • trunk/libtransmission/Makefile

    r135 r191  
    1010
    1111libtransmission.a: $(OBJS)
    12 ifeq ($(SYSTEM),Darwin)
    13         libtool -static $(OBJS) -o $@
    14 else
    1512        ar ru $@ $(OBJS)
    1613        ranlib $@
    17 endif
    1814
    1915%.o: %.c ../Makefile.config ../Makefile.common Makefile
     
    2521.depend: $(SRCS) Makefile
    2622        $(RM) .depend
    27         $(foreach SRC, $(SRCS), $(CC) -MM $(SRC) -D__TRANSMISSION__ >> .depend;)
     23        $(foreach SRC, $(SRCS), $(CC) -MM $(SRC) $(CFLAGS) >> .depend;)
    2824
    2925include .depend
  • trunk/macosx/Badger.h

    r103 r191  
    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
  • trunk/macosx/Badger.m

    r162 r191  
    2323#import "Badger.h"
    2424#import "StringAdditions.h"
     25#import "Utils.h"
    2526
    2627@interface Badger (Private)
     
    4243        fDownloadBadge = [NSImage imageNamed: @"DownloadBadge"];
    4344       
    44         NSShadow * stringShadow = [[NSShadow alloc] init];
    45         [stringShadow setShadowOffset: NSMakeSize(2, -2)];
    46         [stringShadow setShadowBlurRadius: 4];
    47        
    48         fAttributes = [[NSDictionary dictionaryWithObjectsAndKeys:
    49                             [NSColor whiteColor], NSForegroundColorAttributeName,
    50                             [NSFont fontWithName: @"Helvetica-Bold" size: 28], NSFontAttributeName,
    51                             stringShadow, NSShadowAttributeName,
    52                             nil] retain];
    53         [stringShadow release];
     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        }
    5460       
    5561        fCompleted = 0;
  • trunk/macosx/Controller.m

    r169 r191  
    329329
    330330            [panel setPrompt: @"Select Download Folder"];
    331             [panel setMessage: [NSString stringWithFormat:
    332                                 @"Select the download folder for %@",
    333                                 [torrentPath lastPathComponent]]];
    334331            [panel setAllowsMultipleSelection: NO];
    335332            [panel setCanChooseFiles: NO];
    336333            [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]]];
    337340
    338341            [panel beginSheetForDirectory: NULL file: NULL types: NULL
     
    676679{
    677680    [cell setTorrent: [fTorrents objectAtIndex: rowIndex]];
    678     [cell setTextColor: ( [fWindow isKeyWindow] &&
    679         rowIndex == [fTableView selectedRow] ) ?
    680         [NSColor whiteColor] : [NSColor blackColor]];
     681
     682    if( OSX_VERSION >= 10.3 && [fWindow isKeyWindow] &&
     683            rowIndex == [fTableView selectedRow] )
     684        [cell setTextColor: [NSColor whiteColor]];
     685    else
     686        [cell setTextColor: [NSColor blackColor]];
    681687}
    682688
     
    11421148        if (!fCheckIsAutomatic)
    11431149        {
    1144             NSAlert * dialog = [[NSAlert alloc] init];
    1145             [dialog addButtonWithTitle: @"OK"];
    1146             [dialog setMessageText: @"Error checking for updates."];
    1147             [dialog setInformativeText:
    1148                     @"Transmission was not able to check the latest version available."];
    1149             [dialog setAlertStyle: NSInformationalAlertStyle];
    1150 
    1151             [dialog runModal];
    1152             [dialog release];
     1150            if( OSX_VERSION >= 10.3 )
     1151            {
     1152                NSAlert * dialog = [[NSAlert alloc] init];
     1153                [dialog addButtonWithTitle: @"OK"];
     1154                [dialog setMessageText: @"Error checking for updates."];
     1155                [dialog setInformativeText:
     1156                        @"Transmission was not able to check the latest version available."];
     1157                [dialog setAlertStyle: NSInformationalAlertStyle];
     1158
     1159                [dialog runModal];
     1160                [dialog release];
     1161            }
     1162            else
     1163                /* XXX */;
    11531164        }
    11541165        return;
     
    11721183        }
    11731184
    1174         result = [currentSub compare: webSub options: NSNumericSearch];
    1175         if (result != NSOrderedSame)
    1176         {
    1177             if (result == NSOrderedAscending)
    1178                 webGreater = YES;
    1179             break;
    1180         }
     1185        if( OSX_VERSION >= 10.3 )
     1186        {
     1187            result = [currentSub compare: webSub options: NSNumericSearch];
     1188            if (result != NSOrderedSame)
     1189            {
     1190                if (result == NSOrderedAscending)
     1191                    webGreater = YES;
     1192                break;
     1193            }
     1194        }
     1195        else
     1196            /* XXX */;
    11811197    }
    11821198
    11831199    if (webGreater)
    11841200    {
    1185         NSAlert * dialog = [[NSAlert alloc] init];
    1186         [dialog addButtonWithTitle: @"Go to Website"];
    1187         [dialog addButtonWithTitle:@"Cancel"];
    1188         [dialog setMessageText: @"New version is available!"];
    1189         [dialog setInformativeText: [NSString stringWithFormat:
    1190             @"A newer version (%@) is available for download from the Transmission website.", webVersion]];
    1191         [dialog setAlertStyle: NSInformationalAlertStyle];
    1192 
    1193         if ([dialog runModal] == NSAlertFirstButtonReturn)
    1194             [self linkHomepage: nil];
    1195 
    1196         [dialog release];
     1201        if( OSX_VERSION >= 10.3 )
     1202        {
     1203            NSAlert * dialog = [[NSAlert alloc] init];
     1204            [dialog addButtonWithTitle: @"Go to Website"];
     1205            [dialog addButtonWithTitle:@"Cancel"];
     1206            [dialog setMessageText: @"New version is available!"];
     1207            [dialog setInformativeText: [NSString stringWithFormat:
     1208                @"A newer version (%@) is available for download from the Transmission website.", webVersion]];
     1209            [dialog setAlertStyle: NSInformationalAlertStyle];
     1210
     1211            if ([dialog runModal] == NSAlertFirstButtonReturn)
     1212                [self linkHomepage: nil];
     1213
     1214            [dialog release];
     1215        }
     1216        else
     1217            /* XXX */;
    11971218    }
    11981219    else if (!fCheckIsAutomatic)
    11991220    {
    1200         NSAlert * dialog = [[NSAlert alloc] init];
    1201         [dialog addButtonWithTitle: @"OK"];
    1202         [dialog setMessageText: @"No new versions are available."];
    1203         [dialog setInformativeText: [NSString stringWithFormat:
    1204             @"You are running the most current version of Transmission (%@).", currentVersion]];
    1205         [dialog setAlertStyle: NSInformationalAlertStyle];
    1206 
    1207         [dialog runModal];
    1208         [dialog release];
     1221        if( OSX_VERSION >= 10.3 )
     1222        {
     1223            NSAlert * dialog = [[NSAlert alloc] init];
     1224            [dialog addButtonWithTitle: @"OK"];
     1225            [dialog setMessageText: @"No new versions are available."];
     1226            [dialog setInformativeText: [NSString stringWithFormat:
     1227                @"You are running the most current version of Transmission (%@).", currentVersion]];
     1228            [dialog setAlertStyle: NSInformationalAlertStyle];
     1229
     1230            [dialog runModal];
     1231            [dialog release];
     1232        }
     1233        else
     1234            /* XXX */;
    12091235    }
    12101236    else;
  • trunk/macosx/Makefile

    r134 r191  
    11include ../Makefile.config
    22include ../Makefile.common
    3 
    4 SRCS = $(shell ls *.m *.h *.plist)
    5 
    6 Transmission.app: $(SRCS) Info.plist
    7         xcodebuild -configuration Debug | grep -v "^$$"
    83
    94Info.plist: Info.plist.in ../Makefile.common
     
    127
    138clean:
    14         $(RM) Info.plist build
     9        $(RM) Info.plist
  • trunk/macosx/PrefsController.m

    r162 r191  
    7878    [[fPrefsWindow standardWindowButton: NSWindowToolbarButton]
    7979        setFrame: NSZeroRect];
    80    
    81     [fToolbar setSelectedItemIdentifier: TOOLBAR_GENERAL];
     80
     81    if( [fToolbar respondsToSelector: @selector(setSelectedItemIdentifier:) ] )
     82        [fToolbar setSelectedItemIdentifier: TOOLBAR_GENERAL];
    8283    [self setPrefView: fGeneralView];
    8384
     
    180181}
    181182
     183/* Only used on OS X >= 10.3 */
    182184- (NSArray *) toolbarSelectableItemIdentifiers: (NSToolbar *)toolbar
    183185{
     
    344346    windowRect.size.height += difference;
    345347   
    346     [fPrefsWindow setTitle: [fToolbar selectedItemIdentifier]];
     348    if( [fToolbar respondsToSelector: @selector(selectedItemIdentifier) ] )
     349        [fPrefsWindow setTitle: [fToolbar selectedItemIdentifier]];
    347350    [fPrefsWindow setContentView: fBlankView];
    348351    [fPrefsWindow setFrame:windowRect display: YES animate: YES];
  • trunk/macosx/TorrentTableView.m

    r168 r191  
    2424#import "Controller.h"
    2525#import "Torrent.h"
     26#import "Utils.h"
    2627
    2728@implementation TorrentTableView
     
    101102        if( row >= 0 )
    102103        {
    103             [self selectRowIndexes: [NSIndexSet indexSetWithIndex: row]
    104                 byExtendingSelection: NO];
     104            if( OSX_VERSION >= 10.3 )
     105                [self selectRowIndexes: [NSIndexSet indexSetWithIndex: row]
     106                    byExtendingSelection: NO];
     107            else
     108                [self selectRow: row byExtendingSelection: NO];
    105109        }
    106110        else
     
    152156    if( row >= 0 )
    153157    {
    154         [self selectRowIndexes: [NSIndexSet indexSetWithIndex: row]
    155             byExtendingSelection: NO];
     158        if( OSX_VERSION >= 10.3 )
     159            [self selectRowIndexes: [NSIndexSet indexSetWithIndex: row]
     160                byExtendingSelection: NO];
     161        else
     162            [self selectRow: row byExtendingSelection: NO];
    156163        return fContextRow;
    157164    }
  • trunk/macosx/Utils.h

    r34 r191  
    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.