MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / OnBrowserSaveButton

Method OnBrowserSaveButton

src/gui/browserpanel.cc:307–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

305 }
306
307 void OnBrowserSaveButton(wxCommandEvent&) override
308 {
309 auto item = browserTree->GetSelection();
310 auto node = _filesystemModel->Find(item);
311
312 GetfileDialog d(this, wxID_ANY);
313 d.filenameText->SetValue(node->dirent->path.to_str());
314 d.targetFilePicker->SetFileName(wxFileName(node->dirent->filename));
315 d.targetFilePicker->SetFocus();
316 d.buttons_OK->SetDefault();
317 if (d.ShowModal() != wxID_OK)
318 return;
319
320 auto localPath = d.targetFilePicker->GetPath().ToStdString();
321 QueueJob(
322 [this, node, localPath]()
323 {
324 auto bytes = _filesystem->getFile(node->dirent->path);
325 bytes.writeToFile(localPath);
326 });
327 }
328
329 /* Called from worker thread only! */
330 Path ResolveFileConflicts_WT(Path path)

Callers

nothing calls this directly

Calls 5

FindMethod · 0.80
SetValueMethod · 0.80
to_strMethod · 0.80
writeToFileMethod · 0.80
getFileMethod · 0.45

Tested by

no test coverage detected