diff --git a/menu.cpp b/menu.cpp index 0714204..1458f8f 100644 --- a/menu.cpp +++ b/menu.cpp @@ -1273,6 +1273,15 @@ void HandleUI(void) menu, select, up, down, left, right, plus, minus); + // Ensure we clear out the file-selector-visible file on select or cancel + if (cfg.log_file_entry) + { + if (menustate == fs_MenuSelect) + MakeFile("/tmp/FILESELECT", "selected"); + else if (menustate == fs_MenuCancel) + MakeFile("/tmp/FILESELECT", "cancelled"); + } + switch (menustate) { case MENU_NONE1: @@ -4699,12 +4708,9 @@ void HandleUI(void) if (cfg.log_file_entry && flist_nDirEntries()) { //Write out paths infos for external integration - FILE* filePtr = fopen("/tmp/CURRENTPATH", "w"); - FILE* pathPtr = fopen("/tmp/FULLPATH", "w"); - fprintf(filePtr, "%s", flist_SelectedItem()->altname); - fprintf(pathPtr, "%s", selPath); - fclose(filePtr); - fclose(pathPtr); + MakeFile("/tmp/CURRENTPATH", flist_SelectedItem()->altname); + MakeFile("/tmp/FULLPATH", selPath); + MakeFile("/tmp/FILESELECT", "active"); } break; diff --git a/user_io.h b/user_io.h index 8f370a5..2fba278 100644 --- a/user_io.h +++ b/user_io.h @@ -239,6 +239,7 @@ uint16_t sdram_sz(int sz = -1); int user_io_is_dualsdr(); uint16_t altcfg(int alt = -1); +void MakeFile(const char * filename, const char * data); int GetUARTMode(); void SetUARTMode(int mode); int GetMidiLinkMode();