1
0
mirror of synced 2024-11-29 01:44:31 +01:00

fix: List all intel hex and motorola srec file extensions manually

Fixes #871
This commit is contained in:
WerWolv 2023-01-12 08:20:15 +01:00
parent 03d216f116
commit 25ede7ad18
2 changed files with 37 additions and 6 deletions

View File

@ -222,9 +222,24 @@ namespace hex::plugin::builtin {
} }
bool IntelHexProvider::handleFilePicker() { bool IntelHexProvider::handleFilePicker() {
auto picked = fs::openFileBrowser(fs::DialogMode::Open, { { "Intel Hex File", "*" } }, [this](const std::fs::path &path) { auto picked = fs::openFileBrowser(fs::DialogMode::Open, {
this->m_sourceFilePath = path; { "Intel Hex File", "hex" },
}); { "Intel Hex File", "h86" },
{ "Intel Hex File", "hxl" },
{ "Intel Hex File", "hxh" },
{ "Intel Hex File", "obl" },
{ "Intel Hex File", "obh" },
{ "Intel Hex File", "mcs" },
{ "Intel Hex File", "ihex" },
{ "Intel Hex File", "ihe" },
{ "Intel Hex File", "ihx" },
{ "Intel Hex File", "a43" },
{ "Intel Hex File", "a90" }
}, [this](const std::fs::path &path) {
this->m_sourceFilePath = path;
}
);
if (!picked) if (!picked)
return false; return false;
if (!fs::isRegularFile(this->m_sourceFilePath)) if (!fs::isRegularFile(this->m_sourceFilePath))

View File

@ -198,9 +198,25 @@ namespace hex::plugin::builtin {
} }
bool MotorolaSRECProvider::handleFilePicker() { bool MotorolaSRECProvider::handleFilePicker() {
auto picked = fs::openFileBrowser(fs::DialogMode::Open, { { "Motorola SREC File", "*" } }, [this](const std::fs::path &path) { auto picked = fs::openFileBrowser(fs::DialogMode::Open, {
this->m_sourceFilePath = path; { "Motorola SREC File", "s19" },
}); { "Motorola SREC File", "s28" },
{ "Motorola SREC File", "s37" },
{ "Motorola SREC File", "s" },
{ "Motorola SREC File", "s1" },
{ "Motorola SREC File", "s2" },
{ "Motorola SREC File", "s3" },
{ "Motorola SREC File", "sx" },
{ "Motorola SREC File", "srec" },
{ "Motorola SREC File", "exo" },
{ "Motorola SREC File", "mot" },
{ "Motorola SREC File", "mxt" }
},
[this](const std::fs::path &path) {
this->m_sourceFilePath = path;
}
);
if (!picked) if (!picked)
return false; return false;
if (!fs::isRegularFile(this->m_sourceFilePath)) if (!fs::isRegularFile(this->m_sourceFilePath))