MACOSX: Give every license file a menu item

We make a renamed copy of the three license files with non-standard
suffixes, to make them open in TextEdit by default.
This commit is contained in:
angstsmurf 2018-08-21 15:37:08 +02:00 committed by Eugene Sandulenko
parent d4eca67d2a
commit ebedc15437
2 changed files with 26 additions and 8 deletions

View file

@ -69,7 +69,10 @@ static void openFromBundle(NSString *file) {
@interface ScummVMMenuHandler : NSObject {
}
- (void) openReadme;
- (void) openLicense;
- (void) openLicenseGPL;
- (void) openLicenseLGPL;
- (void) openLicenseFreefont;
- (void) openLicenseBSD;
- (void) openNews;
- (void) openUserManual;
- (void) openCredits;
@ -80,8 +83,20 @@ static void openFromBundle(NSString *file) {
openFromBundle(@"README");
}
- (void)openLicense {
openFromBundle(@"COPYING-COMBINED");
- (void)openLicenseGPL {
openFromBundle(@"COPYING");
}
- (void)openLicenseLGPL {
openFromBundle(@"COPYING-LGPL");
}
- (void)openLicenseFreefont {
openFromBundle(@"COPYING-FREEFONT");
}
- (void)openLicenseBSD {
openFromBundle(@"COPYING-BSD");
}
- (void)openNews {
@ -183,7 +198,11 @@ void replaceApplicationMenuItems() {
addMenuItem(_("What's New in ScummVM"), stringEncoding, delegate, @selector(openNews), @"", helpMenu);
[helpMenu addItem:[NSMenuItem separatorItem]];
addMenuItem(_("Credits"), stringEncoding, delegate, @selector(openCredits), @"", helpMenu);
addMenuItem(_("Licensing Information"), stringEncoding, delegate, @selector(openLicense), @"", helpMenu);
addMenuItem(_("GPL License"), stringEncoding, delegate, @selector(openLicenseGPL), @"", helpMenu);
addMenuItem(_("LGPL License"), stringEncoding, delegate, @selector(openLicenseLGPL), @"", helpMenu);
addMenuItem(_("Freefont License"), stringEncoding, delegate, @selector(openLicenseFreefont), @"", helpMenu);
addMenuItem(_("BSD License"), stringEncoding, delegate, @selector(openLicenseBSD), @"", helpMenu);
[appleMenu release];
[windowMenu release];

View file

@ -121,10 +121,9 @@ ifdef DIST_FILES_ENGINEDATA
endif
$(srcdir)/devtools/credits.pl --rtf > $(bundle_name)/Contents/Resources/AUTHORS.rtf
rm $(bundle_name)/Contents/Resources/AUTHORS
cp $(bundle_name)/Contents/Resources/COPYING $(bundle_name)/Contents/Resources/COPYING-COMBINED
echo "\n---\n" | cat - $(bundle_name)/Contents/Resources/COPYING.LGPL >> $(bundle_name)/Contents/Resources/COPYING-COMBINED
echo "\n---\n" | cat - $(bundle_name)/Contents/Resources/COPYING.FREEFONT >> $(bundle_name)/Contents/Resources/COPYING-COMBINED
echo "\n---\n" | cat - $(bundle_name)/Contents/Resources/COPYING.BSD >> $(bundle_name)/Contents/Resources/COPYING-COMBINED
cp $(bundle_name)/Contents/Resources/COPYING.LGPL $(bundle_name)/Contents/Resources/COPYING-LGPL
cp $(bundle_name)/Contents/Resources/COPYING.FREEFONT $(bundle_name)/Contents/Resources/COPYING-FREEFONT
cp $(bundle_name)/Contents/Resources/COPYING.BSD $(bundle_name)/Contents/Resources/COPYING-BSD
chmod 644 $(bundle_name)/Contents/Resources/*
cp scummvm-static $(bundle_name)/Contents/MacOS/scummvm
chmod 755 $(bundle_name)/Contents/MacOS/scummvm