Fix HelpFile by saving the property in the app project and generating the plist.

This commit is contained in:
Riccardo Mottola 2021-05-13 03:21:16 +02:00
parent 82c6aa3162
commit 5da063f7e7
7 changed files with 28 additions and 4 deletions

View file

@ -1,3 +1,12 @@
2021-05-13 Riccardo Mottola <rm@gnu.org>
* Modules/Projects/Application/PCAppProject+Inspector.h
* Modules/Projects/Application/PCAppProject+Inspector.m
* Modules/Projects/Application/PCAppProject.m
* Modules/Projects/Application/Resources/Inspector.gorm
Fix HelpFile by saving the property in the app project and generating
the plist.
2021-02-19 Riccardo Mottola <rm@gnu.org>
* Modules/Editors/ProjectCenter/PCEditor.h

View file

@ -1,7 +1,7 @@
/*
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
Copyright (C) 2001-2016 Free Software Foundation
Copyright (C) 2001-2021 Free Software Foundation
Author: Serg Stoyan <stoyan@on.com.ua>
Riccardo Mottola <rm@gnu.org>
@ -46,6 +46,7 @@
- (BOOL)setAppIconWithFileAtPath:(NSString *)path;
- (void)clearHelpFile:(id)sender;
- (IBAction)setHelpFile:(id)sender;
- (void)clearMainNib:(id)sender;
- (BOOL)setMainNibWithFileAtPath:(NSString *)path;

View file

@ -1,7 +1,7 @@
/*
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
Copyright (C) 2001-2016 Free Software Foundation
Copyright (C) 2001-2021 Free Software Foundation
Author: Serg Stoyan <stoyan@on.com.ua>
Riccardo Mottola <rm@gnu.org>
@ -220,6 +220,13 @@ cleanup(NSMutableDictionary *m, NSString *k)
[self setProjectDictObject:@"" forKey:PCHelpFile notify:YES];
}
- (IBAction)setHelpFile:(id)sender
{
[self setProjectDictObject:[helpFileField stringValue]
forKey:PCHelpFile
notify:YES];
}
// Main Interface File
- (void)clearMainNib: (id)sender
{

View file

@ -151,6 +151,7 @@
NSBundle *projBundle = [NSBundle bundleForClass:[self class]];
NSString *mainNibFile = nil;
NSMutableArray *_array = nil;
NSString *helpFile = nil;
NSAssert(path,@"No valid project path provided!");
@ -250,6 +251,10 @@
if ([projectDict objectForKey:PCBundleIdentifier])
[infoDict setObject:[projectDict objectForKey:PCBundleIdentifier] forKey:@"CFBundleIdentifier"];
// Help file if present
if ([projectDict objectForKey:PCHelpFile])
[infoDict setObject:[projectDict objectForKey:@"GSHelpContentsFile"] forKey:@"GSHelpContentsFile"];
// Write to ProjectNameInfo.plist
_file = [NSString stringWithFormat:@"%@Info.plist",projectName];
_2file = [projectPath stringByAppendingPathComponent:_file];
@ -440,6 +445,7 @@
[infoDict removeObjectForKey:@"NSMainNibFile"];
}
[self writeInfoEntry:@"NSPrincipalClass" forKey:PCPrincipalClass];
[self writeInfoEntry:@"GSHelpContentsFile" forKey:PCHelpFile];
[infoDict setObject:@"Application" forKey:@"NSRole"];
[self writeInfoEntry:@"NSTypes" forKey:PCDocumentTypes];
[self writeInfoEntry:@"URL" forKey:PCURL];

View file

@ -8,7 +8,7 @@
"clearHelpFile:",
"clearMainNib:",
"docFieldSet:",
"newAction:",
"setHelpFile:",
"removeDocType:",
"setAppClass:",
"setAppType:",
@ -31,7 +31,8 @@
"setDocBasedApp:",
"showDocTypesPanel:",
"addDocType:",
"removeDocType:"
"removeDocType:",
"setHelpFile:"
);
Outlets = (
projectAttributesView,