BathyScapheの中身をぐちゃぐちゃに
修订版 | 347416b0bd5c54293c1590a828e8eeb3d9cabcbc (tree) |
---|---|
时间 | 2012-07-15 17:59:39 |
作者 | masakih <masakih@user...> |
Commiter | masakih |
Merge ../gitsvn/BathyScaphe
@@ -115,7 +115,6 @@ | ||
115 | 115 | 87259E94143CB93B00FEA58D /* CMRReplyControllerTbItems.xib in Resources */ = {isa = PBXBuildFile; fileRef = 87259E92143CB93B00FEA58D /* CMRReplyControllerTbItems.xib */; }; |
116 | 116 | 872A51FD139BD3C400EEC288 /* AppDefaults-BoardWarrior.m in Sources */ = {isa = PBXBuildFile; fileRef = 872A51FC139BD3C400EEC288 /* AppDefaults-BoardWarrior.m */; }; |
117 | 117 | 872AE3EF13C77F120085F7FD /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 872AE3EE13C77F120085F7FD /* CoreServices.framework */; }; |
118 | - 872C33D70BB21AF00044890C /* ThreadViewerDefaultTheme.plist in Resources */ = {isa = PBXBuildFile; fileRef = 872C33D60BB21AF00044890C /* ThreadViewerDefaultTheme.plist */; }; | |
119 | 118 | 872E53F11217EB67000F4452 /* LabelsPrefController.h in Headers */ = {isa = PBXBuildFile; fileRef = 872E53EF1217EB67000F4452 /* LabelsPrefController.h */; }; |
120 | 119 | 872E53F21217EB67000F4452 /* LabelsPrefController.m in Sources */ = {isa = PBXBuildFile; fileRef = 872E53F01217EB67000F4452 /* LabelsPrefController.m */; }; |
121 | 120 | 872E53FA1217EB9D000F4452 /* LabelsPreferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 872E53F81217EB9D000F4452 /* LabelsPreferences.xib */; }; |
@@ -582,7 +581,6 @@ | ||
582 | 581 | F473627D0AFF8758009B6189 /* ThreadsList.strings in Resources */ = {isa = PBXBuildFile; fileRef = 872999510832618100CBD740 /* ThreadsList.strings */; }; |
583 | 582 | F473627E0AFF8758009B6189 /* ThreadViewer.strings in Resources */ = {isa = PBXBuildFile; fileRef = 872999540832618100CBD740 /* ThreadViewer.strings */; }; |
584 | 583 | F47362810AFF8758009B6189 /* appIcon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 87299A07083261F200CBD740 /* appIcon.icns */; }; |
585 | - F47362850AFF8758009B6189 /* DraggingBadge.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 87299A11083261F200CBD740 /* DraggingBadge.tiff */; }; | |
586 | 584 | F473629B0AFF8758009B6189 /* ReplyDocument.icns in Resources */ = {isa = PBXBuildFile; fileRef = 87299A31083261F200CBD740 /* ReplyDocument.icns */; }; |
587 | 585 | F47362A20AFF8758009B6189 /* ThreadDocument.icns in Resources */ = {isa = PBXBuildFile; fileRef = 87299A3C083261F200CBD740 /* ThreadDocument.icns */; }; |
588 | 586 | F47362A30AFF8758009B6189 /* BrowserKeyBindings.plist in Resources */ = {isa = PBXBuildFile; fileRef = 87299AF60832622100CBD740 /* BrowserKeyBindings.plist */; }; |
@@ -975,7 +973,6 @@ | ||
975 | 973 | 8729997F0832618900CBD740 /* Japanese */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = Japanese; path = Japanese.lproj/ThreadsList.strings; sourceTree = "<group>"; }; |
976 | 974 | 872999800832618900CBD740 /* Japanese */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = Japanese; path = Japanese.lproj/ThreadViewer.strings; sourceTree = "<group>"; }; |
977 | 975 | 87299A07083261F200CBD740 /* appIcon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = appIcon.icns; sourceTree = "<group>"; }; |
978 | - 87299A11083261F200CBD740 /* DraggingBadge.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = DraggingBadge.tiff; sourceTree = "<group>"; }; | |
979 | 976 | 87299A31083261F200CBD740 /* ReplyDocument.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = ReplyDocument.icns; sourceTree = "<group>"; }; |
980 | 977 | 87299A3C083261F200CBD740 /* ThreadDocument.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = ThreadDocument.icns; sourceTree = "<group>"; }; |
981 | 978 | 87299AF60832622100CBD740 /* BrowserKeyBindings.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = BrowserKeyBindings.plist; sourceTree = "<group>"; }; |
@@ -986,7 +983,6 @@ | ||
986 | 983 | 87299C09083266F700CBD740 /* BathyScaphe.mdimporter */ = {isa = PBXFileReference; explicitFileType = "wrapper.plug-in"; name = BathyScaphe.mdimporter; path = ../metadataimporter/BathyScaphe/build/Deployment/BathyScaphe.mdimporter; sourceTree = SOURCE_ROOT; }; |
987 | 984 | 872A51FC139BD3C400EEC288 /* AppDefaults-BoardWarrior.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "AppDefaults-BoardWarrior.m"; sourceTree = "<group>"; }; |
988 | 985 | 872AE3EE13C77F120085F7FD /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; }; |
989 | - 872C33D60BB21AF00044890C /* ThreadViewerDefaultTheme.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = ThreadViewerDefaultTheme.plist; sourceTree = "<group>"; }; | |
990 | 986 | 872E53EF1217EB67000F4452 /* LabelsPrefController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelsPrefController.h; sourceTree = "<group>"; }; |
991 | 987 | 872E53F01217EB67000F4452 /* LabelsPrefController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LabelsPrefController.m; sourceTree = "<group>"; }; |
992 | 988 | 872E53F91217EB9D000F4452 /* Japanese */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Japanese; path = Japanese.lproj/LabelsPreferences.xib; sourceTree = "<group>"; }; |
@@ -2010,9 +2006,8 @@ | ||
2010 | 2006 | 87D7325D1439F3CD00F4D866 /* DeleteTemplate.pdf */, |
2011 | 2007 | 87D7325E1439F3CD00F4D866 /* ReloadThreadTemplate.pdf */, |
2012 | 2008 | 87AADE191434A35D005F17F3 /* BoardListItemIcon */, |
2013 | - 87299A07083261F200CBD740 /* appIcon.icns */, | |
2014 | - 87299A11083261F200CBD740 /* DraggingBadge.tiff */, | |
2015 | 2009 | 875E77A214A5F051001B15DB /* lastUpdatedHeader.pdf */, |
2010 | + 87299A07083261F200CBD740 /* appIcon.icns */, | |
2016 | 2011 | 87299A31083261F200CBD740 /* ReplyDocument.icns */, |
2017 | 2012 | 87299A3C083261F200CBD740 /* ThreadDocument.icns */, |
2018 | 2013 | ); |
@@ -2529,7 +2524,6 @@ | ||
2529 | 2524 | children = ( |
2530 | 2525 | 874245F5128E656200EB505A /* Labels_Finder.plist */, |
2531 | 2526 | 875FF5C50C7FFA960034E371 /* BSTitleRulerAppearance.plist */, |
2532 | - 872C33D60BB21AF00044890C /* ThreadViewerDefaultTheme.plist */, | |
2533 | 2527 | 8724A6DB09127E69009CC855 /* board_default.plist */, |
2534 | 2528 | 878D961C1216FE91005D5A97 /* Labels.plist */, |
2535 | 2529 | ); |
@@ -3892,7 +3886,6 @@ | ||
3892 | 3886 | F473627D0AFF8758009B6189 /* ThreadsList.strings in Resources */, |
3893 | 3887 | F473627E0AFF8758009B6189 /* ThreadViewer.strings in Resources */, |
3894 | 3888 | F47362810AFF8758009B6189 /* appIcon.icns in Resources */, |
3895 | - F47362850AFF8758009B6189 /* DraggingBadge.tiff in Resources */, | |
3896 | 3889 | F473629B0AFF8758009B6189 /* ReplyDocument.icns in Resources */, |
3897 | 3890 | F47362A20AFF8758009B6189 /* ThreadDocument.icns in Resources */, |
3898 | 3891 | F47362A30AFF8758009B6189 /* BrowserKeyBindings.plist in Resources */, |
@@ -3912,7 +3905,6 @@ | ||
3912 | 3905 | F4FEFB470AFF9CFC0099853B /* ConditionTypes.plist in Resources */, |
3913 | 3906 | F4D8CB680B33021C00B8FDB7 /* SmartBoardListItemEditor.strings in Resources */, |
3914 | 3907 | 87DB9C7F0BA32CE00090090A /* SoftwareUpdate.strings in Resources */, |
3915 | - 872C33D70BB21AF00044890C /* ThreadViewerDefaultTheme.plist in Resources */, | |
3916 | 3908 | 87FC678A0C682E9A00A4C72C /* DownloadableLinkTypes.plist in Resources */, |
3917 | 3909 | 875FF5C60C7FFA960034E371 /* BSTitleRulerAppearance.plist in Resources */, |
3918 | 3910 | 8785B7440D18F7B70081F4EB /* BoardListEditor.strings in Resources */, |
@@ -89,7 +89,7 @@ | ||
89 | 89 | </dict> |
90 | 90 | </array> |
91 | 91 | <key>CFBundleVersion</key> |
92 | - <string>329</string> | |
92 | + <string>334</string> | |
93 | 93 | <key>NSAppleScriptEnabled</key> |
94 | 94 | <true/> |
95 | 95 | <key>NSMainNibFile</key> |
@@ -23,7 +23,7 @@ | ||
23 | 23 | <key>CFBundleSignature</key> |
24 | 24 | <string>????</string> |
25 | 25 | <key>CFBundleVersion</key> |
26 | - <string>118</string> | |
26 | + <string>120</string> | |
27 | 27 | <key>NSHumanReadableCopyright</key> |
28 | 28 | <string>© 2005-2012 tsawada2 & BathyScaphe Project</string> |
29 | 29 | <key>NSMainNibFile</key> |
@@ -1,4 +1,4 @@ | ||
1 | -{\rtf1\ansi\ansicpg932\cocoartf1138\cocoasubrtf320 | |
1 | +{\rtf1\ansi\ansicpg932\cocoartf1138\cocoasubrtf470 | |
2 | 2 | \readonlydoc1{\fonttbl\f0\fnil\fcharset128 HiraKakuPro-W3;\f1\fnil\fcharset0 LucidaGrande;\f2\fnil\fcharset128 HiraKakuProN-W3; |
3 | 3 | \f3\fnil\fcharset0 Menlo-Regular;} |
4 | 4 | {\colortbl;\red255\green255\blue255;\red76\green76\blue76;\red102\green102\blue102;\red0\green116\blue0; |
@@ -441,7 +441,7 @@ IN NO EVENT SHALL MATT GEMMELL OR MAGIC AUBERGINE BE LIABLE FOR ANY SPECIAL, IND | ||
441 | 441 | |
442 | 442 | \b0\fs22 \cf0 BathyScaphe |
443 | 443 | \f0 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67\'83\'81\'83\'93\'83\'6f\'81\'5b\'81\'46 |
444 | -\f1 masakih, nmatz, imait, and tsawada2\ | |
444 | +\f1 masakih, nmatz, imait, 1024jp, and tsawada2\ | |
445 | 445 | BathyScaphe |
446 | 446 | \f0 \'83\'77\'83\'8b\'83\'76 |
447 | 447 | \f1 |
@@ -452,17 +452,12 @@ BathyScaphe | ||
452 | 452 | \f1 BathyScaphe |
453 | 453 | \f0 \'82\'cc\'83\'41\'83\'76\'83\'8a\'83\'50\'81\'5b\'83\'56\'83\'87\'83\'93\'83\'41\'83\'43\'83\'52\'83\'93\'81\'69\'83\'6f\'81\'5b\'83\'57\'83\'87\'83\'93 |
454 | 454 | \f1 1.7 |
455 | -\f0 \'82\'dc\'82\'c5\'81\'6a\'81\'45\'8b\'79\'82\'d1\'82\'bb\'82\'cc\'91\'bc\'82\'cc\'8a\'65\'8e\'ed\'83\'41\'83\'43\'83\'52\'83\'93\'97\'de\'82\'cd\'81\'41 | |
455 | +\f0 \'82\'dc\'82\'c5\'81\'6a\'81\'45\'8b\'79\'82\'d1\'82\'bb\'82\'cc\'91\'bc\'82\'cc\'8a\'65\'8e\'ed\'83\'41\'83\'43\'83\'52\'83\'93\'97\'de\'81\'69\'83\'6f\'81\'5b\'83\'57\'83\'87\'83\'93 | |
456 | +\f1 2.0.5 | |
457 | +\f0 \'82\'dc\'82\'c5\'81\'6a\'82\'cd\'81\'41 | |
456 | 458 | \f1 109@1st thread |
457 | 459 | \f0 \'8e\'81\'82\'cc\'92\'f1\'8b\'9f\'82\'c9\'82\'e6\'82\'e9\'82\'e0\'82\'cc\'82\'c5\'82\'b7\'81\'42\ |
458 | - | |
459 | -\f1 BathyScaphe | |
460 | -\f0 \'82\'cc\'83\'41\'83\'76\'83\'8a\'83\'50\'81\'5b\'83\'56\'83\'87\'83\'93\'83\'41\'83\'43\'83\'52\'83\'93\'81\'45\'8b\'79\'82\'d1\'82\'bb\'82\'cc\'91\'bc\'82\'cc\'8a\'65\'8e\'ed\'83\'41\'83\'43\'83\'52\'83\'93\'97\'de\'81\'69\'83\'6f\'81\'5b\'83\'57\'83\'87\'83\'93 | |
461 | -\f1 2.1 | |
462 | -\f0 \'88\'c8\'8d\'7e\'81\'6a\'82\'cd\'81\'41 | |
463 | -\f1 1024jp <{\field{\*\fldinst{HYPERLINK "http://wolfrosch.com/"}}{\fldrslt http://wolfrosch.com/}}> | |
464 | -\f0 \'8e\'81\'82\'cc\'92\'f1\'8b\'9f\'82\'c9\'82\'e6\'82\'e9\'82\'e0\'82\'cc\'82\'c5\'82\'b7\'81\'42\ | |
465 | 460 | \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\sl480\slmult1 |
466 | 461 | |
467 | -\f1 \cf0 2012-04 BathyScaphe\ | |
462 | +\f1 \cf0 2012-07 BathyScaphe\ | |
468 | 463 | } |
\ No newline at end of file |
@@ -93,6 +93,11 @@ typedef NSInteger NSScrollElasticity; | ||
93 | 93 | @end |
94 | 94 | #endif |
95 | 95 | |
96 | +@interface NSObject(MountainLionStub) | |
97 | +- (id)initWithItems:(NSArray *)items; | |
98 | +- (void)showRelativeToRect:(NSRect)rect ofView:(NSView *)view preferredEdge:(NSRectEdge)preferredEdge; | |
99 | +@end | |
100 | + | |
96 | 101 | |
97 | 102 | #ifdef __cplusplus |
98 | 103 | } /* End of the 'extern "C"' block */ |
@@ -152,7 +152,10 @@ static BOOL shouldCheckItemHeader(id dict); | ||
152 | 152 | id pool2 = [[NSAutoreleasePool alloc] init]; |
153 | 153 | [loop runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; |
154 | 154 | [pool2 release]; |
155 | - if(self.isInterrupted) return; | |
155 | + if (self.isInterrupted) { | |
156 | + [checker autorelease]; | |
157 | + return; | |
158 | + } | |
156 | 159 | } |
157 | 160 | if (!(checker.lastError) && checker.isUpdated) { |
158 | 161 | [updatedThreads addObject:thread]; |
@@ -28,11 +28,6 @@ | ||
28 | 28 | #define UTIL_DEBUGGING 0 |
29 | 29 | #import "UTILDebugging.h" |
30 | 30 | |
31 | -@interface NSObject(MountainLionStub) | |
32 | -- (id)initWithItems:(NSArray *)items; | |
33 | -- (void)showRelativeToRect:(NSRect)rect ofView:(NSView *)view preferredEdge:(NSRectEdge)preferredEdge; | |
34 | -@end | |
35 | - | |
36 | 31 | |
37 | 32 | @implementation CMRThreadViewer(ActionSupport) |
38 | 33 | - (CMRReplyMessenger *)replyMessenger |
@@ -216,20 +211,22 @@ | ||
216 | 211 | NSArray *array_ = [self targetThreadsForAction:_cmd sender:sender]; |
217 | 212 | |
218 | 213 | NSMutableString *tmp; |
219 | - NSURL *url_ = nil; | |
214 | +// NSURL *url_ = nil; | |
220 | 215 | NSPasteboard *pboard_ = [NSPasteboard generalPasteboard]; |
221 | - NSArray *types_; | |
216 | +// NSArray *types_; | |
222 | 217 | |
223 | 218 | tmp = SGTemporaryString(); |
224 | 219 | |
225 | 220 | [CMRThreadAttributes fillBuffer:tmp withThreadInfoForCopying:array_]; |
226 | - url_ = [CMRThreadAttributes threadURLFromDictionary:[array_ lastObject]]; | |
221 | +// url_ = [CMRThreadAttributes threadURLFromDictionary:[array_ lastObject]]; | |
227 | 222 | |
228 | - types_ = [NSArray arrayWithObjects:NSURLPboardType, NSStringPboardType, nil]; | |
229 | - [pboard_ declareTypes:types_ owner:nil]; | |
223 | +// types_ = [NSArray arrayWithObjects:NSURLPboardType, NSStringPboardType, nil]; | |
224 | +// [pboard_ declareTypes:types_ owner:nil]; | |
230 | 225 | |
231 | - [url_ writeToPasteboard:pboard_]; | |
232 | - [pboard_ setString:tmp forType:NSStringPboardType]; | |
226 | +// [url_ writeToPasteboard:pboard_]; | |
227 | +// [pboard_ setString:tmp forType:NSStringPboardType]; | |
228 | + [pboard_ clearContents]; | |
229 | + [pboard_ writeObjects:[NSArray arrayWithObject:tmp]]; | |
233 | 230 | |
234 | 231 | [tmp deleteCharactersInRange:[tmp range]]; |
235 | 232 | } |
@@ -401,17 +398,50 @@ | ||
401 | 398 | |
402 | 399 | - (IBAction)shareThreadInfo:(id)sender |
403 | 400 | { |
404 | - NSArray *array_ = [self selectedThreads]; | |
401 | + if (![sender respondsToSelector:@selector(bounds)]) { | |
402 | + return; // 「テキストのみ」ツールバー対策、暫定 | |
403 | + } | |
404 | + NSArray *array_ = [self targetThreadsForAction:_cmd sender:sender]; | |
405 | 405 | |
406 | 406 | NSMutableString *tmp = [NSMutableString string]; |
407 | 407 | [CMRThreadAttributes fillBuffer:tmp withThreadInfoForCopying:array_]; |
408 | 408 | |
409 | 409 | NSArray *items = [NSArray arrayWithObject:tmp]; |
410 | 410 | id picker = [[[NSClassFromString(@"NSSharingServicePicker") alloc] initWithItems:items] autorelease]; |
411 | -// [picker setDelegate:self]; | |
411 | + [picker setDelegate:self]; | |
412 | 412 | [picker showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSMinYEdge]; |
413 | 413 | } |
414 | 414 | |
415 | +- (NSWindow *)sharingService:(id)sharingService sourceWindowForShareItems:(NSArray *)items sharingContentScope:(NSInteger *)sharingContentScope | |
416 | +{ | |
417 | + *sharingContentScope = 2; | |
418 | + return [self window]; | |
419 | +} | |
420 | + | |
421 | +- (id)sharingServicePicker:(id)sharingServicePicker delegateForSharingService:(id)sharingService | |
422 | +{ | |
423 | + return self; | |
424 | +} | |
425 | +/* | |
426 | +- (NSRect)sharingService:(id)sharingService sourceFrameOnScreenForShareItem:(id<NSPasteboardWriting>)item | |
427 | +{ | |
428 | + NSRect imageViewBounds = [[self scrollView] bounds]; | |
429 | + NSRect frame = [[self scrollView] convertRect:imageViewBounds toView:nil]; | |
430 | + frame.origin = [[[self scrollView] window] convertBaseToScreen:frame.origin]; | |
431 | + return frame; | |
432 | +} | |
433 | + | |
434 | +- (NSImage *)sharingService:(id)sharingService | |
435 | +transitionImageForShareItem:(id <NSPasteboardWriting>)item | |
436 | + contentRect:(NSRect *)contentRect | |
437 | +{ | |
438 | + NSBitmapImageRep* bitmap = [[self scrollView] bitmapImageRepForCachingDisplayInRect:[[self scrollView] bounds]]; | |
439 | + [[self scrollView] cacheDisplayInRect:[[self scrollView] bounds] toBitmapImageRep:bitmap]; | |
440 | + NSImage *image = [[NSImage alloc] init]; | |
441 | + [image addRepresentation:bitmap]; | |
442 | + return [image autorelease]; | |
443 | +} | |
444 | +*/ | |
415 | 445 | // Available in Twincam Angel and later. |
416 | 446 | - (void)checkIfUsesCorpusOptionOn |
417 | 447 | { |
@@ -1033,15 +1033,26 @@ ErrNoSelection: | ||
1033 | 1033 | @implementation CMRThreadView(NSServicesRequests) |
1034 | 1034 | - (BOOL)writeSelectionToPasteboard:(NSPasteboard *)pboard types:(NSArray *)types |
1035 | 1035 | { |
1036 | - NSAttributedString *contents_; | |
1037 | - | |
1038 | 1036 | // 元々渡される types には NSRTFDPboardType が含まれる。しかしこれが受け渡し時に問題を引き起こすようだ |
1039 | 1037 | NSArray *newTypes = [NSArray arrayWithObjects:NSRTFPboardType, NSStringPboardType, nil]; // NSRTFDPboardType を含まない別の array にすり替える |
1040 | - [pboard declareTypes:newTypes owner:nil]; | |
1041 | - | |
1042 | - contents_ = [[self textStorage] attributedSubstringFromRange:[self selectedRange]]; | |
1038 | + return [super writeSelectionToPasteboard:pboard types:newTypes]; | |
1039 | +} | |
1043 | 1040 | |
1044 | - [contents_ writeToPasteboard:pboard]; | |
1045 | - return YES; | |
1041 | +- (BOOL)writeSelectionToPasteboard:(NSPasteboard *)pboard type:(NSString *)type | |
1042 | +{ | |
1043 | + BOOL superResult = [super writeSelectionToPasteboard:pboard type:type]; | |
1044 | + | |
1045 | + if (!superResult) { | |
1046 | + return NO; | |
1047 | + } | |
1048 | + | |
1049 | + if ([type isEqualToString:NSStringPboardType]) { | |
1050 | + NSString *hacking = [pboard stringForType:type]; | |
1051 | + if ([hacking hasPrefix:@"http://"] || [hacking hasPrefix:@"https://"]) { | |
1052 | + NSString *string2 = [hacking stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; | |
1053 | + superResult = [pboard setString:string2 forType:type]; // 強引 | |
1054 | + } | |
1055 | + } | |
1056 | + return superResult; | |
1046 | 1057 | } |
1047 | 1058 | @end |
@@ -187,8 +187,7 @@ static NSString *const st_toolbar_identifier = @"Thread Window Toolbar"; | ||
187 | 187 | NSToolbarItem *item_; |
188 | 188 | NSWindowController *wcontroller_; |
189 | 189 | |
190 | - BOOL loadNibSuccess = [NSBundle loadNibNamed:@"CMRThreadViewerTbItems" owner:self]; | |
191 | - NSAssert(loadNibSuccess, @"Fail to load CMRThreadViewerTbItems.nib!"); | |
190 | + [NSBundle loadNibNamed:@"CMRThreadViewerTbItems" owner:self]; | |
192 | 191 | |
193 | 192 | wcontroller_ = [aWindow windowController]; |
194 | 193 | UTILAssertNotNil(wcontroller_); |
@@ -256,6 +255,7 @@ static NSString *const st_toolbar_identifier = @"Thread Window Toolbar"; | ||
256 | 255 | toolTip:st_shareItemToolTipKey |
257 | 256 | action:@selector(shareThreadInfo:) |
258 | 257 | customizable:NO]; |
258 | + [m_sharingServiceButton sendActionOn:NSLeftMouseDownMask]; | |
259 | 259 | |
260 | 260 | item_ = [self appendButton:m_thunderButton |
261 | 261 | withIdentifier:[self toggleOnlineModeIdentifier] |
@@ -65,7 +65,5 @@ | ||
65 | 65 | |
66 | 66 | - (NSString *)toolTipStringAtIndex:(NSUInteger)index; |
67 | 67 | |
68 | -- (BOOL)appendDataForTokenAtIndexes:(NSIndexSet *)indexes | |
69 | - toPasteboard:(NSPasteboard *)pboard | |
70 | - withFilenamesPboardType:(BOOL)filenamesType; | |
68 | +- (BOOL)writeTokensAtIndexes:(NSIndexSet *)indexes toPasteboard:(NSPasteboard *)pboard; | |
71 | 69 | @end |
@@ -517,33 +517,14 @@ void fsevents_callback(ConstFSEventStreamRef streamRef, | ||
517 | 517 | return string ? string : [[NSBundle bundleForClass:[self class]] localizedStringForKey:@"No Exif data available" value:@"" table:nil]; |
518 | 518 | } |
519 | 519 | |
520 | -- (BOOL)appendDataForTokenAtIndexes:(NSIndexSet *)indexes toPasteboard:(NSPasteboard *)pboard withFilenamesPboardType:(BOOL)filenamesType | |
521 | -{ | |
522 | - // TODO あとで大幅に書き換える | |
523 | - NSArray *tokens_ = [self cachedTokensArrayAtIndexes:indexes]; | |
524 | - if (filenamesType) { | |
525 | - NSMutableArray *pathAry_ = [NSArray arrayWithArray:[tokens_ valueForKey:@"downloadedFilePath"]]; | |
526 | - [pathAry_ removeObjectIdenticalTo:[NSNull null]]; | |
527 | - if ([pathAry_ count] == 0) { | |
528 | - return NO; | |
529 | - } | |
530 | - NSMutableArray *finalArray_ = [NSMutableArray arrayWithCapacity:[pathAry_ count]]; | |
531 | - for (NSString *filePath in pathAry_) { | |
532 | - [finalArray_ addObject:[NSURL fileURLWithPath:filePath isDirectory:NO]]; | |
533 | - } | |
534 | - | |
535 | - [pboard clearContents]; | |
536 | - [pboard writeObjects:finalArray_]; | |
537 | - } else { | |
538 | - NSArray *finalArray_ = [NSArray arrayWithArray:[tokens_ valueForKey:@"sourceURL"]]; | |
539 | - [pboard clearContents]; | |
540 | - [pboard writeObjects:finalArray_]; | |
541 | - } | |
542 | - return YES; | |
520 | +- (BOOL)writeTokensAtIndexes:(NSIndexSet *)indexes toPasteboard:(NSPasteboard *)pboard | |
521 | +{ | |
522 | + [pboard clearContents]; | |
523 | + return [pboard writeObjects:[self cachedTokensArrayAtIndexes:indexes]]; | |
543 | 524 | } |
544 | 525 | |
545 | -- (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard*)pboard | |
526 | +- (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard | |
546 | 527 | { |
547 | - return [self appendDataForTokenAtIndexes:rowIndexes toPasteboard:pboard withFilenamesPboardType:YES]; | |
528 | + return [self writeTokensAtIndexes:rowIndexes toPasteboard:pboard]; | |
548 | 529 | } |
549 | 530 | @end |
@@ -11,7 +11,7 @@ | ||
11 | 11 | |
12 | 12 | @class BSURLDownload; |
13 | 13 | |
14 | -@interface BSIPIToken : NSObject { | |
14 | +@interface BSIPIToken : NSObject<NSPasteboardWriting> { | |
15 | 15 | @private |
16 | 16 | NSURL *ipit_sourceURL; |
17 | 17 | NSString *ipit_downloadedFilePath; |
@@ -486,4 +486,46 @@ NSString *const BSIPITokenDownloadDidFinishNotification = @"jp.tsawada2.BathySca | ||
486 | 486 | [self setCurrentDownload:nil]; |
487 | 487 | [self postErrorNotification:NO]; |
488 | 488 | } |
489 | + | |
490 | +#pragma mark NSPasteboardWriting | |
491 | +- (NSArray *)writableTypesForPasteboard:(NSPasteboard *)pasteboard | |
492 | +{ | |
493 | + NSString *name = [pasteboard name]; | |
494 | + | |
495 | + if ([name isEqualToString:NSGeneralPboard]) { | |
496 | + static NSArray *writableTypesForGeneral = nil; | |
497 | + if (!writableTypesForGeneral) { | |
498 | + writableTypesForGeneral = [[NSArray alloc] initWithObjects:NSPasteboardTypeString, (NSString *)kUTTypeURL, nil]; | |
499 | + } | |
500 | + return writableTypesForGeneral; | |
501 | + } else if ([name isEqualToString:NSDragPboard]) { | |
502 | + static NSArray *writableTypesForDrag = nil; | |
503 | + if (!writableTypesForDrag) { | |
504 | + writableTypesForDrag = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeFileURL, NSPasteboardTypeString, nil]; | |
505 | + } | |
506 | + return writableTypesForDrag; | |
507 | + } | |
508 | + return nil; | |
509 | +} | |
510 | + | |
511 | +- (id)pasteboardPropertyListForType:(NSString *)type | |
512 | +{ | |
513 | + | |
514 | + if ([type isEqualToString:(NSString *)kUTTypeFileURL]) { | |
515 | + if (![self downloadedFilePath]) { | |
516 | + return nil; | |
517 | + } | |
518 | + return [[NSURL fileURLWithPath:[self downloadedFilePath] isDirectory:NO] pasteboardPropertyListForType:type]; | |
519 | + } | |
520 | + | |
521 | + if ([type isEqualToString:(NSString *)kUTTypeURL]) { | |
522 | + return [[self sourceURL] pasteboardPropertyListForType:type]; | |
523 | + } | |
524 | + | |
525 | + if ([type isEqualToString:NSPasteboardTypeString]) { | |
526 | + return [[self sourceURL] absoluteString]; | |
527 | + } | |
528 | + | |
529 | + return nil; | |
530 | +} | |
489 | 531 | @end |
@@ -132,9 +132,7 @@ static NSString *const kIPIPrefsNibFileNameKey = @"BSIPIPreferences"; | ||
132 | 132 | |
133 | 133 | - (IBAction)copyURL:(id)sender |
134 | 134 | { |
135 | - [[self historyManager] appendDataForTokenAtIndexes:[self validIndexesForAction:sender] | |
136 | - toPasteboard:[NSPasteboard generalPasteboard] | |
137 | - withFilenamesPboardType:NO]; | |
135 | + [[self historyManager] writeTokensAtIndexes:[self validIndexesForAction:sender] toPasteboard:[NSPasteboard generalPasteboard]]; | |
138 | 136 | } |
139 | 137 | |
140 | 138 | - (IBAction)openImage:(id)sender |
@@ -431,9 +429,7 @@ static NSString *const kIPIPrefsNibFileNameKey = @"BSIPIPreferences"; | ||
431 | 429 | #pragma mark BSIPIImageView Delegate |
432 | 430 | - (BOOL)imageView:(BSIPIImageView *)aImageView writeSomethingToPasteboard:(NSPasteboard *)pboard |
433 | 431 | { |
434 | - return [[self historyManager] appendDataForTokenAtIndexes:[[self tripleGreenCubes] selectionIndexes] | |
435 | - toPasteboard:pboard | |
436 | - withFilenamesPboardType:YES]; | |
432 | + return [[self historyManager] writeTokensAtIndexes:[[self tripleGreenCubes] selectionIndexes] toPasteboard:pboard]; | |
437 | 433 | } |
438 | 434 | |
439 | 435 | - (void)imageView:(BSIPIImageView *)aImageView mouseDoubleClicked:(NSEvent *)theEvent |
@@ -1,3 +1,32 @@ | ||
1 | +2012-07-15 tsawada2 <tsawada2@users.sourceforge.jp> | |
2 | + * application/source/browser/BSBoardListItemHEADCheckTask.m | |
3 | + メモリリークの恐れがあった箇所の修正。 | |
4 | + * application/Resources/Japanese.lproj/SoftwareUpdate.strings | |
5 | + ダイアログの文言の一部修正。 | |
6 | + * application/Resources/Japanese.lproj/Themes/default_solarized.plist | |
7 | + Solarized テーマの調整。 | |
8 | +2012-07-14 tsawada2 <tsawada2@users.sourceforge.jp> | |
9 | + * application/BathyScaphe.xcodeproj/project.pbxproj | |
10 | + いくつかの不要なファイルがビルド時にコピーされていた問題を修正。 | |
11 | + * application/Resources/Japanese.lproj/Acknowledgments.rtf | |
12 | + * application/Resources/Japanese.lproj/board_default.plist | |
13 | + それぞれ、最新の内容に更新。 | |
14 | +2012-07-13 tsawada2 <tsawada2@users.sourceforge.jp> | |
15 | + * application/source/CMRExports.h | |
16 | + * application/source/thread/CMRThreadViewer-Action.m | |
17 | + * application/source/window/CMRThreadViewerTbDelegate.m | |
18 | + [Mountain Lion] 「共有」ボタンの挙動を調整した。視覚効果を付けた。 | |
19 | + ツールバーが「テキストのみ」モードのときに共有ボタンをクリックすると動作しないのは 2.2 では仕様。 | |
20 | + コンソールにエラーを吐かないようにした。 | |
21 | + * application/source/view/CMRThreadView.m | |
22 | + サービスメニュー経由で他のアプリケーションに「http://」または「https://」で始まる文字列を渡す時は | |
23 | + 文字列をパーセントエスケープするようにした。これで「http://ja.wikipedia.org/wiki/卵かけご飯」も | |
24 | + サービスメニュー経由で開けるようになる。 | |
25 | + * application/subproj/previewer/BSIPIToken.m | |
26 | + * application/subproj/previewer/BSIPIHistoryManager.m | |
27 | + * application/subproj/previewer/BSImagePreviewInspector.m | |
28 | + プレビューインスペクタ:ドラッグ&ドロップで URL をペーストしたりファイルをコピーする処理を最適化した。 | |
29 | +================================================= | |
1 | 30 | 2012-07-11 tsawada2 <tsawada2@users.sourceforge.jp> |
2 | 31 | * application/subproj/previewer/BSIPIArrayController.m |
3 | 32 | * application/subproj/previewer/Japanese.lproj/BSImagePreviewInspector3.xib |