[macos] changed license checking

This commit is contained in:
maxkadushkin
2025-08-14 19:21:01 +03:00
parent 9078a454f7
commit 43f4f3d234
2 changed files with 696 additions and 8 deletions

View File

@ -97,19 +97,19 @@
}
isCommercialVersion = false;
NSString * licPath = [[NSBundle mainBundle] pathForResource:@"LICENSE" ofType:@"html" inDirectory:@"license"];
if ([[NSFileManager defaultManager] fileExistsAtPath:licPath]) {
isCommercialVersion = true;
// [self.licenseButton setTarget:self];
// [self.licenseButton setAction:@selector(buttonCommercialLicenseClicked:)];
}
// EULA View
if (self.eulaWebView) {
NSURL * eulaUrl = [[NSBundle mainBundle] URLForResource:@"EULA" withExtension:@"html" subdirectory:@"license"];
NSString * eulaName = !isCommercialVersion ? @"EULA" : @"LICENSE";
NSURL * eulaUrl = [[NSBundle mainBundle] URLForResource:eulaName withExtension:@"html" subdirectory:@"license"];
[[self.eulaWebView mainFrame] loadRequest:[NSURLRequest requestWithURL:eulaUrl]];
} else {
NSString * licPath = [[NSBundle mainBundle] pathForResource:@"LICENSE" ofType:@"txt" inDirectory:@"license"];
if ([[NSFileManager defaultManager] fileExistsAtPath:licPath]) {
isCommercialVersion = true;
[self.licenseButton setTarget:self]; // 'self' refers to the object containing the action method
[self.licenseButton setAction:@selector(buttonCommercialLicenseClicked:)]; // The selector for your action method
}
// About View
// Setup license button view
NSMutableAttributedString * attrTitle = [[NSMutableAttributedString alloc] initWithAttributedString:[self.licenseButton attributedTitle]];