Browse Source

【从网页创建PDF】- 添加等待状态,第二次转换失败问题

liujiajie 1 year ago
parent
commit
a212ae277f

+ 6 - 6
PDF Office/PDF Master/Class/Home/WindowController/KMURLToPDFWindowController/KMURLToPDFWindowController.swift

@@ -28,7 +28,7 @@ class KMURLToPDFWindowController: NSWindowController, NSTextFieldDelegate {
     @IBOutlet var urlTextField: NSTextField!
     
     var filePath: String?
-//    var posterMaskView: KMBookletMaskView?
+    var posterMaskView: KMBookletMaskView?
     var gap: CGFloat = 0
     var pageSize: CGSize = CGSizeMake(298, 420)
     
@@ -329,13 +329,13 @@ class KMURLToPDFWindowController: NSWindowController, NSTextFieldDelegate {
     }
 
     func showWaitting() {
-//        if posterMaskView == nil {
-//            posterMaskView = KMBookletMaskView(frame: NSMakeRect(0, 0, window?.frame.size.width ?? 0, window?.frame.size.height ?? 0))
-//        }
-//        window?.contentView?.addSubview(posterMaskView!)
+        if posterMaskView == nil {
+            posterMaskView = KMBookletMaskView(frame: NSMakeRect(0, 0, window?.frame.size.width ?? 0, window?.frame.size.height ?? 0))
+        }
+        window?.contentView?.addSubview(posterMaskView!)
     }
 
     func hideWaitting() {
-//        /*posterMaskView*/?.removeFromSuperview()
+        posterMaskView?.removeFromSuperview()
     }
 }

+ 4 - 4
PDF Office/PDF Master/Class/Home/WindowController/KMURLToPDFWindowController/Model/KMConvertURLToPDF.m

@@ -126,10 +126,10 @@
 
 - (void)convertWebViewFrame:(WebFrame *)frame
 {
-    if (isProgressing) {
-        return;
-    }
-    isProgressing = YES;
+//    if (isProgressing) {
+//        return;
+//    }
+//    isProgressing = YES;
     
     NSString *name = [NSString stringWithFormat:@"webpage%ld",self.pageIndex];
     if (self.fileName.length != 0) {