Changeset 6979
- Timestamp:
- Oct 29, 2008, 1:18:03 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEWS
r6976 r6979 15 15 + In the file inspector tab, show progress and size for folders 16 16 + Scrollbars correctly appear when the main window auto-resizes 17 + Sparkle updated to 1.5 17 + Sparkle updated to 1.5b6 18 18 - GTK+ 19 19 + Option to automatically update the blocklist weekly -
trunk/macosx/Torrent.m
r6958 r6979 389 389 if ((stopRatio = [self actualStopRatio]) == INVALID || (ratio = [self ratio]) >= stopRatio) 390 390 return 1.0; 391 else if (stopRatio > 0 )391 else if (stopRatio > 0.0) 392 392 return ratio / stopRatio; 393 393 else 394 return 0 ;394 return 0.0; 395 395 } 396 396 -
trunk/macosx/TorrentTableView.h
r6134 r6979 43 43 IBOutlet NSMenu * fContextRow, * fContextNoRow; 44 44 45 intfMouseControlRow, fMouseRevealRow, fMouseActionRow, fActionPushedRow;45 NSInteger fMouseControlRow, fMouseRevealRow, fMouseActionRow, fActionPushedRow; 46 46 NSArray * fSelectedValues; 47 47 … … 49 49 Torrent * fMenuTorrent; 50 50 51 float fPiecesBarPercent;51 CGFloat fPiecesBarPercent; 52 52 NSAnimation * fPiecesBarAnimation; 53 53 } 54 54 55 - (BOOL) isGroupCollapsed: ( int) value;56 - (void) removeCollapsedGroup: ( int) value;55 - (BOOL) isGroupCollapsed: (NSInteger) value; 56 - (void) removeCollapsedGroup: (NSInteger) value; 57 57 - (void) removeAllCollapsedGroups; 58 58 - (void) saveCollapsedGroups; 59 59 60 60 - (void) removeButtonTrackingAreas; 61 - (void) setControlButtonHover: ( int) row;62 - (void) setRevealButtonHover: ( int) row;63 - (void) setActionButtonHover: ( int) row;61 - (void) setControlButtonHover: (NSInteger) row; 62 - (void) setRevealButtonHover: (NSInteger) row; 63 - (void) setActionButtonHover: (NSInteger) row; 64 64 65 65 - (void) selectValues: (NSArray *) values; … … 67 67 - (NSArray *) selectedTorrents; 68 68 69 - (NSRect) iconRectForRow: ( int) row;69 - (NSRect) iconRectForRow: (NSInteger) row; 70 70 71 71 - (void) paste: (id) sender; … … 85 85 86 86 - (void) togglePiecesBar; 87 - ( float) piecesBarPercent;87 - (CGFloat) piecesBarPercent; 88 88 89 89 @end -
trunk/macosx/TorrentTableView.m
r6889 r6979 37 37 #define ACTION_MENU_LIMIT_TAG 103 38 38 39 #define GROUP_SPEED_IMAGE_COLUMN_WIDTH 8.0 40 #define GROUP_RATIO_IMAGE_COLUMN_WIDTH 10.0 39 #define GROUP_SPEED_IMAGE_COLUMN_WIDTH 8.0f 40 #define GROUP_RATIO_IMAGE_COLUMN_WIDTH 10.0f 41 41 42 42 #define TOGGLE_PROGRESS_SECONDS 0.175 … … 97 97 [self setDelegate: self]; 98 98 99 fPiecesBarPercent = [fDefaults boolForKey: @"PiecesBar"] ? 1.0 : 0.0;99 fPiecesBarPercent = [fDefaults boolForKey: @"PiecesBar"] ? 1.0f : 0.0f; 100 100 } 101 101 … … 123 123 } 124 124 125 - (BOOL) isGroupCollapsed: ( int) value125 - (BOOL) isGroupCollapsed: (NSInteger) value 126 126 { 127 127 if (value == -1) … … 131 131 } 132 132 133 - (void) removeCollapsedGroup: ( int) value133 - (void) removeCollapsedGroup: (NSInteger) value 134 134 { 135 135 if (value == -1) … … 175 175 [cell setRepresentedObject: item]; 176 176 177 introw = [self rowForItem: item];177 NSInteger row = [self rowForItem: item]; 178 178 if ([NSApp isOnLeopardOrBetter]) 179 179 { … … 212 212 //adjust placement for proper vertical alignment 213 213 if (column == [self columnWithIdentifier: @"Group"]) 214 rect.size.height -= 1.0 ;214 rect.size.height -= 1.0f; 215 215 216 216 return rect; … … 235 235 else if (ident) 236 236 { 237 intcount = [[item torrents] count];237 NSInteger count = [[item torrents] count]; 238 238 if (count == 1) 239 239 return NSLocalizedString(@"1 transfer", "Torrent table -> group row -> tooltip"); … … 284 284 } 285 285 286 - (void) setControlButtonHover: ( int) row286 - (void) setControlButtonHover: (NSInteger) row 287 287 { 288 288 fMouseControlRow = row; … … 291 291 } 292 292 293 - (void) setRevealButtonHover: ( int) row293 - (void) setRevealButtonHover: (NSInteger) row 294 294 { 295 295 fMouseRevealRow = row; … … 298 298 } 299 299 300 - (void) setActionButtonHover: ( int) row300 - (void) setActionButtonHover: (NSInteger) row 301 301 { 302 302 fMouseActionRow = row; … … 313 313 if ((row = [dict objectForKey: @"Row"])) 314 314 { 315 introwVal = [row intValue];315 NSInteger rowVal = [row intValue]; 316 316 NSString * type = [dict objectForKey: @"Type"]; 317 317 if ([type isEqualToString: @"Action"]) … … 353 353 - (void) outlineViewItemDidExpand: (NSNotification *) notification 354 354 { 355 intvalue = [[[notification userInfo] objectForKey: @"NSObject"] groupIndex];355 NSInteger value = [[[notification userInfo] objectForKey: @"NSObject"] groupIndex]; 356 356 if (value < 0) 357 357 value = MAX_GROUP; … … 366 366 - (void) outlineViewItemDidCollapse: (NSNotification *) notification 367 367 { 368 intvalue = [[[notification userInfo] objectForKey: @"NSObject"] groupIndex];368 NSInteger value = [[[notification userInfo] objectForKey: @"NSObject"] groupIndex]; 369 369 if (value < 0) 370 370 value = MAX_GROUP; … … 401 401 if ([self pointInActionRect: point]) 402 402 { 403 introw = [self rowAtPoint: point];403 NSInteger row = [self rowAtPoint: point]; 404 404 405 405 fActionPushedRow = row; … … 414 414 { 415 415 id item = nil; 416 introw = [self rowAtPoint: point];416 NSInteger row = [self rowAtPoint: point]; 417 417 if (row != -1) 418 418 item = [self itemAtRow: row]; … … 447 447 else 448 448 { 449 intgroup = [item groupIndex];449 NSInteger group = [item groupIndex]; 450 450 for (NSInteger i = 0; i < [self numberOfRows]; i++) 451 451 { … … 500 500 - (NSMenu *) menuForEvent: (NSEvent *) event 501 501 { 502 introw = [self rowAtPoint: [self convertPoint: [event locationInWindow] fromView: nil]];502 NSInteger row = [self rowAtPoint: [self convertPoint: [event locationInWindow] fromView: nil]]; 503 503 if (row >= 0) 504 504 { … … 543 543 } 544 544 545 - (NSRect) iconRectForRow: ( int) row545 - (NSRect) iconRectForRow: (NSInteger) row 546 546 { 547 547 return [fTorrentCell iconRectForBounds: [self rectOfRow: row]]; … … 582 582 - (void) displayTorrentMenuForEvent: (NSEvent *) event 583 583 { 584 introw = [self rowAtPoint: [self convertPoint: [event locationInWindow] fromView: nil]];584 NSInteger row = [self rowAtPoint: [self convertPoint: [event locationInWindow] fromView: nil]]; 585 585 if (row < 0) 586 586 return; … … 595 595 NSRect rect = [fTorrentCell iconRectForBounds: [self rectOfRow: row]]; 596 596 NSPoint location = rect.origin; 597 location.y += rect.size.height + 5.0 ;597 location.y += rect.size.height + 5.0f; 598 598 location = [self convertPoint: location toView: nil]; 599 599 … … 622 622 if ([menu numberOfItems] == 4) 623 623 { 624 const intspeedLimitActionValue[] = { 0, 5, 10, 20, 30, 40, 50, 75, 100, 150, 200, 250, 500, 750, -1 };624 const NSInteger speedLimitActionValue[] = { 0, 5, 10, 20, 30, 40, 50, 75, 100, 150, 200, 250, 500, 750, -1 }; 625 625 626 626 for (NSInteger i = 0; speedLimitActionValue[i] != -1; i++) … … 637 637 638 638 BOOL upload = menu == fUploadMenu; 639 intmode = [fMenuTorrent speedMode: upload];639 NSInteger mode = [fMenuTorrent speedMode: upload]; 640 640 641 641 item = [menu itemWithTag: ACTION_MENU_LIMIT_TAG]; … … 655 655 if ([menu numberOfItems] == 4) 656 656 { 657 const float ratioLimitActionValue[] = { 0.25, 0.5, 0.75, 1.0, 1.5, 2.0, 3.0, -1.0};657 const CGFloat ratioLimitActionValue[] = { 0.25f, 0.5f, 0.75f, 1.0f, 1.5f, 2.0f, 3.0f, -1.0f }; 658 658 659 for (NSInteger i = 0; ratioLimitActionValue[i] != -1.0 ; i++)659 for (NSInteger i = 0; ratioLimitActionValue[i] != -1.0f; i++) 660 660 { 661 661 item = [[NSMenuItem alloc] initWithTitle: [NSString localizedStringWithFormat: @"%.2f", ratioLimitActionValue[i]] … … 668 668 } 669 669 670 intmode = [fMenuTorrent ratioSetting];670 NSInteger mode = [fMenuTorrent ratioSetting]; 671 671 672 672 item = [menu itemWithTag: ACTION_MENU_LIMIT_TAG]; … … 735 735 } 736 736 737 float newY = NSMaxY([self rectOfRow: i-1]);737 CGFloat newY = NSMaxY([self rectOfRow: i-1]); 738 738 visibleRect.size.height -= newY - visibleRect.origin.y; 739 739 visibleRect.origin.y = newY; … … 741 741 742 742 //remaining visible rows continue alternating 743 float height = [self rowHeight] + [self intercellSpacing].height;744 intnumberOfRects = ceil(visibleRect.size.height / height);743 CGFloat height = [self rowHeight] + [self intercellSpacing].height; 744 NSInteger numberOfRects = ceil(visibleRect.size.height / height); 745 745 visibleRect.size.height = height; 746 746 … … 759 759 - (void) setQuickLimitMode: (id) sender 760 760 { 761 intmode;761 NSInteger mode; 762 762 switch ([sender tag]) 763 763 { … … 791 791 - (void) setQuickRatioMode: (id) sender 792 792 { 793 intmode;793 NSInteger mode; 794 794 switch ([sender tag]) 795 795 { … … 840 840 841 841 NSMutableArray * progressMarks = [NSMutableArray arrayWithCapacity: 16]; 842 for (NSAnimationProgress i = 0.0625 ; i <= 1.0; i += 0.0625)842 for (NSAnimationProgress i = 0.0625f; i <= 1.0f; i += 0.0625f) 843 843 [progressMarks addObject: [NSNumber numberWithFloat: i]]; 844 844 … … 867 867 fPiecesBarPercent = progress; 868 868 else 869 fPiecesBarPercent = 1.0 - progress;869 fPiecesBarPercent = 1.0f - progress; 870 870 871 871 [self reloadData]; … … 873 873 } 874 874 875 - ( float) piecesBarPercent875 - (CGFloat) piecesBarPercent 876 876 { 877 877 return fPiecesBarPercent; … … 884 884 - (BOOL) pointInControlRect: (NSPoint) point 885 885 { 886 introw = [self rowAtPoint: point];886 NSInteger row = [self rowAtPoint: point]; 887 887 if (row < 0 || ![[self itemAtRow: row] isKindOfClass: [Torrent class]]) 888 888 return NO; … … 893 893 - (BOOL) pointInRevealRect: (NSPoint) point 894 894 { 895 introw = [self rowAtPoint: point];895 NSInteger row = [self rowAtPoint: point]; 896 896 if (row < 0 || ![[self itemAtRow: row] isKindOfClass: [Torrent class]]) 897 897 return NO; … … 902 902 - (BOOL) pointInActionRect: (NSPoint) point 903 903 { 904 introw = [self rowAtPoint: point];904 NSInteger row = [self rowAtPoint: point]; 905 905 if (row < 0 || ![[self itemAtRow: row] isKindOfClass: [Torrent class]]) 906 906 return NO; … … 911 911 - (BOOL) pointInGroupStatusRect: (NSPoint) point 912 912 { 913 introw = [self rowAtPoint: point];913 NSInteger row = [self rowAtPoint: point]; 914 914 if (row < 0 || [[self itemAtRow: row] isKindOfClass: [Torrent class]]) 915 915 return NO; … … 929 929 //change size of image column 930 930 NSTableColumn * ulImageTableColumn = [self tableColumnWithIdentifier: @"UL Image"]; 931 float oldWidth = [ulImageTableColumn width], newWidth = ratio ? GROUP_RATIO_IMAGE_COLUMN_WIDTH : GROUP_SPEED_IMAGE_COLUMN_WIDTH;931 CGFloat oldWidth = [ulImageTableColumn width], newWidth = ratio ? GROUP_RATIO_IMAGE_COLUMN_WIDTH : GROUP_SPEED_IMAGE_COLUMN_WIDTH; 932 932 if (oldWidth != newWidth) 933 933 {
Note: See TracChangeset
for help on using the changeset viewer.