// // KMVerificationExpiredViewController.m // PDF Reader Pro Edition // // Created by 王帅 on 2018/5/11. // #import "KMVerificationExpiredViewController.h" #import #import "NSObject+DeviceInfo.h" #import "VerificationManager.h" @interface KMVerificationExpiredViewController () @property (nonatomic,assign) IBOutlet NSTextField *label; @property (nonatomic,assign) IBOutlet NSTextField *sublabel; @property (nonatomic,assign) IBOutlet NSTextField *licenseLabel; @property (nonatomic,assign) IBOutlet NSTextField *license; @property (nonatomic,assign) IBOutlet NSTextField *deviceLabel; @property (nonatomic,assign) IBOutlet NSTextField *device; @property (nonatomic,assign) IBOutlet KMCustomButton *licenseButton; @property (nonatomic,assign) IBOutlet KMCustomButton *contactUsButton; @property (nonatomic, retain) CALayer *contactUsButtonLayer; @end @implementation KMVerificationExpiredViewController #pragma mark Init Methods - (instancetype)init { if (self = [super initWithNibName:@"KMVerificationExpiredViewController" bundle:nil]) { } return self; } - (void)dealloc { } #pragma mark View Methods - (void)loadView { [super loadView]; // Do view setup here. self.licenseButton.wantsLayer = YES; self.licenseButton.layer.masksToBounds = YES; self.licenseButton.layer.cornerRadius = 1.0; // self.licenseButton.layer.backgroundColor = [NSColor colorWithRed:218/255.0 green:219/255.0 blue:222/255.0 alpha:1.0].CGColor; self.contactUsButton.wantsLayer = YES; self.contactUsButton.layer.masksToBounds = YES; self.contactUsButton.layer.cornerRadius = 1.0; // self.contactUsButton.layer.backgroundColor = [KMAppearance KMColor_Interactive_M0].CGColor; self.label.stringValue = NSLocalizedString(@"Activation Error", nil); self.sublabel.stringValue = NSLocalizedString(@"Your license was deactivated. Please contact our support team if you are not sure why this happened.", nil); self.licenseLabel.stringValue = NSLocalizedString(@"License ID:", nil); self.deviceLabel.stringValue = NSLocalizedString(@"UUID:", nil); self.licenseButton.title = NSLocalizedString(@"Enter License Number", nil); self.contactUsButton.title = NSLocalizedString(@"Contact Us", nil); [self.licenseButton setTitleColor:[KMAppearance KMColor_Layout_H0]]; [self.contactUsButton setTitleColor:[NSColor whiteColor]]; NSString *cdkey = [VerificationManager manager].detailInfo[@"device"][@"cdkey"]; NSString *unique_sn = [VerificationManager manager].detailInfo[@"device"][@"uniqueSn"]; self.license.stringValue = cdkey ? : @""; self.device.stringValue = unique_sn ?:GetHardwareUUID()?:@""; self.contactUsButtonLayer = [CALayer layer]; [self.contactUsButton.layer addSublayer:self.contactUsButtonLayer]; self.contactUsButtonLayer.frame = CGRectMake(0, 0, CGRectGetWidth(_contactUsButton.bounds), CGRectGetHeight(_contactUsButton.bounds)); self.contactUsButtonLayer.backgroundColor = [KMAppearance KMColor_Status_Sel].CGColor; self.contactUsButtonLayer.cornerRadius = 0; self.contactUsButtonLayer.hidden = YES; __block KMVerificationExpiredViewController *blockSelf = self; self.contactUsButton.mouseMoveCallback = ^(BOOL mouseEntered) { if (mouseEntered) blockSelf.contactUsButtonLayer.hidden = NO; else blockSelf.contactUsButtonLayer.hidden = YES; }; self.licenseButton.mouseMoveCallback = nil; [self.label setTextColor:[KMAppearance KMColor_Layout_H0]]; [self.sublabel setTextColor:[KMAppearance KM_242424_Color75]]; [self.licenseLabel setTextColor:[KMAppearance KM_242424_Color75]]; [self.deviceLabel setTextColor:[KMAppearance KM_242424_Color75]]; [self.license setTextColor:[KMAppearance KM_242424_Color75]]; [self.device setTextColor:[KMAppearance KM_242424_Color75]]; } #pragma mark Button Actions - (IBAction)licenseButtonAction:(id)sender { if (self.callback) { self.callback(0); } } - (IBAction)contactUsButtonAction:(id)sender { if (self.callback) { self.callback(1); } } @end