mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-04-07 14:09:22 +08:00
[macos] refactoring
This commit is contained in:
@ -96,18 +96,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isCommercialVersion = false;
|
NSURL * eulaUrl = [[NSBundle mainBundle] URLForResource:@"LICENSE" withExtension:@"html" subdirectory:@"license"];
|
||||||
NSString * licPath = [[NSBundle mainBundle] pathForResource:@"LICENSE" ofType:@"html" inDirectory:@"license"];
|
isCommercialVersion = eulaUrl != nil;
|
||||||
if ([[NSFileManager defaultManager] fileExistsAtPath:licPath]) {
|
|
||||||
isCommercialVersion = true;
|
|
||||||
// [self.licenseButton setTarget:self];
|
|
||||||
// [self.licenseButton setAction:@selector(buttonCommercialLicenseClicked:)];
|
|
||||||
}
|
|
||||||
|
|
||||||
// EULA View
|
// EULA View
|
||||||
if (self.eulaWebView) {
|
if (self.eulaWebView) {
|
||||||
NSString * eulaName = !isCommercialVersion ? @"EULA" : @"LICENSE";
|
if ( !eulaUrl )
|
||||||
NSURL * eulaUrl = [[NSBundle mainBundle] URLForResource:eulaName withExtension:@"html" subdirectory:@"license"];
|
eulaUrl = [[NSBundle mainBundle] URLForResource:@"EULA" withExtension:@"html" subdirectory:@"license"];
|
||||||
[[self.eulaWebView mainFrame] loadRequest:[NSURLRequest requestWithURL:eulaUrl]];
|
[[self.eulaWebView mainFrame] loadRequest:[NSURLRequest requestWithURL:eulaUrl]];
|
||||||
} else {
|
} else {
|
||||||
// About View
|
// About View
|
||||||
@ -189,12 +184,4 @@
|
|||||||
#endif
|
#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
|
@end
|
||||||
|
|||||||
Reference in New Issue
Block a user