Skip to content

Commit

Permalink
MACOSX: Give every license file a menu item
Browse files Browse the repository at this point in the history
We make a renamed copy of the three license files with non-standard
suffixes, to make them open in TextEdit by default.
  • Loading branch information
angstsmurf authored and sev- committed Aug 28, 2018
1 parent d4eca67 commit ebedc15
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
27 changes: 23 additions & 4 deletions backends/platform/sdl/macosx/appmenu_osx.mm
Expand Up @@ -69,7 +69,10 @@ static void openFromBundle(NSString *file) {
@interface ScummVMMenuHandler : NSObject { @interface ScummVMMenuHandler : NSObject {
} }
- (void) openReadme; - (void) openReadme;
- (void) openLicense; - (void) openLicenseGPL;
- (void) openLicenseLGPL;
- (void) openLicenseFreefont;
- (void) openLicenseBSD;
- (void) openNews; - (void) openNews;
- (void) openUserManual; - (void) openUserManual;
- (void) openCredits; - (void) openCredits;
Expand All @@ -80,8 +83,20 @@ - (void)openReadme {
openFromBundle(@"README"); openFromBundle(@"README");
} }


- (void)openLicense { - (void)openLicenseGPL {
openFromBundle(@"COPYING-COMBINED"); openFromBundle(@"COPYING");
}

- (void)openLicenseLGPL {
openFromBundle(@"COPYING-LGPL");
}

- (void)openLicenseFreefont {
openFromBundle(@"COPYING-FREEFONT");
}

- (void)openLicenseBSD {
openFromBundle(@"COPYING-BSD");
} }


- (void)openNews { - (void)openNews {
Expand Down Expand Up @@ -183,7 +198,11 @@ void replaceApplicationMenuItems() {
addMenuItem(_("What's New in ScummVM"), stringEncoding, delegate, @selector(openNews), @"", helpMenu); addMenuItem(_("What's New in ScummVM"), stringEncoding, delegate, @selector(openNews), @"", helpMenu);
[helpMenu addItem:[NSMenuItem separatorItem]]; [helpMenu addItem:[NSMenuItem separatorItem]];
addMenuItem(_("Credits"), stringEncoding, delegate, @selector(openCredits), @"", helpMenu); 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]; [appleMenu release];
[windowMenu release]; [windowMenu release];
Expand Down
7 changes: 3 additions & 4 deletions ports.mk
Expand Up @@ -121,10 +121,9 @@ ifdef DIST_FILES_ENGINEDATA
endif endif
$(srcdir)/devtools/credits.pl --rtf > $(bundle_name)/Contents/Resources/AUTHORS.rtf $(srcdir)/devtools/credits.pl --rtf > $(bundle_name)/Contents/Resources/AUTHORS.rtf
rm $(bundle_name)/Contents/Resources/AUTHORS rm $(bundle_name)/Contents/Resources/AUTHORS
cp $(bundle_name)/Contents/Resources/COPYING $(bundle_name)/Contents/Resources/COPYING-COMBINED cp $(bundle_name)/Contents/Resources/COPYING.LGPL $(bundle_name)/Contents/Resources/COPYING-LGPL
echo "\n---\n" | cat - $(bundle_name)/Contents/Resources/COPYING.LGPL >> $(bundle_name)/Contents/Resources/COPYING-COMBINED cp $(bundle_name)/Contents/Resources/COPYING.FREEFONT $(bundle_name)/Contents/Resources/COPYING-FREEFONT
echo "\n---\n" | cat - $(bundle_name)/Contents/Resources/COPYING.FREEFONT >> $(bundle_name)/Contents/Resources/COPYING-COMBINED cp $(bundle_name)/Contents/Resources/COPYING.BSD $(bundle_name)/Contents/Resources/COPYING-BSD
echo "\n---\n" | cat - $(bundle_name)/Contents/Resources/COPYING.BSD >> $(bundle_name)/Contents/Resources/COPYING-COMBINED
chmod 644 $(bundle_name)/Contents/Resources/* chmod 644 $(bundle_name)/Contents/Resources/*
cp scummvm-static $(bundle_name)/Contents/MacOS/scummvm cp scummvm-static $(bundle_name)/Contents/MacOS/scummvm
chmod 755 $(bundle_name)/Contents/MacOS/scummvm chmod 755 $(bundle_name)/Contents/MacOS/scummvm
Expand Down

0 comments on commit ebedc15

Please sign in to comment.