mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 13:05:25 -05:00
impr: Handle and show NFD errors (#995)
This PR handles errors that NFD might encounter (both in Init() and the other method to open the dialog), and log them in the logs and in the GUI This (among other) fix the crash I had running ImHex as root and opening a file
This commit is contained in:
@@ -123,11 +123,11 @@ namespace hex::plugin::builtin {
|
||||
ImHexApi::HexEditor::impl::setCurrentSelection(region);
|
||||
});
|
||||
|
||||
fs::setFileBrowserErrorCallback([]{
|
||||
fs::setFileBrowserErrorCallback([](const std::string& errMsg){
|
||||
#if defined(NFD_PORTAL)
|
||||
View::showErrorPopup("hex.builtin.popup.error.file_dialog.portal"_lang);
|
||||
View::showErrorPopup(hex::format("hex.builtin.popup.error.file_dialog.portal"_lang, errMsg));
|
||||
#else
|
||||
View::showErrorPopup("hex.builtin.popup.error.file_dialog.common"_lang);
|
||||
View::showErrorPopup(hex::format("hex.builtin.popup.error.file_dialog.common"_lang, errMsg));
|
||||
#endif
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user