|
@@ -10,11 +10,7 @@
|
|
|
#import "VerificationManager.h"
|
|
|
#import "AIInfoManager.h"
|
|
|
#import "KMVerificationWindowController.h"
|
|
|
-#import "KMPurchaseCompareWindowController.h"
|
|
|
#import "KMUnlockAlertViewController.h"
|
|
|
-//#import "FMTrackEventManager.h"
|
|
|
-//#import "SKInspectPublicTool.h"
|
|
|
-//#import "KMToolCompareWindowController.h"
|
|
|
|
|
|
#define kbottomGap 0
|
|
|
@interface KMVerificationMessageViewController ()<
|
|
@@ -32,6 +28,10 @@ NSPopoverDelegate>
|
|
|
|
|
|
@property (weak) IBOutlet NSButton *userButton;
|
|
|
|
|
|
+@property (assign) IBOutlet NSView *signUpView;
|
|
|
+@property (assign) IBOutlet NSImageView *signUpImg;
|
|
|
+@property (assign) IBOutlet NSTextField *signUpLabel;
|
|
|
+
|
|
|
@property (nonatomic, retain) NSTrackingArea *trackingArea;
|
|
|
|
|
|
@property (nonatomic, retain) NSPopover *popover;
|
|
@@ -128,6 +128,12 @@ NSPopoverDelegate>
|
|
|
self.aiLabel.textColor = [NSColor whiteColor];
|
|
|
|
|
|
[self reloadData];
|
|
|
+
|
|
|
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(popoverShowNoti:) name:@"KMVerificationMessagePopShowNoti" object:nil];
|
|
|
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginSuccessNotification:) name:@"MemberCenterLoginSuccess" object:nil];
|
|
|
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(logoutSuccessNotification:) name:@"MemberCenterLogoutSuccess" object:nil];
|
|
|
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(expandPersonalCenterNotification:) name:@"ExpandPersonalCenter" object:nil];
|
|
|
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(closeMenu:) name:@"CloseMenuNotification" object:nil];
|
|
|
}
|
|
|
|
|
|
- (void)reloadData {
|
|
@@ -199,8 +205,6 @@ NSPopoverDelegate>
|
|
|
}
|
|
|
self.label.stringValue = @"";
|
|
|
|
|
|
-// self.button.layer.backgroundColor = [NSColor colorWithRed:221/255.0 green:44/255.0 blue:0/255.0 alpha:1].CGColor;
|
|
|
-// self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Unlock Full Version", nil)];
|
|
|
self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Upgrade", nil)];
|
|
|
[self.button setAlignment:NSTextAlignmentCenter];
|
|
|
self.bgImg.hidden = NO;
|
|
@@ -226,12 +230,10 @@ NSPopoverDelegate>
|
|
|
self.bgImg.hidden = NO;
|
|
|
self.button.layer.backgroundColor = [NSColor clearColor].CGColor;
|
|
|
[self.button setAlignment:NSTextAlignmentCenter];
|
|
|
-// [self.view removeTrackingArea:self.trackingArea];
|
|
|
}
|
|
|
} else if (ActivityStatusVerifExpire == [VerificationManager manager].status) {
|
|
|
self.labelContentView.hidden = self.bgImg.hidden = self.button.hidden = NO;
|
|
|
self.label.stringValue = @"";
|
|
|
-// self.button.layer.backgroundColor = [NSColor colorWithRed:221/255.0 green:44/255.0 blue:0/255.0 alpha:1].CGColor;
|
|
|
self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Upgrade", nil)];
|
|
|
[self.button setTitleColor:[NSColor whiteColor]];
|
|
|
self.bgImg.hidden = NO;
|
|
@@ -290,6 +292,7 @@ NSPopoverDelegate>
|
|
|
} else {
|
|
|
self.labelContentView.hidden = self.bgImg.hidden = self.button.hidden = YES;
|
|
|
}
|
|
|
+
|
|
|
#endif
|
|
|
|
|
|
[self.button sizeToFit];
|
|
@@ -346,8 +349,97 @@ NSPopoverDelegate>
|
|
|
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;
|
|
|
+
|
|
|
+ // PDF Reader Pro Lite
|
|
|
+ // 未登录 - 无订阅 - 无AI
|
|
|
+ // 未登录 - 有订阅高级版+有AI序列码
|
|
|
+ // 已登录(未试用过的免费用户+未订阅AI) - 无订阅+无AI旧剩余点数
|
|
|
+ // 已登录(试用到期且未付费用户+未订阅AI) - 无旧订阅+有AI旧剩余点数
|
|
|
+ // 已登录(新的买断会员+有订阅AI) - 无旧订阅+无AI旧剩余点数
|
|
|
+ // 已登录(自动订阅中 + 订阅AI) - 无旧订阅+有AI旧剩余点数
|
|
|
+ // 已登录(订阅中但取消续订用户) - 无旧订阅+无AI旧剩余点数
|
|
|
+ // 已登录(订阅过期用户) - 无旧订阅+无AI旧剩余点数
|
|
|
+ // 已登录(试用过期用户) - 无旧订阅+无AI旧剩余点数
|
|
|
+
|
|
|
+ // PDF Reader Pro
|
|
|
+ // 未登录 - 标准版+无AI
|
|
|
+ // 未登录 - 高级版(有购买转档包)+有AI序列码
|
|
|
+ // 已登录(未试用过的免费用户+未订阅AI) - 标准版+无AI旧剩余点数
|
|
|
+ // 已登录(新的买断会员+有订阅AI) - 高级版(有升级转档包)+无AI旧剩余点数
|
|
|
+ // 已登录(全平台高级版年订阅自动订阅中 + 订阅AI) - 无旧订阅+有AI旧剩余点数
|
|
|
+ // 已登录(全平台标准版年订阅订阅中但取消续订用户) - 标准版+无AI旧剩余点数
|
|
|
+ // 已登录(订阅过期用户) - 高级版+无AI旧剩余点数
|
|
|
+
|
|
|
+ // PDF Reader Pro DMG
|
|
|
+ // 未登录 - 无激活+无AI序列码
|
|
|
+ // 未登录 - 有激活标准版+有AI序列码
|
|
|
+ // 未登录 - 有激活高级版+无AI序列码
|
|
|
+ // 已登录(未试用过的免费用户+未订阅AI) - 无激活+无AI序列码
|
|
|
+ // 已登录(新的买断会员+有订阅AI) - 无激活+无AI序列码
|
|
|
+ // 已登录(自动订阅中 + 订阅AI) - 无激活+有AI序列码
|
|
|
+ // 已登录(订阅中但取消续订用户) - 无激活+无AI
|
|
|
+ // 已登录(订阅过期用户) - 无激活+无AI
|
|
|
+
|
|
|
+ totalWidth = 8;
|
|
|
+ self.button.hidden = YES;
|
|
|
+ self.label.hidden = YES;
|
|
|
+ self.secondTrialBtn.hidden = YES;
|
|
|
+ self.labelContentView.hidden = YES;
|
|
|
+ self.bgImg.hidden = YES;
|
|
|
+ self.aiContendView.hidden = YES;
|
|
|
+ self.userButton.hidden = YES;
|
|
|
+ self.signUpView.hidden = YES;
|
|
|
+ self.signUpLabel.stringValue = NSLocalizedStringFromTable(@"Sign Up", @"MemberCenterLocalizable", nil);
|
|
|
+ [self.signUpLabel sizeToFit];
|
|
|
+ CGFloat signUpWidth = self.signUpLabel.frame.size.width;
|
|
|
+ signUpWidth += 4;
|
|
|
+ signUpWidth += 8;
|
|
|
+ signUpWidth += 8;
|
|
|
+ signUpWidth += 12;
|
|
|
+ self.signUpImg.frame = CGRectMake(8, CGRectGetHeight(self.view.frame)/2.-6, 12, 12);
|
|
|
+ CGRect signUplabelRect = self.signUpLabel.frame;
|
|
|
+ signUplabelRect.origin.x = CGRectGetMaxX(self.signUpImg.frame) + 4;
|
|
|
+ self.signUpLabel.frame = signUplabelRect;
|
|
|
+
|
|
|
+ self.button.layer.backgroundColor = [NSColor clearColor].CGColor;
|
|
|
+ self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Upgrade to Pro", nil)];
|
|
|
+ [self.button setTitleColor:[NSColor whiteColor]];
|
|
|
+
|
|
|
+ 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.aiIconImg.frame = CGRectMake(8, CGRectGetHeight(self.view.frame)/2.-8, 16, 16);
|
|
|
+ self.aiContendView.frame = CGRectMake(totalWidth, 0, aiWidth, self.view.frame.size.height);
|
|
|
+ CGRect ailabelRect = self.aiLabel.frame;
|
|
|
+ ailabelRect.origin.x = CGRectGetMaxX(self.aiIconImg.frame) + 4;
|
|
|
+ self.aiLabel.frame = ailabelRect;
|
|
|
+// totalWidth+=aiWidth;
|
|
|
+// totalWidth+=4;
|
|
|
+
|
|
|
CGFloat userImageWidth = 24;
|
|
|
- self.userButton.frame = CGRectMake(totalWidth, 0, userImageWidth, userImageWidth);
|
|
|
+// self.userButton.frame = CGRectMake(totalWidth, 0, userImageWidth, userImageWidth);
|
|
|
totalWidth += userImageWidth;
|
|
|
totalWidth += 8;
|
|
|
if ([KMMemberInfo shared].isLogin) {
|
|
@@ -355,9 +447,60 @@ NSPopoverDelegate>
|
|
|
} else {
|
|
|
self.userButton.image = [NSImage imageNamed:@"UserProfilePicture1"];
|
|
|
}
|
|
|
-
|
|
|
- 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);
|
|
|
+
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type1 || [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type2) {
|
|
|
+ self.bgImg.hidden = NO;
|
|
|
+ self.button.hidden = NO;
|
|
|
+ self.signUpView.hidden = NO;
|
|
|
+ self.button.frame = CGRectMake(totalWidth, kbottomGap, buttonWidth, self.view.frame.size.height -2 *kbottomGap);
|
|
|
+ CGRect rect = self.button.frame;
|
|
|
+ self.bgImg.frame = rect;
|
|
|
+ totalWidth+=CGRectGetWidth(self.button.bounds);
|
|
|
+ totalWidth+=4;
|
|
|
+ self.signUpView.frame = CGRectMake(totalWidth, 0, signUpWidth, self.view.frame.size.height);
|
|
|
+ totalWidth+=CGRectGetWidth(self.signUpView.bounds);
|
|
|
+ } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type3 || [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type4) {
|
|
|
+ self.signUpView.hidden = NO;
|
|
|
+ self.signUpView.frame = CGRectMake(totalWidth, 0, signUpWidth, self.view.frame.size.height);
|
|
|
+ totalWidth+=CGRectGetWidth(self.signUpView.bounds);
|
|
|
+ } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type5 ||
|
|
|
+ [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type6 ||
|
|
|
+ [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type7 ||
|
|
|
+ [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type10 ||
|
|
|
+ [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type11) {
|
|
|
+ if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type5) {
|
|
|
+ self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Free Trial", nil)];
|
|
|
+ } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type6 ||
|
|
|
+ [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type10 ||
|
|
|
+ [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type11) {
|
|
|
+ self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedStringFromTable(@"立即续费", @"MemberCenterLocalizable", nil)];
|
|
|
+ } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type7) {
|
|
|
+ self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedStringFromTable(@"立即升级", @"MemberCenterLocalizable", nil)];
|
|
|
+ }
|
|
|
+ [self.button setTitleColor:[NSColor whiteColor]];
|
|
|
+ self.bgImg.hidden = NO;
|
|
|
+ self.button.hidden = NO;
|
|
|
+ self.userButton.hidden = NO;
|
|
|
+ self.button.frame = CGRectMake(totalWidth, kbottomGap, buttonWidth, self.view.frame.size.height -2 *kbottomGap);
|
|
|
+ CGRect rect = self.button.frame;
|
|
|
+ self.bgImg.frame = rect;
|
|
|
+ totalWidth+=CGRectGetWidth(self.button.bounds);
|
|
|
+ totalWidth+=8;
|
|
|
+
|
|
|
+ self.userButton.frame = CGRectMake(totalWidth, 0, userImageWidth, userImageWidth);
|
|
|
+ totalWidth += userImageWidth;
|
|
|
+ totalWidth += 8;
|
|
|
+ } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type8 ||
|
|
|
+ [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type9) {
|
|
|
+ self.userButton.hidden = NO;
|
|
|
+ self.userButton.frame = CGRectMake(totalWidth, 0, userImageWidth, userImageWidth);
|
|
|
+ totalWidth += userImageWidth;
|
|
|
+ totalWidth += 8;
|
|
|
}
|
|
|
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);
|
|
@@ -368,19 +511,6 @@ NSPopoverDelegate>
|
|
|
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;
|
|
|
-
|
|
|
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(popoverShowNoti:) name:@"KMVerificationMessagePopShowNoti" object:nil];
|
|
|
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginSuccessNotification:) name:@"MemberCenterLoginSuccess" object:nil];
|
|
|
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(logoutSuccessNotification:) name:@"MemberCenterLogoutSuccess" object:nil];
|
|
|
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(expandPersonalCenterNotification:) name:@"ExpandPersonalCenter" object:nil];
|
|
|
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(closeMenu:) name:@"CloseMenuNotification" object:nil];
|
|
|
}
|
|
|
|
|
|
#pragma mark - Button Actions
|
|
@@ -390,157 +520,173 @@ NSPopoverDelegate>
|
|
|
KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeRepeatTrialGuide];
|
|
|
[vc showWindow:nil];
|
|
|
} else {
|
|
|
- [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
|
|
|
+ [[KMProductCompareWC shared] setOrientation:NO];
|
|
|
+ [[KMProductCompareWC shared] showWindow:nil];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- (IBAction)buttonAction:(id)sender {
|
|
|
- BOOL isFree = NO;
|
|
|
-
|
|
|
-#if VERSION_DMG
|
|
|
- if (ActivityStatusNone == [VerificationManager manager].status) {
|
|
|
- //弹出 试用弹窗UI优化-新用户试用路径 新UI 情况一 右上角按钮
|
|
|
- KMPurchaseFirstTrialWindowController *firstTrialWC = [KMPurchaseFirstTrialWindowController currentFirstTrialWC];
|
|
|
- firstTrialWC.buttonActionBlock = ^(KMPurchaseFirstTrialWindowController * _Nonnull ftWC, KMButton * _Nonnull btn, NSString * _Nonnull email, NSString * _Nonnull name) {
|
|
|
- if (btn.tag == 10001) {
|
|
|
- if (ActivityStatusNone == [VerificationManager manager].status ||
|
|
|
- ActivityStatusTrialExpire == [VerificationManager manager].status) {
|
|
|
-
|
|
|
- [[FMTrackEventManager defaultManager] trackEventWithEvent:@"Tbr" withProperties:@{@"Tbr_Btn":@"Btn_Tbr_SecondTrial"}];
|
|
|
- [[VerificationManager manager] trialForDays:7
|
|
|
- email:email?:[VerificationManager manager].email
|
|
|
- name:name?:[VerificationManager manager].accountName
|
|
|
- complention:^(ActivityStatus status, NSDictionary *info, NSError *error) {
|
|
|
- if (error ||
|
|
|
- status != ActivityStatusTrial) {
|
|
|
- NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Activation Error", nil)
|
|
|
- defaultButton:NSLocalizedString(@"Try Again", nil)
|
|
|
- alternateButton:nil
|
|
|
- otherButton:nil
|
|
|
- informativeTextWithFormat:NSLocalizedString(@"Failed to sign up for the free trial. Please make sure your internet connection is available and try again later.", nil), nil];
|
|
|
- [alert runModal];
|
|
|
- } else {
|
|
|
- KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeRepeatTrialSuccess];
|
|
|
- [vc showWindow:nil];
|
|
|
- }
|
|
|
- }];
|
|
|
- [ftWC close];
|
|
|
- } else {
|
|
|
- [ftWC close];
|
|
|
- KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];
|
|
|
- vc.callback = ^{
|
|
|
- [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
|
|
|
- };
|
|
|
- [vc showWindow:nil];
|
|
|
- }
|
|
|
- } else if (btn.tag == 10002) {
|
|
|
- NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@?utm_source=app_dmg&utm_medium=dmg_puw_free_trial", Swift_oc_Tool.Store_Link_OC]];
|
|
|
- [[NSWorkspace sharedWorkspace] openURL:url];
|
|
|
- [[FMTrackEventManager defaultManager] trackEventWithEvent:@"PUW" withProperties:@{@"PUW_Btn":@"PUW_Btn_UpgradeBuyNow"}];
|
|
|
- } else if (btn.tag == 10003) {
|
|
|
- KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];//KMVerificationTypeActivate
|
|
|
- [vc showWindow:nil];
|
|
|
- [ftWC close];
|
|
|
- }
|
|
|
- };
|
|
|
- [firstTrialWC.window center];
|
|
|
- [firstTrialWC showWindow:nil];
|
|
|
- } else if (ActivityStatusTrialExpire == [VerificationManager manager].status ||
|
|
|
- ActivityStatusTrial == [VerificationManager manager].status) {
|
|
|
-// if ([VerificationManager manager].secondTrialEnabled) {
|
|
|
-// if (!self.checkValue) {
|
|
|
-// [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
|
|
|
+// BOOL isFree = NO;
|
|
|
+//
|
|
|
+//#if VERSION_DMG
|
|
|
+// if (ActivityStatusNone == [VerificationManager manager].status) {
|
|
|
+// //弹出 试用弹窗UI优化-新用户试用路径 新UI 情况一 右上角按钮
|
|
|
+// KMPurchaseFirstTrialWindowController *firstTrialWC = [KMPurchaseFirstTrialWindowController currentFirstTrialWC];
|
|
|
+// firstTrialWC.buttonActionBlock = ^(KMPurchaseFirstTrialWindowController * _Nonnull ftWC, KMButton * _Nonnull btn, NSString * _Nonnull email, NSString * _Nonnull name) {
|
|
|
+// if (btn.tag == 10001) {
|
|
|
+// if (ActivityStatusNone == [VerificationManager manager].status ||
|
|
|
+// ActivityStatusTrialExpire == [VerificationManager manager].status) {
|
|
|
+//
|
|
|
+// [[FMTrackEventManager defaultManager] trackEventWithEvent:@"Tbr" withProperties:@{@"Tbr_Btn":@"Btn_Tbr_SecondTrial"}];
|
|
|
+// [[VerificationManager manager] trialForDays:7
|
|
|
+// email:email?:[VerificationManager manager].email
|
|
|
+// name:name?:[VerificationManager manager].accountName
|
|
|
+// complention:^(ActivityStatus status, NSDictionary *info, NSError *error) {
|
|
|
+// if (error ||
|
|
|
+// status != ActivityStatusTrial) {
|
|
|
+// NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Activation Error", nil)
|
|
|
+// defaultButton:NSLocalizedString(@"Try Again", nil)
|
|
|
+// alternateButton:nil
|
|
|
+// otherButton:nil
|
|
|
+// informativeTextWithFormat:NSLocalizedString(@"Failed to sign up for the free trial. Please make sure your internet connection is available and try again later.", nil), nil];
|
|
|
+// [alert runModal];
|
|
|
+// } else {
|
|
|
+// KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeRepeatTrialSuccess];
|
|
|
+// [vc showWindow:nil];
|
|
|
+// }
|
|
|
+// }];
|
|
|
+// [ftWC close];
|
|
|
+// } else {
|
|
|
+// [ftWC close];
|
|
|
+// KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];
|
|
|
+// vc.callback = ^{
|
|
|
+// [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
|
|
|
+// };
|
|
|
+// [vc showWindow:nil];
|
|
|
+// }
|
|
|
+// } else if (btn.tag == 10002) {
|
|
|
+// NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@?utm_source=app_dmg&utm_medium=dmg_puw_free_trial", Swift_oc_Tool.Store_Link_OC]];
|
|
|
+// [[NSWorkspace sharedWorkspace] openURL:url];
|
|
|
+// [[FMTrackEventManager defaultManager] trackEventWithEvent:@"PUW" withProperties:@{@"PUW_Btn":@"PUW_Btn_UpgradeBuyNow"}];
|
|
|
+// } else if (btn.tag == 10003) {
|
|
|
+// KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];//KMVerificationTypeActivate
|
|
|
+// [vc showWindow:nil];
|
|
|
+// [ftWC close];
|
|
|
+// }
|
|
|
+// };
|
|
|
+// [firstTrialWC.window center];
|
|
|
+// [firstTrialWC showWindow:nil];
|
|
|
+// } else if (ActivityStatusTrialExpire == [VerificationManager manager].status ||
|
|
|
+// ActivityStatusTrial == [VerificationManager manager].status) {
|
|
|
+// [[NSNotificationCenter defaultCenter] postNotificationName:@"KMVerificationMessagePopShowNoti" object:nil];
|
|
|
+//
|
|
|
+// if (!self.testVC) {
|
|
|
+// self.testVC = [[KMUnlockAlertViewController alloc] init];
|
|
|
+// }
|
|
|
+// [self.testVC addtrackingAreaInfo];
|
|
|
+// self.testVC.callback = ^(NSInteger index) {
|
|
|
+// if (index == 1) {
|
|
|
+// KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];
|
|
|
+// [vc showWindow:nil];
|
|
|
+// } else if (index == 2) {
|
|
|
+// KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentFirstTrialWC:@"com.brother.pdfreaderpro.mac.product_3"];
|
|
|
+// [embeddedWC showWindow:nil];
|
|
|
+// [[embeddedWC window] center];
|
|
|
+// }
|
|
|
+// };
|
|
|
+// self.testVC.mouseEventCall = ^(BOOL mouseEnter) {
|
|
|
+// if (mouseEnter) {
|
|
|
+// self.stopPopOverHide = YES;
|
|
|
+// if (ActivityStatusTrialExpire == [VerificationManager manager].status ||
|
|
|
+// ActivityStatusTrial == [VerificationManager manager].status) {
|
|
|
+// if (!self.popover.isShown) {
|
|
|
+// [self buttonAction:self.button];
|
|
|
+// }
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// self.stopPopOverHide = NO;
|
|
|
+// if (self.popover) {
|
|
|
+// [self.popover close];
|
|
|
+// }
|
|
|
+// [self.testVC removeTrackingAreaInfo];
|
|
|
// }
|
|
|
+// };
|
|
|
+// NSPopover *popover = [[NSPopover alloc] init];
|
|
|
+// popover.delegate = self;
|
|
|
+// popover.contentViewController = self.testVC;
|
|
|
+// popover.animates = YES;
|
|
|
+// popover.behavior = NSPopoverBehaviorTransient;
|
|
|
+// [popover showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSMinYEdge];
|
|
|
+// self.popover = popover;
|
|
|
+// } else if (ActivityStatusVerifExpire == [VerificationManager manager].status) {
|
|
|
+// KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivateExpired];
|
|
|
+// [vc showWindow:nil];
|
|
|
+// } else if (ActivityStatusVerification == [VerificationManager manager].status) {
|
|
|
+// if ([VerificationManager manager].needUpgradeLicense) {
|
|
|
+// KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentFirstTrialWC:@"com.brother.pdfreaderpro.mac.product_2"];
|
|
|
+// [embeddedWC showWindow:nil];
|
|
|
+// [[embeddedWC window] center];
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// if ([VerificationManager manager].needUpgradeLicense) {
|
|
|
+// KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentFirstTrialWC:@"com.brother.pdfreaderpro.mac.product_2"];
|
|
|
+// [embeddedWC showWindow:nil];
|
|
|
+// [[embeddedWC window] center];
|
|
|
// } else {
|
|
|
- [[NSNotificationCenter defaultCenter] postNotificationName:@"KMVerificationMessagePopShowNoti" object:nil];
|
|
|
-
|
|
|
- if (!self.testVC) {
|
|
|
- self.testVC = [[KMUnlockAlertViewController alloc] init];
|
|
|
- }
|
|
|
- [self.testVC addtrackingAreaInfo];
|
|
|
- self.testVC.callback = ^(NSInteger index) {
|
|
|
- if (index == 1) {
|
|
|
- KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];
|
|
|
- [vc showWindow:nil];
|
|
|
- } else if (index == 2) {
|
|
|
-// NSURL *url = [NSURL URLWithString:Swift_oc_Tool.Store_Link_OC];
|
|
|
-// [[NSWorkspace sharedWorkspace] openURL:url];
|
|
|
-// [[FMTrackEventManager defaultManager] trackEventWithEvent:@"PUW" withProperties:@{@"PUW_Btn":@"Btn_PUW_BuyNow-Expire"}];
|
|
|
- KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentFirstTrialWC:@"com.brother.pdfreaderpro.mac.product_3"];
|
|
|
- [embeddedWC showWindow:nil];
|
|
|
- [[embeddedWC window] center];
|
|
|
- }
|
|
|
- };
|
|
|
- self.testVC.mouseEventCall = ^(BOOL mouseEnter) {
|
|
|
- if (mouseEnter) {
|
|
|
- self.stopPopOverHide = YES;
|
|
|
- if (ActivityStatusTrialExpire == [VerificationManager manager].status ||
|
|
|
- ActivityStatusTrial == [VerificationManager manager].status) {
|
|
|
- if (!self.popover.isShown) {
|
|
|
- [self buttonAction:self.button];
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- self.stopPopOverHide = NO;
|
|
|
- if (self.popover) {
|
|
|
- [self.popover close];
|
|
|
- }
|
|
|
- [self.testVC removeTrackingAreaInfo];
|
|
|
- }
|
|
|
- };
|
|
|
- NSPopover *popover = [[NSPopover alloc] init];
|
|
|
- popover.delegate = self;
|
|
|
- popover.contentViewController = self.testVC;
|
|
|
- popover.animates = YES;
|
|
|
- popover.behavior = NSPopoverBehaviorTransient;
|
|
|
- [popover showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSMinYEdge];
|
|
|
- self.popover = popover;
|
|
|
+// KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeNormal];
|
|
|
+// [vc showWindow:nil];
|
|
|
// }
|
|
|
- } else if (ActivityStatusVerifExpire == [VerificationManager manager].status) {
|
|
|
- KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivateExpired];
|
|
|
- [vc showWindow:nil];
|
|
|
- } else if (ActivityStatusVerification == [VerificationManager manager].status) {
|
|
|
- if ([VerificationManager manager].needUpgradeLicense) {
|
|
|
-// NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@?product_code=product_2", Swift_oc_Tool.Store_Link_OC]];
|
|
|
-// [[NSWorkspace sharedWorkspace] openURL:url];
|
|
|
-// [[FMTrackEventManager defaultManager] trackEventWithEvent:@"Tbr" withProperties:@{@"Tbr_Btn":@"Btn_Tbr_PDFtoOffice"}];
|
|
|
- KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentFirstTrialWC:@"com.brother.pdfreaderpro.mac.product_2"];
|
|
|
- [embeddedWC showWindow:nil];
|
|
|
- [[embeddedWC window] center];
|
|
|
- }
|
|
|
- } else {
|
|
|
- if ([VerificationManager manager].needUpgradeLicense) {
|
|
|
-// NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@?product_code=product_2", Swift_oc_Tool.Store_Link_OC]];
|
|
|
-// [[NSWorkspace sharedWorkspace] openURL:url];
|
|
|
-// [[FMTrackEventManager defaultManager] trackEventWithEvent:@"Tbr" withProperties:@{@"Tbr_Btn":@"Btn_Tbr_PDFtoOffice"}];
|
|
|
- KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentFirstTrialWC:@"com.brother.pdfreaderpro.mac.product_2"];
|
|
|
- [embeddedWC showWindow:nil];
|
|
|
- [[embeddedWC window] center];
|
|
|
+// }
|
|
|
+//#else
|
|
|
+// isFree = YES;
|
|
|
+//#if VERSION_FREE
|
|
|
+// if ([IAPProductsManager defaultManager].isAvailableAllFunction) {
|
|
|
+// isFree = NO;
|
|
|
+// }
|
|
|
+// if (isFree) {
|
|
|
+// [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
|
|
|
+// }
|
|
|
+//#else
|
|
|
+// if (![IAPProductsManager defaultManager].isAvailableAdvancedPDFToOffice) {
|
|
|
+// KMToolCompareWindowController *vc = [KMToolCompareWindowController toolCompareWithToolType:KMCompareWithToolTypeConvert selectNum:0];
|
|
|
+// [vc.window center];
|
|
|
+// [vc showWindow:nil];
|
|
|
+// }
|
|
|
+//#endif
|
|
|
+//
|
|
|
+//#endif
|
|
|
+
|
|
|
+ if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type1 ||
|
|
|
+ [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type2 ||
|
|
|
+ [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type3 ||
|
|
|
+ [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type4) {
|
|
|
+ if ([KMMemberInfo shared].isLogin) {
|
|
|
+ [[KMProductCompareWC shared] setOrientation:YES];
|
|
|
+ [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeLite_Base];
|
|
|
+ [[KMProductCompareWC shared] showWindow:nil];
|
|
|
} else {
|
|
|
- KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeNormal];
|
|
|
- [vc showWindow:nil];
|
|
|
+ [KMLoginWindowsController.shared openWindow:^(BOOL success) {
|
|
|
+ if (success) {
|
|
|
+ [[KMProductCompareWC shared] setOrientation:YES];
|
|
|
+ [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeLite_Base];
|
|
|
+ [[KMProductCompareWC shared] showWindow:nil];
|
|
|
+ }
|
|
|
+ }];
|
|
|
}
|
|
|
+ } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type5) {
|
|
|
+ [[KMProductCompareWC shared] setOrientation:NO];
|
|
|
+ [[KMProductCompareWC shared] showWindow:nil];
|
|
|
+ } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type6 ||
|
|
|
+ [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type10 ||
|
|
|
+ [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type11) {
|
|
|
+ [[KMProductCompareWC shared] setOrientation:YES];
|
|
|
+ [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeLite_Base];
|
|
|
+ [[KMProductCompareWC shared] showWindow:nil];
|
|
|
+ } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type7) {
|
|
|
+ [[KMProductCompareWC shared] setOrientation:YES];
|
|
|
+ [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeLite_MacWindows];
|
|
|
+ [[KMProductCompareWC shared] showWindow:nil];
|
|
|
}
|
|
|
-#else
|
|
|
- isFree = YES;
|
|
|
-#if VERSION_FREE
|
|
|
- if ([IAPProductsManager defaultManager].isAvailableAllFunction) {
|
|
|
- isFree = NO;
|
|
|
- }
|
|
|
- if (isFree) {
|
|
|
- [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
|
|
|
- }
|
|
|
-#else
|
|
|
- if (![IAPProductsManager defaultManager].isAvailableAdvancedPDFToOffice) {
|
|
|
-// KMToolCompareWindowController *vc = [KMToolCompareWindowController toolCompareWithType:KMCompareWithToolType_Convert setSelectIndex:0];
|
|
|
- KMToolCompareWindowController *vc = [KMToolCompareWindowController toolCompareWithToolType:KMCompareWithToolTypeConvert selectNum:0];
|
|
|
- [vc.window center];
|
|
|
- [vc showWindow:nil];
|
|
|
- }
|
|
|
-#endif
|
|
|
-
|
|
|
-#endif
|
|
|
-
|
|
|
}
|
|
|
|
|
|
- (NSAttributedString *)numberConvertColor:(NSColor*)color String:(NSString *)string {
|
|
@@ -571,8 +717,6 @@ NSPopoverDelegate>
|
|
|
AIUserInfoController *controller = [[AIUserInfoController alloc] init];
|
|
|
controller.purchaseHandle = ^(AIUserInfoController * _Nonnull vc) {
|
|
|
#if VERSION_DMG
|
|
|
-// NSURL *url = [NSURL URLWithString:Swift_oc_Tool.AIProduct_Link_OC];
|
|
|
-// [[NSWorkspace sharedWorkspace] openURL:url];
|
|
|
KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentFirstTrialWC:@"com.brother.pdfreaderpro.ai.product_1"];
|
|
|
[embeddedWC showWindow:nil];
|
|
|
[[embeddedWC window] center];
|
|
@@ -628,6 +772,10 @@ NSPopoverDelegate>
|
|
|
[self.userMenu popUpMenuPositioningItem:nil atLocation:NSMakePoint(-130, 30) inView:sender];
|
|
|
}
|
|
|
|
|
|
+- (IBAction)signUpAction:(NSButton *)sender {
|
|
|
+ [KMLoginWindowsController.shared showWindow:nil];
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark - NSNotification Methods
|
|
|
- (void)deviceActivateStatusChangeNotification:(NSNotification *)notification {
|
|
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.4 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
@@ -684,10 +832,12 @@ NSPopoverDelegate>
|
|
|
|
|
|
- (void)loginSuccessNotification:(NSNotification *)noti {
|
|
|
_userButton.image = [NSImage imageNamed:@"UserProfilePicture"];
|
|
|
+ [self reloadData];
|
|
|
}
|
|
|
|
|
|
- (void)logoutSuccessNotification:(NSNotification *)noti {
|
|
|
_userButton.image = [NSImage imageNamed:@"UserProfilePicture1"];
|
|
|
+ [self reloadData];
|
|
|
}
|
|
|
|
|
|
- (void)expandPersonalCenterNotification:(NSNotification *)noti {
|