mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 21:47:40 -05:00
feat: Display detailed error message when loading of project fails (#1135)
In order to do this I add to make some other additions : - Add a warning popup (TODO, maybe add some icons to differentiate error/warning popups in a future PR ?) - create showError() and showWarning() functions, as helpers to show a message both to the logs and as a popup
This commit is contained in:
10
plugins/builtin/include/content/helpers/notification.hpp
Normal file
10
plugins/builtin/include/content/helpers/notification.hpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <content/popups/popup_notification.hpp>
|
||||
|
||||
namespace hex::plugin::builtin {
|
||||
|
||||
void showError(const std::string& message);
|
||||
|
||||
void showWarning(const std::string& message);
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex/ui/popup.hpp>
|
||||
|
||||
#include <hex/api/localization.hpp>
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
@@ -53,6 +56,14 @@ namespace hex::plugin::builtin {
|
||||
}) { }
|
||||
};
|
||||
|
||||
class PopupWarning : public impl::PopupNotification<PopupWarning> {
|
||||
public:
|
||||
explicit PopupWarning(std::string message)
|
||||
: PopupNotification("hex.builtin.common.warning", std::move(message), [this]() {
|
||||
Popup::close();
|
||||
}) { }
|
||||
};
|
||||
|
||||
class PopupError : public impl::PopupNotification<PopupError> {
|
||||
public:
|
||||
explicit PopupError(std::string message)
|
||||
|
||||
Reference in New Issue
Block a user