Revision: 18046
http://bibdesk.svn.sourceforge.net/bibdesk/?rev=18046&view=rev
Author: hofman
Date: 2011-08-07 11:33:39 +0000 (Sun, 07 Aug 2011)
Log Message:
-----------
Move makeSearchFieldKey: action to toolbar category, as we want to use macros
from there. Insert the search field in the toolbar when necessary.
Modified Paths:
--------------
trunk/bibdesk/BibDocument_Search.h
trunk/bibdesk/BibDocument_Search.m
trunk/bibdesk/BibDocument_Toolbar.h
trunk/bibdesk/BibDocument_Toolbar.m
Modified: trunk/bibdesk/BibDocument_Search.h
===================================================================
--- trunk/bibdesk/BibDocument_Search.h 2011-08-07 06:34:55 UTC (rev 18045)
+++ trunk/bibdesk/BibDocument_Search.h 2011-08-07 11:33:39 UTC (rev 18046)
@@ -48,7 +48,6 @@
- (NSString *)fileContentSearchString;
-- (IBAction)makeSearchFieldKey:(id)sender;
- (IBAction)changeSearchType:(id)sender;
- (IBAction)search:(id)sender;
Modified: trunk/bibdesk/BibDocument_Search.m
===================================================================
--- trunk/bibdesk/BibDocument_Search.m 2011-08-07 06:34:55 UTC (rev 18045)
+++ trunk/bibdesk/BibDocument_Search.m 2011-08-07 11:33:39 UTC (rev 18046)
@@ -51,6 +51,7 @@
#import "BDSKOverlayWindow.h"
#import "BibDocument_Groups.h"
#import "BibDocument_DataSource.h"
+#import "BibDocument_Toolbar.h"
#import "BDSKMainTableView.h"
#import "BDSKFindController.h"
#import "BDSKItemSearchIndexes.h"
@@ -74,17 +75,6 @@
[self redoSearch];
}
-- (IBAction)makeSearchFieldKey:(id)sender{
-
- NSToolbar *tb = [documentWindow toolbar];
- [tb setVisible:YES];
- if([tb displayMode] == NSToolbarDisplayModeLabelOnly)
- [tb setDisplayMode:NSToolbarDisplayModeIconAndLabel];
-
- [documentWindow makeFirstResponder:searchField];
- [searchField selectText:sender];
-}
-
- (NSString *)searchString {
return [searchField stringValue];
}
Modified: trunk/bibdesk/BibDocument_Toolbar.h
===================================================================
--- trunk/bibdesk/BibDocument_Toolbar.h 2011-08-07 06:34:55 UTC (rev 18045)
+++ trunk/bibdesk/BibDocument_Toolbar.h 2011-08-07 11:33:39 UTC (rev 18046)
@@ -39,4 +39,7 @@
@interface BibDocument (Toolbar) <NSToolbarDelegate>
- (void)setupToolbar;
+
+- (IBAction)makeSearchFieldKey:(id)sender;
+
@end
Modified: trunk/bibdesk/BibDocument_Toolbar.m
===================================================================
--- trunk/bibdesk/BibDocument_Toolbar.m 2011-08-07 06:34:55 UTC (rev 18045)
+++ trunk/bibdesk/BibDocument_Toolbar.m 2011-08-07 11:33:39 UTC (rev 18046)
@@ -35,8 +35,6 @@
*/
#import "BibDocument_Toolbar.h"
-#import "BibDocument_Menus.h"
-#import "BibDocument_Search.h"
#import "BDSKAppController.h"
#import "NSImage_BDSKExtensions.h"
#import "BDSKToolbarItem.h"
@@ -270,4 +268,17 @@
}
+- (IBAction)makeSearchFieldKey:(id)sender{
+ NSToolbar *toolbar = [documentWindow toolbar];
+ NSArray *items = [[toolbar items] valueForKey:@"itemIdentifier"];
+ if ([items containsObject:BibDocumentToolbarSearchItemIdentifier] == NO)
+ [toolbar
insertItemWithItemIdentifier:BibDocumentToolbarSearchItemIdentifier
atIndex:[[items lastObject]
isEqualToString:BibDocumentToolbarCiteDrawerItemIdentifier] ? [items count] - 1
: [items count]];
+ if([toolbar displayMode] == NSToolbarDisplayModeLabelOnly)
+ [toolbar setDisplayMode:NSToolbarDisplayModeIconAndLabel];
+ [toolbar setVisible:YES];
+
+ [documentWindow makeFirstResponder:searchField];
+ [searchField selectText:sender];
+}
+
@end
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit