Make the Changelog macOS app menu item more relevant

This changes the URL used for the changelog menu item from using a
direct GitHub file link to the master branch's changelog.md file to
using a https://changelog.wesnoth.org/X.Y.Z link, where X.Y.Z are
specifically the version number used in the macOS bundle's Info.plist
file.

Note that this may result in incorrect links for +dev versions, where
the Changelog link will simply send the user to the page for the
latest release and not the future release. This shouldn't be a problem
though, since people using those builds, especially on macOS, should
really already know where to find the most relevant changelog for the
version they're running -- in their own source tree.
This commit is contained in:
Iris Morelle 2024-03-16 18:20:00 -03:00
parent 1e33024171
commit 55290c8715

View file

@ -77,7 +77,9 @@ static std::vector<char*> gArgs;
- (IBAction) openChangelog:(id)sender
{
(void) sender;
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://github.com/wesnoth/wesnoth/blob/master/changelog.md"]];
NSString* version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
NSString* url = [NSString stringWithFormat:@"https://changelog.wesnoth.org/%@", version];
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:url]];
}
/* Called when the internal event loop has just started running */