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
|
|
|
|
2004-06-15 20:41:49 +00:00
|
|
|
Copyright (C) 2003-2004 Free Software Foundation
|
2004-06-11 13:43:02 +00:00
|
|
|
|
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/PCProjectLauncher.h>
|
|
|
|
#import <ProjectCenter/PCProjectLauncherPanel.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 PCProjectLauncherPanel
|
2004-06-11 13:43:02 +00:00
|
|
|
|
|
|
|
- (id)initWithProjectManager:(PCProjectManager *)aManager
|
|
|
|
{
|
|
|
|
PCProjectLauncher *projectLauncher = nil;
|
|
|
|
PCProject *activeProject = nil;
|
|
|
|
|
|
|
|
projectManager = aManager;
|
|
|
|
activeProject = [projectManager rootActiveProject];
|
|
|
|
projectLauncher = [activeProject projectLauncher];
|
|
|
|
|
|
|
|
projectLauncher = [[aManager activeProject] projectLauncher];
|
|
|
|
|
|
|
|
self = [super initWithContentRect: NSMakeRect (0, 300, 480, 322)
|
|
|
|
styleMask: (NSTitledWindowMask
|
|
|
|
| NSClosableWindowMask
|
|
|
|
| NSResizableWindowMask)
|
|
|
|
backing: NSBackingStoreRetained
|
|
|
|
defer: YES];
|
|
|
|
[self setMinSize: NSMakeSize(440, 222)];
|
|
|
|
[self setFrameAutosaveName: @"ProjectLauncher"];
|
|
|
|
[self setReleasedWhenClosed: NO];
|
|
|
|
[self setHidesOnDeactivate: NO];
|
|
|
|
[self setTitle: [NSString stringWithFormat:
|
|
|
|
@"%@ - Launch", [activeProject projectName]]];
|
|
|
|
|
|
|
|
contentBox = [[NSBox alloc] init];
|
|
|
|
[contentBox setContentViewMargins:NSMakeSize(8.0, 0.0)];
|
|
|
|
[contentBox setTitlePosition:NSNoTitle];
|
|
|
|
[contentBox setBorderType:NSNoBorder];
|
|
|
|
[super setContentView:contentBox];
|
|
|
|
|
|
|
|
// Empty content view of contentBox
|
|
|
|
emptyBox = [[NSBox alloc] init];
|
|
|
|
[emptyBox setContentViewMargins:NSMakeSize(0.0, 0.0)];
|
|
|
|
[emptyBox setTitlePosition:NSNoTitle];
|
|
|
|
[emptyBox setBorderType:NSLineBorder];
|
|
|
|
[contentBox setContentView:emptyBox];
|
|
|
|
|
|
|
|
// Track project switching
|
|
|
|
[[NSNotificationCenter defaultCenter]
|
|
|
|
addObserver:self
|
|
|
|
selector:@selector(activeProjectDidChange:)
|
|
|
|
name:PCActiveProjectDidChangeNotification
|
|
|
|
object:nil];
|
|
|
|
|
|
|
|
if (![self setFrameUsingName: @"ProjectLauncher"])
|
|
|
|
{
|
|
|
|
[self center];
|
|
|
|
}
|
|
|
|
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)dealloc
|
|
|
|
{
|
2004-06-19 21:55:29 +00:00
|
|
|
#ifdef DEVELOPMENT
|
2004-06-11 13:43:02 +00:00
|
|
|
NSLog (@"PCLaunchPanel: dealloc");
|
2004-06-19 21:55:29 +00:00
|
|
|
#endif
|
2004-06-11 13:43:02 +00:00
|
|
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
|
|
|
|
|
|
|
[super dealloc];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)orderFront:(id)sender
|
|
|
|
{
|
|
|
|
PCProject *activeProject = [projectManager rootActiveProject];
|
|
|
|
NSView *launcherView = [[activeProject projectLauncher] componentView];
|
|
|
|
|
|
|
|
if (!([contentBox contentView] == launcherView))
|
|
|
|
{
|
|
|
|
[contentBox setContentView:launcherView];
|
|
|
|
[contentBox display];
|
|
|
|
}
|
|
|
|
|
2004-07-01 11:36:33 +00:00
|
|
|
/* PCLogInfo(self, @"orderFront: %@ -> %@",
|
|
|
|
launcherView, [launcherView superview]);*/
|
2004-06-11 13:43:02 +00:00
|
|
|
|
|
|
|
[super orderFront:self];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (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
|
|
|
|
|
|
|
[super close];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (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;
|
|
|
|
|
|
|
|
if (!rootProject)
|
|
|
|
{
|
|
|
|
[contentBox setContentView:emptyBox];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
[self setTitle: [NSString stringWithFormat:
|
|
|
|
@"%@ - Launch", [rootProject projectName]]];
|
|
|
|
|
|
|
|
[contentBox
|
|
|
|
setContentView:[[rootProject projectLauncher] componentView]];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|