Author: ericwa
Date: Fri Mar 14 22:23:01 2014
New Revision: 10567
URL: http://svn.gna.org/viewcvs/etoile?rev=10567&view=rev
Log:
Typewriter: add an 'All Notes' tag group to the UI
Modified:
trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWTagListDataSource.h
trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWTagListDataSource.m
trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/en.lproj/Document.xib
Modified:
trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWTagListDataSource.h
URL:
http://svn.gna.org/viewcvs/etoile/trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWTagListDataSource.h?rev=10567&r1=10566&r2=10567&view=diff
==============================================================================
--- trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWTagListDataSource.h
(original)
+++ trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWTagListDataSource.h
Fri Mar 14 22:23:01 2014
@@ -18,6 +18,7 @@
@interface EWTagListDataSource : NSObject <NSOutlineViewDataSource,
NSOutlineViewDelegate>
{
NSTreeNode *rootTreeNode;
+ NSTreeNode *allNotesTreeNode;
NSMutableSet *oldSelection;
EWTagGroupTagPair *nextSelection;
BOOL ignoreSelectionChanges;
Modified:
trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWTagListDataSource.m
URL:
http://svn.gna.org/viewcvs/etoile/trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWTagListDataSource.m?rev=10567&r1=10566&r2=10567&view=diff
==============================================================================
--- trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWTagListDataSource.m
(original)
+++ trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWTagListDataSource.m
Fri Mar 14 22:23:01 2014
@@ -73,6 +73,9 @@
{
if (nil == item) { item = [self rootObject]; }
NSTreeNode *treeNode = item;
+
+ if (treeNode == allNotesTreeNode)
+ return @"All Notes";
return [(COObject *)[treeNode representedObject] name];
}
@@ -81,6 +84,9 @@
{
if (nil == item) { item = [self rootObject]; }
NSTreeNode *treeNode = item;
+
+ if (treeNode == allNotesTreeNode)
+ return;
COObject *treeNodeRepObj = [treeNode representedObject];
@@ -156,6 +162,10 @@
COTagLibrary *library = [self.owner tagLibrary];
rootTreeNode = [[NSTreeNode alloc] initWithRepresentedObject: library];
+
+ allNotesTreeNode = [[NSTreeNode alloc] initWithRepresentedObject: nil];
+ [[rootTreeNode mutableChildNodes] addObject: allNotesTreeNode];
+
for (COTagGroup *tagGroup in [library tagGroups])
{
NSTreeNode *tagGroupNode = [[NSTreeNode alloc]
initWithRepresentedObject: tagGroup];
@@ -196,12 +206,23 @@
}
}
}
+
+ if ([newSelectedRows isEmpty])
+ {
+ NSInteger allNotesIndex = [self.outlineView rowForItem:
allNotesTreeNode];
+ ETAssert(allNotesIndex != -1);
+ [newSelectedRows addIndex: allNotesIndex];
+ }
+
[self.outlineView selectRowIndexes: newSelectedRows
byExtendingSelection: NO];
[self cacheSelection];
}
- (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item
{
+ if (item == allNotesTreeNode)
+ return YES;
+
return [[item representedObject] isKindOfClass: [COTagGroup class]];
}
Modified:
trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/en.lproj/Document.xib
URL:
http://svn.gna.org/viewcvs/etoile/trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/en.lproj/Document.xib?rev=10567&r1=10566&r2=10567&view=diff
==============================================================================
--- trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/en.lproj/Document.xib
(original)
+++ trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/en.lproj/Document.xib
Fri Mar 14 22:23:01 2014
@@ -214,7 +214,7 @@
</object>
</object>
<double key="NSRowHeight">20</double>
-
<int key="NSTvFlags">-767557632</int>
+
<int key="NSTvFlags">-1035993088</int>
<reference key="NSDelegate"/>
<reference key="NSDataSource"/>
<int
key="NSColumnAutoresizingStyle">4</int>
_______________________________________________
Etoile-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-cvs