diff --git a/macosx/English.lproj/MessageWindow.nib/keyedobjects.nib b/macosx/English.lproj/MessageWindow.nib/keyedobjects.nib index afcb705c2..b0cd86aa8 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.m b/macosx/MessageWindowController.m index ba0874be3..3d364bb26 100644 --- a/macosx/MessageWindowController.m +++ b/macosx/MessageWindowController.m @@ -164,10 +164,33 @@ - (void) tableView: (NSTableView *) tableView sortDescriptorsDidChange: (NSArray *) oldDescriptors { [fMessages sortUsingDescriptors: [fMessageTable sortDescriptors]]; - [fMessageTable reloadData]; } +- (void) copy: (id) sender +{ + NSIndexSet * indexes = [fMessageTable selectedRowIndexes]; + NSMutableArray * messageStrings = [NSMutableArray arrayWithCapacity: [indexes count]]; + + unsigned int i; + for (i = [indexes firstIndex]; i != NSNotFound; i = [indexes indexGreaterThanIndex: i]) + [messageStrings addObject: [self stringForMessage: [fMessages objectAtIndex: i]]]; + + NSPasteboard * pb = [NSPasteboard generalPasteboard]; + [pb declareTypes: [NSArray arrayWithObject: NSStringPboardType] owner: self]; + [pb setString: [messageStrings componentsJoinedByString: @"\n"] forType: NSStringPboardType]; +} + +- (BOOL) validateMenuItem: (NSMenuItem *) menuItem +{ + SEL action = [menuItem action]; + + if (action == @selector(copy:)) + return [fMessageTable numberOfSelectedRows] > 0; + + return YES; +} + - (void) changeLevel: (id) sender { [self updateLog: nil];