mirror of
https://github.com/transmission/transmission
synced 2025-03-10 22:22:58 +00:00
on 10.6, use the new copying methods in the message window
This commit is contained in:
parent
c2f8e82c3d
commit
3ae277af17
1 changed files with 13 additions and 4 deletions
|
@ -249,16 +249,25 @@
|
||||||
|
|
||||||
- (void) copy: (id) sender
|
- (void) copy: (id) sender
|
||||||
{
|
{
|
||||||
NSPasteboard * pb = [NSPasteboard generalPasteboard];
|
|
||||||
[pb declareTypes: [NSArray arrayWithObject: NSStringPboardType] owner: self];
|
|
||||||
|
|
||||||
NSIndexSet * indexes = [fMessageTable selectedRowIndexes];
|
NSIndexSet * indexes = [fMessageTable selectedRowIndexes];
|
||||||
NSMutableArray * messageStrings = [NSMutableArray arrayWithCapacity: [indexes count]];
|
NSMutableArray * messageStrings = [NSMutableArray arrayWithCapacity: [indexes count]];
|
||||||
|
|
||||||
for (NSDictionary * message in [fMessages objectsAtIndexes: indexes])
|
for (NSDictionary * message in [fMessages objectsAtIndexes: indexes])
|
||||||
[messageStrings addObject: [self stringForMessage: message]];
|
[messageStrings addObject: [self stringForMessage: message]];
|
||||||
|
|
||||||
[pb setString: [messageStrings componentsJoinedByString: @"\n"] forType: NSStringPboardType];
|
NSString * messageString = [messageStrings componentsJoinedByString: @"\n"];
|
||||||
|
|
||||||
|
NSPasteboard * pb = [NSPasteboard generalPasteboard];
|
||||||
|
if ([NSApp isOnSnowLeopardOrBetter])
|
||||||
|
{
|
||||||
|
[pb clearContents];
|
||||||
|
[pb writeObjects: [NSArray arrayWithObject: messageString]];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[pb declareTypes: [NSArray arrayWithObject: NSStringPboardType] owner: nil];
|
||||||
|
[pb setString: messageString forType: NSStringPboardType];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) validateMenuItem: (NSMenuItem *) menuItem
|
- (BOOL) validateMenuItem: (NSMenuItem *) menuItem
|
||||||
|
|
Loading…
Add table
Reference in a new issue