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

@@ -2,6 +2,7 @@
#include <hex/helpers/fmt.hpp>
#include <hex/helpers/fs.hpp>
#include <hex/api/localization_manager.hpp>
#include <hex/api/task_manager.hpp>
#include <algorithm>
#include <random>
@@ -9,7 +10,7 @@
#include <imgui.h>
#include <hex/ui/imgui_imhex_extensions.h>
#include <popups/popup_notification.hpp>
#include <toasts/toast_notification.hpp>
#include <wolv/io/file.hpp>
@@ -113,7 +114,7 @@ namespace hex::plugin::builtin {
wolv::io::File output(outputPath, wolv::io::File::Mode::Create);
if (!output.isValid()) {
ui::PopupError::open("hex.builtin.tools.file_tools.combiner.error.open_output"_lang);
ui::ToastError::open("hex.builtin.tools.file_tools.combiner.error.open_output"_lang);
return;
}
@@ -126,7 +127,7 @@ namespace hex::plugin::builtin {
wolv::io::File input(file, wolv::io::File::Mode::Read);
if (!input.isValid()) {
ui::PopupError::open(hex::format("hex.builtin.tools.file_tools.combiner.open_input"_lang, wolv::util::toUTF8String(file)));
ui::ToastError::open(hex::format("hex.builtin.tools.file_tools.combiner.open_input"_lang, wolv::util::toUTF8String(file)));
return;
}
@@ -142,7 +143,7 @@ namespace hex::plugin::builtin {
selectedIndex = 0;
outputPath.clear();
ui::PopupInfo::open("hex.builtin.tools.file_tools.combiner.success"_lang);
ui::ToastInfo::open("hex.builtin.tools.file_tools.combiner.success"_lang);
});
}
}

View File

@@ -1,5 +1,6 @@
#include <hex/helpers/fs.hpp>
#include <hex/api/localization_manager.hpp>
#include <hex/api/task_manager.hpp>
#include <algorithm>
#include <random>
@@ -7,7 +8,7 @@
#include <imgui.h>
#include <hex/ui/imgui_imhex_extensions.h>
#include <popups/popup_notification.hpp>
#include <toasts/toast_notification.hpp>
#include <wolv/io/file.hpp>
#include <wolv/utils/guards.hpp>
@@ -54,7 +55,7 @@ namespace hex::plugin::builtin {
wolv::io::File file(selectedFile, wolv::io::File::Mode::Write);
if (!file.isValid()) {
ui::PopupError::open("hex.builtin.tools.file_tools.shredder.error.open"_lang);
ui::ToastError::open("hex.builtin.tools.file_tools.shredder.error.open"_lang);
return;
}
@@ -128,7 +129,7 @@ namespace hex::plugin::builtin {
file.remove();
ui::PopupInfo::open("hex.builtin.tools.file_tools.shredder.success"_lang);
ui::ToastInfo::open("hex.builtin.tools.file_tools.shredder.success"_lang);
});
}
}

View File

@@ -3,13 +3,14 @@
#include <hex/helpers/literals.hpp>
#include <hex/helpers/fs.hpp>
#include <hex/api/localization_manager.hpp>
#include <hex/api/task_manager.hpp>
#include <algorithm>
#include <imgui.h>
#include <hex/ui/imgui_imhex_extensions.h>
#include <popups/popup_notification.hpp>
#include <toasts/toast_notification.hpp>
#include <wolv/io/file.hpp>
#include <wolv/utils/guards.hpp>
@@ -101,12 +102,12 @@ namespace hex::plugin::builtin {
wolv::io::File file(selectedFile, wolv::io::File::Mode::Read);
if (!file.isValid()) {
ui::PopupError::open("hex.builtin.tools.file_tools.splitter.picker.error.open"_lang);
ui::ToastError::open("hex.builtin.tools.file_tools.splitter.picker.error.open"_lang);
return;
}
if (file.getSize() < splitSize) {
ui::PopupError::open("hex.builtin.tools.file_tools.splitter.picker.error.size"_lang);
ui::ToastError::open("hex.builtin.tools.file_tools.splitter.picker.error.size"_lang);
return;
}
@@ -122,7 +123,7 @@ namespace hex::plugin::builtin {
wolv::io::File partFile(path, wolv::io::File::Mode::Create);
if (!partFile.isValid()) {
ui::PopupError::open(hex::format("hex.builtin.tools.file_tools.splitter.picker.error.create"_lang, index));
ui::ToastError::open(hex::format("hex.builtin.tools.file_tools.splitter.picker.error.create"_lang, index));
return;
}
@@ -135,7 +136,7 @@ namespace hex::plugin::builtin {
index++;
}
ui::PopupInfo::open("hex.builtin.tools.file_tools.splitter.picker.success"_lang);
ui::ToastInfo::open("hex.builtin.tools.file_tools.splitter.picker.success"_lang);
});
}
}