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