mirror of https://github.com/WerWolv/ImHex.git
ux: Only show file chooser popup when there's files in the the relevant folder
This commit is contained in:
parent
eade95dff7
commit
8ab4d25e33
|
@ -118,6 +118,11 @@ namespace hex {
|
|||
}
|
||||
|
||||
void View::showFileChooserPopup(const std::vector<fs::path> &paths, const std::vector<nfdfilteritem_t> &validExtensions, const std::function<void(fs::path)> &callback) {
|
||||
if (paths.empty()) {
|
||||
hex::openFileBrowser("hex.builtin.common.open"_lang, DialogMode::Open, validExtensions, [callback](const auto &path) {
|
||||
callback(path);
|
||||
});
|
||||
} else {
|
||||
View::s_selectableFileIndex = 0;
|
||||
View::s_selectableFiles = paths;
|
||||
View::s_selectableFilesValidExtensions = validExtensions;
|
||||
|
@ -125,6 +130,7 @@ namespace hex {
|
|||
|
||||
ImHexApi::Tasks::doLater([] { ImGui::OpenPopup("hex.builtin.common.choose_file"_lang); });
|
||||
}
|
||||
}
|
||||
|
||||
bool View::hasViewMenuItemEntry() const {
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue