From 5436e2c5d56b3d548063af3374e6c69810fc192a Mon Sep 17 00:00:00 2001 From: maron2000 <68574602+maron2000@users.noreply.github.com> Date: Sun, 31 Mar 2024 22:41:54 +0900 Subject: [PATCH 1/2] Fix some filters were ignored in file open dialogs --- src/dos/dos_programs.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dos/dos_programs.cpp b/src/dos/dos_programs.cpp index 483e172c98..50b2370534 100644 --- a/src/dos/dos_programs.cpp +++ b/src/dos/dos_programs.cpp @@ -551,7 +551,7 @@ void MenuBrowseCDImage(char drive, int num) { std::string files="", fname=""; const char *lFilterPatterns[] = {"*.iso","*.cue","*.bin","*.chd","*.mdf","*.gog","*.ins","*.ISO","*.CUE","*.BIN","*.CHD","*.MDF","*.GOG","*.INS"}; const char *lFilterDescription = "CD image files (*.iso, *.cue, *.bin, *.chd, *.mdf, *.gog, *.ins)"; - lTheOpenFileName = tinyfd_openFileDialog("Select a CD image file","",14,lFilterPatterns,lFilterDescription,0); + lTheOpenFileName = tinyfd_openFileDialog("Select a CD image file","", sizeof(lFilterPatterns) / sizeof(lFilterPatterns[0]),lFilterPatterns,lFilterDescription,0); if (lTheOpenFileName) { isoDrive *cdrom = dynamic_cast(Drives[drive-'A']); @@ -597,7 +597,7 @@ void MenuBrowseFDImage(char drive, int num, int type) { std::string files="", fname=""; const char *lFilterPatterns[] = {"*.ima","*.img","*.xdf","*.fdi","*.hdm","*.nfd","*.d88","*.IMA","*.IMG","*.XDF","*.FDI","*.HDM","*.NFD","*.D88"}; const char *lFilterDescription = "Floppy image files (*.ima, *.img, *.xdf, *.fdi, *.hdm, *.nfd, *.d88)"; - lTheOpenFileName = tinyfd_openFileDialog("Select a floppy image file","",4,lFilterPatterns,lFilterDescription,0); + lTheOpenFileName = tinyfd_openFileDialog("Select a floppy image file","",sizeof(lFilterPatterns)/sizeof(lFilterPatterns[0]), lFilterPatterns, lFilterDescription, 0); if (lTheOpenFileName) { //uint8_t mediaid = 0xF0; UNUSED @@ -654,12 +654,12 @@ void MenuBrowseImageFile(char drive, bool arc, bool boot, bool multiple) { if (arc) { const char *lFilterPatterns[] = {"*.zip","*.7z","*.ZIP","*.7Z"}; const char *lFilterDescription = "Archive files (*.zip, *.7z)"; - lTheOpenFileName = tinyfd_openFileDialog(("Select an archive file for Drive "+str+":").c_str(),"",4,lFilterPatterns,lFilterDescription,0); + lTheOpenFileName = tinyfd_openFileDialog(("Select an archive file for Drive "+str+":").c_str(),"", sizeof(lFilterPatterns) / sizeof(lFilterPatterns[0]),lFilterPatterns,lFilterDescription,0); if (lTheOpenFileName) fname = GetNewStr(lTheOpenFileName); } else { const char *lFilterPatterns[] = {"*.ima","*.img","*.vhd","*.fdi","*.hdi","*.nfd","*.nhd","*.d88","*.hdm","*.xdf","*.iso","*.cue","*.bin","*.chd","*.mdf","*.gog","*.ins","*.ccd","*.IMA","*.IMG","*.VHD","*.FDI","*.HDI","*.NFD","*.NHD","*.D88","*.HDM","*.XDF","*.ISO","*.CUE","*.BIN","*.CHD","*.MDF","*.GOG","*.INS", "*.CCD"}; const char *lFilterDescription = "Disk/CD image files"; - lTheOpenFileName = tinyfd_openFileDialog(((multiple?"Select image file(s) for Drive ":"Select an image file for Drive ")+str+":").c_str(),"",22,lFilterPatterns,lFilterDescription,multiple?1:0); + lTheOpenFileName = tinyfd_openFileDialog(((multiple?"Select image file(s) for Drive ":"Select an image file for Drive ")+str+":").c_str(),"", sizeof(lFilterPatterns) / sizeof(lFilterPatterns[0]),lFilterPatterns,lFilterDescription,multiple?1:0); if (lTheOpenFileName) fname = GetNewStr(lTheOpenFileName); if (multiple&&fname.size()) { files += "\""; @@ -668,7 +668,7 @@ void MenuBrowseImageFile(char drive, bool arc, bool boot, bool multiple) { files += "\" "; } while (multiple&&lTheOpenFileName&&systemmessagebox("Mount image files","Do you want to mount more image file(s)?","yesno", "question", 1)) { - lTheOpenFileName = tinyfd_openFileDialog(("Select image file(s) for Drive "+str+":").c_str(),"",20,lFilterPatterns,lFilterDescription,multiple?1:0); + lTheOpenFileName = tinyfd_openFileDialog(("Select image file(s) for Drive "+str+":").c_str(),"", sizeof(lFilterPatterns) / sizeof(lFilterPatterns[0]),lFilterPatterns,lFilterDescription,multiple?1:0); if (lTheOpenFileName) { fname = GetNewStr(lTheOpenFileName); files += "\""; From 866d7f4300bf5c6347712ae6758ce2e8b977272a Mon Sep 17 00:00:00 2001 From: maron2000 <68574602+maron2000@users.noreply.github.com> Date: Mon, 1 Apr 2024 00:37:38 +0900 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index ff3ff305ce..9410c4b68d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -99,6 +99,10 @@ Next: - Added breakpoint type "Freeze memory" (Enmet) - Implemented seeking in MSCDEX (Imported from dosbox-staging/dosbox-staging#3516 authored by weirddan455) + - Fixed built-in COPY command failed to obtain free space when reported DOS + version is set to 7.1 (maron2000) + - Fixed some file extensions in tbe filter list were ignored in the file open + dialogs (maron2000) 2024.03.01 - If an empty CD-ROM drive is attached to IDE emulation, return "Medium Not