From cb996076147621f076e30cc34b74fb899ea56ffb Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Thu, 23 Dec 2010 20:07:41 +0000 Subject: [PATCH] #1408 display elapsed time in the Mac UI --- macosx/InfoActivityViewController.h | 3 +- macosx/InfoActivityViewController.m | 6 + macosx/Torrent.h | 3 + macosx/Torrent.m | 10 + macosx/en.lproj/InfoActivityView.xib | 556 +++++++++++++++++++++++---- macosx/en.lproj/InfoGeneralView.xib | 122 ++++-- 6 files changed, 595 insertions(+), 105 deletions(-) diff --git a/macosx/InfoActivityViewController.h b/macosx/InfoActivityViewController.h index 42f567acb..d3c0bab29 100644 --- a/macosx/InfoActivityViewController.h +++ b/macosx/InfoActivityViewController.h @@ -37,7 +37,8 @@ IBOutlet NSTextField * fDateAddedField, * fDateCompletedField, * fDateActivityField, * fStateField, * fProgressField, * fHaveField, * fDownloadedTotalField, * fUploadedTotalField, * fFailedHashField, - * fRatioField; + * fRatioField, + * fDownloadTimeField, * fSeedTimeField; IBOutlet NSTextView * fErrorMessageView; diff --git a/macosx/InfoActivityViewController.m b/macosx/InfoActivityViewController.m index eaf022b9f..3e8554c93 100644 --- a/macosx/InfoActivityViewController.m +++ b/macosx/InfoActivityViewController.m @@ -142,6 +142,9 @@ [fDateCompletedField setObjectValue: [torrent dateCompleted]]; + [fDownloadTimeField setStringValue: [NSString timeString: [torrent secondsDownloading] showSeconds: YES]]; + [fSeedTimeField setStringValue: [NSString timeString: [torrent secondsSeeding] showSeconds: YES]]; + [fPiecesView updateView]; } else if (numberSelected > 1) @@ -190,6 +193,9 @@ [fDateAddedField setStringValue: @""]; [fDateCompletedField setStringValue: @""]; + [fDownloadTimeField setStringValue: @""]; + [fSeedTimeField setStringValue: @""]; + [fPiecesControl setSelected: NO forSegment: PIECES_CONTROL_AVAILABLE]; [fPiecesControl setSelected: NO forSegment: PIECES_CONTROL_PROGRESS]; [fPiecesControl setEnabled: NO]; diff --git a/macosx/Torrent.h b/macosx/Torrent.h index 05b8f0ceb..52cc32c75 100644 --- a/macosx/Torrent.h +++ b/macosx/Torrent.h @@ -226,6 +226,9 @@ - (NSDate *) dateActivity; - (NSDate *) dateActivityOrAdd; +- (NSInteger) secondsDownloading; +- (NSInteger) secondsSeeding; + - (NSInteger) stalledMinutes; - (BOOL) isStalled; diff --git a/macosx/Torrent.m b/macosx/Torrent.m index 97b62fac1..3f03689a8 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -1509,6 +1509,16 @@ int trashDataFile(const char * filename) return date ? date : [self dateAdded]; } +- (NSInteger) secondsDownloading +{ + return fStat->secondsDownloading; +} + +- (NSInteger) secondsSeeding +{ + return fStat->secondsSeeding; +} + - (NSInteger) stalledMinutes { if (fStat->idleSecs == -1) diff --git a/macosx/en.lproj/InfoActivityView.xib b/macosx/en.lproj/InfoActivityView.xib index a1b737f3f..27dd19902 100644 --- a/macosx/en.lproj/InfoActivityView.xib +++ b/macosx/en.lproj/InfoActivityView.xib @@ -2,13 +2,13 @@ 1060 - 10D573 - 762 - 1038.29 - 460.00 + 10H574 + 823 + 1038.35 + 461.00 com.apple.InterfaceBuilder.CocoaPlugin - 762 + 823 YES @@ -19,13 +19,8 @@ com.apple.InterfaceBuilder.CocoaPlugin - YES - - YES - - - YES - + PluginDependencyRecalculationVersion + YES @@ -46,7 +41,7 @@ 268 - {{10, 192}, {74, 14}} + {{14, 252}, {74, 14}} YES @@ -82,7 +77,7 @@ 266 - {{85, 192}, {166, 14}} + {{89, 252}, {162, 14}} YES @@ -99,7 +94,7 @@ 268 - {{25, 176}, {59, 14}} + {{29, 236}, {59, 14}} YES @@ -115,7 +110,7 @@ 266 - {{85, 176}, {166, 14}} + {{89, 236}, {162, 14}} YES @@ -132,7 +127,7 @@ 268 - {{49, 144}, {35, 14}} + {{53, 204}, {35, 14}} YES @@ -148,7 +143,7 @@ 266 - {{85, 144}, {158, 14}} + {{89, 204}, {162, 14}} YES @@ -165,7 +160,7 @@ 268 - {{50, 208}, {34, 14}} + {{54, 268}, {34, 14}} YES @@ -181,7 +176,7 @@ 266 - {{85, 208}, {166, 14}} + {{89, 268}, {162, 14}} YES @@ -198,7 +193,7 @@ 268 - {{50, 240}, {34, 14}} + {{54, 300}, {34, 14}} YES @@ -214,7 +209,7 @@ 266 - {{85, 240}, {166, 14}} + {{89, 300}, {162, 14}} YES @@ -243,7 +238,7 @@ NeXT TIFF v4.0 pasteboard type - {{255, 163}, {91, 91}} + {{255, 223}, {91, 91}} YES @@ -269,7 +264,7 @@ 2322 - {252, 14} + {248, 14} @@ -287,7 +282,7 @@ - 252 + 248 1 @@ -346,7 +341,7 @@ - {{1, 1}, {252, 56}} + {{1, 1}, {248, 56}} @@ -360,7 +355,7 @@ 256 - {{253, 1}, {11, 56}} + {{249, 1}, {11, 56}} 256 @@ -379,7 +374,7 @@ 0.94565220000000005 - {{85, 83}, {265, 58}} + {{89, 143}, {261, 58}} 18 @@ -390,7 +385,7 @@ 268 - {{50, 128}, {34, 14}} + {{54, 188}, {34, 14}} YES @@ -403,21 +398,132 @@ - + 268 - {{9, 55}, {37, 17}} + {{9, 39}, {80, 17}} YES - + 67239424 272629760 - Dates + Time Elapsed LucidaGrande-Bold 11 3357 + + + + + + + + 268 + {{10, 26}, {78, 14}} + + YES + + 67239424 + 71303168 + Downloading: + + + + + + + + + 266 + {{89, 26}, {261, 14}} + + YES + + 67239488 + 272631808 + + N/A + + + + + + + + 268 + {{38, 10}, {50, 14}} + + YES + + 67239424 + 71303168 + Seeding: + + + + + + + + + 266 + {{89, 10}, {261, 14}} + + YES + + 67239488 + 272631808 + + N/A + + + + + + + + 266 + {{10, 59}, {340, 5}} + + {0, 0} + + 67239424 + 0 + Box + + LucidaGrande + 13 + 1044 + + + 6 + System + textBackgroundColor + + + + 3 + MCAwLjgwMDAwMDAxAA + + + 3 + 2 + 0 + NO + + + + 268 + {{9, 115}, {37, 17}} + + YES + + 67239424 + 272629760 + Dates + @@ -426,7 +532,7 @@ 268 - {{42, 42}, {42, 14}} + {{46, 102}, {42, 14}} YES @@ -442,7 +548,7 @@ 266 - {{85, 42}, {265, 14}} + {{89, 102}, {261, 14}} YES @@ -454,18 +560,14 @@ YES YES - dateFormat_10_0 dateStyle formatterBehavior - lenient timeStyle YES - %a %b %e, %Y %1I:%M %p - @@ -481,7 +583,7 @@ 268 - {{18, 26}, {66, 14}} + {{22, 86}, {66, 14}} YES @@ -497,7 +599,7 @@ 266 - {{85, 26}, {265, 14}} + {{89, 86}, {261, 14}} YES @@ -509,18 +611,14 @@ YES YES - dateFormat_10_0 dateStyle formatterBehavior - lenient timeStyle YES - %a %b %e, %Y %1I:%M %p - @@ -536,24 +634,15 @@ 266 - {{10, 75}, {340, 5}} + {{10, 135}, {340, 5}} {0, 0} 67239424 0 Box - - LucidaGrande - 13 - 1044 - - - 6 - System - textBackgroundColor - - + + 3 MCAwLjgwMDAwMDAxAA @@ -567,7 +656,7 @@ 268 - {{9, 253}, {53, 17}} + {{9, 313}, {53, 17}} YES @@ -583,7 +672,7 @@ 268 - {{12, 10}, {72, 14}} + {{16, 70}, {72, 14}} YES @@ -599,7 +688,7 @@ 266 - {{85, 10}, {265, 14}} + {{89, 70}, {261, 14}} YES @@ -611,18 +700,14 @@ YES YES - dateFormat_10_0 dateStyle formatterBehavior - lenient timeStyle YES - %a %b %e, %Y %1I:%M %p - @@ -638,7 +723,7 @@ 265 - {{251, 145}, {99, 15}} + {{251, 205}, {99, 15}} YES @@ -671,7 +756,7 @@ 268 - {{30, 224}, {54, 14}} + {{34, 284}, {54, 14}} YES @@ -687,7 +772,7 @@ 266 - {{85, 224}, {166, 14}} + {{89, 284}, {162, 14}} YES @@ -704,7 +789,7 @@ 268 - {{15, 160}, {69, 14}} + {{19, 220}, {69, 14}} YES @@ -720,7 +805,7 @@ 266 - {{85, 160}, {166, 14}} + {{89, 220}, {162, 14}} YES @@ -735,7 +820,7 @@ - {360, 275} + {360, 335} NSView @@ -866,13 +951,31 @@ 76 + + + fSeedTimeField + + + + 98 + + + + fDownloadTimeField + + + + 99 + YES 0 - + + YES + @@ -926,6 +1029,12 @@ + + + + + + Activity @@ -1352,6 +1461,101 @@ + + 79 + + + YES + + + 256 + {{2, 2}, {125, 1}} + + + + + + + 80 + + + YES + + + + + + 81 + + + YES + + + + + + 82 + + + YES + + + + + + 83 + + + YES + + + + + + 84 + + + YES + + + + + + 85 + + + + + 86 + + + + + 87 + + + YES + + + + + 89 + + + + + 90 + + + YES + + + + + 92 + + + @@ -1360,22 +1564,29 @@ YES -3.IBPluginDependency 10.IBPluginDependency + 10.IBViewBoundsToFrameTransform 10.ImportedFromIB2 11.IBPluginDependency 11.ImportedFromIB2 12.IBPluginDependency + 12.IBViewBoundsToFrameTransform 12.ImportedFromIB2 13.CustomClassName 13.IBPluginDependency + 13.IBViewBoundsToFrameTransform 13.ImportedFromIB2 14.IBPluginDependency + 14.IBViewBoundsToFrameTransform 14.ImportedFromIB2 15.CustomClassName 15.IBPluginDependency + 15.IBViewBoundsToFrameTransform 15.ImportedFromIB2 16.IBPluginDependency + 16.IBViewBoundsToFrameTransform 16.ImportedFromIB2 17.IBPluginDependency + 17.IBViewBoundsToFrameTransform 17.ImportedFromIB2 18.IBPluginDependency 18.ImportedFromIB2 @@ -1431,10 +1642,12 @@ 42.IBPluginDependency 43.IBPluginDependency 44.IBPluginDependency + 45.IBDateFormatterBehaviorMetadataKey 45.IBPluginDependency 45.ImportedFromIB2 46.IBPluginDependency 47.IBPluginDependency + 48.IBDateFormatterBehaviorMetadataKey 48.IBPluginDependency 48.ImportedFromIB2 49.IBPluginDependency @@ -1444,6 +1657,7 @@ 50.IBPluginDependency 51.IBPluginDependency 52.IBPluginDependency + 53.IBDateFormatterBehaviorMetadataKey 53.IBPluginDependency 53.ImportedFromIB2 54.IBPluginDependency @@ -1462,39 +1676,88 @@ 61.ImportedFromIB2 7.IBPluginDependency 7.ImportedFromIB2 + 79.IBPluginDependency + 79.IBViewBoundsToFrameTransform + 79.ImportedFromIB2 8.IBPluginDependency 8.ImportedFromIB2 + 80.CustomClassName + 80.IBPluginDependency + 80.IBViewBoundsToFrameTransform + 80.ImportedFromIB2 + 81.IBPluginDependency + 81.IBViewBoundsToFrameTransform + 81.ImportedFromIB2 + 82.CustomClassName + 82.IBPluginDependency + 82.IBViewBoundsToFrameTransform + 82.ImportedFromIB2 + 83.IBPluginDependency + 83.IBViewBoundsToFrameTransform + 83.ImportedFromIB2 + 84.IBPluginDependency + 84.IBViewBoundsToFrameTransform + 84.ImportedFromIB2 + 85.IBPluginDependency + 86.IBPluginDependency + 87.IBPluginDependency + 89.IBPluginDependency 9.CustomClassName 9.IBPluginDependency + 9.IBViewBoundsToFrameTransform 9.ImportedFromIB2 + 90.IBPluginDependency + 92.IBPluginDependency + 92.ImportedFromIB2 YES com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBQAAAwsIAAA + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + AUEgAABDFgAAA + InfoTextField com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCqgAAwuIAAA + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBkAAAwuIAAA + InfoTextField com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCqgAAwwEAAA + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCKAAAwwEAAA + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBEAAAwxEAAA + com.apple.InterfaceBuilder.CocoaPlugin PiecesView com.apple.InterfaceBuilder.CocoaPlugin - {{446, 701}, {360, 275}} + {{489, 460}, {360, 335}} com.apple.InterfaceBuilder.CocoaPlugin {{274, 636}, {360, 290}} @@ -1543,13 +1806,21 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1557,27 +1828,64 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + InfoTextField com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + AUFwAABDEQAAA + + com.apple.InterfaceBuilder.CocoaPlugin InfoTextField com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCtAAAwtgAAA + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBuAAAwtgAAA + + InfoTextField com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCtAAAwvgAAA + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCPAAAwvgAAA + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBYAAAwwwAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin InfoTextField com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCqgAAwsIAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin @@ -1597,7 +1905,7 @@ - 76 + 99 @@ -1609,6 +1917,13 @@ setPiecesView: id + + setPiecesView: + + setPiecesView: + id + + YES @@ -1616,6 +1931,7 @@ fDateActivityField fDateAddedField fDateCompletedField + fDownloadTimeField fDownloadedTotalField fErrorMessageView fFailedHashField @@ -1624,6 +1940,7 @@ fPiecesView fProgressField fRatioField + fSeedTimeField fStateField fUploadedTotalField @@ -1633,6 +1950,7 @@ NSTextField NSTextField NSTextField + NSTextField NSTextView NSTextField NSTextField @@ -1642,6 +1960,91 @@ NSTextField NSTextField NSTextField + NSTextField + + + + YES + + YES + fDateActivityField + fDateAddedField + fDateCompletedField + fDownloadTimeField + fDownloadedTotalField + fErrorMessageView + fFailedHashField + fHaveField + fPiecesControl + fPiecesView + fProgressField + fRatioField + fSeedTimeField + fStateField + fUploadedTotalField + + + YES + + fDateActivityField + NSTextField + + + fDateAddedField + NSTextField + + + fDateCompletedField + NSTextField + + + fDownloadTimeField + NSTextField + + + fDownloadedTotalField + NSTextField + + + fErrorMessageView + NSTextView + + + fFailedHashField + NSTextField + + + fHaveField + NSTextField + + + fPiecesControl + NSSegmentedControl + + + fPiecesView + PiecesView + + + fProgressField + NSTextField + + + fRatioField + NSTextField + + + fSeedTimeField + NSTextField + + + fStateField + NSTextField + + + fUploadedTotalField + NSTextField + @@ -2251,6 +2654,13 @@ view NSView + + view + + view + NSView + + IBFrameworkSource AppKit.framework/Headers/NSViewController.h diff --git a/macosx/en.lproj/InfoGeneralView.xib b/macosx/en.lproj/InfoGeneralView.xib index 42f1cfe18..c091e7f85 100644 --- a/macosx/en.lproj/InfoGeneralView.xib +++ b/macosx/en.lproj/InfoGeneralView.xib @@ -2,13 +2,13 @@ 1060 - 10D573 - 762 - 1038.29 - 460.00 + 10H574 + 823 + 1038.35 + 461.00 com.apple.InterfaceBuilder.CocoaPlugin - 762 + 823 YES @@ -19,13 +19,8 @@ com.apple.InterfaceBuilder.CocoaPlugin - YES - - YES - - - YES - + PluginDependencyRecalculationVersion + YES @@ -46,7 +41,7 @@ 268 - {{37, 175}, {41, 14}} + {{37, 176}, {41, 14}} YES @@ -82,7 +77,7 @@ 266 - {{79, 175}, {261, 14}} + {{79, 176}, {261, 14}} YES @@ -133,7 +128,7 @@ 268 - {{9, 188}, {118, 17}} + {{9, 189}, {118, 17}} YES @@ -153,7 +148,7 @@ 268 - {{35, 143}, {43, 14}} + {{35, 144}, {43, 14}} YES @@ -169,7 +164,7 @@ 266 - {{79, 143}, {261, 14}} + {{79, 144}, {261, 14}} YES @@ -202,7 +197,7 @@ 266 - {{79, 10}, {242, 14}} + {{79, 11}, {242, 14}} YES @@ -235,7 +230,7 @@ 265 - {{326, 10}, {14, 14}} + {{326, 11}, {14, 14}} YES @@ -267,7 +262,7 @@ 268 - {{30, 127}, {48, 14}} + {{30, 128}, {48, 14}} YES @@ -283,7 +278,7 @@ 266 - {{79, 127}, {261, 14}} + {{79, 128}, {261, 14}} YES @@ -300,7 +295,7 @@ 268 - {{10, 111}, {68, 14}} + {{10, 112}, {68, 14}} YES @@ -316,7 +311,7 @@ 266 - {{79, 111}, {261, 14}} + {{79, 112}, {261, 14}} YES @@ -351,7 +346,7 @@ 268 - {{18, 95}, {60, 14}} + {{18, 96}, {60, 14}} YES @@ -367,7 +362,7 @@ 268 - {{43, 159}, {35, 14}} + {{43, 160}, {35, 14}} YES @@ -383,7 +378,7 @@ 266 - {{79, 159}, {261, 14}} + {{79, 160}, {261, 14}} YES @@ -517,7 +512,7 @@ 0.94565220000000005 - {{79, 50}, {261, 58}} + {{79, 51}, {261, 58}} 18 @@ -526,7 +521,7 @@ - {350, 210} + {350, 211} NSView @@ -623,7 +618,9 @@ YES 0 - + + YES + @@ -1058,7 +1055,7 @@ InfoTextField com.apple.InterfaceBuilder.CocoaPlugin - {{389, 674}, {350, 210}} + {{389, 673}, {350, 211}} com.apple.InterfaceBuilder.CocoaPlugin {{519, 533}, {350, 268}} @@ -1137,6 +1134,13 @@ revealDataFile: id + + revealDataFile: + + revealDataFile: + id + + YES @@ -1162,6 +1166,55 @@ NSTextField + + YES + + YES + fCommentView + fCreatorField + fDataLocationField + fDateCreatedField + fHashField + fPiecesField + fRevealDataButton + fSecureField + + + YES + + fCommentView + NSTextView + + + fCreatorField + NSTextField + + + fDataLocationField + NSTextField + + + fDateCreatedField + NSTextField + + + fHashField + NSTextField + + + fPiecesField + NSTextField + + + fRevealDataButton + NSButton + + + fSecureField + NSTextField + + + IBProjectSource macosx/InfoGeneralViewController.h @@ -1745,6 +1798,13 @@ view NSView + + view + + view + NSView + + IBFrameworkSource AppKit.framework/Headers/NSViewController.h @@ -1775,7 +1835,7 @@ YES {14, 14} - {14.1732, 14.1732} + {14, 14} -- 2.40.0