BathyScapheの中身をぐちゃぐちゃに
Revisión | 943ab3b550c97934db7d799ea01c720789c04fce (tree) |
---|---|
Tiempo | 2012-05-05 23:49:01 |
Autor | masakih <masakih@user...> |
Commiter | masakih |
[Mod] baordName, threadTitleプロパティ
@@ -85,6 +85,22 @@ | ||
85 | 85 | bsview, threadList, boardList, progressView, nil]; |
86 | 86 | } |
87 | 87 | |
88 | ++ (NSSet *)keyPathsForValuesAffectingBoardName | |
89 | +{ | |
90 | + return [NSSet setWithObjects:@"doc", @"window.firstResponder", @"boardList.selection", nil]; | |
91 | +} | |
92 | +- (NSString *)boardName | |
93 | +{ | |
94 | + NSResponder *responder = [[self window] firstResponder]; | |
95 | + while(responder) { | |
96 | + if(responder == bsview ) { | |
97 | + return [super boardName]; | |
98 | + } | |
99 | + responder = [responder nextResponder]; | |
100 | + } | |
101 | + return [boardList.selection representName]; | |
102 | +} | |
103 | + | |
88 | 104 | - (void)setDocument:(NSDocument *)document |
89 | 105 | { |
90 | 106 | if([self.document windowControllers].count == 1) { |
@@ -25,6 +25,8 @@ | ||
25 | 25 | |
26 | 26 | @property (readonly) KMDocument *doc; |
27 | 27 | @property (readonly) KMLogViewController *logViewController; |
28 | +@property (readonly) NSString *boardName; | |
29 | +@property (readonly) NSString *threadTitle; | |
28 | 30 | |
29 | 31 | // KMDocument |
30 | 32 | @property (readonly) NSNumber *numberMessages; |
@@ -90,6 +90,22 @@ static NSMutableArray *_windowControllers = nil; | ||
90 | 90 | if(num == 0) return nil; |
91 | 91 | return [NSNumber numberWithUnsignedInteger:num]; |
92 | 92 | } |
93 | ++ (NSSet *)keyPathsForValuesAffectingBoardName | |
94 | +{ | |
95 | + return [NSSet setWithObject:@"doc"]; | |
96 | +} | |
97 | +- (NSString *)boardName | |
98 | +{ | |
99 | + return self.doc.boardName; | |
100 | +} | |
101 | ++ (NSSet *)keyPathsForValuesAffectingThreadTitle | |
102 | +{ | |
103 | + return [NSSet setWithObject:@"doc"]; | |
104 | +} | |
105 | +- (NSString *)threadTitle | |
106 | +{ | |
107 | + return self.doc.threadTitle; | |
108 | +} | |
93 | 109 | |
94 | 110 | - (void)setDocument:(NSDocument *)document |
95 | 111 | { |