|
@@ -142,232 +142,10 @@ NSPopoverDelegate>
|
|
|
BOOL isFree = NO;
|
|
|
self.secondTrialBtn.hidden = YES;
|
|
|
self.bgImg.hidden = YES;
|
|
|
-//#if VERSION_DMG
|
|
|
-//
|
|
|
-// if (self.trackingArea) {
|
|
|
-// [self.button removeTrackingArea:self.trackingArea];
|
|
|
-// }
|
|
|
-//
|
|
|
-// self.label.stringValue = @"";
|
|
|
-// if (ActivityStatusNone == [VerificationManager manager].status || isFree) {
|
|
|
-// self.labelContentView.hidden = self.bgImg.hidden = self.button.hidden = NO;
|
|
|
-// self.label.stringValue = @"";
|
|
|
-// self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Free Trial", nil)];
|
|
|
-// if (isFree) {
|
|
|
-// self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Upgrade to Pro", nil)];
|
|
|
-// self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Upgrade", nil)];
|
|
|
-// [self.button setAlignment:NSTextAlignmentCenter];
|
|
|
-// if ([IAPProductsManager defaultManager].isAvailableAllFunction) {
|
|
|
-// self.labelContentView.hidden = self.bgImg.hidden = self.button.hidden = YES;
|
|
|
-// } else {
|
|
|
-// self.labelContentView.hidden = self.bgImg.hidden = self.button.hidden = NO;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// self.button.layer.backgroundColor = [NSColor colorWithRed:0.0/255.0 green:207.0/255.0 blue:133.0/255.0 alpha:1].CGColor;
|
|
|
-// [self.button setTitleColor:[NSColor whiteColor]];
|
|
|
-// } else if (ActivityStatusTrial == [VerificationManager manager].status) {
|
|
|
-// NSDate *date = [NSDate date];
|
|
|
-// NSDate *expireDate = [VerificationManager manager].detailInfo.expireDate;
|
|
|
-// NSTimeInterval time = [expireDate timeIntervalSinceDate:date];
|
|
|
-// int leftDays = ((int)time)/(3600*24);
|
|
|
-// self.labelContentView.hidden = self.bgImg.hidden = self.button.hidden = NO;
|
|
|
-// NSString * needShowString = [NSString stringWithFormat:NSLocalizedString(@"%d days left", nil),leftDays];
|
|
|
-// if (@available(macOS 10.14, *)) {
|
|
|
-// self.label.attributedStringValue = [self numberConvertColor:[NSColor redColor] String:needShowString];
|
|
|
-// self.label.textColor = [NSColor colorWithRed:255.0/255.0 green:94.0/255.0 blue:44.0/255.0 alpha:1];
|
|
|
-// } else {
|
|
|
-// self.label.stringValue = needShowString;
|
|
|
-// self.label.textColor = [NSColor colorWithRed:255.0/255.0 green:94.0/255.0 blue:44.0/255.0 alpha:1];
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// self.label.wantsLayer = YES;
|
|
|
-// self.label.layer.backgroundColor = [NSColor clearColor].CGColor;
|
|
|
-// self.button.layer.backgroundColor = [NSColor colorWithRed:255.0/255.0 green:94.0/255.0 blue:44.0/255.0 alpha:1].CGColor;
|
|
|
-// self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Upgrade", nil)];
|
|
|
-// [self.button setTitleColor:[KMAppearance KMColor_Layout_W0]];
|
|
|
-// [self.button setAlignment:NSTextAlignmentCenter];
|
|
|
-//
|
|
|
-// if (!self.trackingArea) {
|
|
|
-// self.trackingArea = [[NSTrackingArea alloc] initWithRect:self.button.bounds options:NSTrackingMouseEnteredAndExited | NSTrackingInVisibleRect | NSTrackingActiveAlways owner:self userInfo:nil];
|
|
|
-// }
|
|
|
-// [self.button addTrackingArea:self.trackingArea];
|
|
|
-// } else if (ActivityStatusTrialExpire == [VerificationManager manager].status) {
|
|
|
-// self.labelContentView.hidden = self.bgImg.hidden = self.button.hidden = NO;
|
|
|
-//
|
|
|
-// self.label.wantsLayer = YES;
|
|
|
-// self.label.layer.backgroundColor = [NSColor clearColor].CGColor;
|
|
|
-// self.label.stringValue = NSLocalizedString(@"Trial expired", nil);
|
|
|
-// if (@available(macOS 10.14, *)) {
|
|
|
-// self.label.textColor = [NSColor whiteColor];
|
|
|
-// } else {
|
|
|
-// self.label.textColor = [NSColor redColor];
|
|
|
-// }
|
|
|
-// self.label.stringValue = @"";
|
|
|
-//
|
|
|
-// self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Upgrade", nil)];
|
|
|
-// [self.button setAlignment:NSTextAlignmentCenter];
|
|
|
-// self.bgImg.hidden = NO;
|
|
|
-// self.button.layer.backgroundColor = [NSColor clearColor].CGColor;
|
|
|
-// [self.button setTitleColor:[NSColor whiteColor]];
|
|
|
-//
|
|
|
-// if (!self.trackingArea) {
|
|
|
-// self.trackingArea = [[NSTrackingArea alloc] initWithRect:self.button.bounds options:NSTrackingMouseEnteredAndExited | NSTrackingInVisibleRect | NSTrackingActiveAlways owner:self userInfo:nil];
|
|
|
-// }
|
|
|
-// [self.button addTrackingArea:self.trackingArea];
|
|
|
-//
|
|
|
-// if ([VerificationManager manager].secondTrialEnabled) {
|
|
|
-//
|
|
|
-// self.label.stringValue = NSLocalizedString(@"Trial expired", nil);
|
|
|
-// self.label.hidden = YES;
|
|
|
-// self.secondTrialBtn.hidden = NO;
|
|
|
-// self.secondTrialBtn.layer.backgroundColor = [NSColor colorWithRed:0.0/255.0 green:207.0/255.0 blue:133.0/255.0 alpha:1].CGColor;
|
|
|
-// [self.secondTrialBtn setTitleColor:[NSColor whiteColor]];
|
|
|
-// [self.secondTrialBtn setAlignment:NSTextAlignmentCenter];
|
|
|
-//
|
|
|
-// self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Upgrade", nil)];
|
|
|
-// [self.button setTitleColor:[NSColor whiteColor]];
|
|
|
-// self.bgImg.hidden = NO;
|
|
|
-// self.button.layer.backgroundColor = [NSColor clearColor].CGColor;
|
|
|
-// [self.button setAlignment:NSTextAlignmentCenter];
|
|
|
-// }
|
|
|
-// } else if (ActivityStatusVerifExpire == [VerificationManager manager].status) {
|
|
|
-// self.labelContentView.hidden = self.bgImg.hidden = self.button.hidden = NO;
|
|
|
-// self.label.stringValue = @"";
|
|
|
-// self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Upgrade", nil)];
|
|
|
-// [self.button setTitleColor:[NSColor whiteColor]];
|
|
|
-// self.bgImg.hidden = NO;
|
|
|
-// self.button.layer.backgroundColor = [NSColor clearColor].CGColor;
|
|
|
-// [self.button setAlignment:NSTextAlignmentCenter];
|
|
|
-// } else if (ActivityStatusVerification == [VerificationManager manager].status) {
|
|
|
-// if ([VerificationManager manager].needUpgradeLicense == NO) {
|
|
|
-// self.labelContentView.hidden = self.bgImg.hidden = self.button.hidden = YES;
|
|
|
-// } else {
|
|
|
-// self.labelContentView.hidden = self.bgImg.hidden = self.button.hidden = NO;
|
|
|
-// self.label.stringValue = @"";
|
|
|
-// self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"PDF to Office Pack", nil)];
|
|
|
-// [self.button setTitleColor:[KMAppearance KMColor_Interactive_A0]];
|
|
|
-// self.button.layer.backgroundColor = [NSColor colorWithRed:229/255. green:233/255. blue:248/255. alpha:1].CGColor;
|
|
|
-// [self.button setAlignment:NSTextAlignmentCenter];
|
|
|
-// }
|
|
|
-// } else {
|
|
|
-// self.labelContentView.hidden = self.bgImg.hidden = self.button.hidden = YES;
|
|
|
-// if ([VerificationManager manager].needUpgradeLicense) {
|
|
|
-// self.labelContentView.hidden = self.bgImg.hidden = self.button.hidden = NO;
|
|
|
-// self.label.stringValue = @"";
|
|
|
-//
|
|
|
-// self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"PDF to Office Pack", nil)];
|
|
|
-// [self.button setTitleColor:[KMAppearance KMColor_Interactive_A0]];
|
|
|
-// self.button.layer.backgroundColor = [NSColor colorWithRed:229/255. green:233/255. blue:248/255. alpha:1].CGColor;
|
|
|
-// [self.button setAlignment:NSTextAlignmentCenter];
|
|
|
-// }
|
|
|
-// }
|
|
|
-//#else
|
|
|
-// isFree = YES;
|
|
|
-// if (isFree) {
|
|
|
-// self.labelContentView.hidden = self.bgImg.hidden = self.button.hidden = NO;
|
|
|
-// self.button.layer.backgroundColor = [NSColor clearColor].CGColor;
|
|
|
-// self.label.stringValue = @"";
|
|
|
-// self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Free Trial", nil)];
|
|
|
-// if (isFree) {
|
|
|
-// self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Upgrade to Pro", nil)];
|
|
|
-// [self.button setTitleColor:[NSColor whiteColor]];
|
|
|
-// if ([IAPProductsManager defaultManager].isAvailableAllFunction) {
|
|
|
-// self.labelContentView.hidden = self.bgImg.hidden = self.button.hidden = YES;
|
|
|
-// } else {
|
|
|
-// self.labelContentView.hidden = self.bgImg.hidden = self.button.hidden = NO;
|
|
|
-// }
|
|
|
-// self.bgImg.hidden = self.button.hidden;
|
|
|
-//#if !VERSION_FREE
|
|
|
-// self.bgImg.hidden = YES;
|
|
|
-// self.labelContentView.hidden = self.bgImg.hidden = self.button.hidden = NO;
|
|
|
-// self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"PDF to Office Pack", nil)];
|
|
|
-// if ([IAPProductsManager defaultManager].isAvailableAdvancedPDFToOffice) {
|
|
|
-// self.labelContentView.hidden = self.bgImg.hidden = self.button.hidden = YES;
|
|
|
-// }
|
|
|
-// [self.button setTitleColor:[KMAppearance KMColor_Interactive_A0]];
|
|
|
-// self.button.layer.backgroundColor = [NSColor colorWithRed:229/255. green:233/255. blue:248/255. alpha:1].CGColor;
|
|
|
-//#endif
|
|
|
-// }
|
|
|
-// } else {
|
|
|
-// self.labelContentView.hidden = self.bgImg.hidden = self.button.hidden = YES;
|
|
|
-// }
|
|
|
-//
|
|
|
-//#endif
|
|
|
-//
|
|
|
-// [self.button sizeToFit];
|
|
|
-// [self.button setAlignment:NSTextAlignmentCenter];
|
|
|
-// [self.secondTrialBtn sizeToFit];
|
|
|
-// [self.secondTrialBtn setAlignment:NSTextAlignmentCenter];
|
|
|
-//
|
|
|
-// [self.label sizeToFit];
|
|
|
-// if (self.label.stringValue.length == 0) {
|
|
|
-// self.labelContentView.frame = CGRectZero;
|
|
|
-// } else {
|
|
|
-// self.labelContentView.frame = CGRectMake(0, kbottomGap, self.label.frame.size.width + self.view.frame.size.height , self.view.frame.size.height -2 *kbottomGap);
|
|
|
-//
|
|
|
-// if ([VerificationManager manager].secondTrialEnabled) {
|
|
|
-// self.labelContentView.frame = CGRectMake(0, kbottomGap, self.button.frame.size.width + self.secondTrialBtn.frame.size.width - 16, self.view.frame.size.height -2 *kbottomGap);
|
|
|
-// }
|
|
|
-// self.labelContentView.wantsLayer = YES;
|
|
|
-// self.labelContentView.layer.cornerRadius = 4.;
|
|
|
-// [self.labelContentView.layer masksToBounds];
|
|
|
-//
|
|
|
-// self.labelContentView.layer.backgroundColor = [NSColor colorWithRed:255.0/255.0 green:94.0/255.0 blue:44.0/255.0 alpha:0.15].CGColor;
|
|
|
-// if ([VerificationManager manager].secondTrialEnabled) {
|
|
|
-// self.labelContentView.layer.backgroundColor = [NSColor clearColor].CGColor;
|
|
|
-// }
|
|
|
-// self.label.frame = CGRectMake(self.labelContentView.frame.size.height/2, (self.labelContentView.frame.size.height - self.label.frame.size.height)/2, self.label.frame.size.width, self.label.frame.size.height);
|
|
|
-// }
|
|
|
-//
|
|
|
-// CGFloat totalWidth = CGRectGetMaxX(self.labelContentView.frame) + 8;
|
|
|
-//
|
|
|
-//// self.aiLabel.stringValue = NSLocalizedString(@"My AI Credit", nil);
|
|
|
-//// [self.aiLabel sizeToFit];
|
|
|
-//// CGFloat aiWidth = self.aiLabel.frame.size.width;
|
|
|
-//// aiWidth += 4;
|
|
|
-//// aiWidth += 16;
|
|
|
-//// aiWidth += 16;
|
|
|
-//// self.aiContendView.frame = CGRectMake(totalWidth, 0, aiWidth, self.view.frame.size.height);
|
|
|
-//// self.aiIconImg.frame = CGRectMake(8, CGRectGetHeight(self.view.frame)/2.-8, 16, 16);
|
|
|
-//// CGRect ailabelRect = self.aiLabel.frame;
|
|
|
-//// ailabelRect.origin.x = CGRectGetMaxX(self.aiIconImg.frame) + 4;
|
|
|
-//// self.aiLabel.frame = ailabelRect;
|
|
|
-////
|
|
|
-//// totalWidth += aiWidth;
|
|
|
-//// totalWidth += 8;
|
|
|
-// self.aiContendView.hidden = YES;
|
|
|
-//
|
|
|
-// if (self.button.hidden == NO) {
|
|
|
-// CGFloat buttonWidth = CGRectGetMaxX(self.button.frame);
|
|
|
-// NSRect btnRect = [self.button.attributedTitle boundingRectWithSize:CGSizeMake(MAXFLOAT, CGRectGetHeight(self.button.frame)) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading];
|
|
|
-// if (fabs(buttonWidth-btnRect.size.width)>50) {
|
|
|
-// buttonWidth = btnRect.size.width + 10;
|
|
|
-// }
|
|
|
-// self.button.frame = CGRectMake(totalWidth, kbottomGap, buttonWidth, self.view.frame.size.height -2 *kbottomGap);
|
|
|
-// totalWidth += buttonWidth;
|
|
|
-// totalWidth += 8;
|
|
|
-// }
|
|
|
-//
|
|
|
-// if (!self.secondTrialBtn.hidden) {
|
|
|
-// self.secondTrialBtn.frame = CGRectMake(MAX(CGRectGetMaxX(self.labelContentView.frame) - self.button.frame.size.width, 0), kbottomGap, self.button.frame.size.width, self.view.frame.size.height -2 *kbottomGap);
|
|
|
-// }
|
|
|
-//// if (self.view.superview) {
|
|
|
-//// self.view.frame = CGRectMake(MAX(0, CGRectGetWidth(self.view.superview.frame)-totalWidth - 8), (CGRectGetHeight(self.view.superview.frame)-CGRectGetHeight(self.view.frame))/2., totalWidth, self.view.frame.size.height);
|
|
|
-//// } else {
|
|
|
-//// if (self.button.hidden) {
|
|
|
-//// self.view.frame = CGRectMake(0,0, CGRectGetMaxX(self.aiLabel.frame) + 20 ,self.view.frame.size.height);
|
|
|
-//// } else {
|
|
|
-//// self.view.frame = CGRectMake(0,0, CGRectGetMaxX(self.button.frame) ,self.view.frame.size.height);
|
|
|
-// }
|
|
|
-// }
|
|
|
|
|
|
if (self.frameUpdateHandle) {
|
|
|
self.frameUpdateHandle(self.view.frame);
|
|
|
}
|
|
|
-
|
|
|
-// CGRect rect = self.button.frame;
|
|
|
-// self.bgImg.frame = rect;
|
|
|
|
|
|
CGFloat totalWidth = 8;
|
|
|
self.button.hidden = YES;
|