From ed6a04b56c9760cf88bfbb23587db9d44d2a53d2 Mon Sep 17 00:00:00 2001 From: Sergii Stoian Date: Fri, 30 May 2003 07:21:21 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@16840 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 10 ++++++++++ PCLib/PCBrowserController.m | 20 +++++++++++--------- PCLib/PCEditor.h | 2 ++ PCLib/PCEditor.m | 11 +++++++++++ PCLib/PCEditorController.h | 3 +-- PCLib/PCEditorController.m | 6 ++---- PCLib/PCEditorView.m | 6 +----- 7 files changed, 38 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 96ff22b..84203b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2003-05-30 Serg Stoyan + + * PCLib/PCEditor.[hm]: Added becomeFirstResponder. + * PCLib/PCEditorController.[hm]: Rename setBrowser: to + setBrowserPath:category:. + * PCLib/PCEditorController.m: + (activeEditor): Don't count on [project isEditorActive]. + * PCLib/PCEditorView.m: + (becomeFirstResponder): Call editor's becomeFirstResponder. + 2003-05-29 Serg Stoyan * PCMenuController.m: diff --git a/PCLib/PCBrowserController.m b/PCLib/PCBrowserController.m index ca7dff8..ecd1b52 100644 --- a/PCLib/PCBrowserController.m +++ b/PCLib/PCBrowserController.m @@ -41,17 +41,19 @@ - (void)click:(id)sender { if ([[sender selectedCell] isLeaf] && [[self selectedFiles] count] == 1) - { - NSString *ltitle = [[sender selectedCell] stringValue]; - NSString *category = [[sender selectedCellInColumn:0] stringValue]; - - if ([self isEditableCategory:category file: ltitle]) { - [[NSNotificationCenter defaultCenter] postNotificationName:@"FileBecomesEditedNotification" object:ltitle]; - - [project browserDidClickFile:ltitle category:category]; + NSString *ltitle = [[sender selectedCell] stringValue]; + NSString *category = [[sender selectedCellInColumn:0] stringValue]; + + if ([self isEditableCategory:category file: ltitle]) + { + [[NSNotificationCenter defaultCenter] + postNotificationName:@"FileBecomesEditedNotification" + object:ltitle]; + + [project browserDidClickFile:ltitle category:category]; + } } - } } - (void)doubleClick:(id)sender diff --git a/PCLib/PCEditor.h b/PCLib/PCEditor.h index 17f7be4..9fcecca 100644 --- a/PCLib/PCEditor.h +++ b/PCLib/PCEditor.h @@ -62,12 +62,14 @@ - (void)windowDidResignKey:(NSNotification *)aNotification; - (void)textDidChange:(NSNotification *)aNotification; +- (BOOL)becomeFirstResponder; @end @interface NSObject (PCEditorDelegate) - (void)editorDidClose:(id)sender; +- (void)setBrowserPath:(NSString *)file category:(NSString *)category; @end diff --git a/PCLib/PCEditor.m b/PCLib/PCEditor.m index 4477e77..b697063 100644 --- a/PCLib/PCEditor.m +++ b/PCLib/PCEditor.m @@ -323,5 +323,16 @@ NSString *PCEditorDidResignKeyNotification=@"PCEditorDidResignKeyNotification"; [self setIsEdited:YES]; } +- (BOOL)becomeFirstResponder +{ + if (_delegate + && [_delegate respondsToSelector:@selector(setBrowserPath:category:)]) + { + [_delegate setBrowserPath:[_path lastPathComponent] category:_category]; + } + + return YES; +} + @end diff --git a/PCLib/PCEditorController.h b/PCLib/PCEditorController.h index 317e9b5..be5f58a 100644 --- a/PCLib/PCEditorController.h +++ b/PCLib/PCEditorController.h @@ -65,8 +65,7 @@ // =========================================================================== - (void)editorDidClose:(id)sender; - -- (void)setBrowserPath:(NSString *)file; +- (void)setBrowserPath:(NSString *)file category:(NSString *)category; @end diff --git a/PCLib/PCEditorController.m b/PCLib/PCEditorController.m index 83252f3..2ef8538 100644 --- a/PCLib/PCEditorController.m +++ b/PCLib/PCEditorController.m @@ -153,7 +153,6 @@ if (([window isVisible] && [window isKeyWindow]) || ([[editor internalView] superview] - && [project isEditorActive] && [[project projectWindow] isKeyWindow])) { return editor; @@ -297,10 +296,9 @@ } } -- (void)setBrowserPath:(NSString *)file +- (void)setBrowserPath:(NSString *)file category:(NSString *)category { - [[project browserController] setPathForFile:file - category:[[self activeEditor] category]]; + [[project browserController] setPathForFile:file category:category]; } @end diff --git a/PCLib/PCEditorView.m b/PCLib/PCEditorView.m index be77be9..55e8a9c 100644 --- a/PCLib/PCEditorView.m +++ b/PCLib/PCEditorView.m @@ -36,11 +36,7 @@ static int _tabFlags = PCTab4Sp; - (BOOL) becomeFirstResponder { - NSString *file = [[editor path] lastPathComponent]; - - [(PCEditorController *)[self delegate] setBrowserPath:file]; - - return YES; + return [editor becomeFirstResponder]; } + (void)setTabBehaviour:(int)tabFlags