mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-02-10 18:05:16 +08:00
[macos] refactoring
This commit is contained in:
@ -96,18 +96,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
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:)];
|
||||
}
|
||||
NSURL * eulaUrl = [[NSBundle mainBundle] URLForResource:@"LICENSE" withExtension:@"html" subdirectory:@"license"];
|
||||
isCommercialVersion = eulaUrl != nil;
|
||||
|
||||
// EULA View
|
||||
if (self.eulaWebView) {
|
||||
NSString * eulaName = !isCommercialVersion ? @"EULA" : @"LICENSE";
|
||||
NSURL * eulaUrl = [[NSBundle mainBundle] URLForResource:eulaName withExtension:@"html" subdirectory:@"license"];
|
||||
if ( !eulaUrl )
|
||||
eulaUrl = [[NSBundle mainBundle] URLForResource:@"EULA" withExtension:@"html" subdirectory:@"license"];
|
||||
[[self.eulaWebView mainFrame] loadRequest:[NSURLRequest requestWithURL:eulaUrl]];
|
||||
} else {
|
||||
// About View
|
||||
@ -189,12 +184,4 @@
|
||||
#endif
|
||||
}
|
||||
|
||||
- (IBAction)buttonCommercialLicenseClicked:(id)sender {
|
||||
NSString * licensePath = [[NSBundle mainBundle] pathForResource:@"LICENSE" ofType:@"txt" inDirectory:@"license"];
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:licensePath]) {
|
||||
NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
|
||||
[workspace openFile:licensePath];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user