MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / FileDialogOnFileOpened

Function FileDialogOnFileOpened

LibLemon/src/gui/filedialog.cpp:15–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13 __thread int dflags = 0;
14
15 void FileDialogOnFileOpened(const char* path, __attribute__((unused)) FileView* fv){
16 if(!(dflags & FILE_DIALOG_CREATE) || access(path, W_OK) || DisplayMessageBox("Open...", "File already exists! Overwrite?", MsgButtonsOKCancel)) { // Only open if create flag not specified OR user responds ok to message
17 if(selectedPth){
18 free(selectedPth);
19 }
20
21 selectedPth = strdup(path);
22 }
23 }
24
25 void FileDialogOnFileSelected(std::string& path, __attribute__((unused)) FileView* fv){
26 dialogFileBox->contents.front() = path;

Callers 1

Calls 2

DisplayMessageBoxFunction · 0.85
strdupFunction · 0.85

Tested by

no test coverage detected