mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-03-19 17:11:32 +00:00
*** empty log message ***
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@16832 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d0f26f386c
commit
1ff9f6f15b
19 changed files with 352 additions and 198 deletions
45
ChangeLog
45
ChangeLog
|
@ -1,3 +1,48 @@
|
|||
2003-05-29 Serg Stoyan <stoyan@hologr.com>
|
||||
|
||||
* PCMenuController.m:
|
||||
(projectRemoveFiles:): Call removeFilesPermanently.
|
||||
(fileSaveAs:): Implemented.
|
||||
|
||||
* PCAppProj/PCAppProject.m:
|
||||
(init): Initialize rootObjects and rootKeys arrays. Initialize
|
||||
rootCategories dictionary with these arrays to preserve order of
|
||||
categories in browser. "Non Project Files" category added.
|
||||
(dealloc): Release rootObjects and rootKeys arrays.
|
||||
(otherKeys): Added PCNonProject.
|
||||
* PCBundleProj/PCBundleProject.m: Ditto.
|
||||
* PCGormProj/PCGormProject.m: Ditto.
|
||||
* PCLibProj/PCLibProject.m: Ditto.
|
||||
* PCRenaissanceProj/PCRenaissanceProject.m: Ditto.
|
||||
* PCToolProj/PCToolProject.m: Ditto.
|
||||
|
||||
* PCLib/PCBrowserController.[hm]: Rename method setPathForFile: to
|
||||
setPathForFile:category:.
|
||||
* PCLib/PCBrowserController.m:
|
||||
(isEditableCategory:file:): PCOtherSources, PCOtherResources and
|
||||
PCNonProject to editable categories.
|
||||
(projectDictDidChange:): Set path to category if there is no file
|
||||
editing.
|
||||
* PCLib/PCEditor.[hm]: Added _category ivar. Every editor now holds
|
||||
category of the file being edited. Added methods category and
|
||||
setCategory:. Removed saveFileAs: method.
|
||||
* PCLib/PCEditorController.[hm]: Added and implemented method
|
||||
closeEditorForFile:.
|
||||
* PCLib/PCEditorController.m:
|
||||
(editorDidClose:): Call [PCBrowserController projectDictDidChange:]
|
||||
instead of [self setBrowserPath:].
|
||||
* PCLib/PCProject.h: Added PCNonProject contant. Added rootObjects,
|
||||
rootKeys ivars. Removed categoryForFile: method. Renamed
|
||||
removeSelectedFilePermanently: to removeSelectedFilesPermanently:.
|
||||
* PCLib/PCProject.m:
|
||||
(fileExtensionsForCategory:): Removed .m and .M extenstions from
|
||||
PCOtherSources category.
|
||||
(browserDidClickFile:category:): Setting category to editor added.
|
||||
(removeFile:forKey:): Close editor when file removed.
|
||||
(contentAtKeyPath:): Return rootKeys instead of all keys of rootCategories dictionary.
|
||||
(removeFilesPermanently:): Call removeSelectedFilesPermanently:
|
||||
(after renaming).
|
||||
|
||||
2003-05-23 Serg Stoyan <stoyan@hologr.com>
|
||||
|
||||
* PCMenuController.h: Added fileOpenQuickly:, fileNewUntitled:
|
||||
|
|
|
@ -123,27 +123,48 @@
|
|||
|
||||
- (id)init
|
||||
{
|
||||
if ((self = [super init])) {
|
||||
rootCategories = [[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
PCGModels,@"Interfaces",
|
||||
PCSupportingFiles,@"Supporting Files",
|
||||
PCImages,@"Images",
|
||||
PCOtherResources,@"Other Resources",
|
||||
PCSubprojects,@"Subprojects",
|
||||
PCLibraries,@"Libraries",
|
||||
PCDocuFiles,@"Documentation",
|
||||
PCOtherSources,@"Other Sources",
|
||||
PCHeaders,@"Headers",
|
||||
PCClasses,@"Classes",
|
||||
nil] retain];
|
||||
if ((self = [super init]))
|
||||
{
|
||||
rootObjects = [[NSArray arrayWithObjects: PCClasses,
|
||||
PCHeaders,
|
||||
PCOtherSources,
|
||||
PCGModels,
|
||||
PCImages,
|
||||
PCOtherResources,
|
||||
PCSubprojects,
|
||||
PCDocuFiles,
|
||||
PCSupportingFiles,
|
||||
PCLibraries,
|
||||
PCNonProject,
|
||||
nil] retain];
|
||||
|
||||
}
|
||||
rootKeys = [[NSArray arrayWithObjects: @"Classes",
|
||||
@"Headers",
|
||||
@"Other Sources",
|
||||
@"Interfaces",
|
||||
@"Images",
|
||||
@"Other Resources",
|
||||
@"Subprojects",
|
||||
@"Documentation",
|
||||
// @"Context Help",
|
||||
@"Supporting Files",
|
||||
// @"Frameworks",
|
||||
@"Libraries",
|
||||
@"Non Project Files",
|
||||
nil] retain];
|
||||
|
||||
rootCategories = [[NSDictionary
|
||||
dictionaryWithObjects:rootObjects forKeys:rootKeys] retain];
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[rootCategories release];
|
||||
[rootObjects release];
|
||||
[rootKeys release];
|
||||
[appClassField release];
|
||||
[appImageField release];
|
||||
|
||||
|
@ -218,7 +239,8 @@
|
|||
|
||||
- (NSArray *)otherKeys
|
||||
{
|
||||
return [NSArray arrayWithObjects:PCDocuFiles,PCSupportingFiles,nil];
|
||||
return [NSArray arrayWithObjects:PCDocuFiles,PCSupportingFiles,
|
||||
PCNonProject,nil];
|
||||
}
|
||||
|
||||
- (NSArray *)buildTargets
|
||||
|
|
|
@ -83,27 +83,47 @@
|
|||
|
||||
- (id)init
|
||||
{
|
||||
if ((self = [super init])) {
|
||||
rootCategories = [[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
PCGModels,@"Interfaces",
|
||||
PCSupportingFiles,@"Supporting Files",
|
||||
PCImages,@"Images",
|
||||
PCOtherResources,@"Other Resources",
|
||||
PCSubprojects,@"Subprojects",
|
||||
PCLibraries,@"Libraries",
|
||||
PCDocuFiles,@"Documentation",
|
||||
PCOtherSources,@"Other Sources",
|
||||
PCHeaders,@"Headers",
|
||||
PCClasses,@"Classes",
|
||||
nil] retain];
|
||||
|
||||
}
|
||||
if ((self = [super init]))
|
||||
{
|
||||
rootObjects = [[NSArray arrayWithObjects: PCClasses,
|
||||
PCHeaders,
|
||||
PCOtherSources,
|
||||
PCGModels,
|
||||
PCImages,
|
||||
PCOtherResources,
|
||||
PCSubprojects,
|
||||
PCDocuFiles,
|
||||
PCSupportingFiles,
|
||||
PCLibraries,
|
||||
PCNonProject,
|
||||
nil] retain];
|
||||
|
||||
rootKeys = [[NSArray arrayWithObjects: @"Classes",
|
||||
@"Headers",
|
||||
@"Other Sources",
|
||||
@"Interfaces",
|
||||
@"Images",
|
||||
@"Other Resources",
|
||||
@"Subprojects",
|
||||
@"Documentation",
|
||||
@"Supporting Files",
|
||||
@"Libraries",
|
||||
@"Non Project Files",
|
||||
nil] retain];
|
||||
|
||||
rootCategories = [[NSDictionary
|
||||
dictionaryWithObjects:rootObjects forKeys:rootKeys] retain];
|
||||
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[rootCategories release];
|
||||
[rootObjects release];
|
||||
[rootKeys release];
|
||||
[principalClassField release];
|
||||
|
||||
[super dealloc];
|
||||
|
|
|
@ -121,27 +121,46 @@
|
|||
|
||||
- (id)init
|
||||
{
|
||||
if ((self = [super init])) {
|
||||
rootCategories = [[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
PCGModels,@"Interfaces",
|
||||
PCSupportingFiles,@"Supporting Files",
|
||||
PCImages,@"Images",
|
||||
PCOtherResources,@"Other Resources",
|
||||
PCSubprojects,@"Subprojects",
|
||||
PCLibraries,@"Libraries",
|
||||
PCDocuFiles,@"Documentation",
|
||||
PCOtherSources,@"Other Sources",
|
||||
PCHeaders,@"Headers",
|
||||
PCClasses,@"Classes",
|
||||
nil] retain];
|
||||
if ((self = [super init]))
|
||||
{
|
||||
rootObjects = [[NSArray arrayWithObjects: PCClasses,
|
||||
PCHeaders,
|
||||
PCOtherSources,
|
||||
PCGModels,
|
||||
PCImages,
|
||||
PCOtherResources,
|
||||
PCSubprojects,
|
||||
PCDocuFiles,
|
||||
PCSupportingFiles,
|
||||
PCLibraries,
|
||||
PCNonProject,
|
||||
nil] retain];
|
||||
|
||||
rootKeys = [[NSArray arrayWithObjects: @"Classes",
|
||||
@"Headers",
|
||||
@"Other Sources",
|
||||
@"Interfaces",
|
||||
@"Images",
|
||||
@"Other Resources",
|
||||
@"Subprojects",
|
||||
@"Documentation",
|
||||
@"Supporting Files",
|
||||
@"Libraries",
|
||||
@"Non Project Files",
|
||||
nil] retain];
|
||||
|
||||
rootCategories = [[NSDictionary
|
||||
dictionaryWithObjects:rootObjects forKeys:rootKeys] retain];
|
||||
}
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[rootCategories release];
|
||||
[rootObjects release];
|
||||
[rootKeys release];
|
||||
[appClassField release];
|
||||
[appImageField release];
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
|
||||
- (void)setBrowser:(NSBrowser *)aBrowser;
|
||||
- (void)setProject:(PCProject *)aProj;
|
||||
- (BOOL)setPathForFile:(NSString *)file;
|
||||
- (BOOL)setPathForFile:(NSString *)file category:(NSString *)category;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
*/
|
||||
|
||||
#include "PCBrowserController.h"
|
||||
#include "PCEditorController.h"
|
||||
#include "PCProject.h"
|
||||
#include "PCFileManager.h"
|
||||
|
||||
|
@ -84,7 +85,9 @@
|
|||
[k isEqualToString:PCHeaders] ||
|
||||
[k isEqualToString:PCSupportingFiles] ||
|
||||
[k isEqualToString:PCDocuFiles] ||
|
||||
[k isEqualToString:PCOtherSources])
|
||||
[k isEqualToString:PCOtherSources] ||
|
||||
[k isEqualToString:PCOtherResources] ||
|
||||
[k isEqualToString:PCNonProject])
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
@ -100,9 +103,18 @@
|
|||
|
||||
- (void)projectDictDidChange:(NSNotification *)aNotif
|
||||
{
|
||||
if (browser)
|
||||
if (browser)
|
||||
{
|
||||
[browser reloadColumn:[browser lastColumn]];
|
||||
NSString *browserPath = [browser path];
|
||||
NSString *path = [[browserPath componentsSeparatedByString:@"/"] objectAtIndex:1];
|
||||
|
||||
if (![browserPath isEqualToString:path]
|
||||
&& [[[project editorController] allEditors] count] == 0)
|
||||
{
|
||||
[self setPathForFile:nil category:path];
|
||||
}
|
||||
|
||||
[browser reloadColumn:[browser lastColumn]];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -163,13 +175,9 @@
|
|||
project = aProj;
|
||||
}
|
||||
|
||||
- (BOOL)setPathForFile:(NSString *)file
|
||||
- (BOOL)setPathForFile:(NSString *)file category:(NSString *)category
|
||||
{
|
||||
NSString *category = [project categoryForFile:file];
|
||||
NSString *browserCategory = [[[project rootCategories]
|
||||
allKeysForObject: category]
|
||||
lastObject];
|
||||
NSArray *comp = [NSArray arrayWithObjects: @"/",browserCategory,file,nil];
|
||||
NSArray *comp = [NSArray arrayWithObjects: @"/",category,@"/",file,nil];
|
||||
NSString *path = [NSString pathWithComponents:comp];
|
||||
|
||||
int selectedColumn;
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
NSTextStorage *_storage;
|
||||
NSWindow *_window;
|
||||
NSMutableString *_path;
|
||||
NSString *_category;
|
||||
|
||||
id _delegate;
|
||||
|
||||
|
@ -40,6 +41,8 @@
|
|||
- (NSWindow *)editorWindow;
|
||||
- (NSString *)path;
|
||||
- (void)setPath:(NSString *)path;
|
||||
- (NSString *)category;
|
||||
- (void)setCategory:(NSString *)category;
|
||||
- (BOOL)isEdited;
|
||||
- (void)setIsEdited:(BOOL)yn;
|
||||
|
||||
|
@ -47,7 +50,6 @@
|
|||
- (void)show;
|
||||
- (BOOL)saveFileIfNeeded;
|
||||
- (BOOL)saveFile;
|
||||
- (BOOL)saveFileAs:(NSString *)path;
|
||||
- (BOOL)saveFileTo:(NSString *)path;
|
||||
- (BOOL)revertFileToSaved;
|
||||
- (BOOL)closeFile:(id)sender;
|
||||
|
|
|
@ -119,6 +119,16 @@ NSString *PCEditorDidResignKeyNotification=@"PCEditorDidResignKeyNotification";
|
|||
_path = [path copy];
|
||||
}
|
||||
|
||||
- (NSString *)category
|
||||
{
|
||||
return _category;
|
||||
}
|
||||
|
||||
- (void)setCategory:(NSString *)category
|
||||
{
|
||||
_category = [category copy];
|
||||
}
|
||||
|
||||
- (BOOL)isEdited
|
||||
{
|
||||
return _isEdited;
|
||||
|
@ -162,15 +172,6 @@ NSString *PCEditorDidResignKeyNotification=@"PCEditorDidResignKeyNotification";
|
|||
return [[_storage string] writeToFile:_path atomically:YES];
|
||||
}
|
||||
|
||||
- (BOOL)saveFileAs:(NSString *)path
|
||||
{
|
||||
// Unfinished
|
||||
/* [self setPath:file];
|
||||
|
||||
// Operate on the text storage!*/
|
||||
return [self saveFile];
|
||||
}
|
||||
|
||||
- (BOOL)saveFileTo:(NSString *)path
|
||||
{
|
||||
// Operate on the text storage!
|
||||
|
@ -323,3 +324,4 @@ NSString *PCEditorDidResignKeyNotification=@"PCEditorDidResignKeyNotification";
|
|||
}
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
- (PCEditor *)editorForFile:(NSString *)path;
|
||||
- (PCEditor *)activeEditor;
|
||||
- (NSArray *)allEditors;
|
||||
- (void)closeEditorForFile:(NSString *)file;
|
||||
- (void)closeAllEditors;
|
||||
|
||||
|
||||
|
|
|
@ -168,6 +168,15 @@
|
|||
return [editorDict allValues];
|
||||
}
|
||||
|
||||
- (void)closeEditorForFile:(NSString *)file
|
||||
{
|
||||
PCEditor *editor;
|
||||
|
||||
editor = [editorDict objectForKey:file];
|
||||
[editor closeFile:self];
|
||||
[editorDict removeObjectForKey:file];
|
||||
}
|
||||
|
||||
- (void)closeAllEditors
|
||||
{
|
||||
NSEnumerator *enumerator = [editorDict keyEnumerator];
|
||||
|
@ -224,7 +233,13 @@
|
|||
|
||||
if (editor != nil)
|
||||
{
|
||||
return [editor saveFileAs:file];
|
||||
BOOL res;
|
||||
res = [editor saveFileTo:file];
|
||||
[editor closeFile:self];
|
||||
|
||||
[[self internalEditorForFile:file]
|
||||
showInProjectEditor:[project projectEditor]];
|
||||
return res;
|
||||
}
|
||||
|
||||
return NO;
|
||||
|
@ -259,7 +274,6 @@
|
|||
[[self activeEditor] closeFile:self];
|
||||
}
|
||||
|
||||
|
||||
// ===========================================================================
|
||||
// ==== Delegate
|
||||
// ===========================================================================
|
||||
|
@ -279,13 +293,14 @@
|
|||
else
|
||||
{
|
||||
[[project projectEditor] setEditorView:nil];
|
||||
[self setBrowserPath:nil];
|
||||
[[project browserController] projectDictDidChange:nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setBrowserPath:(NSString *)file
|
||||
{
|
||||
[(PCBrowserController *)[project browserController] setPathForFile:file];
|
||||
[[project browserController] setPathForFile:file
|
||||
category:[[self activeEditor] category]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -226,16 +226,3 @@ static int _tabFlags = PCTab4Sp;
|
|||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -81,15 +81,17 @@ typedef int PCProjInfoBits;
|
|||
|
||||
static NSString * const PCClasses = @"CLASS_FILES";
|
||||
static NSString * const PCHeaders = @"HEADER_FILES";
|
||||
static NSString * const PCGSMarkupFiles = @"INTERFACES";
|
||||
static NSString * const PCOtherSources = @"OTHER_SOURCES";
|
||||
static NSString * const PCOtherResources = @"OTHER_RESOURCES";
|
||||
static NSString * const PCSupportingFiles = @"SUPPORTING_FILES";
|
||||
static NSString * const PCDocuFiles = @"DOCU_FILES";
|
||||
static NSString * const PCSubprojects = @"SUBPROJECTS";
|
||||
static NSString * const PCGModels = @"INTERFACES";
|
||||
static NSString * const PCImages = @"IMAGES";
|
||||
static NSString * const PCOtherResources = @"OTHER_RESOURCES";
|
||||
static NSString * const PCSubprojects = @"SUBPROJECTS";
|
||||
static NSString * const PCDocuFiles = @"DOCU_FILES";
|
||||
static NSString * const PCSupportingFiles = @"SUPPORTING_FILES";
|
||||
static NSString * const PCLibraries = @"LIBRARIES";
|
||||
static NSString * const PCNonProject = @"NON_PROJECT_FILES";
|
||||
static NSString * const PCGSMarkupFiles = @"INTERFACES";
|
||||
|
||||
static NSString * const PCCompilerOptions = @"COMPILEROPTIONS";
|
||||
static NSString * const PCLinkerOptions = @"LINKEROPTIONS";
|
||||
static NSString * const PCProjectName = @"PROJECT_NAME";
|
||||
|
@ -158,6 +160,8 @@ static NSString * const PCBuildTool = @"BUILDTOOL";
|
|||
NSString *projectPath;
|
||||
NSMutableDictionary *projectDict;
|
||||
|
||||
NSArray *rootObjects;
|
||||
NSArray *rootKeys;
|
||||
NSDictionary *rootCategories; // Needs to be initialised by subclasses!
|
||||
NSMutableDictionary *buildOptions;
|
||||
|
||||
|
@ -181,7 +185,6 @@ static NSString * const PCBuildTool = @"BUILDTOOL";
|
|||
- (NSString *)selectedRootCategory;
|
||||
|
||||
- (NSArray *)fileExtensionsForCategory:(NSString *)key;
|
||||
- (NSString *)categoryForFile:(NSString *)file;
|
||||
|
||||
- (void)setProjectName:(NSString *)aName;
|
||||
- (NSString *)projectName;
|
||||
|
@ -236,7 +239,7 @@ static NSString * const PCBuildTool = @"BUILDTOOL";
|
|||
- (void)addFile:(NSString *)file forKey:(NSString *)key copy:(BOOL)yn;
|
||||
|
||||
- (void)removeFile:(NSString *)file forKey:(NSString *)key;
|
||||
- (BOOL)removeSelectedFilePermanently:(BOOL)yn;
|
||||
- (BOOL)removeSelectedFilesPermanently:(BOOL)yn;
|
||||
- (void)renameFile:(NSString *)aFile;
|
||||
|
||||
- (BOOL)assignProjectDict:(NSDictionary *)aDict;
|
||||
|
|
|
@ -148,7 +148,7 @@
|
|||
return [NSArray arrayWithObjects:@"h",nil];
|
||||
}
|
||||
else if ([key isEqualToString:PCOtherSources]) {
|
||||
return [NSArray arrayWithObjects:@"c",@"C",@"m",@"M",nil];
|
||||
return [NSArray arrayWithObjects:@"c",@"C",nil];
|
||||
}
|
||||
else if ([key isEqualToString:PCLibraries]) {
|
||||
return [NSArray arrayWithObjects:@"so",@"a",@"lib",nil];
|
||||
|
@ -163,55 +163,6 @@
|
|||
return nil;
|
||||
}
|
||||
|
||||
- (NSString *)categoryForFile:(NSString *)file
|
||||
{
|
||||
NSString *fileExt = [[file componentsSeparatedByString: @"."] lastObject];
|
||||
|
||||
if ([fileExt isEqualToString:@"gmodel"] || [fileExt isEqualToString:@"gorm"])
|
||||
{
|
||||
return PCGModels;
|
||||
}
|
||||
else if ([fileExt isEqualToString:@"gsmarkup"])
|
||||
{
|
||||
return PCGSMarkupFiles;
|
||||
}
|
||||
else if ([fileExt isEqualToString:@"h"] || [fileExt isEqualToString:@"H"])
|
||||
{
|
||||
return PCHeaders;
|
||||
}
|
||||
else if ([fileExt isEqualToString:@"m"] || [fileExt isEqualToString:@"M"])
|
||||
{
|
||||
return PCClasses;
|
||||
}
|
||||
else if ([fileExt isEqualToString:@"c"] || [fileExt isEqualToString:@"C"])
|
||||
{
|
||||
return PCOtherSources;
|
||||
}
|
||||
else if ([fileExt isEqualToString:@"so"] || [fileExt isEqualToString:@"lib"]
|
||||
|| [fileExt isEqualToString:@"a"])
|
||||
{
|
||||
return PCLibraries;
|
||||
}
|
||||
else if ([fileExt isEqualToString:@"subproj"])
|
||||
{
|
||||
return PCSubprojects;
|
||||
}
|
||||
else if ([[NSImage imageFileTypes] containsObject: fileExt])
|
||||
{
|
||||
return PCImages;
|
||||
}
|
||||
else if ([file hasPrefix: @"GNUmakefile"])
|
||||
{
|
||||
return PCSupportingFiles;
|
||||
}
|
||||
else if (file != nil)
|
||||
{
|
||||
return PCOtherResources;
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)setProjectName:(NSString *)aName
|
||||
{
|
||||
AUTORELEASE(projectName);
|
||||
|
@ -351,6 +302,7 @@
|
|||
}
|
||||
|
||||
[self showEditorView:self];
|
||||
[e setCategory:c];
|
||||
[e showInProjectEditor:projectEditor];
|
||||
|
||||
[projectWindow makeFirstResponder:(NSResponder*)[projectEditor editorView]];
|
||||
|
@ -358,13 +310,14 @@
|
|||
|
||||
- (void)browserDidDblClickFile:(NSString *)fileName category:(NSString*)c
|
||||
{
|
||||
PCEditor *e;
|
||||
PCEditor *e;
|
||||
|
||||
e = [editorController editorForFile:fileName];
|
||||
e = [editorController editorForFile:fileName];
|
||||
|
||||
if( e )
|
||||
if (e)
|
||||
{
|
||||
[e show];
|
||||
[e setCategory:c];
|
||||
[e show];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -431,12 +384,20 @@
|
|||
|
||||
- (void)removeFile:(NSString *)file forKey:(NSString *)key
|
||||
{
|
||||
NSMutableArray *array;
|
||||
NSMutableArray *array;
|
||||
NSMutableString *filePath;
|
||||
|
||||
if (!file || !key) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Close editor
|
||||
filePath = [[NSMutableString alloc] initWithString:projectPath];
|
||||
[filePath appendString:@"/"];
|
||||
[filePath appendString:file];
|
||||
[editorController closeEditorForFile:filePath];
|
||||
[filePath release];
|
||||
|
||||
array = [NSMutableArray arrayWithArray:[projectDict objectForKey:key]];
|
||||
[array removeObject:file];
|
||||
[projectDict setObject:array forKey:key];
|
||||
|
@ -444,7 +405,7 @@
|
|||
[projectWindow setDocumentEdited:YES];
|
||||
}
|
||||
|
||||
- (BOOL)removeSelectedFilePermanently:(BOOL)yn
|
||||
- (BOOL)removeSelectedFilesPermanently:(BOOL)yn
|
||||
{
|
||||
NSEnumerator *files = [[browserController selectedFiles] objectEnumerator];
|
||||
NSString *file = nil;
|
||||
|
@ -824,8 +785,9 @@
|
|||
NSLog(@"<%@ %x>: content at path %@",[self class],self,keyPath);
|
||||
#endif
|
||||
|
||||
if ([keyPath isEqualToString:@""] || [keyPath isEqualToString:@"/"]) {
|
||||
return [rootCategories allKeys];
|
||||
if ([keyPath isEqualToString:@""] || [keyPath isEqualToString:@"/"])
|
||||
{
|
||||
return rootKeys;
|
||||
}
|
||||
|
||||
key = [[keyPath componentsSeparatedByString:@"/"] lastObject];
|
||||
|
|
|
@ -156,7 +156,7 @@
|
|||
- (void)closeFile;
|
||||
|
||||
- (BOOL)renameFileTo:(NSString *)path;
|
||||
- (BOOL)removeFilePermanently:(BOOL)yn;
|
||||
- (BOOL)removeFilesPermanently:(BOOL)yn;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -491,14 +491,14 @@ NSString *ActiveProjectDidChangeNotification = @"ActiveProjectDidChange";
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)removeFilePermanently:(BOOL)yn
|
||||
- (BOOL)removeFilesPermanently:(BOOL)yn
|
||||
{
|
||||
if (!activeProject)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
return [activeProject removeSelectedFilePermanently:yn];
|
||||
return [activeProject removeSelectedFilesPermanently:yn];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -54,16 +54,30 @@
|
|||
- (id)init
|
||||
{
|
||||
if ((self = [super init])) {
|
||||
rootCategories = [[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
PCSupportingFiles,@"Supporting Files",
|
||||
PCSubprojects, @"Subprojects",
|
||||
PCLibraries, @"Libraries",
|
||||
PCDocuFiles,@"Documentation",
|
||||
PCOtherResources,@"Other Resources",
|
||||
PCOtherSources,@"Other Sources",
|
||||
PCHeaders,@"Headers",
|
||||
PCClasses,@"Classes",
|
||||
nil] retain];
|
||||
rootObjects = [[NSArray arrayWithObjects: PCClasses,
|
||||
PCHeaders,
|
||||
PCOtherSources,
|
||||
PCOtherResources,
|
||||
PCSubprojects,
|
||||
PCDocuFiles,
|
||||
PCSupportingFiles,
|
||||
PCLibraries,
|
||||
PCNonProject,
|
||||
nil] retain];
|
||||
|
||||
rootKeys = [[NSArray arrayWithObjects: @"Classes",
|
||||
@"Headers",
|
||||
@"Other Sources",
|
||||
@"Other Resources",
|
||||
@"Subprojects",
|
||||
@"Documentation",
|
||||
@"Supporting Files",
|
||||
@"Libraries",
|
||||
@"Non Project Files",
|
||||
nil] retain];
|
||||
|
||||
rootCategories = [[NSDictionary
|
||||
dictionaryWithObjects:rootObjects forKeys:rootKeys] retain];
|
||||
|
||||
}
|
||||
return self;
|
||||
|
@ -72,6 +86,8 @@
|
|||
- (void)dealloc
|
||||
{
|
||||
[rootCategories release];
|
||||
[rootObjects release];
|
||||
[rootKeys release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
|
|
@ -255,7 +255,7 @@
|
|||
{
|
||||
BOOL flag = (ret == NSAlertOtherReturn) ? YES : NO;
|
||||
|
||||
[projectManager removeFilePermanently:flag];
|
||||
[projectManager removeFilesPermanently:flag];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -343,22 +343,29 @@
|
|||
// Not finished
|
||||
- (void)fileSaveAs:(id)sender
|
||||
{
|
||||
/* NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||
NSSavePanel *savePanel = [NSSavePanel savePanel];;
|
||||
NSString *oldFilePath;
|
||||
NSString *newFilePath;
|
||||
int retval;
|
||||
NSString *oldFilePath = nil;
|
||||
NSString *newFilePath = nil;
|
||||
NSString *directory = nil;
|
||||
int retval = NSOKButton;
|
||||
|
||||
oldFilePath =
|
||||
[[[[projectManager activeProject] editorController] activeEditor] path];
|
||||
|
||||
[savePanel setTitle: @"Save As..."];
|
||||
retval = [savePanel runModalForDirectory:[projectManager projectPath]
|
||||
file:[projectManager selectedFileName]];
|
||||
while (![directory isEqualToString: [projectManager projectPath]]
|
||||
&& retval != NSCancelButton)
|
||||
{
|
||||
retval = [savePanel
|
||||
runModalForDirectory:[projectManager projectPath]
|
||||
file:[projectManager selectedFileName]];
|
||||
directory = [savePanel directory];
|
||||
}
|
||||
|
||||
if (retval == NSOKButton)
|
||||
{
|
||||
[ud setObject:[savePanel directory] forKey:@"LastOpenDirectory"];
|
||||
[ud setObject:directory forKey:@"LastOpenDirectory"];
|
||||
|
||||
newFilePath = [savePanel filename];
|
||||
|
||||
|
@ -368,10 +375,17 @@
|
|||
@"Couldn't save file as\n%@!",
|
||||
@"OK",nil,nil,newFilePath);
|
||||
}
|
||||
}*/
|
||||
NSRunAlertPanel(@"PCMenuController: Sorry!",
|
||||
@"This feature not finished yet",
|
||||
@"OK",nil,nil);
|
||||
else
|
||||
{
|
||||
PCProject *project = [projectManager activeProject];
|
||||
NSString *category = [[[project rootCategories] allKeysForObject:PCNonProject] objectAtIndex:0];
|
||||
|
||||
[projectManager closeFile];
|
||||
[project addFile:newFilePath forKey:PCNonProject];
|
||||
[project browserDidClickFile:[newFilePath lastPathComponent]
|
||||
category:category];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)fileSaveTo:(id)sender
|
||||
|
|
|
@ -122,27 +122,46 @@
|
|||
|
||||
- (id)init
|
||||
{
|
||||
if ((self = [super init])) {
|
||||
rootCategories = [[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
PCGModels,@"Interfaces",
|
||||
PCSupportingFiles,@"Supporting Files",
|
||||
PCImages,@"Images",
|
||||
PCOtherResources,@"Other Resources",
|
||||
PCSubprojects,@"Subprojects",
|
||||
PCLibraries,@"Libraries",
|
||||
PCDocuFiles,@"Documentation",
|
||||
PCOtherSources,@"Other Sources",
|
||||
PCHeaders,@"Headers",
|
||||
PCClasses,@"Classes",
|
||||
nil] retain];
|
||||
if ((self = [super init]))
|
||||
{
|
||||
rootObjects = [[NSArray arrayWithObjects: PCClasses,
|
||||
PCHeaders,
|
||||
PCOtherSources,
|
||||
PCGModels,
|
||||
PCImages,
|
||||
PCOtherResources,
|
||||
PCSubprojects,
|
||||
PCDocuFiles,
|
||||
PCSupportingFiles,
|
||||
PCLibraries,
|
||||
PCNonProject,
|
||||
nil] retain];
|
||||
|
||||
rootKeys = [[NSArray arrayWithObjects: @"Classes",
|
||||
@"Headers",
|
||||
@"Other Sources",
|
||||
@"Interfaces",
|
||||
@"Images",
|
||||
@"Other Resources",
|
||||
@"Subprojects",
|
||||
@"Documentation",
|
||||
@"Supporting Files",
|
||||
@"Libraries",
|
||||
@"Non Project Files",
|
||||
nil] retain];
|
||||
|
||||
rootCategories = [[NSDictionary
|
||||
dictionaryWithObjects:rootObjects forKeys:rootKeys] retain];
|
||||
}
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[rootCategories release];
|
||||
[rootObjects release];
|
||||
[rootKeys release];
|
||||
[appClassField release];
|
||||
[appImageField release];
|
||||
|
||||
|
|
|
@ -53,26 +53,45 @@
|
|||
|
||||
- (id)init
|
||||
{
|
||||
if ((self = [super init])) {
|
||||
rootCategories = [[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
PCSupportingFiles,@"Supporting Files",
|
||||
PCImages,@"Images",
|
||||
PCOtherResources,@"Other Resources",
|
||||
PCSubprojects,@"Subprojects",
|
||||
PCLibraries,@"Libraries",
|
||||
PCDocuFiles,@"Documentation",
|
||||
PCOtherSources,@"Other Sources",
|
||||
PCHeaders,@"Headers",
|
||||
PCClasses,@"Classes",
|
||||
nil] retain];
|
||||
if ((self = [super init]))
|
||||
{
|
||||
rootObjects = [[NSArray arrayWithObjects: PCClasses,
|
||||
PCHeaders,
|
||||
PCOtherSources,
|
||||
PCImages,
|
||||
PCOtherResources,
|
||||
PCSubprojects,
|
||||
PCDocuFiles,
|
||||
PCSupportingFiles,
|
||||
PCLibraries,
|
||||
PCNonProject,
|
||||
nil] retain];
|
||||
|
||||
rootKeys = [[NSArray arrayWithObjects: @"Classes",
|
||||
@"Headers",
|
||||
@"Other Sources",
|
||||
@"Images",
|
||||
@"Other Resources",
|
||||
@"Subprojects",
|
||||
@"Documentation",
|
||||
@"Supporting Files",
|
||||
@"Libraries",
|
||||
@"Non Project Files",
|
||||
nil] retain];
|
||||
|
||||
rootCategories = [[NSDictionary
|
||||
dictionaryWithObjects:rootObjects forKeys:rootKeys] retain];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[rootCategories release];
|
||||
[rootObjects release];
|
||||
[rootKeys release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue