impr: Switch most usages of modals over to toasts

This commit is contained in:
WerWolv
2023-12-26 00:22:47 +01:00
parent 52192a3b26
commit 96fe608d60
25 changed files with 129 additions and 121 deletions

View File

@@ -3,7 +3,7 @@
#include <hex/api/project_file_manager.hpp>
#include <hex/helpers/logger.hpp>
#include <popups/popup_notification.hpp>
#include <toasts/toast_notification.hpp>
#include <wolv/utils/string.hpp>
@@ -13,7 +13,7 @@ namespace hex::plugin::builtin {
fs::openFileBrowser(fs::DialogMode::Open, { {"Project File", "hexproj"} },
[](const auto &path) {
if (!ProjectFile::load(path)) {
ui::PopupError::open(hex::format("hex.builtin.popup.error.project.load"_lang, wolv::util::toUTF8String(path)));
ui::ToastError::open(hex::format("hex.builtin.popup.error.project.load"_lang, wolv::util::toUTF8String(path)));
}
});
}
@@ -21,7 +21,7 @@ namespace hex::plugin::builtin {
void saveProject() {
if (ImHexApi::Provider::isValid() && ProjectFile::hasPath()) {
if (!ProjectFile::store()) {
ui::PopupError::open("hex.builtin.popup.error.project.save"_lang);
ui::ToastError::open("hex.builtin.popup.error.project.save"_lang);
} else {
log::debug("Project saved");
}
@@ -36,7 +36,7 @@ namespace hex::plugin::builtin {
}
if (!ProjectFile::store(path)) {
ui::PopupError::open("hex.builtin.popup.error.project.save"_lang);
ui::ToastError::open("hex.builtin.popup.error.project.save"_lang);
}
});
}