Changeset 6


Ignore:
Timestamp:
Jan 12, 2006, 6:33:20 PM (17 years ago)
Author:
root
Message:

Update 2005-11-21

Location:
trunk
Files:
1 added
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/AUTHORS

    r4 r6  
    1 Authors:
     1AUTHORS for Transmission <http://transmission.m0k.org/>
     2=======================================================
     3
     4Transmission is written is maintained by:
    25
    36Eric Petit <titer@m0k.org>
    4  + About everything until now
     7 + Back-end
     8 + OS X interface
     9
     10Josh Elsasser <josh@elsasser.org>
     11 + GTK interface
     12
     13Michael Demars <keul@m0k.org>
     14 + OS X interface
     15 + Growl notifications
     16 + AppleScript support
    517
    618
     
    1527Omar and Adrien
    1628 + Beta testing
    17 
    18 Michael Demars
    19  + Beta testing
    20  + OS X UI patches
    2129
    2230Various people
  • trunk/Jamfile

    r5 r6  
    77if $(OS) = MACOSX
    88{
     9    OSXLinks macosx/Frameworks/Growl.framework/Growl ;
    910    OSXInfoPlist macosx/Info.plist : macosx/Info.plist.in ;
    1011    OSXBundle Transmission.app : libtransmission.a
     
    1617        macosx/English.lproj/MainMenu.nib/info.nib
    1718        macosx/English.lproj/MainMenu.nib/keyedobjects.nib
     19        macosx/Frameworks/Growl.framework/Growl
    1820        macosx/Images/Info.png
    1921        macosx/Images/Open.png
  • trunk/Jamrules

    r4 r6  
    1717RM       = rm -Rf ;
    1818
     19rule SystemLibraries
     20{
     21    LINKLIBS on [ FAppendSuffix $(<) : $(SUFEXE) ] ?= $(LINKLIBS) ;
     22    LINKLIBS on [ FAppendSuffix $(<) : $(SUFEXE) ] +=  $(>) ;
     23}
     24
    1925if $(OS) = MACOSX
    2026{
     
    3339    {
    3440        libtool -static $(>) -o $(<) ;
     41    }
     42
     43    rule OSXLinks
     44    {
     45    }
     46    actions OSXLinks
     47    {
     48        ( cd macosx/Frameworks/Growl.framework/ && \
     49          ln -s Versions/Current/Growl && \
     50          ln -s Versions/Current/Headers && \
     51          ln -s Versions/Current/Resources && \
     52          ln -s A Versions/Current )
    3553    }
    3654
     
    7492        ditto LICENSE "$TMP/LICENSE.txt" &&
    7593        ditto NEWS "$TMP/NEWS.txt" &&
     94        strip -S "$TMP/Transmission.app/Contents/MacOS/Transmission" &&
    7695        ( echo "[InternetShortcut]"; \
    7796          echo "URL=http://transmission.m0k.org/" ) > \
  • trunk/configure

    r5 r6  
    4646gtk_test()
    4747{
    48   cat > testconf.c << EOF
    49   #include <gtk/gtk.h>
    50   int main()
    51   {
    52     gtk_main();
    53   }
    54 EOF
    55   if $CC `pkg-config gtk+-2.0 --cflags --libs 2>/dev/null` -o testconf testconf.c
     48  if pkg-config gtk+-2.0 > /dev/null 2>&1
    5649  then
    57     echo "GTK+: yes"
    58     GTK=yes
    59     GTKCCFLAGS=`pkg-config gtk+-2.0 --cflags`
    60     GTKLINKLIBS=`pkg-config gtk+-2.0 --libs`
     50    cat > testconf.c << EOF
     51    #include <gtk/gtk.h>
     52    int main()
     53    {
     54      gtk_main();
     55    }
     56EOF
     57    if $CC `pkg-config gtk+-2.0 --cflags --libs` -o testconf testconf.c > /dev/null 2>&1
     58    then
     59      echo "GTK+:    yes"
     60      GTK=yes
     61      GTKCCFLAGS=`pkg-config gtk+-2.0 --cflags`
     62      GTKLINKLIBS=`pkg-config gtk+-2.0 --libs`
     63    else
     64      echo "GTK+:    no"
     65      GTK=no
     66    fi
     67    rm -f testconf.c testconf
    6168  else
    62     echo "GTK+: no"
     69    echo "GTK+:    no"
    6370    GTK=no
    6471  fi
    65   rm -f testconf.c testconf
    6672}
    6773
     
    156162echo "System:  $SYSTEM"
    157163
    158 # Check for GTK
    159 if pkg-config gtk+-2.0
    160 then
    161     echo "GTK+: yes"
    162     GTK=yes
    163     GTKCCFLAGS=`pkg-config gtk+-2.0 --cflags`
    164     GTKLINKLIBS=`pkg-config gtk+-2.0 --libs`
    165 else
    166     echo "GTK+: no"
    167     GTK=no
    168 fi
    169 
    170164#
    171165# OpenSSL settings
     
    181175#
    182176if [ ${gtk_disable} = 1 ]; then
    183   echo "GTK+: no"
     177  echo "GTK+:    no"
    184178else
    185179    gtk_test
  • trunk/gtk/Jamfile

    r5 r6  
    1 {
    2     SubDir TOP gtk ;
     1SubDir TOP gtk ;
    32
    4     GTK_SRC = conf.c main.c util.c ;
     3GTK_SRC = conf.c main.c util.c ;
    54
    6     local CCFLAGS = $(CCFLAGS) $(GTKCCFLAGS) ;
    7     #local LINKLIBS = $(LINKLIBS) $(GTKLINKLIBS) ;
    8     local HDRS = $(HDRS) $(TOP)/libtransmission ;
     5Main          transmission-gtk   : $(GTK_SRC) ;
     6LinkLibraries transmission-gtk   : libtransmission.a ;
    97
    10     # jesus fucking christ, I give up
    11     LINKLIBS += $(GTKLINKLIBS) ;
    12 
    13     Main          transmission-gtk   : $(GTK_SRC) ;
    14     LinkLibraries transmission-gtk   : libtransmission.a ;
    15 }
     8ObjectCcFlags   $(GTK_SRC)       : $(GTKCCFLAGS) ;
     9ObjectHdrs      $(GTK_SRC)       : $(TOP)/libtransmission ;
     10SystemLibraries transmission-gtk : $(GTKLINKLIBS) ;
  • trunk/libtransmission/internal.h

    r3 r6  
    128128
    129129    int               status;
     130        int                               finished;
    130131    char              error[128];
    131132
  • trunk/libtransmission/metainfo.c

    r1 r6  
    4242    struct stat sb;
    4343
    44     snprintf( inf->torrent, MAX_PATH_LENGTH, path );
     44    snprintf( inf->torrent, MAX_PATH_LENGTH, "%s", path );
    4545
    4646    if( stat( path, &sb ) )
     
    143143        return 1;
    144144    }
    145     snprintf( inf->trackerAnnounce, MAX_PATH_LENGTH, s2 );
     145    snprintf( inf->trackerAnnounce, MAX_PATH_LENGTH, "%s", s2 );
    146146
    147147    /* Piece length */
  • trunk/libtransmission/tracker.c

    r3 r6  
    359359        tor->status |= TR_TRACKER_ERROR;
    360360        snprintf( tor->error, sizeof( tor->error ),
    361                   bePeers->val.s.s );
     361                  "%s", bePeers->val.s.s );
    362362        goto cleanup;
    363363    }
     
    607607    return 0;
    608608}
     609
     610int tr_trackerSeeders( tr_torrent_t * tor)
     611{
     612        if (tor->status != TR_STATUS_PAUSE)
     613        {
     614                return (tor->tracker)->seeders;
     615        }
     616        return 0;
     617}
     618
     619int tr_trackerLeechers( tr_torrent_t * tor)
     620{
     621        if (tor->status != TR_STATUS_PAUSE)
     622        {
     623                return (tor->tracker)->leechers;
     624        }
     625        return 0;
     626}
  • trunk/libtransmission/tracker.h

    r1 r6  
    3232void           tr_trackerClose     ( tr_tracker_t * );
    3333
     34/***********************************************************************
     35 * tr_trackerSeeders
     36 ***********************************************************************
     37 * Looks for the seeders/leechers as returned by the tracker.
     38 **********************************************************************/
     39int                         tr_trackerSeeders  ( tr_torrent_t * );
     40
     41/***********************************************************************
     42 * tr_trackerLeechers
     43 ***********************************************************************
     44 * Looks for the seeders/leechers as returned by the tracker.
     45 **********************************************************************/
     46int                         tr_trackerLeechers ( tr_torrent_t * );
     47
    3448int            tr_trackerScrape    ( tr_torrent_t *, int *, int * );
    3549
  • trunk/libtransmission/transmission.c

    r5 r6  
    173173    tor->id     = h->id;
    174174    tor->key    = h->key;
     175        tor->finished = 0;
     176
    175177
    176178    /* Guess scrape URL */
     
    316318{
    317319    return h->torrentCount;
     320}
     321
     322int tr_getFinished( tr_handle_t * h, int i)
     323{
     324        return h->torrents[i]->finished;
     325}
     326void tr_setFinished( tr_handle_t * h, int i, int val)
     327{
     328        h->torrents[i]->finished = val;
    318329}
    319330
     
    375386        s[i].rateDownload = rateDownload( tor );
    376387        s[i].rateUpload   = rateUpload( tor );
     388       
     389        s[i].seeders      = tr_trackerSeeders(tor);
     390                s[i].leechers     = tr_trackerLeechers(tor);
    377391
    378392        if( s[i].rateDownload < 0.1 )
     
    497511            /* Done */
    498512            tor->status = TR_STATUS_SEED;
     513                        tor->finished = 1;
    499514            tr_trackerCompleted( tor->tracker );
    500515        }
  • trunk/libtransmission/transmission.h

    r2 r6  
    7272
    7373/***********************************************************************
     74 * tr_getFinished
     75 ***********************************************************************
     76 * Tests to see if torrent is finished
     77 **********************************************************************/
     78int tr_getFinished( tr_handle_t *, int );
     79
     80/***********************************************************************
     81 * tr_setFinished
     82 ***********************************************************************
     83 * Sets the boolean value finished in the torrent back to false
     84 **********************************************************************/
     85void tr_setFinished( tr_handle_t *, int, int );
     86
     87/***********************************************************************
    7488 * tr_torrentInit
    7589 ***********************************************************************
     
    206220    int         peersDownloading;
    207221    char        pieces[120];
     222    int                 seeders;
     223        int                     leechers;
    208224
    209225    uint64_t    downloaded;
  • trunk/macosx/Controller.h

    r4 r6  
    2727#include <transmission.h>
    2828#include "PrefsController.h"
     29#include <Growl/Growl.h>
    2930
    3031@class TorrentTableView;
    3132
    32 @interface Controller : NSObject
     33@interface Controller : NSObject <GrowlApplicationBridgeDelegate>
    3334{
    3435    tr_handle_t                  * fHandle;
     
    4445    IBOutlet NSMenuItem          * fPauseResumeItem;
    4546    IBOutlet NSMenuItem          * fRemoveItem;
     47    IBOutlet NSMenuItem          * fRevealItem;
    4648
    4749    IBOutlet NSWindow            * fWindow;
     
    5860    IBOutlet NSTextField         * fInfoPieces;
    5961    IBOutlet NSTextField         * fInfoPieceSize;
     62    IBOutlet NSTextField         * fInfoSeeders;
     63    IBOutlet NSTextField         * fInfoLeechers;
    6064    IBOutlet NSTextField         * fInfoFolder;
    6165    IBOutlet NSTextField         * fInfoDownloaded;
     
    7276                            contextInfo: (void *) info;
    7377- (void) stopTorrent:     (id) sender;
     78- (void) stopAllTorrents: (id) sender;
    7479- (void) stopTorrentWithIndex: (int) index;
    7580- (void) resumeTorrent:   (id) sender;
     81- (void) resumeAllTorrents: (id) sender;
    7682- (void) resumeTorrentWithIndex: (int) index;
    7783- (void) removeTorrent:   (id) sender;
     
    9399- (void) linkHomepage:    (id) sender;
    94100- (void) linkForums:      (id) sender;
     101- (void) notifyGrowl:     (NSString *) file folder: (NSString *) folder;
     102- (void) revealInFinder:  (NSString *) path;
    95103
    96104@end
  • trunk/macosx/Controller.m

    r4 r6  
    7878    if( row < 0 )
    7979    {
     80        [fRevealItem setAction: NULL];
    8081        return;
    8182    }
     83   
     84    [fRevealItem setAction: @selector( revealFromMenu: )];
     85
    8286    if( fStat[row].status & TR_STATUS_PAUSE )
    8387    {
     
    186190        }
    187191    }
    188 
     192   
     193    /*  Register with the growl system */
     194    [GrowlApplicationBridge setGrowlDelegate:self];
     195   
    189196    /* Update the interface every 500 ms */
    190197    fCount = 0;
     
    359366        [defaults setObject:@"YES" forKey:@"UseAdvancedBar"];
    360367    }
     368    [fTableView display];
     369}
     370
     371/* called on by applescript */
     372- (void) open: (NSArray *) files
     373{
     374    fFilenames = [files retain];
     375    [self performSelectorOnMainThread: @selector(cantFindAName:)
     376                withObject: NULL waitUntilDone: NO];
    361377}
    362378
     
    404420}
    405421
     422- (void) resumeAllTorrents: (id) sender
     423{
     424    int i;
     425    for ( i = 0; i < fCount; i++)
     426    {
     427        if ( fStat[i].status & ( TR_STATUS_STOPPING
     428        | TR_STATUS_PAUSE | TR_STATUS_STOPPED ) )
     429        {
     430            [self resumeTorrentWithIndex: i];
     431        }
     432    }
     433}
     434
    406435- (void) resumeTorrentWithIndex: (int) idx
    407436{
     
    413442{
    414443    [self stopTorrentWithIndex: [fTableView selectedRow]];
     444}
     445
     446- (void) stopAllTorrents: (id) sender
     447{
     448    int i;
     449    for ( i = 0; i < fCount; i++)
     450    {
     451        if ( fStat[i].status & ( TR_STATUS_CHECK
     452        | TR_STATUS_DOWNLOAD | TR_STATUS_SEED) )
     453        {
     454            [self stopTorrentWithIndex: i];
     455        }
     456    }
    415457}
    416458
     
    435477        NSAlert *alert = [[[NSAlert alloc] init] autorelease];
    436478       
    437         [alert addButtonWithTitle:@"No"];
    438         [alert addButtonWithTitle:@"Yes"];
     479        [alert addButtonWithTitle:@"Delete"];
     480        [alert addButtonWithTitle:@"Cancel"];
    439481        [alert setAlertStyle:NSWarningAlertStyle];
    440         [alert setMessageText:@"Are you sure you want to remove and delete?"];
     482        [alert setMessageText:@"Do you want to remove this torrent from Transmission?"];
    441483       
    442484        if ( (deleteTorrent && torrentWarning) &&
     
    444486        {
    445487            /* delete torrent warning YES, delete data warning NO */
    446             [alert setInformativeText:@"If you choose yes, the .torrent file will "
    447                 "be deleted. This cannot be undone."];
     488            [alert setInformativeText:@"This will delete the .torrent file only. "
     489                "This can not be undone!"];
    448490        }
    449491        else if( (deleteData && dataWarning) &&
     
    451493        {
    452494            /* delete torrent warning NO, delete data warning YES */
    453             [alert setInformativeText:@"If you choose yes, the downloaded data will "
    454                 "be deleted. This cannot be undone."];
     495            [alert setInformativeText:@"This will delete the downloaded data. "
     496                "This can not be undone!"];
    455497        }
    456498        else
    457499        {
    458500            /* delete torrent warning YES, delete data warning YES */
    459             [alert setInformativeText:@"If you choose yes, both downloaded data and "
    460                 "torrent file will be deleted. This cannot be undone."];
     501            [alert setInformativeText:@"This will delete the downloaded data and "
     502                ".torrent file. This can not be undone!"];
    461503        }
    462504       
    463         if ( [alert runModal] == NSAlertFirstButtonReturn )
     505        if ( [alert runModal] == NSAlertSecondButtonReturn )
    464506            return;
    465507    }
     
    535577{
    536578    float dl, ul;
    537     int row;
     579    int row, i;
    538580
    539581    /* Update the NSTableView */
     
    561603            stringForFileSize( fStat[row].uploaded )];
    562604    }
     605   
     606    /* check if torrents have recently ended. */
     607    for (i = 0; i < fCount; i++)
     608    {
     609        if( !tr_getFinished( fHandle, i ) )
     610        {
     611            continue;
     612        }
     613        [self notifyGrowl: [NSString stringWithUTF8String:
     614            fStat[i].info.name] folder: [NSString stringWithUTF8String:
     615            fStat[i].folder]];
     616        tr_setFinished( fHandle, i, 0 );
     617    }
    563618
    564619    /* Must we do this? Can't remember */
     
    576631    int status = fStat[idx].status;
    577632   
    578     NSMenuItem *pauseItem = [fContextMenu itemWithTag: CONTEXT_PAUSE];
     633    NSMenuItem *pauseItem =  [fContextMenu itemWithTag: CONTEXT_PAUSE];
    579634    NSMenuItem *removeItem = [fContextMenu itemAtIndex: 1];
     635    NSMenuItem *infoItem =   [fContextMenu itemAtIndex: 2];
    580636   
    581637    [pauseItem setTarget: self];
     
    600656    }
    601657   
     658    if( [fInfoPanel isVisible] )
     659    {
     660        [infoItem setTitle: @"Hide Info"];
     661    } else {
     662        [infoItem setTitle: @"Show Info"];
     663    }
     664   
    602665    return fContextMenu;
    603666}
     
    669732        [fInfoDownloaded setStringValue: @""];
    670733        [fInfoUploaded   setStringValue: @""];
     734        [fInfoSeeders    setStringValue: @""];
     735        [fInfoLeechers   setStringValue: @""];
    671736        return;
    672737    }
     
    687752    [fInfoFolder setStringValue: [[NSString stringWithUTF8String:
    688753        tr_torrentGetFolder( fHandle, row )] lastPathComponent]];
     754       
     755    if ( fStat[row].seeders == -1 ) {
     756                [fInfoSeeders setStringValue: [NSString stringWithUTF8String: "?"]];
     757        } else {
     758                [fInfoSeeders setStringValue: [NSString stringWithFormat: @"%d",
     759                        fStat[row].seeders]];
     760        }
     761        if ( fStat[row].leechers == -1 ) {
     762                [fInfoLeechers setStringValue: [NSString stringWithUTF8String: "?"]];
     763        } else {
     764                [fInfoLeechers setStringValue: [NSString stringWithFormat: @"%d",
     765                        fStat[row].leechers]];
     766        }
    689767}
    690768
     
    806884    rectWin  = [fWindow frame];
    807885    rectView = [[fWindow contentView] frame];
    808     foo      = 68.0 + MAX( 1, tr_torrentCount( fHandle ) ) * 62.0 -
     886    foo      = 47.0 + MAX( 1, tr_torrentCount( fHandle ) ) * 62.0 -
    809887                  rectView.size.height;
    810888
     
    832910}
    833911
     912- (void) notifyGrowl: (NSString * ) file folder: (NSString *) folder
     913{
     914    [GrowlApplicationBridge
     915        notifyWithTitle: @"Download complete."
     916        description: [NSString stringWithFormat: @"Seeding: %@", file]
     917        notificationName: @"Download complete."
     918        iconData: nil
     919        priority: 0
     920        isSticky: FALSE
     921        clickContext: [NSString stringWithFormat: @"%@/%@", folder, file]];
     922}
     923
     924- (NSDictionary *)registrationDictionaryForGrowl
     925{   
     926    NSString *title        = [NSString stringWithUTF8String: "Download complete."];
     927    NSMutableArray *defNotesArray = [NSMutableArray array];
     928    NSMutableArray *allNotesArray = [NSMutableArray array];
     929
     930    [allNotesArray addObject:title];
     931    [defNotesArray addObject:[NSNumber numberWithUnsignedInt:0]];   
     932
     933    NSDictionary *regDict = [NSDictionary dictionaryWithObjectsAndKeys:
     934        @"Transmission", GROWL_APP_NAME,
     935        allNotesArray, GROWL_NOTIFICATIONS_ALL,
     936        defNotesArray, GROWL_NOTIFICATIONS_DEFAULT,
     937        nil];
     938   
     939    return regDict;
     940}
     941
     942- (NSString *) applicationNameForGrowl
     943{
     944    return [NSString stringWithUTF8String: "Transmission"];
     945}
     946
     947- (void) growlNotificationWasClicked: (id) clickContext
     948{
     949    [self revealInFinder: (NSString *) clickContext];
     950}
     951
     952- (void) revealFromMenu: (id) sender
     953{
     954    [fTableView revealInFinder: [fTableView selectedRow]];
     955}
     956
     957- (void) revealInFinder: (NSString *) path
     958{
     959    NSString * string;
     960    NSAppleScript * appleScript;
     961    NSDictionary * error;
     962   
     963    string = [NSString stringWithFormat: @"tell application "
     964        "\"Finder\"\nactivate\nreveal (POSIX file \"%@\")\nend tell",
     965        path];
     966    appleScript = [[NSAppleScript alloc] initWithSource: string];
     967    if( ![appleScript executeAndReturnError: &error] )
     968    {
     969        printf( "Reveal in Finder: AppleScript failed\n" );
     970    }
     971    [appleScript release];
     972}
     973
     974
    834975@end
  • trunk/macosx/English.lproj/MainMenu.nib/classes.nib

    r4 r6  
    1111                removeTorrentDeleteData = id;
    1212                removeTorrentDeleteFile = id;
     13                resumeAllTorrents = id;
    1314                resumeTorrent = id;
     15                revealFromMenu = id;
    1416                showInfo = id;
    1517                showMainWindow = id;
     18                stopAllTorrents = id;
    1619                stopTorrent = id;
    1720            };
     
    2427                fInfoDownloaded = NSTextField;
    2528                fInfoFolder = NSTextField;
     29                fInfoLeechers = NSTextField;
    2630                fInfoPanel = NSPanel;
    2731                fInfoPieceSize = NSTextField;
    2832                fInfoPieces = NSTextField;
     33                fInfoSeeders = NSTextField;
    2934                fInfoSize = NSTextField;
    3035                fInfoTitle = NSTextField;
     
    3439                fPrefsController = PrefsController;
    3540                fRemoveItem = NSMenuItem;
     41                fRevealItem = NSMenuItem;
    3642                fTableView = TorrentTableView;
    3743                fTotalDLField = NSTextField;
  • trunk/macosx/English.lproj/MainMenu.nib/info.nib

    r4 r6  
    44<dict>
    55        <key>IBDocumentLocation</key>
    6         <string>185 138 361 432 0 0 1280 832 </string>
     6        <string>231 62 361 432 0 0 1280 832 </string>
    77        <key>IBEditorPositions</key>
    88        <dict>
    99                <key>29</key>
    10                 <string>105 768 371 44 0 0 1280 832 </string>
     10                <string>92 769 371 44 0 0 1280 832 </string>
    1111                <key>456</key>
    12                 <string>174 512 147 87 0 0 1280 832 </string>
     12                <string>116 510 147 106 0 0 1280 832 </string>
    1313        </dict>
    1414        <key>IBFramework Version</key>
     
    1818        <key>IBOpenObjects</key>
    1919        <array>
     20                <integer>456</integer>
    2021                <integer>29</integer>
    21                 <integer>456</integer>
     22                <integer>21</integer>
     23                <integer>273</integer>
    2224        </array>
    2325        <key>IBSystem Version</key>
  • trunk/macosx/Info.plist.in

    r1 r6  
    4242        <key>NSPrincipalClass</key>
    4343        <string>NSApplication</string>
     44        <key>NSAppleScriptEnabled</key>
     45        <string>YES</string>
    4446</dict>
    4547</plist>
  • trunk/macosx/ProgressCell.h

    r2 r6  
    3636
    3737    NSBitmapImageRep * fBgBmp;
    38     NSImage          * fImg;
    3938    NSBitmapImageRep * fBmp;
    4039}
  • trunk/macosx/ProgressCell.m

    r4 r6  
    8585    fBgBmp = [[bgImg representations] objectAtIndex: 0];
    8686    size   = [bgImg size];
    87     fImg   = [[NSImage alloc] initWithSize: size];
    8887    fBmp   = [[NSBitmapImageRep alloc]
    8988        initWithBitmapDataPlanes: NULL pixelsWide: size.width
     
    9392        bytesPerRow: 0 bitsPerPixel: 0];
    9493
    95     [fImg addRepresentation: fBmp];
    96 
    9794    return self;
    9895}
     
    111108        @"UL: %.2f KB/s", fStat->rateUpload];
    112109
    113     for( i = 0; i < [fImg size].height; i++ )
     110    for( i = 0; i < [fBmp size].height; i++ )
    114111    {
    115112        memcpy( [fBmp bitmapData] + i * [fBmp bytesPerRow],
    116113                [fBgBmp bitmapData] + i * [fBgBmp bytesPerRow],
    117                 [fImg size].width * 4 );
     114                [fBmp size].width * 4 );
    118115    }
    119116
     
    141138        for( w = 0; w < 120; w++ )
    142139        {
     140            if( w >= (int) ( fStat->progress * 120 ) )
     141            {
     142                break;
     143            }
     144
    143145            if( fStat->status & TR_STATUS_SEED )
    144146            {
     
    149151                *p = kBlue2[h];
    150152            }
    151 
    152             if( w >= (int) ( fStat->progress * 120 ) )
    153             {
    154                 break;
    155             }
    156 
    157153            p++;
    158154        }
     
    182178                {
    183179                    /* First two lines: dark blue to show progression */
     180                    if( w >= (int) ( fStat->progress * 120 ) )
     181                    {
     182                        break;
     183                    }
    184184                    *p = kBlue4[h];
    185 
    186                     if( w >= (int) ( fStat->progress * 120 ) )
    187                     {
    188                         break;
    189                     }
    190185                }
    191186                else
     
    223218- (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) view
    224219{
     220    NSImage * img;
     221
    225222    if( ![view lockFocusIfCanDraw] )
    226223    {
     
    237234    pen.x += 5; pen.y += 5;
    238235
    239     pen.y += [fImg size].height;
    240     [fImg compositeToPoint: pen operation: NSCompositeSourceOver];
    241     pen.y -= [fImg size].height;
     236    img = [[NSImage alloc] initWithSize: [fBmp size]];
     237    [img addRepresentation: fBmp];
     238    [img setFlipped: YES];
     239    [img drawAtPoint: pen fromRect:
     240        NSMakeRect( 0, 0, [fBmp size].width, [fBmp size].height )
     241        operation: NSCompositeSourceOver fraction: 1.0];
     242    [img release];
    242243
    243244    [attributes setObject: [NSFont messageFontOfSize:10.0]
  • trunk/macosx/TorrentTableView.m

    r3 r6  
    107107    else if( [self pointInRevealRect: point] )
    108108    {
    109         [self revealInFinder: row];
     109        [fController revealInFinder: [NSString stringWithFormat:
     110            @"%@/%@", [NSString stringWithUTF8String: fStat[row].folder],
     111            [NSString stringWithUTF8String: fStat[row].info.name]]];
    110112        [self display];
     113    }
     114    else if( row >= 0 && col == [self columnWithIdentifier: @"Progress"]
     115             && ( [e modifierFlags] & NSAlternateKeyMask ) )
     116    {
     117        [fController advancedChanged: NULL];
    111118    }
    112119    else
  • trunk/macosx/Transmission.xcodeproj/project.pbxproj

    r3 r6  
    1919                4D752E930913C949008EAAD4 /* Preferences.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D752E920913C949008EAAD4 /* Preferences.png */; };
    2020                4D813EB508AA43AC00191DB4 /* Progress.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D813EB408AA43AC00191DB4 /* Progress.png */; };
     21                4D81E2E4092EF0CB00F24127 /* Growl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D81E2E3092EF0CB00F24127 /* Growl.framework */; };
     22                4D81E309092EF26F00F24127 /* Growl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4D81E2E3092EF0CB00F24127 /* Growl.framework */; };
    2123                4DA6FDBA0911233800450CB1 /* PauseOn.png in Resources */ = {isa = PBXBuildFile; fileRef = 4DA6FDB80911233800450CB1 /* PauseOn.png */; };
    2224                4DA6FDBB0911233800450CB1 /* PauseOff.png in Resources */ = {isa = PBXBuildFile; fileRef = 4DA6FDB90911233800450CB1 /* PauseOff.png */; };
     
    6062                };
    6163/* End PBXBuildStyle section */
     64
     65/* Begin PBXCopyFilesBuildPhase section */
     66                4D81E301092EF24500F24127 /* CopyFiles */ = {
     67                        isa = PBXCopyFilesBuildPhase;
     68                        buildActionMask = 2147483647;
     69                        dstPath = "";
     70                        dstSubfolderSpec = 10;
     71                        files = (
     72                                4D81E309092EF26F00F24127 /* Growl.framework in CopyFiles */,
     73                        );
     74                        runOnlyForDeploymentPostprocessing = 0;
     75                };
     76/* End PBXCopyFilesBuildPhase section */
    6277
    6378/* Begin PBXFileReference section */
     
    85100                4D752E920913C949008EAAD4 /* Preferences.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Preferences.png; path = Images/Preferences.png; sourceTree = "<group>"; };
    86101                4D813EB408AA43AC00191DB4 /* Progress.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Progress.png; path = Images/Progress.png; sourceTree = "<group>"; };
     102                4D81E2E3092EF0CB00F24127 /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = Frameworks/Growl.framework; sourceTree = "<group>"; };
    87103                4DA6FDB80911233800450CB1 /* PauseOn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PauseOn.png; path = Images/PauseOn.png; sourceTree = "<group>"; };
    88104                4DA6FDB90911233800450CB1 /* PauseOff.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PauseOff.png; path = Images/PauseOff.png; sourceTree = "<group>"; };
     
    107123                                4DF0C5AE08991C1600DD8943 /* libtransmission.a in Frameworks */,
    108124                                4D3EA0AA08AE13C600EA10C2 /* IOKit.framework in Frameworks */,
     125                                4D81E2E4092EF0CB00F24127 /* Growl.framework in Frameworks */,
    109126                        );
    110127                        runOnlyForDeploymentPostprocessing = 0;
     
    134151                        children = (
    135152                                1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
     153                                4D81E2E3092EF0CB00F24127 /* Growl.framework */,
    136154                        );
    137155                        name = "Linked Frameworks";
     
    221239                                8D11072C0486CEB800E47090 /* Sources */,
    222240                                8D11072E0486CEB800E47090 /* Frameworks */,
     241                                4D81E301092EF24500F24127 /* CopyFiles */,
    223242                        );
    224243                        buildRules = (
     
    331350                                        ppc,
    332351                                        i386,
     352                                );
     353                                FRAMEWORK_SEARCH_PATHS = (
     354                                        "$(FRAMEWORK_SEARCH_PATHS)",
     355                                        "$(SRCROOT)/Frameworks",
    333356                                );
    334357                                GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
Note: See TracChangeset for help on using the changeset viewer.