diff --git a/plugins/builtin/romfs/lang/en_US.json b/plugins/builtin/romfs/lang/en_US.json index c92fa5296..e58afd1d8 100644 --- a/plugins/builtin/romfs/lang/en_US.json +++ b/plugins/builtin/romfs/lang/en_US.json @@ -369,7 +369,6 @@ "hex.builtin.popup.error.create": "Failed to create new file!", "hex.builtin.popup.error.file_dialog.common": "An error occurred while opening the file browser: {}", "hex.builtin.popup.error.file_dialog.portal": "There was an error while opening the file browser: {}.\nThis might be caused by your system not having a xdg-desktop-portal backend installed correctly.\n\nOn KDE, it's xdg-desktop-portal-kde.\nOn Gnome it's xdg-desktop-portal-gnome.\nOn wlroots it's xdg-desktop-portal-wlr.\nOtherwise, you can try to use xdg-desktop-portal-gtk.\n\nReboot your system after installing it.\n\nIf the file browser still doesn't work after this, submit an issue at https://github.com/WerWolv/ImHex/issues\n\nIn the meantime files can still be opened by dragging them onto the ImHex window!", - "hex.builtin.popup.error.open": "Failed to open file!", "hex.builtin.popup.error.project.load": "Failed to load project!", "hex.builtin.popup.error.project.save": "Failed to save project!", "hex.builtin.popup.error.read_only": "Couldn't get write access. File opened in read-only mode.", @@ -378,6 +377,7 @@ "hex.builtin.popup.exit_application.title": "Exit Application?", "hex.builtin.popup.waiting_for_tasks.title": "Waiting for Tasks", "hex.builtin.popup.waiting_for_tasks.desc": "There are still tasks running in the background.\nImHex will close after they are finished.", + "hex.builtin.provider.error.open": "Failed to open provider: {}", "hex.builtin.provider.disk": "Raw Disk Provider", "hex.builtin.provider.disk.disk_size": "Disk Size", "hex.builtin.provider.disk.reload": "Reload", @@ -386,6 +386,7 @@ "hex.builtin.provider.disk.error.read_ro": "Failed to open disk {} in read-only mode: {}", "hex.builtin.provider.disk.error.read_rw": "Failed to open disk {} in read/write mode: {}", "hex.builtin.provider.file": "File Provider", + "hex.builtin.provider.file.error.open": "Failed to open file {}: {}", "hex.builtin.provider.file.access": "Last access time", "hex.builtin.provider.file.creation": "Creation time", "hex.builtin.provider.file.modification": "Last modification time", diff --git a/plugins/builtin/source/content/events.cpp b/plugins/builtin/source/content/events.cpp index 06f72ac50..00e223135 100644 --- a/plugins/builtin/source/content/events.cpp +++ b/plugins/builtin/source/content/events.cpp @@ -109,7 +109,7 @@ namespace hex::plugin::builtin { return; } if (!provider->open()) { - PopupError::open("hex.builtin.popup.error.open"_lang); + PopupError::open(hex::format("hex.builtin.provider.error.open"_lang, provider->getErrorMessage())); TaskManager::doLater([provider] { ImHexApi::Provider::remove(provider); }); return; } @@ -120,7 +120,7 @@ namespace hex::plugin::builtin { EventManager::post(View::toWindowName("hex.builtin.view.provider_settings.load_popup")); else { if (!provider->open() || !provider->isAvailable()) { - PopupError::open("hex.builtin.popup.error.open"_lang); + PopupError::open(hex::format("hex.builtin.provider.error.open"_lang, provider->getErrorMessage())); TaskManager::doLater([provider] { ImHexApi::Provider::remove(provider); }); return; } diff --git a/plugins/builtin/source/content/providers/file_provider.cpp b/plugins/builtin/source/content/providers/file_provider.cpp index b8dc17913..a8168d5c6 100644 --- a/plugins/builtin/source/content/providers/file_provider.cpp +++ b/plugins/builtin/source/content/providers/file_provider.cpp @@ -215,6 +215,7 @@ namespace hex::plugin::builtin { if (!file.isValid()) { this->m_writable = false; this->m_readable = false; + this->setErrorMessage(hex::format("hex.builtin.provider.file.error.open"_lang, this->m_path.string(), ::strerror(errno))); return false; } diff --git a/plugins/builtin/source/content/welcome_screen.cpp b/plugins/builtin/source/content/welcome_screen.cpp index 5d54c7bdc..bc7ceb1b7 100644 --- a/plugins/builtin/source/content/welcome_screen.cpp +++ b/plugins/builtin/source/content/welcome_screen.cpp @@ -180,7 +180,7 @@ namespace hex::plugin::builtin { provider->loadSettings(recentProvider.data); if (!provider->open() || !provider->isAvailable()) { - PopupError::open("hex.builtin.popup.error.open"_lang); + PopupError::open(hex::format("hex.builtin.provider.error.open"_lang, provider->getErrorMessage())); TaskManager::doLater([provider] { ImHexApi::Provider::remove(provider); }); return; }