diff options
| author | Aldrik Ramaekers <aldrik@mailbox.org> | 2026-01-01 14:33:14 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik@mailbox.org> | 2026-01-01 14:33:14 +0100 |
| commit | a1d639e963eaad1f8d24d47cd004c22052166978 (patch) | |
| tree | 473a9a1b8b9ed5bd0c24a81fa848c31d3db788d0 /include | |
| parent | be5c11029adb25c586c4fcde6fedfa01d1bdcd49 (diff) | |
export dropdown ui
Diffstat (limited to 'include')
| -rw-r--r-- | include/config.hpp | 3 | ||||
| -rw-r--r-- | include/exporter.hpp | 7 | ||||
| -rw-r--r-- | include/ui.hpp | 3 |
3 files changed, 12 insertions, 1 deletions
diff --git a/include/config.hpp b/include/config.hpp index ff36364..dcc476b 100644 --- a/include/config.hpp +++ b/include/config.hpp @@ -31,12 +31,15 @@ #define u32 uint32_t #define u64 uint64_t +#define SIMULATE_EMAIL 1 + namespace config { static const char* PROGRAM_VERSION = "0.1.0"; // major.minor.patch namespace colors { static const ImU32 COLOR_ERROR_OUTLINE = IM_COL32(255, 0, 0, 80); static const ImU32 COLOR_ERROR = IM_COL32(235, 64, 52, 255); + static const ImU32 COLOR_SUCCESS = IM_COL32(125, 214, 66, 255); static const ImU32 COLOR_DEFAULT = IM_COL32(235, 255, 255, 255); } } diff --git a/include/exporter.hpp b/include/exporter.hpp index 00eaf32..82c18b2 100644 --- a/include/exporter.hpp +++ b/include/exporter.hpp @@ -26,6 +26,7 @@ typedef uint32_t e_err; namespace exporter { + typedef enum { EXPORT_STARTING, @@ -33,15 +34,19 @@ namespace exporter { EXPORT_DONE, } status; + typedef void (*send_email_callback)(e_err err); + typedef struct { time_t started_at; + time_t done_at; e_err error; status status; char* sender; char* recipient; const char* subject; const char* text; + send_email_callback callback; } export_request; typedef struct @@ -51,5 +56,5 @@ namespace exporter { } email_provider_impl; email_provider_impl get_email_provider_implementation(email_provider provider); - exporter::export_request* send_email(char* sender, char* recipient, const char* subject, const char* text); + exporter::export_request* send_email(char* sender, char* recipient, const char* subject, const char* text, send_email_callback ev); }
\ No newline at end of file diff --git a/include/ui.hpp b/include/ui.hpp index 86778bc..2e85dc2 100644 --- a/include/ui.hpp +++ b/include/ui.hpp @@ -17,6 +17,7 @@ #pragma once #include "imgui.h" +#include "exporter.hpp" #include "administration.hpp" #define STATUS_TEXT_LEN 64 @@ -102,4 +103,6 @@ namespace ImGui void TaxRateDropdown(char* tax_internal_code, bool outgoing, bool has_error); bool CurrencyDropdown(char* currency); void ToggleDropdown(bool *buffer, char* option1, char* option2); + + bool BeginExportDropdown(const char* title, const char* text, exporter::export_request* active_request); }
\ No newline at end of file |
