mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-02-20 18:32:17 +00:00
The path for creating new projects is now maintained by a separate defaults
entry. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@12620 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ae73b13acc
commit
4682c6aa76
1 changed files with 12 additions and 2 deletions
|
@ -152,19 +152,29 @@
|
||||||
- (void)newProject:(id)sender
|
- (void)newProject:(id)sender
|
||||||
{
|
{
|
||||||
NSSavePanel *sp;
|
NSSavePanel *sp;
|
||||||
int runResult;
|
int runResult;
|
||||||
|
NSString *dir = nil;
|
||||||
|
|
||||||
sp = [NSSavePanel savePanel];
|
sp = [NSSavePanel savePanel];
|
||||||
|
|
||||||
[sp setTitle:@"Create new project..."];
|
[sp setTitle:@"Create new project..."];
|
||||||
[sp setAccessoryView:projectTypeAccessaryView];
|
[sp setAccessoryView:projectTypeAccessaryView];
|
||||||
|
|
||||||
runResult = [sp runModalForDirectory:NSHomeDirectory() file:@""];
|
dir = [[NSUserDefaults standardUserDefaults] objectForKey:@"LastNewDirectory"];
|
||||||
|
if( !dir )
|
||||||
|
{
|
||||||
|
dir = NSHomeDirectory();
|
||||||
|
}
|
||||||
|
|
||||||
|
runResult = [sp runModalForDirectory:dir file:@""];
|
||||||
if (runResult == NSOKButton)
|
if (runResult == NSOKButton)
|
||||||
{
|
{
|
||||||
NSString *projectType = [projectTypePopup titleOfSelectedItem];
|
NSString *projectType = [projectTypePopup titleOfSelectedItem];
|
||||||
NSString *className = [[appController projectTypes] objectForKey:projectType];
|
NSString *className = [[appController projectTypes] objectForKey:projectType];
|
||||||
|
|
||||||
|
[[NSUserDefaults standardUserDefaults] setObject:[sp directory]
|
||||||
|
forKey:@"LastNewDirectory"];
|
||||||
|
|
||||||
if (![projectManager createProjectOfType:className path:[sp filename]])
|
if (![projectManager createProjectOfType:className path:[sp filename]])
|
||||||
{
|
{
|
||||||
NSRunAlertPanel(@"Attention!",
|
NSRunAlertPanel(@"Attention!",
|
||||||
|
|
Loading…
Reference in a new issue