Explorar o código

【系统菜单栏】帮助菜单,feekback菜单补充

tangchao hai 1 ano
pai
achega
34bb13a731

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

@@ -644,7 +644,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, iRateDelegate{
         KMEmailSubWindowController().showWindow(nil)
     }
     @IBAction func feedback(_ sender: NSMenuItem) -> Void {
-        KMPrint("feedback ...")
+        KMTools.feekback()
     }
     @IBAction func reportBug(_ sender: NSMenuItem) -> Void {
         KMPrint("reportBug ...")

+ 60 - 5
PDF Office/PDF Master/Class/Common/Tools/KMTools.swift

@@ -368,17 +368,72 @@ extension KMTools {
         let versionInfoString = "\(KMTools.getRawSystemInfo()) - \(major).\(minor).\(bugFix)"
         
         let appVersion = KMTools.getAppVersion()
-        let appName = KMTools.getAppName()
+        let appName = KMTools.getAppNameForSupportEmail()
         let subjects = "\(appName) - \(appVersion);\(NSLocalizedString("Propose a New Feature", comment: ""));\(versionInfoString)"
-        // MARK: -
-        // MARK TODO: 邮箱域名需要替换
         let email = "support@pdfreaderpro.com"
         
-        // MARK: -
-        // MARK TODO: 邮箱域名需要替换
         KMMailHelper.newEmail(withContacts: email, andSubjects: subjects)
     }
     
+    @objc class func getAppNameForSupportEmail() -> String {
+        var tAppName = "PDF Reader Pro"
+    #if VERSION_FREE
+
+    #if VERSION_DMG
+        
+    #if VERSION_BETA
+        tAppName = "PDF Reader Pro Beta"
+    #endif
+        
+        // 桌机版
+//        VerificationManager *tManager = [VerificationManager manager];
+//        switch ([tManager status]) {
+//            case ActivityStatusTrial:
+//                tAppName = [tAppName stringByAppendingString:@" Trial"];
+//                break;
+//
+//            case ActivityStatusVerification:
+//                tAppName = [tAppName stringByAppendingString:@" Verification"];
+//                break;
+//
+//            case ActivityStatusTrialExpire:
+//                tAppName = [tAppName stringByAppendingString:@" TrialExpire"];
+//                break;
+//
+//            case ActivityStatusVerifExpire:
+//                tAppName = [tAppName stringByAppendingString:@" VerifExpire"];
+//                break;
+//
+//            default:
+//                break;
+//        }
+        if let tManager = VerificationManager.default() {
+            let status = tManager.status
+            if status == ActivityStatus.trial {
+                tAppName = "\(tAppName) Trial"
+            } else if status == ActivityStatus.verification {
+                tAppName = "\(tAppName) Verification"
+            } else if status == ActivityStatus.trialExpired {
+                tAppName = "\(tAppName) TrialExpire"
+            } else if status == ActivityStatus.verifExpire {
+                tAppName = "\(tAppName) VerifExpire"
+            }
+        }
+    #else
+        
+        // AppStore 免费版本
+        tAppName = "PDF Reader Pro Lite"
+    #endif
+        
+    #else
+        
+        // AppStore 付费版
+        tAppName = "PDF Reader Pro Edition"
+    #endif
+        
+        return tAppName
+    }
+    
     @objc class func getRawSystemInfo() -> String {
         let info = GBDeviceInfo.deviceInfo().rawSystemInfoString
         if (info == nil) {