Author: ericwa
Date: Thu Mar 20 03:19:41 2014
New Revision: 10593

URL: http://svn.gna.org/viewcvs/etoile?rev=10593&view=rev
Log:
Typewriter: don't create a default tag group

Modified:
    trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWDocument.m
    
trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWTypewriterWindowController.m
    trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/TODO.md

Modified: trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWDocument.m
URL: 
http://svn.gna.org/viewcvs/etoile/trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWDocument.m?rev=10593&r1=10592&r2=10593&view=diff
==============================================================================
--- trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWDocument.m  
(original)
+++ trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWDocument.m  Thu Mar 
20 03:19:41 2014
@@ -37,12 +37,6 @@
        if ([libraryPersistentRoots count] == 0)
        {
                library = [ctx insertNewPersistentRootWithEntityName: 
@"COTagLibrary"];
-               
-               // Create a default tag group
-               COTagGroup *defaultTagGroup = [[COTagGroup alloc] 
initWithObjectGraphContext: library.objectGraphContext];
-               defaultTagGroup.name = @"Default Tag Group";
-               [(COTagLibrary *)library.rootObject setTagGroups: 
@[defaultTagGroup]];
-               
                [ctx commit];
        }
        else if ([libraryPersistentRoots count] == 1)

Modified: 
trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWTypewriterWindowController.m
URL: 
http://svn.gna.org/viewcvs/etoile/trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWTypewriterWindowController.m?rev=10593&r1=10592&r2=10593&view=diff
==============================================================================
--- 
trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWTypewriterWindowController.m
        (original)
+++ 
trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/EWTypewriterWindowController.m
        Thu Mar 20 03:19:41 2014
@@ -260,7 +260,10 @@
 {
        COTagGroup *targetTagGroup = [self tagGroupOfSelectedRow];
        if (targetTagGroup == nil)
-               targetTagGroup = [self defaultTagGroup];
+       {
+               NSLog(@"Couldn't create tag; no tag group to insert it in to");
+               return;
+       }
 
        __block COTag *newTag = nil;
        
@@ -727,23 +730,25 @@
 - (void) selectNote: (COPersistentRoot *)aNote
 {
        selectedNote = aNote;
-       
-       // Make a temporary copy of the note's current state. We use this to 
generate the diff for the commit metadata.
-       selectedNoteCommittedState = [COObjectGraphContext new];
-       [selectedNoteCommittedState setItemGraph: 
selectedNote.objectGraphContext];
-       
+               
        if (selectedNote == nil)
        {
                // Nothing selected
                NSLog(@"Nothing selected");
                [textView setEditable: NO];
                [textView setHidden: YES];
+               
+               selectedNoteCommittedState = nil;
                return;
        }
        else
        {
                [textView setEditable: YES];
                [textView setHidden: NO];
+               
+               // Make a temporary copy of the note's current state. We use 
this to generate the diff for the commit metadata.
+               selectedNoteCommittedState = [COObjectGraphContext new];
+               [selectedNoteCommittedState setItemGraph: 
selectedNote.objectGraphContext];
        }
        
        TypewriterDocument *doc = [selectedNote rootObject];
@@ -844,11 +849,6 @@
        return [[[self document] libraryPersistentRoot] rootObject];
 }
 
-- (COTagGroup *)defaultTagGroup
-{
-       return [self tagLibrary].tagGroups[0];
-}
-
 #pragma mark - Search
 
 - (void)search:(id)sender

Modified: trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/TODO.md
URL: 
http://svn.gna.org/viewcvs/etoile/trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/TODO.md?rev=10593&r1=10592&r2=10593&view=diff
==============================================================================
--- trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/TODO.md       
(original)
+++ trunk/Etoile/Frameworks/CoreObject/Samples/Typewriter/TODO.md       Thu Mar 
20 03:19:41 2014
@@ -2,7 +2,7 @@
 ===============
 
 - [ ] Maybe commit text changes when the user manually moves the insertion 
point, to try to avoid "... and other edits" commits
-- [ ] Don't create Default Tag Group
+- [x] Don't create Default Tag Group
 - [ ] Delete' is enabled in the menus for All Notes
 - [ ] if not tag group exists, new tags you create remain invisible (and the 
button and menu actions are not disabled)… I guess the solution is to create 
a New Tag Group at the same time, if there is none.
 - [ ] name a new tag group just Untitled Tag Group X


_______________________________________________
Etoile-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-cvs

Reply via email to