mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-02-19 01:51:09 +00:00
* PCMenuController.m:
(validateMenuItem:): Enable "File" menu items for files opened witout project. It fixes bug #25311 (now file saved). * Framework/PCProjectManager.m: (openFileAtPath:): Call to orderFrontEditorForFile: explicitly because of last change in PCEditorManager. * Framework/PCProjectBrowser.m: (doubleClick:): Do not open file in separate window with PCProjectEditor not PCProjectManager. * Framework/PCProjectEditor.m: (openEditorForCategoryPath:windowed:): Cleanup. * Framework/PCEditorManager.m: (openEditorForFile:editable:windowed:): Remove call to orderFrontEditorForFile:. * Modules/Editors/ProjectCenter/PCEditor.m: (_createWindow): Modify default size and position of window. (openFileAtPath:editorManager:editable:): Remove creation of internal view. Create it when first requested (editorView and componentView methods). (windowDidBecomeKey:) No need to set first responder. It seems first responder remembered by window correctly. (windowDidResignKey:): Call resignFirstResponder: to notify others. * Modules/Projects/Application/PCAppProject.m: (dealloc): TODO added. * Documentation/TODO: Mark "Finish FileNameIcon..." task as done. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@27807 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9b5a3b8e4c
commit
a417d8581e
8 changed files with 50 additions and 57 deletions
|
@ -46,8 +46,8 @@ ProjectCenter 0.6
|
||||||
- Create new Info panel [done!]
|
- Create new Info panel [done!]
|
||||||
- Implement support for integrated debugging [90% done]
|
- Implement support for integrated debugging [90% done]
|
||||||
- change project type from file to bundle casamento/mottola
|
- change project type from file to bundle casamento/mottola
|
||||||
- Finish FileNameIcon (draggable, files can be dragged to it) stoyan
|
- Finish FileNameIcon (draggable, files can be dragged to it) [done!]
|
||||||
- Review all situations when dialogs must be popped up stoyan
|
- Review all situations when dialogs must be popped up stoyan
|
||||||
- Rewrite Preferences (3rd party sections etc.) stoyan
|
- Rewrite Preferences (3rd party sections etc.) stoyan
|
||||||
- More options for file creation stoyan
|
- More options for file creation stoyan
|
||||||
--- Project Editor ---------------------------------------------
|
--- Project Editor ---------------------------------------------
|
||||||
|
@ -60,6 +60,8 @@ ProjectCenter 0.6
|
||||||
- Implement interaction with Editor (errors, warnings) stoyan
|
- Implement interaction with Editor (errors, warnings) stoyan
|
||||||
- Think about imlementing pending adding/removal of files ???
|
- Think about imlementing pending adding/removal of files ???
|
||||||
- New icons. Need volonteers!!! ???
|
- New icons. Need volonteers!!! ???
|
||||||
|
- Split "Application GORM" and "Application Renaissance"
|
||||||
|
project types ???
|
||||||
- Add "Palette" project type ???
|
- Add "Palette" project type ???
|
||||||
- Add "Component" project type ???
|
- Add "Component" project type ???
|
||||||
|
|
||||||
|
|
|
@ -106,9 +106,9 @@ NSString *PCEditorDidResignActiveNotification =
|
||||||
|
|
||||||
- (void)dealloc
|
- (void)dealloc
|
||||||
{
|
{
|
||||||
#ifdef DEVELOPMENT
|
#ifdef DEBUG
|
||||||
#endif
|
|
||||||
NSLog (@"PCEditorManager: dealloc");
|
NSLog (@"PCEditorManager: dealloc");
|
||||||
|
#endif
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||||
|
|
||||||
|
@ -149,8 +149,6 @@ NSString *PCEditorDidResignActiveNotification =
|
||||||
id<CodeEditor> editor;
|
id<CodeEditor> editor;
|
||||||
id<CodeParser> parser;
|
id<CodeParser> parser;
|
||||||
|
|
||||||
NSLog(@"EditorManager: openEditorForFile: \"%@\"", filePath);
|
|
||||||
|
|
||||||
// Determine if file not exist or file is directory
|
// Determine if file not exist or file is directory
|
||||||
if (![fm fileExistsAtPath:filePath isDirectory:&isDir] || isDir)
|
if (![fm fileExistsAtPath:filePath isDirectory:&isDir] || isDir)
|
||||||
{
|
{
|
||||||
|
@ -165,7 +163,9 @@ NSString *PCEditorDidResignActiveNotification =
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(editor = [_editorsDict objectForKey:filePath]))
|
NSLog(@"EditorManager 1: %@", _editorsDict);
|
||||||
|
editor = [_editorsDict objectForKey:filePath];
|
||||||
|
if (editor == nil)
|
||||||
{
|
{
|
||||||
NSLog(@"Opening new editor");
|
NSLog(@"Opening new editor");
|
||||||
// Editor
|
// Editor
|
||||||
|
@ -193,12 +193,9 @@ NSString *PCEditorDidResignActiveNotification =
|
||||||
[_editorsDict setObject:editor forKey:filePath];
|
[_editorsDict setObject:editor forKey:filePath];
|
||||||
RELEASE(editor);
|
RELEASE(editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
[editor setWindowed:windowed];
|
[editor setWindowed:windowed];
|
||||||
|
// [self orderFrontEditorForFile:filePath];
|
||||||
[self orderFrontEditorForFile:filePath];
|
|
||||||
|
|
||||||
NSLog(@"EditorManager: %@", _editorsDict);
|
|
||||||
|
|
||||||
return editor;
|
return editor;
|
||||||
}
|
}
|
||||||
|
|
|
@ -394,8 +394,8 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification";
|
||||||
|
|
||||||
- (void)doubleClick:(id)sender
|
- (void)doubleClick:(id)sender
|
||||||
{
|
{
|
||||||
|
NSString *category = [self nameOfSelectedCategory];
|
||||||
id selectedCell;
|
id selectedCell;
|
||||||
NSString *category;
|
|
||||||
NSString *fileName;
|
NSString *fileName;
|
||||||
PCProject *activeProject;
|
PCProject *activeProject;
|
||||||
NSString *key;
|
NSString *key;
|
||||||
|
@ -403,14 +403,12 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification";
|
||||||
NSWorkspace *workspace;
|
NSWorkspace *workspace;
|
||||||
NSString *appName, *type;
|
NSString *appName, *type;
|
||||||
|
|
||||||
if ((sender != browser) ||
|
if ((sender != browser) || [category isEqualToString:@"Libraries"])
|
||||||
[[self nameOfSelectedCategory] isEqualToString:@"Libraries"])
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
selectedCell = [sender selectedCell];
|
selectedCell = [sender selectedCell];
|
||||||
category = [self nameOfSelectedCategory];
|
|
||||||
fileName = [[sender selectedCell] stringValue];
|
fileName = [[sender selectedCell] stringValue];
|
||||||
activeProject = [[project projectManager] activeProject];
|
activeProject = [[project projectManager] activeProject];
|
||||||
key = [activeProject keyForCategory:category];
|
key = [activeProject keyForCategory:category];
|
||||||
|
@ -430,13 +428,10 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification";
|
||||||
// name will be returned according that setting. Otherwise
|
// name will be returned according that setting. Otherwise
|
||||||
// 'ProjectCenter.app' will be returned accoring to NSTypes
|
// 'ProjectCenter.app' will be returned accoring to NSTypes
|
||||||
// from Info-gnustep.plist file of PC.
|
// from Info-gnustep.plist file of PC.
|
||||||
if(foundApp == NO)
|
if(foundApp == NO || [appName isEqualToString:@"ProjectCenter.app"])
|
||||||
{
|
{
|
||||||
if (appName == nil || [appName isEqualToString:@"ProjectCenter.app"])
|
[[activeProject projectEditor] openEditorForCategoryPath:[self path]
|
||||||
{
|
windowed:YES];
|
||||||
[[project projectEditor] openEditorForCategoryPath:[browser path]
|
|
||||||
windowed:YES];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -182,7 +182,7 @@
|
||||||
// 2. "/Subprojects/Project/Classes/Class.m/- init"
|
// 2. "/Subprojects/Project/Classes/Class.m/- init"
|
||||||
// 3. "/Library/gnustep-gui"
|
// 3. "/Library/gnustep-gui"
|
||||||
- (id<CodeEditor>)openEditorForCategoryPath:(NSString *)categoryPath
|
- (id<CodeEditor>)openEditorForCategoryPath:(NSString *)categoryPath
|
||||||
windowed:(BOOL)windowed
|
windowed:(BOOL)windowed
|
||||||
{
|
{
|
||||||
NSArray *pathArray = [categoryPath pathComponents];
|
NSArray *pathArray = [categoryPath pathComponents];
|
||||||
NSString *pathLastObject = [pathArray lastObject];
|
NSString *pathLastObject = [pathArray lastObject];
|
||||||
|
@ -212,25 +212,13 @@
|
||||||
|
|
||||||
// Set the 'editor' var either by requesting already opened
|
// Set the 'editor' var either by requesting already opened
|
||||||
// editor or by creating the new one.
|
// editor or by creating the new one.
|
||||||
editor = [self editorForFile:filePath];
|
editor = [self openEditorForFile:filePath
|
||||||
if (editor)
|
editable:editable
|
||||||
|
windowed:windowed];
|
||||||
|
if (!editor)
|
||||||
{
|
{
|
||||||
// It seems double click occured in browser
|
NSLog(@"We don't have editor for file: %@", fileName);
|
||||||
if (windowed)
|
return nil;
|
||||||
{
|
|
||||||
[editor setWindowed:windowed];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
editor = [self openEditorForFile:filePath
|
|
||||||
editable:editable
|
|
||||||
windowed:windowed];
|
|
||||||
if (!editor)
|
|
||||||
{
|
|
||||||
NSLog(@"We don't have editor for file: %@", fileName);
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Category path was changed by user's clicking inside browser.
|
// Category path was changed by user's clicking inside browser.
|
||||||
|
|
|
@ -1006,11 +1006,14 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
|
||||||
|
|
||||||
- (void)openFileAtPath:(NSString *)filePath
|
- (void)openFileAtPath:(NSString *)filePath
|
||||||
{
|
{
|
||||||
|
PCEditorManager *em = [self editorManager];
|
||||||
|
|
||||||
if (filePath != nil)
|
if (filePath != nil)
|
||||||
{
|
{
|
||||||
[[self editorManager] openEditorForFile:filePath
|
[em openEditorForFile:filePath
|
||||||
editable:YES
|
editable:YES
|
||||||
windowed:YES];
|
windowed:YES];
|
||||||
|
[em orderFrontEditorForFile:filePath];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,8 +44,8 @@
|
||||||
|
|
||||||
windowWidth = [[NSFont userFixedPitchFontOfSize:0.0] widthOfString:@"A"];
|
windowWidth = [[NSFont userFixedPitchFontOfSize:0.0] widthOfString:@"A"];
|
||||||
windowWidth *= 80;
|
windowWidth *= 80;
|
||||||
windowWidth += 35+80;
|
windowWidth += 35;
|
||||||
rect = NSMakeRect(100,100,windowWidth,320);
|
rect = NSMakeRect(0,0,windowWidth,320);
|
||||||
|
|
||||||
_window = [[NSWindow alloc] initWithContentRect:rect
|
_window = [[NSWindow alloc] initWithContentRect:rect
|
||||||
styleMask:style
|
styleMask:style
|
||||||
|
@ -54,6 +54,7 @@
|
||||||
[_window setReleasedWhenClosed:YES];
|
[_window setReleasedWhenClosed:YES];
|
||||||
[_window setMinSize:NSMakeSize(512,320)];
|
[_window setMinSize:NSMakeSize(512,320)];
|
||||||
[_window setDelegate:self];
|
[_window setDelegate:self];
|
||||||
|
[_window center];
|
||||||
rect = [[_window contentView] frame];
|
rect = [[_window contentView] frame];
|
||||||
|
|
||||||
// Scroll view
|
// Scroll view
|
||||||
|
@ -241,8 +242,6 @@
|
||||||
NSMutableDictionary *attributes = [NSMutableDictionary new];
|
NSMutableDictionary *attributes = [NSMutableDictionary new];
|
||||||
NSFont *font;
|
NSFont *font;
|
||||||
|
|
||||||
NSLog(@"PCEditor: openFileAtPath");
|
|
||||||
|
|
||||||
// Inform about future file opening
|
// Inform about future file opening
|
||||||
[[NSNotificationCenter defaultCenter]
|
[[NSNotificationCenter defaultCenter]
|
||||||
postNotificationName:PCEditorWillOpenNotification
|
postNotificationName:PCEditorWillOpenNotification
|
||||||
|
@ -274,7 +273,7 @@
|
||||||
[_storage setAttributedString:attributedString];
|
[_storage setAttributedString:attributedString];
|
||||||
RELEASE(attributedString);
|
RELEASE(attributedString);
|
||||||
|
|
||||||
[self _createInternalView];
|
// [self _createInternalView];
|
||||||
/* if (categoryPath) // category == nil if we're non project editor
|
/* if (categoryPath) // category == nil if we're non project editor
|
||||||
{
|
{
|
||||||
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||||
|
@ -375,11 +374,19 @@
|
||||||
|
|
||||||
- (NSView *)editorView
|
- (NSView *)editorView
|
||||||
{
|
{
|
||||||
|
if (!_intScrollView)
|
||||||
|
{
|
||||||
|
[self _createInternalView];
|
||||||
|
}
|
||||||
return _intEditorView;
|
return _intEditorView;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSView *)componentView
|
- (NSView *)componentView
|
||||||
{
|
{
|
||||||
|
if (!_intScrollView)
|
||||||
|
{
|
||||||
|
[self _createInternalView];
|
||||||
|
}
|
||||||
return _intScrollView;
|
return _intScrollView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -689,7 +696,7 @@
|
||||||
@"Save and Close", @"Don't save", @"Cancel",
|
@"Save and Close", @"Don't save", @"Cancel",
|
||||||
[_path lastPathComponent]);
|
[_path lastPathComponent]);
|
||||||
|
|
||||||
if (ret == YES)
|
if (ret == YES) // Save and Close
|
||||||
{
|
{
|
||||||
if ([self saveFile] == NO)
|
if ([self saveFile] == NO)
|
||||||
{
|
{
|
||||||
|
@ -734,7 +741,7 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return [self closeFile:_window save:YES];
|
return [self closeFile:sender save:YES];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -743,18 +750,19 @@
|
||||||
|
|
||||||
- (void)windowDidBecomeKey:(NSNotification *)aNotification
|
- (void)windowDidBecomeKey:(NSNotification *)aNotification
|
||||||
{
|
{
|
||||||
if ([[aNotification object] isEqual:_window] && [_window isVisible])
|
/* if ([[aNotification object] isEqual:_window] && [_window isVisible])
|
||||||
{
|
{
|
||||||
[_window makeFirstResponder:_extEditorView];
|
[_window makeFirstResponder:_extEditorView];
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidResignKey:(NSNotification *)aNotification
|
- (void)windowDidResignKey:(NSNotification *)aNotification
|
||||||
{
|
{
|
||||||
if ([[aNotification object] isEqual:_window] && [_window isVisible])
|
/* if ([[aNotification object] isEqual:_window] && [_window isVisible])
|
||||||
{
|
{
|
||||||
[_window makeFirstResponder:_extEditorView];
|
[_window makeFirstResponder:_extEditorView];
|
||||||
}
|
}*/
|
||||||
|
[self resignFirstResponder:_extEditorView];
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
|
@ -119,7 +119,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc
|
- (void)dealloc
|
||||||
{
|
{ // TODO: Never called. Should be fixed.
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
NSLog (@"PCAppProject: dealloc");
|
NSLog (@"PCAppProject: dealloc");
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -355,7 +355,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// File related menu items
|
// File related menu items
|
||||||
if ([menuTitle isEqualToString: @"File"])
|
if ([menuTitle isEqualToString: @"File"] && !editorIsActive)
|
||||||
{
|
{
|
||||||
if ([[menuItem title] isEqualToString:@"New in Project"]) return NO;
|
if ([[menuItem title] isEqualToString:@"New in Project"]) return NO;
|
||||||
if ([[menuItem title] isEqualToString:@"Save"]) return NO;
|
if ([[menuItem title] isEqualToString:@"Save"]) return NO;
|
||||||
|
|
Loading…
Reference in a new issue