mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 21:05:56 -05:00
api: Refactored providers to allow for loading interfaces and config views
This commit is contained in:
@@ -713,8 +713,13 @@ namespace hex::plugin::builtin {
|
||||
hex::prv::Provider *provider = nullptr;
|
||||
EventManager::post<RequestCreateProvider>("hex.builtin.provider.file", &provider);
|
||||
|
||||
if (auto fileProvider = dynamic_cast<prv::FileProvider*>(provider))
|
||||
fileProvider->open(path);
|
||||
if (auto fileProvider = dynamic_cast<prv::FileProvider*>(provider)) {
|
||||
fileProvider->setPath(path);
|
||||
if (!fileProvider->open()) {
|
||||
View::showErrorPopup("hex.builtin.view.hexeditor.error.open"_lang);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!provider->isWritable()) {
|
||||
this->m_memoryEditor.ReadOnly = true;
|
||||
|
||||
Reference in New Issue
Block a user