From 02ec735687156b295bb129b927f4840ca090d160 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Wed, 29 Jun 2022 11:56:01 -0700 Subject: [PATCH] Remove the file tree, as Sandbox does not permit The Sandbox does not permit such controls to exist. Signed-off-by: Christopher Snowhill --- Application/AppController.h | 4 - Application/AppController.m | 58 - Base.lproj/FileTree.xib | 157 --- Base.lproj/MainMenu.xib | 1335 +++++++++++------------ Cog.xcodeproj/project.pbxproj | 102 -- FileTree/ContainedNode.h | 16 - FileTree/ContainedNode.m | 42 - FileTree/ContainerNode.h | 16 - FileTree/ContainerNode.m | 35 - FileTree/DirectoryNode.h | 15 - FileTree/DirectoryNode.m | 40 - FileTree/FileIconCell.h | 15 - FileTree/FileIconCell.m | 23 - FileTree/FileNode.h | 15 - FileTree/FileNode.m | 17 - FileTree/FileTreeController.h | 26 - FileTree/FileTreeController.m | 85 -- FileTree/FileTreeDataSource.h | 24 - FileTree/FileTreeDataSource.m | 205 ---- FileTree/FileTreeOutlineView.h | 16 - FileTree/FileTreeOutlineView.m | 66 -- FileTree/FileTreeViewController.h | 23 - FileTree/FileTreeViewController.m | 44 - FileTree/PathNode.h | 43 - FileTree/PathNode.m | 155 --- FileTree/PathWatcher.h | 30 - FileTree/PathWatcher.m | 84 -- FileTree/SmartFolderNode.h | 17 - FileTree/SmartFolderNode.m | 90 -- Preferences/Preferences/PathSuggester.m | 6 - Utils/SideViewController.h | 34 - Utils/SideViewController.m | 183 ---- en.lproj/FileTree.strings | 21 - en.lproj/MainMenu.strings | 12 - es.lproj/FileTree.strings | 21 - es.lproj/MainMenu.strings | 12 - 36 files changed, 642 insertions(+), 2445 deletions(-) delete mode 100644 Base.lproj/FileTree.xib delete mode 100644 FileTree/ContainedNode.h delete mode 100644 FileTree/ContainedNode.m delete mode 100644 FileTree/ContainerNode.h delete mode 100644 FileTree/ContainerNode.m delete mode 100644 FileTree/DirectoryNode.h delete mode 100644 FileTree/DirectoryNode.m delete mode 100644 FileTree/FileIconCell.h delete mode 100644 FileTree/FileIconCell.m delete mode 100644 FileTree/FileNode.h delete mode 100644 FileTree/FileNode.m delete mode 100644 FileTree/FileTreeController.h delete mode 100644 FileTree/FileTreeController.m delete mode 100644 FileTree/FileTreeDataSource.h delete mode 100644 FileTree/FileTreeDataSource.m delete mode 100644 FileTree/FileTreeOutlineView.h delete mode 100644 FileTree/FileTreeOutlineView.m delete mode 100644 FileTree/FileTreeViewController.h delete mode 100644 FileTree/FileTreeViewController.m delete mode 100644 FileTree/PathNode.h delete mode 100644 FileTree/PathNode.m delete mode 100644 FileTree/PathWatcher.h delete mode 100644 FileTree/PathWatcher.m delete mode 100644 FileTree/SmartFolderNode.h delete mode 100644 FileTree/SmartFolderNode.m delete mode 100644 Utils/SideViewController.h delete mode 100644 Utils/SideViewController.m delete mode 100644 en.lproj/FileTree.strings delete mode 100644 es.lproj/FileTree.strings diff --git a/Application/AppController.h b/Application/AppController.h index 14675ad30..0193e8ead 100644 --- a/Application/AppController.h +++ b/Application/AppController.h @@ -2,7 +2,6 @@ #import -@class FileTreeViewController; @class PlaybackController; @class PlaylistController; @class PlaylistView; @@ -19,7 +18,6 @@ IBOutlet NSWindow *mainWindow; IBOutlet NSWindow *miniWindow; - IBOutlet NSSplitView *mainView; IBOutlet NSSegmentedControl *playbackButtons; IBOutlet NSButton *fileButton; @@ -46,8 +44,6 @@ IBOutlet NSWindowController *spotlightWindowController; - IBOutlet FileTreeViewController *fileTreeViewController; - IBOutlet PreferencesController *preferencesController; NSOperationQueue *queue; // Since we are the app delegate, we take care of the op queue diff --git a/Application/AppController.m b/Application/AppController.m index 3a56f271a..0ea6126db 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" @@ -238,50 +234,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 @@ -369,20 +326,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]; @@ -456,7 +399,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 be90053d6..daabf2f9f 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 @@ - - - -