mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-02-10 18:05:16 +08:00
Merge pull request 'feature/fix-opening-lic-link' (#540) from feature/fix-opening-lic-link into develop
This commit is contained in:
@ -102,6 +102,9 @@
|
||||
BE6251BA22BD089100656116 /* dictionaries in Resources */ = {isa = PBXBuildFile; fileRef = BE6251B922BD089100656116 /* dictionaries */; };
|
||||
BE9A63CD2E2A429F0040CE84 /* ascdocumentscore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE9A63CC2E2A429F0040CE84 /* ascdocumentscore.framework */; };
|
||||
BE9A63CF2E2A42A60040CE84 /* ooxmlsignature.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE9A63CE2E2A42A60040CE84 /* ooxmlsignature.framework */; };
|
||||
F10175932EAB756000C6C1B8 /* ASCLicenseController.m in Sources */ = {isa = PBXBuildFile; fileRef = F10175922EAB756000C6C1B8 /* ASCLicenseController.m */; };
|
||||
F10175942EAB756100C6C1B8 /* ASCLicenseController.m in Sources */ = {isa = PBXBuildFile; fileRef = F10175922EAB756000C6C1B8 /* ASCLicenseController.m */; };
|
||||
F10175952EAB756100C6C1B8 /* ASCLicenseController.m in Sources */ = {isa = PBXBuildFile; fileRef = F10175922EAB756000C6C1B8 /* ASCLicenseController.m */; };
|
||||
FC09073E1C1855A400D9E881 /* editors in Resources */ = {isa = PBXBuildFile; fileRef = FC09073D1C1855A400D9E881 /* editors */; };
|
||||
FC0907411C186A7A00D9E881 /* converter in Resources */ = {isa = PBXBuildFile; fileRef = FC0907401C186A7A00D9E881 /* converter */; };
|
||||
FC0BD686258B63F700C47F95 /* NSView+Extensions.m in Sources */ = {isa = PBXBuildFile; fileRef = FC73E6DB207DE3C700EFFD2F /* NSView+Extensions.m */; };
|
||||
@ -829,6 +832,8 @@
|
||||
BE95F0A623E9FF590045E0CB /* mac_cefview.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mac_cefview.h; sourceTree = "<group>"; };
|
||||
BE9A63CC2E2A429F0040CE84 /* ascdocumentscore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ascdocumentscore.framework; path = ../../build_tools/out/mac_arm64/onlyoffice/desktopeditors/ascdocumentscore.framework; sourceTree = "<group>"; };
|
||||
BE9A63CE2E2A42A60040CE84 /* ooxmlsignature.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ooxmlsignature.framework; path = ../../build_tools/out/mac_arm64/onlyoffice/desktopeditors/ooxmlsignature.framework; sourceTree = "<group>"; };
|
||||
F10175912EAB756000C6C1B8 /* ASCLicenseController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCLicenseController.h; sourceTree = "<group>"; };
|
||||
F10175922EAB756000C6C1B8 /* ASCLicenseController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASCLicenseController.m; sourceTree = "<group>"; };
|
||||
FC033D251BB13B9900F6C55F /* mac_application.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mac_application.h; sourceTree = "<group>"; };
|
||||
FC035A5B24855E8C00AF820F /* ASCTabViewType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASCTabViewType.h; sourceTree = "<group>"; };
|
||||
FC09073D1C1855A400D9E881 /* editors */ = {isa = PBXFileReference; lastKnownFileType = folder; name = editors; path = Vendor/ONLYOFFICE/editors; sourceTree = SOURCE_ROOT; };
|
||||
@ -1157,6 +1162,15 @@
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
F10175902EAB739E00C6C1B8 /* License */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F10175912EAB756000C6C1B8 /* ASCLicenseController.h */,
|
||||
F10175922EAB756000C6C1B8 /* ASCLicenseController.m */,
|
||||
);
|
||||
path = License;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
FC035A5A24855E1900AF820F /* Enums */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -1691,6 +1705,7 @@
|
||||
FCF289722150E6A1002FD438 /* Controllers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F10175902EAB739E00C6C1B8 /* License */,
|
||||
FCF289742150E820002FD438 /* Common */,
|
||||
FCF289762150E904002FD438 /* MainWindow */,
|
||||
FCF289782150E95F002FD438 /* About */,
|
||||
@ -2391,6 +2406,7 @@
|
||||
FC0BD6AC258B63F700C47F95 /* ASCDownloadController.mm in Sources */,
|
||||
FC0BD6AD258B63F700C47F95 /* ASCTabCloseButtonCell.m in Sources */,
|
||||
FC0BD6AE258B63F700C47F95 /* ASCTabTouchBarItem.m in Sources */,
|
||||
F10175952EAB756100C6C1B8 /* ASCLicenseController.m in Sources */,
|
||||
FC0BD6AF258B63F700C47F95 /* ASCTabViewController.m in Sources */,
|
||||
FC2C439625D4356E003A39C4 /* ASCCertificatePreviewTextViewController.m in Sources */,
|
||||
FC0BD6B0258B63F700C47F95 /* ASCPresentationReporter.mm in Sources */,
|
||||
@ -2466,6 +2482,7 @@
|
||||
FCB4C6E526DD018B0012C20D /* ASCDownloadController.mm in Sources */,
|
||||
FCB4C6E626DD018B0012C20D /* ASCTabCloseButtonCell.m in Sources */,
|
||||
FCB4C6E726DD018B0012C20D /* ASCTabTouchBarItem.m in Sources */,
|
||||
F10175932EAB756000C6C1B8 /* ASCLicenseController.m in Sources */,
|
||||
FCB4C6E826DD018B0012C20D /* ASCTabViewController.m in Sources */,
|
||||
FCB4C6E926DD018B0012C20D /* ASCCertificatePreviewTextViewController.m in Sources */,
|
||||
FCB4C6EA26DD018B0012C20D /* ASCPresentationReporter.mm in Sources */,
|
||||
@ -2541,6 +2558,7 @@
|
||||
FCD294691BB97D3300318930 /* ASCDownloadController.mm in Sources */,
|
||||
FCC77C91206CEE85001B7837 /* ASCTabCloseButtonCell.m in Sources */,
|
||||
FCCC2FE121E5E10D00FB9209 /* ASCTabTouchBarItem.m in Sources */,
|
||||
F10175942EAB756100C6C1B8 /* ASCLicenseController.m in Sources */,
|
||||
FC25A1A71C2E844800063A42 /* ASCTabViewController.m in Sources */,
|
||||
FC2C439525D4356E003A39C4 /* ASCCertificatePreviewTextViewController.m in Sources */,
|
||||
FC54A2941F94BCE00086F4FE /* ASCPresentationReporter.mm in Sources */,
|
||||
|
||||
@ -1075,10 +1075,10 @@
|
||||
<buttonCell key="cell" type="bevel" title="License agreement" bezelStyle="regularSquare" alignment="center" imageScaling="proportionallyDown" inset="2" id="8Ga-Cu-VGe">
|
||||
<behavior key="behavior" lightByContents="YES"/>
|
||||
<font key="font" metaFont="label" size="12"/>
|
||||
<connections>
|
||||
<action selector="onLicenseButtonClick:" target="kIG-b2-o2F" id="0YB-Fw-bH4"/>
|
||||
</connections>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<segue destination="KRO-Tf-SDi" kind="sheet" id="mDF-Nf-qW8"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
@ -1104,55 +1104,6 @@
|
||||
</objects>
|
||||
<point key="canvasLocation" x="1674" y="1756"/>
|
||||
</scene>
|
||||
<!--About Controller-->
|
||||
<scene sceneID="cTW-F0-aao">
|
||||
<objects>
|
||||
<viewController id="KRO-Tf-SDi" customClass="ASCAboutController" sceneMemberID="viewController">
|
||||
<view key="view" id="5RA-3C-cHz">
|
||||
<rect key="frame" x="0.0" y="0.0" width="800" height="491"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<webView translatesAutoresizingMaskIntoConstraints="NO" id="rxD-dJ-5nd">
|
||||
<rect key="frame" x="10" y="60" width="780" height="421"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="780" id="5L3-pz-emb"/>
|
||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="420" id="CFF-ti-tZ6"/>
|
||||
</constraints>
|
||||
<webPreferences key="preferences" defaultFontSize="12" defaultFixedFontSize="12" minimumFontSize="7" plugInsEnabled="NO" javaEnabled="NO" javaScriptCanOpenWindowsAutomatically="NO">
|
||||
<nil key="identifier"/>
|
||||
</webPreferences>
|
||||
</webView>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="UVj-pl-yO9">
|
||||
<rect key="frame" x="366" y="13" width="69" height="32"/>
|
||||
<buttonCell key="cell" type="push" title="Close" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Riu-oE-8dj">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<string key="keyEquivalent" base64-UTF8="YES">
|
||||
DQ
|
||||
</string>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="dismissController:" target="4Gz-l5-4i0" id="VWc-In-XyJ"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="rxD-dJ-5nd" firstAttribute="leading" secondItem="5RA-3C-cHz" secondAttribute="leading" constant="10" id="ATh-Zd-Bng"/>
|
||||
<constraint firstItem="rxD-dJ-5nd" firstAttribute="top" secondItem="5RA-3C-cHz" secondAttribute="top" constant="10" id="OOn-Cf-86P"/>
|
||||
<constraint firstItem="UVj-pl-yO9" firstAttribute="centerX" secondItem="5RA-3C-cHz" secondAttribute="centerX" id="Rnw-Js-xvO"/>
|
||||
<constraint firstAttribute="trailing" secondItem="rxD-dJ-5nd" secondAttribute="trailing" constant="10" id="SGh-ex-i5C"/>
|
||||
<constraint firstAttribute="bottom" secondItem="UVj-pl-yO9" secondAttribute="bottom" constant="20" id="W90-kj-63m"/>
|
||||
<constraint firstItem="UVj-pl-yO9" firstAttribute="top" secondItem="rxD-dJ-5nd" secondAttribute="bottom" constant="20" symbolic="YES" id="l3C-JB-km4"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="eulaWebView" destination="rxD-dJ-5nd" id="OXX-65-NSp"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<customObject id="4Gz-l5-4i0" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="2693" y="1069.5"/>
|
||||
</scene>
|
||||
<!--Common View Controller-->
|
||||
<scene sceneID="hIz-AP-VOD">
|
||||
<objects>
|
||||
@ -1546,6 +1497,80 @@ DQ
|
||||
</objects>
|
||||
<point key="canvasLocation" x="131" y="34"/>
|
||||
</scene>
|
||||
<!--Window Controller-->
|
||||
<scene sceneID="wU6-OG-e5u">
|
||||
<objects>
|
||||
<windowController storyboardIdentifier="ASCLicenseWindowControllerId" id="quU-PS-Zqh" sceneMemberID="viewController">
|
||||
<window key="window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" titlebarAppearsTransparent="YES" id="ooH-wy-fad">
|
||||
<windowStyleMask key="styleMask" titled="YES" fullSizeContentView="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="294" y="313" width="680" height="340"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
|
||||
<view key="contentView" id="3dt-ev-Idy">
|
||||
<rect key="frame" x="0.0" y="0.0" width="680" height="340"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="quU-PS-Zqh" id="CHC-gh-jHU"/>
|
||||
</connections>
|
||||
</window>
|
||||
<connections>
|
||||
<segue destination="VpZ-MX-EgL" kind="relationship" relationship="window.shadowedContentViewController" id="90Y-gx-R9D"/>
|
||||
</connections>
|
||||
</windowController>
|
||||
<customObject id="ZmP-al-Equ" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="1207" y="2334"/>
|
||||
</scene>
|
||||
<!--License Controller-->
|
||||
<scene sceneID="U8C-hR-HlF">
|
||||
<objects>
|
||||
<viewController id="VpZ-MX-EgL" customClass="ASCLicenseController" sceneMemberID="viewController">
|
||||
<view key="view" id="baa-lw-Js5">
|
||||
<rect key="frame" x="0.0" y="0.0" width="800" height="491"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<webView translatesAutoresizingMaskIntoConstraints="NO" id="nPq-tX-WST">
|
||||
<rect key="frame" x="10" y="60" width="780" height="421"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="780" id="cUr-Iz-0Ec"/>
|
||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="420" id="juy-Wf-L5D"/>
|
||||
</constraints>
|
||||
<webPreferences key="preferences" defaultFontSize="12" defaultFixedFontSize="12" minimumFontSize="7" plugInsEnabled="NO" javaEnabled="NO" javaScriptCanOpenWindowsAutomatically="NO">
|
||||
<nil key="identifier"/>
|
||||
</webPreferences>
|
||||
</webView>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="fh8-FG-lR6">
|
||||
<rect key="frame" x="365" y="13" width="70" height="32"/>
|
||||
<buttonCell key="cell" type="push" title="Close" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="3FX-nT-Klk">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<string key="keyEquivalent" base64-UTF8="YES">
|
||||
DQ
|
||||
</string>
|
||||
<connections>
|
||||
<action selector="onCloseButtonClick:" target="VpZ-MX-EgL" id="Mvv-jG-hat"/>
|
||||
</connections>
|
||||
</buttonCell>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="fh8-FG-lR6" firstAttribute="centerX" secondItem="baa-lw-Js5" secondAttribute="centerX" id="LoW-y6-Eam"/>
|
||||
<constraint firstItem="fh8-FG-lR6" firstAttribute="top" secondItem="nPq-tX-WST" secondAttribute="bottom" constant="20" symbolic="YES" id="QDY-9x-oev"/>
|
||||
<constraint firstAttribute="trailing" secondItem="nPq-tX-WST" secondAttribute="trailing" constant="10" id="WJE-cY-Yst"/>
|
||||
<constraint firstItem="nPq-tX-WST" firstAttribute="top" secondItem="baa-lw-Js5" secondAttribute="top" constant="10" id="XOh-fP-a5f"/>
|
||||
<constraint firstItem="nPq-tX-WST" firstAttribute="leading" secondItem="baa-lw-Js5" secondAttribute="leading" constant="10" id="h8m-P5-eTK"/>
|
||||
<constraint firstAttribute="bottom" secondItem="fh8-FG-lR6" secondAttribute="bottom" constant="20" id="uz5-gt-aP8"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="eulaWebView" destination="nPq-tX-WST" id="2zB-fJ-pd9"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<customObject id="oty-wv-CAn" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="2189" y="2370"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="NSApplicationIcon" width="32" height="32"/>
|
||||
|
||||
@ -41,5 +41,5 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface ASCAboutController : NSViewController
|
||||
|
||||
- (IBAction)onLicenseButtonClick:(id)sender;
|
||||
@end
|
||||
|
||||
@ -40,11 +40,10 @@
|
||||
|
||||
#import "ASCAboutController.h"
|
||||
|
||||
#import <WebKit/WebKit.h>
|
||||
|
||||
#import "ASCConstants.h"
|
||||
#import "ASCExternalController.h"
|
||||
#import "ASCSharedSettings.h"
|
||||
#import "ASCLicenseController.h"
|
||||
|
||||
@interface ASCAboutController () {
|
||||
BOOL isCommercialVersion;
|
||||
@ -53,7 +52,6 @@
|
||||
@property (weak) IBOutlet NSTextField *versionText;
|
||||
@property (weak) IBOutlet NSTextField *copyrightText;
|
||||
@property (weak) IBOutlet NSButton *licenseButton;
|
||||
@property (weak) IBOutlet WebView *eulaWebView;
|
||||
@property (weak) IBOutlet NSStackView *infoStackView;
|
||||
@end
|
||||
|
||||
@ -99,12 +97,6 @@
|
||||
NSURL * eulaUrl = [[NSBundle mainBundle] URLForResource:@"EULA" withExtension:@"html" subdirectory:@"license"];
|
||||
isCommercialVersion = eulaUrl != nil;
|
||||
|
||||
// EULA View
|
||||
if (self.eulaWebView) {
|
||||
if ( !eulaUrl )
|
||||
eulaUrl = [[NSBundle mainBundle] URLForResource:@"LICENSE" withExtension:@"html" subdirectory:@"license"];
|
||||
[[self.eulaWebView mainFrame] loadRequest:[NSURLRequest requestWithURL:eulaUrl]];
|
||||
} else {
|
||||
// About View
|
||||
// Setup license button view
|
||||
NSMutableAttributedString * attrTitle = [[NSMutableAttributedString alloc] initWithAttributedString:[self.licenseButton attributedTitle]];
|
||||
@ -140,27 +132,16 @@
|
||||
|
||||
// Window
|
||||
[self setTitle:[NSString stringWithFormat:NSLocalizedString(@"About %@", nil), locProductName]];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)viewDidAppear {
|
||||
[super viewDidAppear];
|
||||
|
||||
// EULA View
|
||||
if (self.eulaWebView) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
[self.view.window setStyleMask:[self.view.window styleMask] & ~NSResizableWindowMask];
|
||||
}
|
||||
|
||||
- (void)viewDidDisappear {
|
||||
[super viewDidDisappear];
|
||||
|
||||
// EULA View
|
||||
if (self.eulaWebView) {
|
||||
return;
|
||||
}
|
||||
|
||||
[NSApp stopModal];
|
||||
}
|
||||
@ -184,4 +165,23 @@
|
||||
#endif
|
||||
}
|
||||
|
||||
- (IBAction)onLicenseButtonClick:(id)sender {
|
||||
NSURL * eulaUrl = [[NSBundle mainBundle] URLForResource:@"EULA" withExtension:@"html" subdirectory:@"license"];
|
||||
if ( !eulaUrl )
|
||||
eulaUrl = [[NSBundle mainBundle] URLForResource:@"LICENSE" withExtension:@"html" subdirectory:@"license"];
|
||||
|
||||
NSWindowController * windowController = [self.storyboard instantiateControllerWithIdentifier:@"ASCLicenseWindowControllerId"];
|
||||
ASCLicenseController *licView = (ASCLicenseController *)windowController.contentViewController;
|
||||
[licView setUrl:eulaUrl];
|
||||
NSWindow *licWindow = windowController.window;
|
||||
|
||||
NSRect parentFrame = self.view.window.frame;
|
||||
NSRect childFrame = licWindow.frame;
|
||||
[licWindow setFrameOrigin:NSMakePoint(NSMidX(parentFrame) - childFrame.size.width/2,
|
||||
NSMidY(parentFrame) - childFrame.size.height/2)];
|
||||
[licWindow makeKeyAndOrderFront:nil]; // Show the window first to apply the coordinates
|
||||
|
||||
[NSApp runModalForWindow:licWindow];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@ -71,6 +71,7 @@
|
||||
#import "ASCThemesController.h"
|
||||
#import "ASCEditorJSVariables.h"
|
||||
#import "ASCPresentationReporter.h"
|
||||
#import "ASCLicenseController.h"
|
||||
#import <Carbon/Carbon.h>
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
@ -240,21 +241,40 @@
|
||||
}
|
||||
|
||||
- (void)openLocalPage:(NSString *)path query:(NSString *)query title:(NSString *)title {
|
||||
if ( !path ) return;
|
||||
|
||||
NSURLComponents *urlPage = [NSURLComponents componentsWithString:path];
|
||||
urlPage.scheme = NSURLFileScheme;
|
||||
urlPage.query = query;
|
||||
|
||||
ASCTabView * existTab = [self tabWithParam:@"url" value:[urlPage string]];
|
||||
|
||||
if (existTab) {
|
||||
[self.tabsControl selectTab:existTab];
|
||||
} else {
|
||||
ASCTabView *tab = [[ASCTabView alloc] initWithFrame:CGRectZero];
|
||||
tab.title = title;
|
||||
tab.type = ASCTabViewTypePortal;
|
||||
tab.params = [@{@"url" : [urlPage string]} mutableCopy];
|
||||
|
||||
// ASCTabView * existTab = [self tabWithParam:@"url" value:[urlPage string]];
|
||||
//
|
||||
// if (existTab) {
|
||||
// [self.tabsControl selectTab:existTab];
|
||||
// } else {
|
||||
// ASCTabView *tab = [[ASCTabView alloc] initWithFrame:CGRectZero];
|
||||
// tab.title = title;
|
||||
// tab.type = ASCTabViewTypePortal;
|
||||
// tab.params = [@{@"url" : [urlPage string]} mutableCopy];
|
||||
//
|
||||
// [self.tabsControl addTab:tab selected:YES];
|
||||
// }
|
||||
|
||||
[self.tabsControl addTab:tab selected:YES];
|
||||
NSWindow *mainWindow = [[NSApp windows] objectAtIndex:0];
|
||||
if (mainWindow) {
|
||||
ASCCommonViewController * controller = (ASCCommonViewController *)mainWindow.contentViewController;
|
||||
NSWindowController * windowController = [controller.storyboard instantiateControllerWithIdentifier:@"ASCLicenseWindowControllerId"];
|
||||
ASCLicenseController *licView = (ASCLicenseController *)windowController.contentViewController;
|
||||
[licView setUrl:urlPage.URL];
|
||||
NSWindow *licWindow = windowController.window;
|
||||
|
||||
NSRect parentFrame = mainWindow.frame;
|
||||
NSRect childFrame = licWindow.frame;
|
||||
[licWindow setFrameOrigin:NSMakePoint(NSMidX(parentFrame) - childFrame.size.width/2,
|
||||
NSMidY(parentFrame) - childFrame.size.height/2)];
|
||||
[licWindow makeKeyAndOrderFront:nil]; // Show the window first to apply the coordinates
|
||||
|
||||
[NSApp runModalForWindow:licWindow];
|
||||
}
|
||||
}
|
||||
|
||||
@ -343,7 +363,13 @@
|
||||
}
|
||||
|
||||
- (void)openEULA {
|
||||
[self openLocalPage:[[NSBundle mainBundle] pathForResource:@"EULA" ofType:@"html"] title:NSLocalizedString(@"License Agreement", nil)];
|
||||
NSString * eulaUrl = [[NSBundle mainBundle] pathForResource:@"EULA" ofType:@"html" inDirectory:@"license"];
|
||||
if ( !eulaUrl )
|
||||
eulaUrl = [[NSBundle mainBundle] pathForResource:@"LICENSE" ofType:@"html" inDirectory:@"license"];
|
||||
|
||||
if ( eulaUrl ) {
|
||||
[self openLocalPage:eulaUrl title:NSLocalizedString(@"License Agreement", nil)];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)openPreferences {
|
||||
|
||||
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2019
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
|
||||
//
|
||||
// ASCLicenseController.h
|
||||
// ONLYOFFICE
|
||||
//
|
||||
// Copyright © 2025 Ascensio System SIA. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface ASCLicenseController : NSViewController
|
||||
- (void)setUrl:(NSURL *)url;
|
||||
- (IBAction)onCloseButtonClick:(id)sender;
|
||||
@end
|
||||
@ -0,0 +1,79 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2019
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
|
||||
//
|
||||
// ASCLicenseController.m
|
||||
// ONLYOFFICE
|
||||
//
|
||||
// Copyright © 2025 Ascensio System SIA. All rights reserved.
|
||||
//
|
||||
|
||||
#import "ASCLicenseController.h"
|
||||
#import <WebKit/WebKit.h>
|
||||
|
||||
@interface ASCLicenseController () {
|
||||
NSURL *_url;
|
||||
}
|
||||
@property (weak) IBOutlet WebView *eulaWebView;
|
||||
@end
|
||||
|
||||
@implementation ASCLicenseController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
if (_url) {
|
||||
[[self.eulaWebView mainFrame] loadRequest:[NSURLRequest requestWithURL:_url]];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)viewDidAppear {
|
||||
[super viewDidAppear];
|
||||
}
|
||||
|
||||
- (void)viewDidDisappear {
|
||||
[super viewDidDisappear];
|
||||
}
|
||||
|
||||
- (void)setUrl:(NSURL *)url {
|
||||
_url = url;
|
||||
if (self.isViewLoaded) {
|
||||
[[self.eulaWebView mainFrame] loadRequest:[NSURLRequest requestWithURL:url]];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)onCloseButtonClick:(id)sender {
|
||||
[NSApp stopModal];
|
||||
[self.view.window close];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user