diff --git a/macosx/English.lproj/MessageWindow.nib/classes.nib b/macosx/English.lproj/MessageWindow.nib/classes.nib index 4520368a8..488c2b01a 100644 --- a/macosx/English.lproj/MessageWindow.nib/classes.nib +++ b/macosx/English.lproj/MessageWindow.nib/classes.nib @@ -1,18 +1,69 @@ -{ - IBClasses = ( - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - ACTIONS = {changeLevel = id; clearLog = id; writeToFile = id; }; - CLASS = MessageWindowController; - LANGUAGE = ObjC; - OUTLETS = { - fDebugWarningField = NSTextField; - fDebugWarningIcon = NSImageView; - fLevelButton = NSPopUpButton; - fMessageTable = NSTableView; - }; - SUPERCLASS = NSWindowController; - } - ); - IBVersion = 1; -} \ No newline at end of file + + + + + IBClasses + + + CLASS + NSApplication + LANGUAGE + ObjC + SUPERCLASS + NSResponder + + + CLASS + NSMenu + LANGUAGE + ObjC + SUPERCLASS + NSObject + + + CLASS + FirstResponder + LANGUAGE + ObjC + SUPERCLASS + NSObject + + + CLASS + NSObject + LANGUAGE + ObjC + + + ACTIONS + + changeLevel + id + clearLog + id + writeToFile + id + + CLASS + MessageWindowController + LANGUAGE + ObjC + OUTLETS + + fDebugWarningField + NSTextField + fDebugWarningIcon + NSImageView + fLevelButton + NSPopUpButton + fMessageTable + NSTableView + + SUPERCLASS + NSWindowController + + + IBVersion + 1 + + diff --git a/macosx/English.lproj/MessageWindow.nib/info.nib b/macosx/English.lproj/MessageWindow.nib/info.nib index 7685cb6e7..12d1e176f 100644 --- a/macosx/English.lproj/MessageWindow.nib/info.nib +++ b/macosx/English.lproj/MessageWindow.nib/info.nib @@ -1,16 +1,20 @@ - + - IBDocumentLocation - 42 94 356 240 0 0 1680 1028 IBFramework Version - 446.1 + 629 + IBLastKnownRelativeProjectPath + ../../../Transmission.xcodeproj + IBOldestOS + 5 IBOpenObjects 5 IBSystem Version - 8R4031 + 9A581 + targetFramework + IBCocoaFramework diff --git a/macosx/English.lproj/MessageWindow.nib/keyedobjects.nib b/macosx/English.lproj/MessageWindow.nib/keyedobjects.nib index 93564910c..fd15bf9ad 100644 Binary files a/macosx/English.lproj/MessageWindow.nib/keyedobjects.nib and b/macosx/English.lproj/MessageWindow.nib/keyedobjects.nib differ diff --git a/macosx/MessageWindowController.h b/macosx/MessageWindowController.h index 43dbce391..8dcd15755 100644 --- a/macosx/MessageWindowController.h +++ b/macosx/MessageWindowController.h @@ -32,6 +32,8 @@ NSMutableArray * fMessages; + NSDictionary * fAttributes; + NSTimer * fTimer; NSImage * fErrorImage, * fInfoImage, * fDebugImage; diff --git a/macosx/MessageWindowController.m b/macosx/MessageWindowController.m index d3199b97d..b83c659a5 100644 --- a/macosx/MessageWindowController.m +++ b/macosx/MessageWindowController.m @@ -34,6 +34,7 @@ @interface MessageWindowController (Private) +- (void) resizeColumn; - (NSString *) stringForMessage: (NSDictionary *) message; - (void) setDebugWarningHidden: (BOOL) hide; @@ -61,6 +62,8 @@ [fTimer invalidate]; [fMessages release]; + [fAttributes release]; + [super dealloc]; } @@ -70,6 +73,9 @@ [window setFrameAutosaveName: @"MessageWindowFrame"]; [window setFrameUsingName: @"MessageWindowFrame"]; + [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(resizeColumn) + name: @"NSTableViewColumnDidResizeNotification" object: fMessageTable]; + //initially sort peer table by IP if ([[fMessageTable sortDescriptors] count] == 0) { @@ -128,6 +134,8 @@ [descriptors release]; [fMessages removeObjectsInRange: NSMakeRange(0, total-MAX_MESSAGES)]; + + [fMessageTable noteHeightOfRowsWithIndexesChanged: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, MAX_MESSAGES)]]; } [fMessages sortUsingDescriptors: [fMessageTable sortDescriptors]]; @@ -165,6 +173,26 @@ return [message objectForKey: @"Message"]; } +- (float) tableView: (NSTableView *) tableView heightOfRow: (int) row +{ + NSTableColumn * column = [tableView tableColumnWithIdentifier: @"Message"]; + + int count = 0; + float width = [column width]; + if (width > 0) + { + if (!fAttributes) + fAttributes = [[[[column dataCell] attributedStringValue] attributesAtIndex: 0 effectiveRange: NULL] retain]; + + NSAttributedString * string = [[NSAttributedString alloc] initWithString: [[fMessages objectAtIndex: row] + objectForKey: @"Message"] attributes: fAttributes]; + count = [string size].width / width; + [string release]; + } + + return [tableView rowHeight] * (float)(count+1); +} + - (NSString *) tableView: (NSTableView *) tableView toolTipForCell: (NSCell *) cell rect: (NSRectPointer) rect tableColumn: (NSTableColumn *) column row: (int) row mouseLocation: (NSPoint) mouseLocation { @@ -286,6 +314,12 @@ @implementation MessageWindowController (Private) +- (void) resizeColumn +{ + [fMessageTable noteHeightOfRowsWithIndexesChanged: [NSIndexSet indexSetWithIndexesInRange: + NSMakeRange(0, [fMessageTable numberOfRows])]]; +} + - (NSString *) stringForMessage: (NSDictionary *) message { NSString * level; diff --git a/macosx/PeerProgressIndicatorCell.m b/macosx/PeerProgressIndicatorCell.m index ae6037c02..8afeae4ee 100644 --- a/macosx/PeerProgressIndicatorCell.m +++ b/macosx/PeerProgressIndicatorCell.m @@ -26,6 +26,7 @@ @implementation PeerProgressIndicatorCell +#warning exists in 10.5 - (BOOL) hidden { return fIsHidden;