mirror of
https://github.com/SatDump/SatDump
synced 2026-08-13 17:47:30 -04:00
Mostly some UI stuff
This commit is contained in:
parent
e79169476b
commit
bb73e355be
44 changed files with 2844 additions and 2880 deletions
29
src-interface/error.cpp
Normal file
29
src-interface/error.cpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#include "error.h"
|
||||
#include "imgui/imgui.h"
|
||||
#include <string>
|
||||
|
||||
namespace satdump
|
||||
{
|
||||
namespace error
|
||||
{
|
||||
bool hasError = false;
|
||||
std::string error_title;
|
||||
std::string error_message;
|
||||
|
||||
void set_error(std::string title, std::string description)
|
||||
{
|
||||
error_title = title;
|
||||
error_message = description;
|
||||
hasError = true;
|
||||
}
|
||||
|
||||
void render()
|
||||
{
|
||||
ImGui::Begin(error_title.c_str(), &hasError);
|
||||
ImGui::TextColored(ImColor(255, 0, 0), "%s", error_message.c_str());
|
||||
if (ImGui::Button("Close"))
|
||||
hasError = false;
|
||||
ImGui::End();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue