KMVerificationExpiredViewController.m 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. //
  2. // KMVerificationExpiredViewController.m
  3. // PDF Reader Pro Edition
  4. //
  5. // Created by 王帅 on 2018/5/11.
  6. //
  7. #import "KMVerificationExpiredViewController.h"
  8. #import "PDF_Master-Bridging-Header.h"
  9. #if VERSION_DMG
  10. #import <PDF_Master-Swift.h>
  11. #else
  12. #import <PDF_Master-Swift.h>
  13. #endif
  14. //#import "VerificationManager.h"
  15. @interface KMVerificationExpiredViewController ()
  16. @property (nonatomic,assign) IBOutlet NSTextField *label;
  17. @property (nonatomic,assign) IBOutlet NSTextField *sublabel;
  18. @property (nonatomic,assign) IBOutlet NSTextField *licenseLabel;
  19. @property (nonatomic,assign) IBOutlet NSTextField *license;
  20. @property (nonatomic,assign) IBOutlet NSTextField *deviceLabel;
  21. @property (nonatomic,assign) IBOutlet NSTextField *device;
  22. @property (nonatomic,assign) IBOutlet KMCustomButton *licenseButton;
  23. @property (nonatomic,assign) IBOutlet KMCustomButton *contactUsButton;
  24. @property (nonatomic, retain) CALayer *contactUsButtonLayer;
  25. @end
  26. @implementation KMVerificationExpiredViewController
  27. #pragma mark Init Methods
  28. - (instancetype)init {
  29. if (self = [super initWithNibName:@"KMVerificationExpiredViewController" bundle:nil]) {
  30. }
  31. return self;
  32. }
  33. - (void)dealloc {
  34. }
  35. #pragma mark View Methods
  36. - (void)loadView {
  37. [super loadView];
  38. // Do view setup here.
  39. self.licenseButton.wantsLayer = YES;
  40. self.licenseButton.layer.masksToBounds = YES;
  41. self.licenseButton.layer.cornerRadius = 1.0;
  42. // self.licenseButton.layer.backgroundColor = [NSColor colorWithRed:218/255.0 green:219/255.0 blue:222/255.0 alpha:1.0].CGColor;
  43. self.contactUsButton.wantsLayer = YES;
  44. self.contactUsButton.layer.masksToBounds = YES;
  45. self.contactUsButton.layer.cornerRadius = 1.0;
  46. // self.contactUsButton.layer.backgroundColor = [KMAppearance KMColor_Interactive_M0].CGColor;
  47. self.label.stringValue = NSLocalizedString(@"Activation Error", nil);
  48. self.sublabel.stringValue = NSLocalizedString(@"Your license was deactivated. Please contact our support team if you are not sure why this happened.", nil);
  49. self.licenseLabel.stringValue = NSLocalizedString(@"License ID:", nil);
  50. self.deviceLabel.stringValue = NSLocalizedString(@"UUID:", nil);
  51. self.licenseButton.title = NSLocalizedString(@"Enter License Number", nil);
  52. self.contactUsButton.title = NSLocalizedString(@"Contact Us", nil);
  53. [self.licenseButton setTitleColor:[KMAppearance KMColor_Layout_H0]];
  54. [self.contactUsButton setTitleColor:[NSColor whiteColor]];
  55. // NSString *cdkey = [VerificationManager manager].detailInfo[@"device"][@"cdkey"];
  56. // NSString *unique_sn = [VerificationManager manager].detailInfo[@"device"][@"unique_sn"];
  57. // self.license.stringValue = cdkey ? : @"";
  58. // self.device.stringValue = unique_sn ? : @"";
  59. self.contactUsButtonLayer = [CALayer layer];
  60. [self.contactUsButton.layer addSublayer:self.contactUsButtonLayer];
  61. self.contactUsButtonLayer.frame = CGRectMake(0, 0, CGRectGetWidth(_contactUsButton.bounds), CGRectGetHeight(_contactUsButton.bounds));
  62. self.contactUsButtonLayer.backgroundColor = [KMAppearance KMColor_Status_Sel].CGColor;
  63. self.contactUsButtonLayer.cornerRadius = 0;
  64. self.contactUsButtonLayer.hidden = YES;
  65. __block KMVerificationExpiredViewController *blockSelf = self;
  66. self.contactUsButton.mouseMoveCallback = ^(BOOL mouseEntered) {
  67. if (mouseEntered)
  68. blockSelf.contactUsButtonLayer.hidden = NO;
  69. else
  70. blockSelf.contactUsButtonLayer.hidden = YES;
  71. };
  72. self.licenseButton.mouseMoveCallback = nil;
  73. [self.label setTextColor:[KMAppearance KMColor_Layout_H0]];
  74. [self.sublabel setTextColor:[KMAppearance KM_242424_Color75]];
  75. [self.licenseLabel setTextColor:[KMAppearance KM_242424_Color75]];
  76. [self.deviceLabel setTextColor:[KMAppearance KM_242424_Color75]];
  77. [self.license setTextColor:[KMAppearance KM_242424_Color75]];
  78. [self.device setTextColor:[KMAppearance KM_242424_Color75]];
  79. }
  80. #pragma mark Button Actions
  81. - (IBAction)licenseButtonAction:(id)sender {
  82. if (self.callback) {
  83. self.callback(0);
  84. }
  85. }
  86. - (IBAction)contactUsButtonAction:(id)sender {
  87. if (self.callback) {
  88. self.callback(1);
  89. }
  90. }
  91. @end