From e94e13d918023d6479479956d91ac6eebf2e73b5 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Fri, 20 Oct 2006 15:01:18 +0000 Subject: [PATCH] flash individual pieces red when they complete --- Transmission.xcodeproj/project.pbxproj | 2 +- macosx/PiecesView.m | 37 +++++++++++--------------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/Transmission.xcodeproj/project.pbxproj b/Transmission.xcodeproj/project.pbxproj index 3c87496de..b66e35fcd 100644 --- a/Transmission.xcodeproj/project.pbxproj +++ b/Transmission.xcodeproj/project.pbxproj @@ -286,7 +286,7 @@ 4DAB87C40ABE1F730081CF7E /* http.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = http.c; path = libtransmission/http.c; sourceTree = ""; }; 4DCCBB3C09C3D71100D3CABF /* TorrentCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = TorrentCell.m; path = macosx/TorrentCell.m; sourceTree = ""; }; 4DCCBB3D09C3D71100D3CABF /* TorrentCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = TorrentCell.h; path = macosx/TorrentCell.h; sourceTree = ""; }; - 4DDBB71909E16BAE00284745 /* transmissioncli */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = transmissioncli; sourceTree = BUILT_PRODUCTS_DIR; }; + 4DDBB71909E16BAE00284745 /* transmissioncli */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = transmissioncli; sourceTree = BUILT_PRODUCTS_DIR; }; 4DDBB71B09E16BF100284745 /* transmissioncli.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = transmissioncli.c; path = cli/transmissioncli.c; sourceTree = ""; }; 4DDFDD20099A5D8E00189D81 /* DownloadBadge.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = DownloadBadge.png; path = macosx/Images/DownloadBadge.png; sourceTree = ""; }; 4DDFDD21099A5D8E00189D81 /* UploadBadge.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = UploadBadge.png; path = macosx/Images/UploadBadge.png; sourceTree = ""; }; diff --git a/macosx/PiecesView.m b/macosx/PiecesView.m index 68bc989c0..40da0fd1c 100644 --- a/macosx/PiecesView.m +++ b/macosx/PiecesView.m @@ -292,18 +292,21 @@ else { piecePercent = piecesPercent[index]; - /*if (i==0) - pieceImage = fBlue1Piece; - else if (i==1) - pieceImage = fBlue2Piece; - else if (i==2) - pieceImage = fBlue3Piece; - else if (i==3) - pieceImage = fBlue4Piece; - else if (i==4) - pieceImage = fBluePiece; - - else */if (piecePercent <= 0.0) + if (piecePercent >= 1.0) + { + if (first || fPieces[index] == -2) + { + fPieces[index] = -1; + pieceImage = fBluePiece; + } + else if (fPieces[index] != -1) + { + fPieces[index] = -2; + pieceImage = fRedPiece; + } + else; + } + else if (piecePercent <= 0.0) { if (first || fPieces[index] != 0) { @@ -335,7 +338,7 @@ pieceImage = fBlue3Piece; } } - else if (piecePercent < 1.0) + else { if (first || fPieces[index] != 4) { @@ -343,14 +346,6 @@ pieceImage = fBlue4Piece; } } - else - { - if (first || fPieces[index] != 5) - { - fPieces[index] = 5; - pieceImage = fBluePiece; - } - } } if (pieceImage)