pasteCopyFilesCheck copies files into given directory node, first checking if any already exist -- if they exist, prompts.
(tdir *Node, md mimedata.Mimes, externalDrop bool, dropFinal func())
| 151 | // pasteCopyFilesCheck copies files into given directory node, |
| 152 | // first checking if any already exist -- if they exist, prompts. |
| 153 | func (fn *Node) pasteCopyFilesCheck(tdir *Node, md mimedata.Mimes, externalDrop bool, dropFinal func()) { |
| 154 | existing, _ := fn.pasteCheckExisting(tdir, md, externalDrop) |
| 155 | if len(existing) == 0 { |
| 156 | fn.pasteCopyFiles(tdir, md, externalDrop) |
| 157 | if dropFinal != nil { |
| 158 | dropFinal() |
| 159 | } |
| 160 | return |
| 161 | } |
| 162 | d := core.NewBody().AddTitle("File(s) Exist in Target Dir, Overwrite?"). |
| 163 | AddText(fmt.Sprintf("File(s): %v exist, do you want to overwrite?", existing)) |
| 164 | d.AddBottomBar(func(parent core.Widget) { |
| 165 | d.AddCancel(parent) |
| 166 | d.AddOK(parent).SetText("Overwrite").OnClick(func(e events.Event) { |
| 167 | fn.pasteCopyFiles(tdir, md, externalDrop) |
| 168 | if dropFinal != nil { |
| 169 | dropFinal() |
| 170 | } |
| 171 | }) |
| 172 | }) |
| 173 | d.RunDialog(fn) |
| 174 | } |
| 175 | |
| 176 | // pasteFiles applies a paste / drop of mime data onto this node. |
| 177 | // always does a copy of files into / onto target. |
no test coverage detected