diff --git a/Application/AppController.h b/Application/AppController.h index e744d0c1d..24a681e30 100644 --- a/Application/AppController.h +++ b/Application/AppController.h @@ -2,7 +2,6 @@ #import -@class FileTreeViewController; @class PlaybackController; @class PlaylistController; @class PlaylistView; @@ -20,7 +19,6 @@ IBOutlet NSWindow *mainWindow; IBOutlet NSWindow *miniWindow; - IBOutlet NSSplitView *mainView; IBOutlet NSSegmentedControl *playbackButtons; IBOutlet NSButton *fileButton; @@ -47,8 +45,6 @@ IBOutlet NSWindowController *spotlightWindowController; - IBOutlet FileTreeViewController *fileTreeViewController; - IBOutlet SUUpdater *updater; IBOutlet PreferencesController *preferencesController; diff --git a/Application/AppController.m b/Application/AppController.m index 77f905606..811587d8b 100644 --- a/Application/AppController.m +++ b/Application/AppController.m @@ -1,11 +1,7 @@ #import "AppController.h" #import "Cog-Swift.h" -#import "FileTreeController.h" -#import "FileTreeOutlineView.h" -#import "FileTreeViewController.h" #import "FontSizetoLineHeightTransformer.h" #import "OpenURLPanel.h" -#import "PathNode.h" #import "PlaybackController.h" #import "PlaylistController.h" #import "PlaylistEntry.h" @@ -245,50 +241,11 @@ static AppController *kAppController = nil; [self setFloatingMiniWindow:[[NSUserDefaults standardUserDefaults] boolForKey:@"floatingMiniWindow"]]; - // We need file tree view to restore its state here - // so attempt to access file tree view controller's root view - // to force it to read nib and create file tree view for us - // - // TODO: there probably is a more elegant way to do all this - // but i'm too stupid/tired to figure it out now - [fileTreeViewController view]; - - FileTreeOutlineView *outlineView = [fileTreeViewController outlineView]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(nodeExpanded:) name:NSOutlineViewItemDidExpandNotification object:outlineView]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(nodeCollapsed:) name:NSOutlineViewItemDidCollapseNotification object:outlineView]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateDockMenu:) name:CogPlaybackDidBeginNotficiation object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateDockMenu:) name:CogPlaybackDidStopNotficiation object:nil]; [self updateDockMenu:nil]; - NSArray *expandedNodesArray = [[NSUserDefaults standardUserDefaults] valueForKey:@"fileTreeViewExpandedNodes"]; - - if(expandedNodesArray) { - expandedNodes = [[NSMutableSet alloc] initWithArray:expandedNodesArray]; - } else { - expandedNodes = [[NSMutableSet alloc] init]; - } - - DLog(@"Nodes to expand: %@", [expandedNodes description]); - - DLog(@"Num of rows: %ld", [outlineView numberOfRows]); - - if(!outlineView) { - DLog(@"outlineView is NULL!"); - } - - [outlineView reloadData]; - - for(NSInteger i = 0; i < [outlineView numberOfRows]; i++) { - PathNode *pn = [outlineView itemAtRow:i]; - NSString *str = [[pn URL] absoluteString]; - - if([expandedNodes containsObject:str]) { - [outlineView expandItem:pn]; - } - } - [self addObserver:self forKeyPath:@"playlistController.currentEntry" options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew @@ -376,20 +333,6 @@ static AppController *kAppController = nil; } } -- (void)nodeExpanded:(NSNotification *)notification { - PathNode *node = [[notification userInfo] objectForKey:@"NSObject"]; - NSString *url = [[node URL] absoluteString]; - - [expandedNodes addObject:url]; -} - -- (void)nodeCollapsed:(NSNotification *)notification { - PathNode *node = [[notification userInfo] objectForKey:@"NSObject"]; - NSString *url = [[node URL] absoluteString]; - - [expandedNodes removeObject:url]; -} - - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender { if(playbackController.progressOverall) { [playbackController.progressOverall addObserver:self forKeyPath:@"finished" options:0 context:kAppControllerContext]; @@ -463,7 +406,6 @@ static AppController *kAppController = nil; DLog(@"Saving expanded nodes: %@", [expandedNodes description]); - [[NSUserDefaults standardUserDefaults] setValue:[expandedNodes allObjects] forKey:@"fileTreeViewExpandedNodes"]; // Workaround window not restoring it's size and position. [miniWindow setContentSize:NSMakeSize(miniWindow.frame.size.width, 1)]; [miniWindow saveFrameUsingName:@"Mini Window"]; diff --git a/Base.lproj/FileTree.xib b/Base.lproj/FileTree.xib deleted file mode 100644 index 24f9aa092..000000000 --- a/Base.lproj/FileTree.xib +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - StringToURLTransformer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FontSizetoLineHeightTransformer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Base.lproj/MainMenu.xib b/Base.lproj/MainMenu.xib index 355113fc0..f261f6412 100644 --- a/Base.lproj/MainMenu.xib +++ b/Base.lproj/MainMenu.xib @@ -24,668 +24,657 @@ - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - FontSizetoLineHeightTransformer + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FontSizetoLineHeightTransformer + + + + + + + + + + + + + + + + + + + + + - + @@ -707,9 +696,7 @@ - - @@ -852,20 +839,6 @@ - - - -