mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-04-07 14:09:22 +08:00
[macos] changed license checking
This commit is contained in:
@ -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]];
|
||||
|
||||
Reference in New Issue
Block a user