2004-06-11 13:43:02 +00:00
|
|
|
/*
|
2006-12-26 10:58:39 +00:00
|
|
|
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
|
2004-06-11 13:43:02 +00:00
|
|
|
|
|
|
|
Copyright (C) 2003 Free Software Foundation
|
|
|
|
|
2004-06-12 19:23:26 +00:00
|
|
|
Authors: Serg Stoyan
|
2004-06-11 13:43:02 +00:00
|
|
|
|
|
|
|
This file is part of GNUstep.
|
|
|
|
|
|
|
|
This application is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This application is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public
|
|
|
|
License along with this library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
|
|
|
*/
|
|
|
|
|
2008-12-30 13:47:27 +00:00
|
|
|
#import <ProjectCenter/PCProjectManager.h>
|
|
|
|
#import <ProjectCenter/PCProject.h>
|
|
|
|
#import <ProjectCenter/PCProjectBuilder.h>
|
|
|
|
#import <ProjectCenter/PCProjectBuilderPanel.h>
|
2004-06-11 13:43:02 +00:00
|
|
|
|
2008-12-30 13:47:27 +00:00
|
|
|
#import <ProjectCenter/PCLogController.h>
|
2004-06-11 13:43:02 +00:00
|
|
|
|
2009-03-09 20:15:10 +00:00
|
|
|
#import "Modules/Preferences/Misc/PCMiscPrefs.h"
|
|
|
|
|
2006-12-26 10:58:39 +00:00
|
|
|
@implementation PCProjectBuilderPanel
|
2004-06-11 13:43:02 +00:00
|
|
|
|
2007-01-09 16:49:47 +00:00
|
|
|
- (void)awakeFromNib
|
2004-06-11 13:43:02 +00:00
|
|
|
{
|
2007-01-12 18:02:41 +00:00
|
|
|
PCProject *activeProject = [projectManager rootActiveProject];
|
2007-01-09 16:49:47 +00:00
|
|
|
|
|
|
|
[panel setFrameAutosaveName:@"ProjectBuilder"];
|
|
|
|
[panel setTitle:[NSString stringWithFormat:
|
2004-06-11 13:43:02 +00:00
|
|
|
@"%@ - Project Build", [activeProject projectName]]];
|
|
|
|
|
|
|
|
// Panel's content view
|
2007-01-09 16:49:47 +00:00
|
|
|
[panel setContentView:contentBox];
|
2004-06-11 13:43:02 +00:00
|
|
|
|
|
|
|
// Empty content view of contentBox
|
2007-01-09 16:49:47 +00:00
|
|
|
RETAIN(emptyBox);
|
2004-06-11 13:43:02 +00:00
|
|
|
|
|
|
|
// Track project switching
|
|
|
|
[[NSNotificationCenter defaultCenter]
|
|
|
|
addObserver:self
|
|
|
|
selector:@selector(activeProjectDidChange:)
|
|
|
|
name:PCActiveProjectDidChangeNotification
|
|
|
|
object:nil];
|
|
|
|
|
2007-01-09 16:49:47 +00:00
|
|
|
if (![panel setFrameUsingName:@"ProjectBuilder"])
|
|
|
|
{
|
|
|
|
[panel center];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- (id)initWithProjectManager:(PCProjectManager *)aManager
|
|
|
|
{
|
|
|
|
projectManager = aManager;
|
|
|
|
|
|
|
|
if ([NSBundle loadNibNamed:@"BuilderPanel" owner:self] == NO)
|
2004-06-11 13:43:02 +00:00
|
|
|
{
|
2007-01-09 16:49:47 +00:00
|
|
|
PCLogError(self, @"error loading BuilderPanel NIB file!");
|
|
|
|
return nil;
|
2004-06-11 13:43:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)dealloc
|
|
|
|
{
|
2004-06-21 20:35:37 +00:00
|
|
|
#ifdef DEVELOPMENT
|
2004-06-11 13:43:02 +00:00
|
|
|
NSLog(@"PCBuildPanel: dealloc");
|
2004-06-21 20:35:37 +00:00
|
|
|
#endif
|
2004-06-11 13:43:02 +00:00
|
|
|
|
|
|
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
|
|
|
|
2007-01-09 16:49:47 +00:00
|
|
|
RELEASE(emptyBox);
|
|
|
|
|
2004-06-11 13:43:02 +00:00
|
|
|
[super dealloc];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)orderFront:(id)sender
|
|
|
|
{
|
|
|
|
PCProject *activeProject = [projectManager rootActiveProject];
|
|
|
|
NSView *builderView = [[activeProject projectBuilder] componentView];
|
|
|
|
|
|
|
|
if (!([contentBox contentView] == builderView))
|
|
|
|
{
|
|
|
|
[contentBox setContentView:builderView];
|
|
|
|
}
|
|
|
|
|
2009-03-05 00:42:59 +00:00
|
|
|
/* NSLog(self, @"orderFront: %@ -> %@",
|
|
|
|
builderView, [builderView superview]);*/
|
2004-06-11 13:43:02 +00:00
|
|
|
|
2007-01-09 16:49:47 +00:00
|
|
|
[panel orderFront:self];
|
2004-06-11 13:43:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)close
|
|
|
|
{
|
2004-07-01 11:36:33 +00:00
|
|
|
// PCLogInfo(self, @"close: %@", [contentBox contentView]);
|
2004-06-11 13:43:02 +00:00
|
|
|
|
|
|
|
[contentBox setContentView:emptyBox];
|
|
|
|
|
2004-07-01 11:36:33 +00:00
|
|
|
// PCLogInfo(self, @"close: %@", [contentBox contentView]);
|
2004-06-11 13:43:02 +00:00
|
|
|
|
2007-01-09 16:49:47 +00:00
|
|
|
[panel close];
|
2004-06-11 13:43:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)activeProjectDidChange:(NSNotification *)aNotif
|
|
|
|
{
|
2009-03-09 20:15:10 +00:00
|
|
|
PCProject *rootProject;
|
|
|
|
id <PCPreferences> prefs = [projectManager prefController];
|
|
|
|
|
* Headers/Protocols/Preferences.h: Add new methods.
* PCPrefController.m: Implemented set/get of preferences value dependent. All
values are stored in preferences as NSString values and converted upon
request to specified type.
* Modules/Preferences/EditorFSC/PCEditorFSCPrefs.m: Use new methods of
PCPrefController. Implemented setting of editor fonts.
(setDefaults): Removed.
* Modules/Preferences/Build/PCBuildPrefs.m,
* Modules/Preferences/Misc/PCMiscPrefs.m,
* Modules/Preferences/Saving/PCSavingPrefs.m: Use new methods of PCPrefController.
(setDefaults): Removed.
* Framework/PCProjectLoadedFiles.m,
* Framework/PCMakefileFactory.m,
* Framework/PCProject.m,
* Framework/PCProjectLauncherPanel.m,
* Framework/PCFileManager.m,
* Framework/PCProjectBrowser.m,
* Framework/PCProjectBuilder.m,
* Framework/PCEditorManager.m,
* Framework/PCProjectLoadedFilesPanel.m,
* Framework/PCProjectLauncher.m,
* Framework/PCProjectBuilderPanel.m,
* Framework/PCProjectWindow.m,
* PCAppController.m,
* Framework/PCProjectManager.m: Use new methods of PCPrefController.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@28074 72102866-910b-0410-8b05-ffd578937521
2009-03-15 00:12:00 +00:00
|
|
|
if (![prefs boolForKey:UseTearOffWindows])
|
2009-03-09 20:15:10 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2004-06-11 13:43:02 +00:00
|
|
|
|
2009-03-09 20:15:10 +00:00
|
|
|
rootProject = [projectManager rootActiveProject];
|
2004-06-11 13:43:02 +00:00
|
|
|
if (rootProject == currentProject)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
currentProject = rootProject;
|
|
|
|
|
2009-03-16 23:32:00 +00:00
|
|
|
// NSLog(@"Buider Panel: activeProjectDidChange to: %@",
|
|
|
|
// [rootProject projectName]);
|
2004-06-11 13:43:02 +00:00
|
|
|
|
|
|
|
if (!rootProject)
|
|
|
|
{
|
|
|
|
[contentBox setContentView:emptyBox];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2007-01-09 16:49:47 +00:00
|
|
|
[panel setTitle:[NSString stringWithFormat:
|
2004-06-11 13:43:02 +00:00
|
|
|
@"%@ - Project Build", [rootProject projectName]]];
|
2007-01-09 16:49:47 +00:00
|
|
|
[contentBox setContentView:[[rootProject projectBuilder] componentView]];
|
2004-06-11 13:43:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-01-09 16:49:47 +00:00
|
|
|
- (BOOL)isVisible
|
|
|
|
{
|
|
|
|
return [panel isVisible];
|
|
|
|
}
|
|
|
|
|
2009-03-09 20:15:10 +00:00
|
|
|
// --- Panel delgate
|
|
|
|
- (BOOL)windowShouldClose:(id)sender
|
|
|
|
{
|
|
|
|
[contentBox setContentView:emptyBox];
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
2004-06-11 13:43:02 +00:00
|
|
|
@end
|
|
|
|
|