diff --git a/macosx/English.lproj/InfoWindow.nib/keyedobjects.nib b/macosx/English.lproj/InfoWindow.nib/keyedobjects.nib index 90ab09c23..3bae7cc68 100644 Binary files a/macosx/English.lproj/InfoWindow.nib/keyedobjects.nib and b/macosx/English.lproj/InfoWindow.nib/keyedobjects.nib differ diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index 377fd9a8c..c8e2c5025 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -788,28 +788,6 @@ typedef enum NSNumber * rate; return (rate = [peer objectForKey: @"DL From Rate"]) ? [NSString stringForSpeedAbbrev: [rate floatValue]] : @""; } - else if ([ident isEqualToString: @"Status"]) - { - switch ([[peer objectForKey: @"Status"] intValue]) - { - case TR_PEER_STATUS_HANDSHAKE: - return NSLocalizedString(@"Handshaking", "peer -> status"); - case TR_PEER_STATUS_PEER_IS_CHOKED: - return NSLocalizedString(@"Peer is Choked", "peer -> status"); - case TR_PEER_STATUS_CLIENT_IS_CHOKED: - return NSLocalizedString(@"Choked", "peer -> status"); - case TR_PEER_STATUS_CLIENT_IS_INTERESTED: - return NSLocalizedString(@"Choked & Interested", "peer -> status"); - case TR_PEER_STATUS_READY: - return NSLocalizedString(@"Ready", "peer -> status"); - case TR_PEER_STATUS_REQUEST_SENT: - return NSLocalizedString(@"Request Sent", "peer -> status"); - case TR_PEER_STATUS_ACTIVE: - return NSLocalizedString(@"Active", "peer -> status"); - case TR_PEER_STATUS_ACTIVE_AND_CHOKED: - return NSLocalizedString(@"Active & Interested", "peer -> status"); - } - } else return [peer objectForKey: @"IP"]; } @@ -841,7 +819,7 @@ typedef enum if (tableView == fPeerTable) { NSDictionary * peer = [fPeers objectAtIndex: row]; - NSMutableArray * components = [NSMutableArray arrayWithCapacity: 4]; + NSMutableArray * components = [NSMutableArray arrayWithCapacity: 5]; [components addObject: [NSString stringWithFormat: NSLocalizedString(@"Progress: %.1f%%", "Inspector -> Peers tab -> table row tooltip"), [[peer objectForKey: @"Progress"] floatValue] * 100.0]]; @@ -872,6 +850,34 @@ typedef enum break; } + switch ([[peer objectForKey: @"Status"] intValue]) + { + case TR_PEER_STATUS_HANDSHAKE: + [components addObject: NSLocalizedString(@"Handshaking", "peer -> status")]; + break; + case TR_PEER_STATUS_PEER_IS_CHOKED: + [components addObject: NSLocalizedString(@"Peer is Choked", "peer -> status")]; + break; + case TR_PEER_STATUS_CLIENT_IS_CHOKED: + [components addObject: NSLocalizedString(@"Choked", "peer -> status")]; + break; + case TR_PEER_STATUS_CLIENT_IS_INTERESTED: + [components addObject: NSLocalizedString(@"Choked & Interested", "peer -> status")]; + break; + case TR_PEER_STATUS_READY: + [components addObject: NSLocalizedString(@"Ready", "peer -> status")]; + break; + case TR_PEER_STATUS_REQUEST_SENT: + [components addObject: NSLocalizedString(@"Request Sent", "peer -> status")]; + break; + case TR_PEER_STATUS_ACTIVE: + [components addObject: NSLocalizedString(@"Active", "peer -> status")]; + break; + case TR_PEER_STATUS_ACTIVE_AND_CHOKED: + [components addObject: NSLocalizedString(@"Active & Interested", "peer -> status")]; + break; + } + return [components componentsJoinedByString: @"\n"]; } return nil; diff --git a/macosx/PrefsWindow.m b/macosx/PrefsWindow.m index 4f8647436..aa3035116 100644 --- a/macosx/PrefsWindow.m +++ b/macosx/PrefsWindow.m @@ -24,6 +24,8 @@ #import "PrefsWindow.h" +#warning elliminate this class + @implementation PrefsWindow - (void) keyDown: (NSEvent *) event diff --git a/macosx/StatsWindowController.m b/macosx/StatsWindowController.m index 0e1ab816d..b078247a5 100644 --- a/macosx/StatsWindowController.m +++ b/macosx/StatsWindowController.m @@ -69,23 +69,26 @@ tr_handle * fLib; fStatsWindowInstance = nil; } +#warning make like pref window panel + @end @implementation StatsWindowController (Private) - (void) updateStats { - tr_session_stats stats; - tr_getCumulativeSessionStats(fLib, &stats); + tr_session_stats statsAll, statsSession; + tr_getCumulativeSessionStats(fLib, &statsAll); + tr_getSessionStats(fLib, &statsSession); - [fUploadedField setStringValue: [NSString stringForLargeFileSizeGigs: stats.uploadedGigs bytes: stats.uploadedBytes]]; - [fDownloadedField setStringValue: [NSString stringForLargeFileSizeGigs: stats.downloadedGigs bytes: stats.downloadedBytes]]; - [fRatioField setStringValue: [NSString stringForRatio: stats.ratio]]; + [fUploadedField setStringValue: [NSString stringForLargeFileSizeGigs: statsAll.uploadedGigs bytes: statsAll.uploadedBytes]]; + [fDownloadedField setStringValue: [NSString stringForLargeFileSizeGigs: statsAll.downloadedGigs bytes: statsAll.downloadedBytes]]; + [fRatioField setStringValue: [NSString stringForRatio: statsAll.ratio]]; - [fTimeField setStringValue: [self timeString: stats.secondsActive]]; + [fTimeField setStringValue: [self timeString: statsAll.secondsActive]]; [fNumOpenedField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d Times", "stats window -> times opened"), - stats.sessionCount]]; + statsAll.sessionCount]]; } - (NSString *) timeString: (uint64_t) seconds