|
@@ -193,6 +193,8 @@ static KMPDFEditAppendWindow *windowController = nil;
|
|
|
@property (nonatomic, strong) KMDesignButton *nMergeVC;
|
|
|
@property (nonatomic, strong) KMDesignButton *nCancelVC;
|
|
|
|
|
|
+@property (nonatomic, strong) NSButton *loading_backgroundView;
|
|
|
+
|
|
|
@end
|
|
|
|
|
|
@implementation KMPDFEditAppendWindow
|
|
@@ -428,6 +430,16 @@ static KMPDFEditAppendWindow *windowController = nil;
|
|
|
self.addFileButton.editable = false; //默认属性,初始化可不设置
|
|
|
self.addFileButton.delete = self;
|
|
|
[self.addFileButton updateUI];
|
|
|
+
|
|
|
+ self.loading_backgroundView = [[NSButton alloc] init];
|
|
|
+ [self.window.contentView addSubview:self.loading_backgroundView];
|
|
|
+ self.loading_backgroundView.frame = self.window.contentView.bounds;
|
|
|
+ self.loading_backgroundView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
|
|
|
+ self.loading_backgroundView.title = @"";
|
|
|
+ self.loading_backgroundView.bordered = NO;
|
|
|
+ self.loading_backgroundView.wantsLayer = YES;
|
|
|
+ self.loading_backgroundView.layer.backgroundColor = [NSColor clearColor].CGColor;
|
|
|
+ self.loading_backgroundView.hidden = YES;
|
|
|
}
|
|
|
|
|
|
- (void)updateButtonState
|
|
@@ -477,6 +489,12 @@ static KMPDFEditAppendWindow *windowController = nil;
|
|
|
|
|
|
- (void)beginSheetModalForWindow:(NSWindow *)window completionHandler:(void (^)(BOOL isSuccessfully,NSIndexSet * selectedIndexSet))handler
|
|
|
{
|
|
|
+ if (windowController.window.isSheet) {
|
|
|
+#if DEBUG
|
|
|
+ NSLog(@"合并窗口已显示");
|
|
|
+#endif
|
|
|
+ return;
|
|
|
+ }
|
|
|
windowController = self;
|
|
|
|
|
|
[NSApp beginSheet:[self window]
|
|
@@ -1025,6 +1043,7 @@ static KMPDFEditAppendWindow *windowController = nil;
|
|
|
[self.nCancelVC setEnabled:NO];
|
|
|
self.canMerge = NO;
|
|
|
[_progress startAnimation:nil];
|
|
|
+ self.loading_backgroundView.hidden = NO;
|
|
|
|
|
|
BOOL allPage = YES;//只有是全部才支持大纲的合并
|
|
|
for (KMFileAttribute *file in _files) {
|
|
@@ -1038,6 +1057,7 @@ static KMPDFEditAppendWindow *windowController = nil;
|
|
|
[self->_progress setHidden:YES];
|
|
|
[self.nCancelVC setEnabled:YES];
|
|
|
self.canMerge = YES;
|
|
|
+ self.loading_backgroundView.hidden = YES;
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
@@ -1131,6 +1151,7 @@ static KMPDFEditAppendWindow *windowController = nil;
|
|
|
[self->_progress setHidden:YES];
|
|
|
[self.nCancelVC setEnabled:YES];
|
|
|
self.canMerge = YES;
|
|
|
+ self.loading_backgroundView.hidden = YES;
|
|
|
|
|
|
if (self->_isSuccessfully) {
|
|
|
[NSApp endSheet:[self window] returnCode:[(NSView *)sender tag]];
|
|
@@ -1172,6 +1193,7 @@ static KMPDFEditAppendWindow *windowController = nil;
|
|
|
[self->_progress setHidden:YES];
|
|
|
[self.nCancelVC setEnabled:YES];
|
|
|
self.canMerge = YES;
|
|
|
+ self.loading_backgroundView.hidden = YES;
|
|
|
}
|
|
|
}];
|
|
|
});
|
|
@@ -1215,6 +1237,7 @@ static KMPDFEditAppendWindow *windowController = nil;
|
|
|
[self->_progress setHidden:YES];
|
|
|
[self.nCancelVC setEnabled:YES];
|
|
|
self.canMerge = YES;
|
|
|
+ self.loading_backgroundView.hidden = YES;
|
|
|
|
|
|
if (self->_isSuccessfully) {
|
|
|
[NSApp endSheet:[self window] returnCode:[(NSView *)sender tag]];
|
|
@@ -1256,6 +1279,7 @@ static KMPDFEditAppendWindow *windowController = nil;
|
|
|
[self->_progress setHidden:YES];
|
|
|
[self.nCancelVC setEnabled:YES];
|
|
|
self.canMerge = YES;
|
|
|
+ self.loading_backgroundView.hidden = YES;
|
|
|
}
|
|
|
}];
|
|
|
} else {
|