Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
Added "Show Deleted" checkbox
Browse files Browse the repository at this point in the history
This requires support for ?include_deleted that I just added to CouchCocoa and TouchDB.
  • Loading branch information
snej committed Sep 4, 2012
1 parent 8d79927 commit 8cac2dd
Show file tree
Hide file tree
Showing 11 changed files with 290 additions and 61 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*.perspectivev3
*.mode1v3
*.framework
*.app
*.zip
xcuserdata/
build/
DerivedData/
4 changes: 4 additions & 0 deletions TouchDB Viewer/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
//gRESTLogLevel = kRESTLogRequestHeaders;
}

- (BOOL) applicationShouldOpenUntitledFile:(NSApplication *)sender {
return NO;
}

@end
3 changes: 3 additions & 0 deletions TouchDB Viewer/DBWindowController.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
- (IBAction) newDocument: (id)sender;
- (IBAction) deleteDocument: (id)sender;

/** Either the QueryResultController or the RevTreeController */
@property (readonly) id outlineController;

- (BOOL) hasColumnForProperty: (NSString*)property;
- (void) addColumnForProperty: (NSString*)property;
- (void) removeColumnForProperty: (NSString*)property;
Expand Down
10 changes: 10 additions & 0 deletions TouchDB Viewer/DBWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ @implementation DBWindowController

- (id)initWithDatabase: (CouchDatabase*)db
{
NSParameterAssert(db != nil);
self = [super initWithWindowNibName: @"DBWindowController"];
if (self) {
_db = db;
Expand Down Expand Up @@ -179,6 +180,11 @@ - (void) showDocColumns {
#pragma mark - ACTIONS:


- (id) outlineController {
return _docsOutline.dataSource;
}


- (IBAction) showDocRevisionTree:(id)sender {
if (_revTreeController.outline)
return;
Expand All @@ -188,9 +194,11 @@ - (IBAction) showDocRevisionTree:(id)sender {

CouchDocument* doc = docs[0];
[self hideDocColumns];
[self willChangeValueForKey: @"outlineController"];
_revTreeController.document = doc;
_queryController.outline = nil;
_revTreeController.outline = _docsOutline;
[self didChangeValueForKey: @"outlineController"];
[self setPathURL: doc.URL];
}

Expand All @@ -200,10 +208,12 @@ - (IBAction) hideDocRevisionTree: (id)sender {
return;
[self showDocColumns];
CouchDocument* doc = _revTreeController.document;
[self willChangeValueForKey: @"outlineController"];
_revTreeController.document = nil;
_revTreeController.outline = nil;
_queryController.outline = _docsOutline;
[_queryController selectDocument: doc];
[self didChangeValueForKey: @"outlineController"];
[self setPathURL: _db.URL];
}

Expand Down
Loading

0 comments on commit 8cac2dd

Please sign in to comment.