parent
3e4c4430d5
commit
3cb8e37182
@ -85,22 +85,25 @@ namespace hex::plugin::builtin {
|
||||
EventManager::post<EventProviderOpened>(newProvider);
|
||||
} else if (name == "Open File") {
|
||||
fs::openFileBrowser(fs::DialogMode::Open, { }, [](const auto &path) {
|
||||
if(path.extension() == ".hexproj"){
|
||||
if (path.extension() == ".hexproj") {
|
||||
if (!ProjectFile::load(path)) {
|
||||
PopupError::open("hex.builtin.popup.error.project.load"_lang);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
FileProvider* newProvider = static_cast<FileProvider*>(
|
||||
ImHexApi::Provider::createProvider("hex.builtin.provider.file", true)
|
||||
);
|
||||
|
||||
if (newProvider == nullptr)
|
||||
return;
|
||||
|
||||
newProvider->setPath(path);
|
||||
newProvider->open();
|
||||
if (newProvider != nullptr && !newProvider->open())
|
||||
if (!newProvider->open())
|
||||
hex::ImHexApi::Provider::remove(newProvider);
|
||||
else
|
||||
EventManager::post<EventProviderOpened>(newProvider);
|
||||
}
|
||||
});
|
||||
});
|
||||
} else if (name == "Open Project") {
|
||||
fs::openFileBrowser(fs::DialogMode::Open, { {"Project File", "hexproj"} },
|
||||
[](const auto &path) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user