|
@@ -471,10 +471,19 @@ class AutoTestAdvanceSettingView : NSView, NSTableViewDataSource, NSTableViewDel
|
|
|
|
|
|
func fileCellNeedDelete(_ cell:TestFileCellView, fileName:String) {
|
|
|
let originDirectory = _autoTestObj?.originFileDirectory()
|
|
|
+ let resultDirectory = _autoTestObj?.resultFileDirectory()
|
|
|
+ let compareDirectory = _autoTestObj?.checkFileDirectory()
|
|
|
+
|
|
|
+ let nFileName = NSString(string: NSString(string: fileName).deletingPathExtension).appendingPathExtension(_autoTestObj?.extention() ?? "")! as String
|
|
|
+
|
|
|
let path = NSString(string: originDirectory!).appendingPathComponent(fileName);
|
|
|
+ let resultPath = NSString(string: resultDirectory!).appendingPathComponent(nFileName);
|
|
|
+ let comparePath = NSString(string: compareDirectory!).appendingPathComponent(nFileName);
|
|
|
|
|
|
FileConverter.shared().cancelTaskForSrcPath(path);
|
|
|
try? FileManager.default.removeItem(atPath: path);
|
|
|
+ try? FileManager.default.removeItem(atPath: resultPath);
|
|
|
+ try? FileManager.default.removeItem(atPath: comparePath);
|
|
|
|
|
|
let index = _files.firstIndex(of: fileName)
|
|
|
|
|
@@ -484,6 +493,29 @@ class AutoTestAdvanceSettingView : NSView, NSTableViewDataSource, NSTableViewDel
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ func fileCellNeedDeleteAll(_ cell:TestFileCellView) {
|
|
|
+ let originDirectory = _autoTestObj?.originFileDirectory()
|
|
|
+ let resultDirectory = _autoTestObj?.resultFileDirectory()
|
|
|
+ let compareDirectory = _autoTestObj?.checkFileDirectory()
|
|
|
+
|
|
|
+ for fn in _files {
|
|
|
+ let nFileName = NSString(string: NSString(string: fn).deletingPathExtension).appendingPathExtension(_autoTestObj?.extention() ?? "")! as String
|
|
|
+
|
|
|
+ let path = NSString(string: originDirectory!).appendingPathComponent(fn);
|
|
|
+ let resultPath = NSString(string: resultDirectory!).appendingPathComponent(nFileName);
|
|
|
+ let comparePath = NSString(string: compareDirectory!).appendingPathComponent(nFileName);
|
|
|
+
|
|
|
+ FileConverter.shared().cancelTaskForSrcPath(path);
|
|
|
+ try? FileManager.default.removeItem(atPath: path);
|
|
|
+
|
|
|
+ try? FileManager.default.removeItem(atPath: resultPath);
|
|
|
+ try? FileManager.default.removeItem(atPath: comparePath);
|
|
|
+ }
|
|
|
+
|
|
|
+ _files = [];
|
|
|
+ _fileList.reloadData()
|
|
|
+ }
|
|
|
+
|
|
|
func fileCellNeedCancelConvertTask(_ cell:TestFileCellView, fileName:String) {
|
|
|
let originDirectory = _autoTestObj?.originFileDirectory()
|
|
|
let path = NSString(string: originDirectory!).appendingPathComponent(fileName);
|