fix: Bad formatting of project open error popup

This commit is contained in:
WerWolv
2023-07-28 00:01:49 +02:00
parent 42c36279d1
commit 33f0d59545
2 changed files with 6 additions and 3 deletions

View File

@@ -11,6 +11,7 @@
#include <content/providers/file_provider.hpp>
#include <wolv/io/fs.hpp>
#include <wolv/utils/string.hpp>
#include <content/popups/popup_notification.hpp>
#include <content/popups/popup_question.hpp>
@@ -91,7 +92,7 @@ namespace hex::plugin::builtin {
fs::openFileBrowser(fs::DialogMode::Open, { }, [](const auto &path) {
if (path.extension() == ".hexproj") {
if (!ProjectFile::load(path)) {
PopupError::open("hex.builtin.popup.error.project.load"_lang);
PopupError::open(hex::format("hex.builtin.popup.error.project.load"_lang, wolv::util::toUTF8String(path)));
}
} else {
FileProvider* newProvider = static_cast<FileProvider*>(
@@ -112,7 +113,7 @@ namespace hex::plugin::builtin {
fs::openFileBrowser(fs::DialogMode::Open, { {"Project File", "hexproj"} },
[](const auto &path) {
if (!ProjectFile::load(path)) {
PopupError::open("hex.builtin.popup.error.project.load"_lang);
PopupError::open(hex::format("hex.builtin.popup.error.project.load"_lang, wolv::util::toUTF8String(path)));
}
});
}

View File

@@ -5,13 +5,15 @@
#include <content/popups/popup_notification.hpp>
#include <wolv/utils/string.hpp>
namespace hex::plugin::builtin {
void openProject() {
fs::openFileBrowser(fs::DialogMode::Open, { {"Project File", "hexproj"} },
[](const auto &path) {
if (!ProjectFile::load(path)) {
PopupError::open("hex.builtin.popup.error.project.load"_lang);
PopupError::open(hex::format("hex.builtin.popup.error.project.load"_lang, wolv::util::toUTF8String(path)));
}
});
}