Browse Source

Merge branch 'develop_PDFReaderProV4.6.0' of git.kdan.cc:Mac_PDF/PDF_Office into develop_PDFReaderProV4.6.0

tangchao 6 months ago
parent
commit
052f6ce143

+ 2 - 1
PDF Office/PDF Master/AppDelegate.swift

@@ -718,8 +718,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, iRateDelegate{
 //        if tWorkSpace.open(url!) == false {
 //            tWorkSpace.open(url!)
 //        }
-        let embeddedWC = KMPurchaseEmbeddedWindowController(windowNibName: "com.brother.pdfreaderpro.mac.product_2")
+        let embeddedWC = KMPurchaseEmbeddedWindowController.currentFirstTrialWC("com.brother.pdfreaderpro.mac.product_2")
         embeddedWC.showWindow(nil)
+        embeddedWC.window?.center()
 #endif
     }
     

+ 3 - 2
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIHeaderView/AIHeaderView.swift

@@ -62,8 +62,9 @@ class AIHeaderView: NSView, NibLoadable {
 #if VERSION_DMG
 //            let url = URL(string: AIProduct_Link)
 //            NSWorkspace.shared.open(url!)
-            let embeddedWC = KMPurchaseEmbeddedWindowController(windowNibName: "com.brother.pdfreaderpro.ai.product_1")
-            embeddedWC.showWindow(nil)
+            let embeddedWC = KMPurchaseEmbeddedWindowController.currentFirstTrialWC("com.brother.pdfreaderpro.ai.product_1")
+            embeddedWC.showWindow(self)
+            embeddedWC.window?.center()
 #else
             AIPurchaseWindowController.currentWC().showWindow(nil)
 #endif

+ 7 - 3
PDF Office/PDF Master/Class/GuideInfo/KMFunctionGuideWindowController.swift

@@ -96,11 +96,15 @@ class KMFunctionGuideWindowController: NSWindowController {
                     if controller.currentNameKEY == controller.AIInfoKey {
 //                        var url = URL(string: AIProduct_Link)!
 //                        NSWorkspace.shared.open(url)
-                        let embeddedWC = KMPurchaseEmbeddedWindowController(windowNibName: "com.brother.pdfreaderpro.ai.product_1")
+                        let embeddedWC = KMPurchaseEmbeddedWindowController.currentFirstTrialWC("com.brother.pdfreaderpro.ai.product_1")
                         embeddedWC.showWindow(nil)
+                        embeddedWC.window?.center()
                     } else if controller.currentNameKEY == controller.MeasureInfoKey {
-                        var url = URL(string: Store_Link)!
-                        NSWorkspace.shared.open(url)
+//                        var url = URL(string: Store_Link)!
+//                        NSWorkspace.shared.open(url)
+                        let embeddedWC = KMPurchaseEmbeddedWindowController.currentFirstTrialWC("com.brother.pdfreaderpro.mac.product_1")
+                        embeddedWC.showWindow(nil)
+                        embeddedWC.window?.center()
                     } else {
                         KMPrint("请配置Key...")
                     }

+ 4 - 2
PDF Office/PDF Master/Class/PDFTools/Convert/NewController/KMToolCompareWindowController.swift

@@ -239,8 +239,9 @@ var currentWindowController: KMToolCompareWindowController? = nil
 #if VERSION_DMG
 //        var url = URL(string: Store_Link + "?utm_source=MacAppDmg&utm_campaign=StoreLink&utm_medium=PdfStore")
 //        NSWorkspace.shared.open(url!)
-        let embeddedWC = KMPurchaseEmbeddedWindowController(windowNibName: "com.brother.pdfreaderpro.mac.product_1")
+        let embeddedWC = KMPurchaseEmbeddedWindowController.currentFirstTrialWC("com.brother.pdfreaderpro.mac.product_1")
         embeddedWC.showWindow(nil)
+        embeddedWC.window?.center()
 #endif
     }
     
@@ -249,8 +250,9 @@ var currentWindowController: KMToolCompareWindowController? = nil
 //        var url = URL(string: Store_Link + "?product_code=product_2&utm_source=MacAppDmg&utm_campaign=OfficeStoreLink&utm_medium=PdfOfficeStore")
 //        NSWorkspace.shared.open(url!)
 //        FMTrackEventManager.defaultManager.trackOnceEvent(event: "PUW", withProperties: ["PUW_Btn":"Btn_PUW_PDFtoOffice_Buy"])
-        let embeddedWC = KMPurchaseEmbeddedWindowController(windowNibName: "com.brother.pdfreaderpro.mac.product_2")
+        let embeddedWC = KMPurchaseEmbeddedWindowController.currentFirstTrialWC("com.brother.pdfreaderpro.mac.product_2")
         embeddedWC.showWindow(nil)
+        embeddedWC.window?.center()
 #endif
     }
     

+ 30 - 27
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseCompareDMGWindowController.m

@@ -238,7 +238,6 @@ static NSString *const KMPurchaseCompareDMGCellIdentifier       = @"KMPurchaseCo
     self.discountPriceLabel.font = [NSFont fontWithName:@"Ubuntu" size:36.0];
     self.originalPriceLabel.textColor = [NSColor colorWithRed:255.0/255.0 green:94.0/255.0 blue:44.0/255.0 alpha:1.0];
     self.originalPriceLabel.font = [NSFont fontWithName:@"Ubuntu" size:14.0];
-    [self updatePriceLabel];
 
     self.freeVersionLbl.stringValue = NSLocalizedString(@"Free Version", nil);
     self.parmanentVerLbl.stringValue = NSLocalizedString(@"Permanent License", nil);
@@ -350,6 +349,7 @@ static NSString *const KMPurchaseCompareDMGCellIdentifier       = @"KMPurchaseCo
         }
     };
     self.discountTipImage.hidden = YES;
+    [self updatePriceLabel];
     
     self.aiSepLineView.wantsLayer = YES;
     self.aiInfoLbl1.font = self.aiInfoLbl2.font = self.aiInfoLbl3.font = self.aiInfoLbl4.font = [NSFont SFProTextRegularFont:14];
@@ -490,19 +490,7 @@ static NSString *const KMPurchaseCompareDMGCellIdentifier       = @"KMPurchaseCo
     }
     [self.buyNowButton setTitleColor:[NSColor whiteColor]];
     
-    if (KMAdvertisementManager.manager.info.discountContent.content.count > 0) {
-        KMAdvertisementItemInfo *info = KMAdvertisementManager.manager.info.discountContent.content.firstObject;
-        if ([KMAdvertisementManager checkAdvertisementValid:info]) {
-            self.discountTipImage.hidden = NO;
-            
-            NSURL *url = [NSURL URLWithString:[KMAdvertisementModelTransition transitionImagePathWithImage:info.image highlight:NO]];
-            self.discountTipImage.image = [KMAdvertisementImage imageWithURLWithUrl:url completion:^(NSImage * _Nonnull image) {
-                self.discountTipImage.image = image;
-            }];
-        } else {
-            self.discountTipImage.hidden = YES;
-        }
-    }
+    [self updatePriceLabel];
 }
 
 - (void)updatePriceLabel {
@@ -532,10 +520,30 @@ static NSString *const KMPurchaseCompareDMGCellIdentifier       = @"KMPurchaseCo
     self.originalPriceLabel.attributedStringValue = attributedText;
     self.discountPriceLabel.stringValue = discountText;
     
-    if ([originalText isEqualToString:discountText]) {
-        [self.originalPriceLabel setHidden:YES];
-    } else {
-        [self.originalPriceLabel setHidden:NO];
+    if (KMAdvertisementManager.manager.info.discountContent.content.count > 0) {
+        KMAdvertisementItemInfo *info = KMAdvertisementManager.manager.info.discountContent.content.firstObject;
+        if ([KMAdvertisementManager checkAdvertisementValid:info]) {
+            self.discountTipImage.hidden = NO;
+            
+            NSURL *url = [NSURL URLWithString:[KMAdvertisementModelTransition transitionImagePathWithImage:info.image highlight:NO]];
+            self.discountTipImage.image = [KMAdvertisementImage imageWithURLWithUrl:url completion:^(NSImage * _Nonnull image) {
+                self.discountTipImage.image = image;
+            }];
+            if ([originalText isEqualToString:discountText]) {
+                [self.originalPriceLabel setHidden:YES];
+                [self.discountTipImage setHidden:YES];
+            } else {
+                [self.originalPriceLabel setHidden:NO];
+                [self.discountTipImage setHidden:NO];
+            }
+        } else {
+            self.discountTipImage.hidden = YES;
+            if ([originalText isEqualToString:discountText]) {
+                [self.originalPriceLabel setHidden:YES];
+            } else {
+                [self.originalPriceLabel setHidden:NO];
+            }
+        }
     }
 }
 
@@ -662,6 +670,7 @@ static NSString *const KMPurchaseCompareDMGCellIdentifier       = @"KMPurchaseCo
 //            
 //    }];
     [embeddedWC showWindow:nil];
+    [[embeddedWC window] center];
 #endif
 }
 
@@ -719,8 +728,10 @@ static NSString *const KMPurchaseCompareDMGCellIdentifier       = @"KMPurchaseCo
 //    [[NSWorkspace sharedWorkspace] openURL:url];
 //    
 //    [[FMTrackEventManager defaultManager] trackEventWithEvent:@"PUW" withProperties:@{@"PUW_Btn":@"PUW_Btn_BuyAITools"}];
+    [self close];
     KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentFirstTrialWC:@"com.brother.pdfreaderpro.ai.product_1"];
     [embeddedWC showWindow:nil];
+    [[embeddedWC window] center];
 }
 
 - (IBAction)buySwitchAction:(NSSwitch *)sender {
@@ -736,15 +747,7 @@ static NSString *const KMPurchaseCompareDMGCellIdentifier       = @"KMPurchaseCo
 
 - (void)recommondInfoUpdateNoti:(NSNotification *)noti {
     dispatch_async(dispatch_get_main_queue(), ^{
-        if (KMAdvertisementManager.manager.info.discountContent.content.count > 0) {
-            KMAdvertisementItemInfo *info = KMAdvertisementManager.manager.info.discountContent.content.firstObject;
-            if ([KMAdvertisementManager checkAdvertisementValid:info]) {
-                self.discountTipImage.hidden = NO;
-                self.discountTipImage.image = info.image;
-            } else {
-                self.discountTipImage.hidden = YES;
-            }
-        }
+        [self updatePriceLabel];
     });
 }
 

+ 2 - 2
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseCompareDMGWindowController.xib

@@ -607,7 +607,7 @@
                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="axesIndependently" image="dmg_upgrade_part_bg" id="gA1-8q-pda"/>
                                     </imageView>
-                                    <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="40K-mz-4Ku">
+                                    <imageView hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="40K-mz-4Ku">
                                         <rect key="frame" x="221" y="478" width="71" height="24"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="24" id="DGI-EH-CtC"/>
@@ -919,7 +919,7 @@
                                         </constraints>
                                         <color key="fillColor" red="1" green="0.36862745098039218" blue="0.17254901960784313" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                     </box>
-                                    <switch horizontalHuggingPriority="750" verticalHuggingPriority="750" baseWritingDirection="leftToRight" alignment="left" translatesAutoresizingMaskIntoConstraints="NO" id="tbA-Jh-3g0">
+                                    <switch horizontalHuggingPriority="750" verticalHuggingPriority="750" baseWritingDirection="leftToRight" alignment="left" state="on" translatesAutoresizingMaskIntoConstraints="NO" id="tbA-Jh-3g0">
                                         <rect key="frame" x="128" y="468" width="44" height="23"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="40" id="Pmx-W4-KxA"/>

+ 60 - 49
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseEmbeddedWindowController.swift

@@ -59,10 +59,12 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
     @IBOutlet weak var applyButton: NSButton!
     @IBOutlet weak var lastPriceLabel: NSTextField!
     @IBOutlet weak var lastPriceLabel1: NSTextField!
+    @IBOutlet weak var discountView: NSView!
     @IBOutlet weak var discountLabel: NSTextField!
     @IBOutlet weak var discountLabel1: NSTextField!
     @IBOutlet weak var paySumLabel: NSTextField!
     @IBOutlet weak var paySumLabel1: NSTextField!
+    @IBOutlet weak var discountLayoutConstraint: NSLayoutConstraint!
     
     @IBOutlet weak var privacyLabel: NSTextField!
     
@@ -255,7 +257,7 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                 oneLicenseLabel.stringValue = NSLocalizedString("Manually renew at USD 14.99", comment: "")
             }
         } else {
-            pdfReaderProLabel.stringValue = NSLocalizedString("PDF Reader Pro for Mac", comment: "")
+            pdfReaderProLabel.stringValue = NSLocalizedString("I have a coupon ?", comment: "")
             prmiumLabel.stringValue = NSLocalizedString("Premium and PDF to Office Converter", comment: "")
             oneLicenseLabel.stringValue = NSLocalizedString("One License for One Mac. One Time Purchase.", comment: "")
             
@@ -319,22 +321,33 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
         paySumLabel1.textColor = NSColor(named: "KMPurchaseCouponColor")
         paySumLabel1.font = NSFont.SFProTextBoldFont(24.0)
         
+        privacyLabel.isEditable = false
+        privacyLabel.isSelectable = true
+        privacyLabel.allowsEditingTextAttributes = true
         privacyLabel.textColor = NSColor.black
+        privacyLabel.font = NSFont.SFProTextRegularFont(16.0)
         let tipsString = NSLocalizedString("Are you a student or a professor? %@ / Want a volume purchase? Please %@.", comment: "")
         let specialOffer = NSLocalizedString("Get Special Offer", comment: "")
         let contactsUs = NSLocalizedString("Contact Us", comment: "")
         let fullString = String(format: tipsString, specialOffer, contactsUs)
         let attributedString = NSMutableAttributedString(string: fullString)
+        // 定义链接的范围
         let specialOfferRange = (fullString as NSString).range(of: specialOffer)
         let contactsUsRange = (fullString as NSString).range(of: contactsUs)
-        attributedString.addAttribute(.foregroundColor, value: NSColor(red: 73/255.0, green: 130/255.0, blue: 230/255.0, alpha: 1.0), range: specialOfferRange)
-        attributedString.addAttribute(.link, value: "GetSpecialOffer://", range: specialOfferRange)
-        attributedString.addAttribute(.foregroundColor, value: NSColor(red: 73/255.0, green: 130/255.0, blue: 230/255.0, alpha: 1.0), range: contactsUsRange)
-        attributedString.addAttribute(.link, value: "www.baidu.com", range: contactsUsRange)
-//        attributedString.addAttributes([.link : "www.baidu.com"], range: contactsUsRange)
+        let linkColor = NSColor(red: 73/255.0, green: 130/255.0, blue: 230/255.0, alpha: 1.0)
+        let font = NSFont.SFProTextRegularFont(16.0) // 与普通文本相同的字体
+        attributedString.addAttributes([
+            .foregroundColor: linkColor,
+            .link: NSLocalizedString("https://www.pdfreaderpro.com/store?mode=edu", comment: ""),
+            .font: font
+        ], range: specialOfferRange)
+        attributedString.addAttributes([
+            .foregroundColor: linkColor,
+            .link: NSLocalizedString("https://www.pdfreaderpro.com/vpp-purchase-program", comment: ""),
+            .font: font
+        ], range: contactsUsRange)
+        attributedString.addAttribute(.font, value: font, range: (fullString as NSString).range(of: fullString))
         privacyLabel.attributedStringValue = attributedString
-        privacyLabel.font = NSFont.SFProTextRegularFont(16.0)
-        privacyLabel.delegate = self
 
         billInformationLabel.stringValue = NSLocalizedString("Bill Information", comment: "")
         billInformationLabel.textColor = NSColor(named: "KMPurchaseTitleColor1")
@@ -356,23 +369,33 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
         paymentMethodLabel.textColor = NSColor(named: "KMPurchaseTitleColor1")
         paymentMethodLabel.font = NSFont.SFProTextRegularFont(14.0)
         wechatPayButton2.isHidden = true
-
+        
+        payExplainLabel.isEditable = false
+        payExplainLabel.isSelectable = true
+        payExplainLabel.allowsEditingTextAttributes = true
         payExplainLabel.textColor = NSColor.black
+        payExplainLabel.font = NSFont.SFProTextRegularFont(11.0)
         let localizedString = NSLocalizedString("By submitting this order, I agree to the %@ and %@ for subscription products", comment: "")
         let privacyPolicy = NSLocalizedString("Privacy Policy", comment: "")
         let termsOfService = NSLocalizedString("Terms of Service", comment: "")
         let fullString1 = String(format: localizedString, privacyPolicy, termsOfService)
         let attributedString1 = NSMutableAttributedString(string: fullString1)
-        let privacyPolicyRange = (fullString as NSString).range(of: privacyPolicy)
-        let termsOfServiceRange = (fullString as NSString).range(of: termsOfService)
-        attributedString1.addAttribute(.foregroundColor, value: NSColor(red: 73/255.0, green: 130/255.0, blue: 230/255.0, alpha: 1.0), range: privacyPolicyRange)
-        attributedString1.addAttribute(.link, value: "PrivacyPolicy://", range: privacyPolicyRange)
-        attributedString1.addAttribute(.foregroundColor, value: NSColor(red: 73/255.0, green: 130/255.0, blue: 230/255.0, alpha: 1.0), range: termsOfServiceRange)
-//        attributedString1.addAttribute(.link, value: "TermsofService://", range: termsOfServiceRange)
-        attributedString1.addAttributes([.link : "www.baidu.com"], range: termsOfServiceRange)
-        payExplainLabel.attributedStringValue = attributedString
-        payExplainLabel.font = NSFont.SFProTextRegularFont(11.0)
-        payExplainLabel.delegate = self
+        let privacyPolicyRange = (fullString1 as NSString).range(of: privacyPolicy)
+        let termsOfServiceRange = (fullString1 as NSString).range(of: termsOfService)
+        let linkColor1 = NSColor(red: 73/255.0, green: 130/255.0, blue: 230/255.0, alpha: 1.0)
+        let font1 = NSFont.SFProTextRegularFont(11.0) // 与普通文本相同的字体
+        attributedString1.addAttributes([
+            .foregroundColor: linkColor1,
+            .link: NSLocalizedString("https://www.pdfreaderpro.com/privacy-policy", comment: ""),
+            .font: font1
+        ], range: privacyPolicyRange)
+        attributedString1.addAttributes([
+            .foregroundColor: linkColor1,
+            .link: NSLocalizedString("https://www.pdfreaderpro.com/terms_of_service", comment: ""),
+            .font: font1
+        ], range: termsOfServiceRange)
+        attributedString1.addAttribute(.font, value: font1, range: (fullString1 as NSString).range(of: fullString1))
+        payExplainLabel.attributedStringValue = attributedString1
         
         paypalBuyNowLabel.stringValue = NSLocalizedString("Buy Now", comment: "")
         paypalBuyNowLabel.textColor = NSColor.white
@@ -651,6 +674,11 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
         lastPriceLabel1.stringValue = String(format: "%@ %@", abbreviation, originalTotalPrice)
         discountLabel1.stringValue = String(format: "%@ %@", abbreviation, discountAmount1)
         paySumLabel1.stringValue = String(format: "%@ %@", abbreviation, discountTotalPrice)
+        
+        if Float(discountAmount1) == 0 {
+            discountView.isHidden = true
+            discountLayoutConstraint.constant = discountView.isHidden ? -CGRectGetHeight(discountView.bounds) : 8
+        }
     }
     
     // MARK: Active
@@ -663,7 +691,9 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                 }
             }
             if sender.tag == 1 {
-                pdfCount += 1
+                if pdfCount < 9999 {
+                    pdfCount += 1
+                }
             }
             if pdfCount > 1 {
                 removeButton1.isEnabled = true
@@ -1424,16 +1454,22 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
 //        }
 //        self.handler = handler
 //    }
-    
-    // MARK: - Notification
-    
+}
+
+extension KMPurchaseEmbeddedWindowController: NSTextFieldDelegate {
     func controlTextDidEndEditing(_ obj: Notification) {
         let textField = obj.object as? NSTextField
         if textField == amountTextField1 {
             if !isNumeric(textField!.stringValue) {
                 if textField == amountTextField1 { textField?.stringValue = String(pdfCount) }
             } else {
-                if textField == amountTextField1 { pdfCount = Int(textField!.stringValue) ?? 1 }
+                if textField == amountTextField1 {
+                    pdfCount = Int(textField!.stringValue) ?? 1
+                    if Int(textField!.stringValue)! > 9999 {
+                        pdfCount = 9999
+                        textField?.stringValue = String(pdfCount)
+                    }
+                }
                 if pdfCount > 100 {
                     wechatPayButton2.isHidden = false
                     cardButton.isHidden = true
@@ -1453,31 +1489,6 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
             
         }
     }
-    
-}
-
-extension KMPurchaseEmbeddedWindowController: NSTextFieldDelegate {
-    func textView(_ textView: NSTextView, clickedOnLink link: Any, at charIndex: Int) -> Bool {
-        if let url = link as? String {
-            switch url {
-            case "GetSpecialOffer://":
-                NSWorkspace.shared.open(URL(string: NSLocalizedString("https://www.pdfreaderpro.com/store?mode=edu", comment: ""))!)
-                break
-            case "ContactUs://":
-                NSWorkspace.shared.open(URL(string: NSLocalizedString("https://www.pdfreaderpro.com/vpp-purchase-program", comment: ""))!)
-                break
-            case "PrivacyPolicy://":
-                NSWorkspace.shared.open(URL(string: "https://www.pdfreaderpro.com/privacy-policy")!)
-                break
-            case "TermsofService://":
-                NSWorkspace.shared.open(URL(string: "https://www.pdfreaderpro.com/terms_of_service")!)
-                break
-            default:
-                break
-            }
-        }
-        return true
-    }
 }
 
 extension KMPurchaseEmbeddedWindowController: NSWindowDelegate {

+ 4 - 2
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseEmbeddedWindowController.xib

@@ -32,9 +32,11 @@
                 <outlet property="couponButton" destination="16N-22-eUq" id="ufx-sv-rRp"/>
                 <outlet property="discountLabel" destination="zuM-1n-klX" id="t9g-Ms-UQK"/>
                 <outlet property="discountLabel1" destination="n83-tW-ibP" id="9tA-NM-reb"/>
+                <outlet property="discountLayoutConstraint" destination="c55-3v-q3H" id="X98-LV-mYs"/>
                 <outlet property="discountPriceLabel1" destination="4Ko-7d-Zp9" id="mo9-Wc-Ag0"/>
                 <outlet property="discountPriceLabel2" destination="Zgg-6x-ycD" id="MK8-XT-aPw"/>
                 <outlet property="discountPriceLabel3" destination="0yC-if-ZhG" id="g9G-YT-PUX"/>
+                <outlet property="discountView" destination="KXb-Fc-Ihu" id="VlV-d6-GhF"/>
                 <outlet property="emailLabel" destination="e5R-5a-vfZ" id="5nn-0v-GIy"/>
                 <outlet property="emailTextField" destination="sU8-qq-wLc" id="oZw-qE-aPj"/>
                 <outlet property="errorLabel" destination="GJE-gl-04P" id="qgA-LP-pwc"/>
@@ -385,7 +387,7 @@
                                         </box>
                                         <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Bf9-95-LZa">
                                             <rect key="frame" x="-2" y="226" width="339" height="16"/>
-                                            <textFieldCell key="cell" lineBreakMode="clipping" alignment="left" title="Label" id="xst-Rc-74s">
+                                            <textFieldCell key="cell" alignment="left" title="Label" id="xst-Rc-74s">
                                                 <font key="font" usesAppearanceFont="YES"/>
                                                 <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
                                                 <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -1074,13 +1076,13 @@
                                                 <constraint firstItem="KXb-Fc-Ihu" firstAttribute="leading" secondItem="2Hk-KG-FSr" secondAttribute="leading" id="2ND-n1-fYL"/>
                                                 <constraint firstItem="o5K-ag-Vbf" firstAttribute="leading" secondItem="2Hk-KG-FSr" secondAttribute="leading" id="5wl-Gd-dUP"/>
                                                 <constraint firstItem="Imv-vq-rsc" firstAttribute="top" secondItem="o5K-ag-Vbf" secondAttribute="bottom" constant="8" id="HxS-Ie-ICF"/>
-                                                <constraint firstItem="o5K-ag-Vbf" firstAttribute="top" secondItem="2Hk-KG-FSr" secondAttribute="top" id="Iza-QQ-I4v"/>
                                                 <constraint firstAttribute="trailing" secondItem="ZY4-l7-Ejn" secondAttribute="trailing" id="RMg-ar-mLp"/>
                                                 <constraint firstItem="Imv-vq-rsc" firstAttribute="leading" secondItem="2Hk-KG-FSr" secondAttribute="leading" id="Y0H-ih-Rgw"/>
                                                 <constraint firstItem="ZY4-l7-Ejn" firstAttribute="top" secondItem="KXb-Fc-Ihu" secondAttribute="bottom" constant="16" id="c55-3v-q3H"/>
                                                 <constraint firstAttribute="trailing" secondItem="KXb-Fc-Ihu" secondAttribute="trailing" id="iGT-gn-pAk"/>
                                                 <constraint firstAttribute="height" constant="128" id="j6Q-TK-M7b"/>
                                                 <constraint firstItem="KXb-Fc-Ihu" firstAttribute="top" secondItem="Imv-vq-rsc" secondAttribute="bottom" constant="8" id="oTP-4f-B8x"/>
+                                                <constraint firstAttribute="bottom" secondItem="ZY4-l7-Ejn" secondAttribute="bottom" id="seY-YL-vDW"/>
                                                 <constraint firstAttribute="trailing" secondItem="o5K-ag-Vbf" secondAttribute="trailing" id="thc-FV-DHJ"/>
                                                 <constraint firstItem="ZY4-l7-Ejn" firstAttribute="leading" secondItem="2Hk-KG-FSr" secondAttribute="leading" id="ud3-KR-CPI"/>
                                                 <constraint firstAttribute="trailing" secondItem="Imv-vq-rsc" secondAttribute="trailing" id="y07-bZ-NS8"/>

+ 2 - 1
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseFirstTrialWindowController.swift

@@ -417,8 +417,9 @@ import Cocoa
 //        }
 //        callBack(self,sender,self.emailTextField.stringValue,self.nameTextField.stringValue)
 //        FMTrackEventManager.defaultManager.trackOnceEvent(event: "PUW", withProperties: ["PUW_Btn":"Btn_PUW_BuyNow"])
-        let embeddedWC = KMPurchaseEmbeddedWindowController(windowNibName: "com.brother.pdfreaderpro.ai.product_1")
+        let embeddedWC = KMPurchaseEmbeddedWindowController.currentFirstTrialWC("com.brother.pdfreaderpro.ai.product_1")
         embeddedWC.showWindow(nil)
+        embeddedWC.window?.center()
     }
     
     @IBAction func enterLicenseAction(_ sender: HyperLinkButton) {

+ 2 - 1
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseLimitWindowController.swift

@@ -161,8 +161,9 @@ class KMPurchaseLimitWindowController: NSWindowController {
 //        var url = URL(string: Store_Link + "?product_code=product_2&utm_source=MacAppDmg&utm_campaign=OfficeStoreLink&utm_medium=PdfOfficeStore")!
 //        NSWorkspace.shared.open(url)
 //        FMTrackEventManager.defaultManager.trackOnceEvent(event: "PUW", withProperties: ["PUW_Btn":"Btn_PUW_PDFtoOffice_Buy"])
-        let embeddedWC = KMPurchaseEmbeddedWindowController(windowNibName: "com.brother.pdfreaderpro.mac.product_2")
+        let embeddedWC = KMPurchaseEmbeddedWindowController.currentFirstTrialWC("com.brother.pdfreaderpro.mac.product_2")
         embeddedWC.showWindow(nil)
+        embeddedWC.window?.center()
     }
     
     @IBAction func continueConvertAction(_ sender: Any) {

+ 4 - 0
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.m

@@ -450,6 +450,7 @@ NSPopoverDelegate>
 //                    [[FMTrackEventManager defaultManager] trackEventWithEvent:@"PUW" withProperties:@{@"PUW_Btn":@"Btn_PUW_BuyNow-Expire"}];
                     KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentFirstTrialWC:@"com.brother.pdfreaderpro.mac.product_1"];
                     [embeddedWC showWindow:nil];
+                    [[embeddedWC window] center];
                 }
             };
         self.testVC.mouseEventCall = ^(BOOL mouseEnter) {
@@ -487,6 +488,7 @@ NSPopoverDelegate>
 //            [[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) {
@@ -495,6 +497,7 @@ NSPopoverDelegate>
 //            [[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 {
             KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeNormal];
             [vc showWindow:nil];
@@ -554,6 +557,7 @@ NSPopoverDelegate>
 //        [[NSWorkspace sharedWorkspace] openURL:url];
         KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentFirstTrialWC:@"com.brother.pdfreaderpro.ai.product_1"];
         [embeddedWC showWindow:nil];
+        [[embeddedWC window] center];
 #else
         
         [[AIPurchaseWindowController currentWC] showWindow:nil];

+ 4 - 2
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationWindowController.m

@@ -755,8 +755,10 @@ static KMVerificationWindowController *_currentWindowController = nil;
 
 - (void)verificationBuy {
 #if VERSION_DMG
-    NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@?utm_source=MacAppDmg&utm_campaign=StoreLink&utm_medium=PdfStore", Swift_oc_Tool.Store_Link_OC]];
-    [[NSWorkspace sharedWorkspace] openURL:url];
+//    NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@?utm_source=MacAppDmg&utm_campaign=StoreLink&utm_medium=PdfStore", Swift_oc_Tool.Store_Link_OC]];
+//    [[NSWorkspace sharedWorkspace] openURL:url];
+    KMPurchaseCompareDMGWindowController *singleTon = [[KMPurchaseCompareDMGWindowController alloc] init];
+    [singleTon showWindow:nil];
 #endif
     
 }