summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2025-10-18 08:41:54 +0200
committerAldrik Ramaekers <aldrikboy@gmail.com>2025-10-18 08:41:54 +0200
commitc1d950f2765cde614c8411b4effb3850146ba598 (patch)
tree408372166c170bfabc3e23a02d8aaa48b662696c /src
parenta8799cfee2de8ac53cc07c571c56ae5d9c98cbbd (diff)
ui loading animation for model request
Diffstat (limited to 'src')
-rw-r--r--src/countries/nl.cpp6
-rw-r--r--src/locales/en.cpp2
-rw-r--r--src/ui/ui_settings.cpp24
3 files changed, 20 insertions, 12 deletions
diff --git a/src/countries/nl.cpp b/src/countries/nl.cpp
index cf79ee2..62f947f 100644
--- a/src/countries/nl.cpp
+++ b/src/countries/nl.cpp
@@ -82,14 +82,14 @@ bool _nl_add_billing_item_to_tax_report(tax_report* report, invoice* inv, billin
a5->total_tax += totals.tax;
}
- // TODO 1c
else if (rate.rate > 0.0f) {
- tax_line* tl = administration::get_tax_line_from_report(report, "1d");
+ tax_line* tl = administration::get_tax_line_from_report(report, "1c");
tl->total_net += totals.net;
tl->total_tax += totals.tax;
-
+
a5->total_tax += totals.tax;
}
+ // NOTE: category '1d' for private usage is not supported.
else if (rate.rate == 0.0f) {
tax_line* tl = administration::get_tax_line_from_report(report, "1e");
tl->total_net += totals.net;
diff --git a/src/locales/en.cpp b/src/locales/en.cpp
index 4abcab8..5b78ec9 100644
--- a/src/locales/en.cpp
+++ b/src/locales/en.cpp
@@ -212,7 +212,7 @@ locale_entry en_locales[] = {
{"import.error.upload","Failure: Upload failed"},
{"import.error.query","Failure: Querying service failed"},
- {"import.error.import","Failure: Failed to import result from service"},
+ {"import.error.import","Failure: Service returned unparseable response. Try using another model."},
// Tax statement strings.
{"taxes.total", "Total"},
diff --git a/src/ui/ui_settings.cpp b/src/ui/ui_settings.cpp
index cf27b49..a4b5748 100644
--- a/src/ui/ui_settings.cpp
+++ b/src/ui/ui_settings.cpp
@@ -16,7 +16,6 @@
#include "ui.hpp"
-#include "imgui.h"
#include "strops.hpp"
#include "memops.hpp"
#include "locales.hpp"
@@ -396,15 +395,24 @@ static void draw_services()
}
else {
ImGui::BeginDisabled();
- if (ImGui::BeginCombo(locale::get("settings.services.ai_service.model"), new_service.model_name))
+ ImGui::BeginCombo(locale::get("settings.services.ai_service.model"), NULL, 1 << 20);
{
- ImGui::EndCombo();
- }
- if (model_request->status != importer::status::IMPORT_DONE) {
- ImGui::SameLine();
+ if (ImGui::BeginComboPreview())
+ {
+ if (model_request->status != importer::status::IMPORT_DONE) {
+ float radius = 10.0f;
+ const ImVec4 col = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered);
+ const ImVec4 bg = ImGui::GetStyleColorVec4(ImGuiCol_Button);
+ ImGui::LoadingIndicatorCircle("##loadingAnim", radius, bg, col, 6, 4.0f);
+
+ ImGui::SameLine();
+ }
+ ImGui::TextUnformatted(new_service.model_name);
+
+ ImGui::EndComboPreview();
+ }
- // TODO replace with LoadingIndicatorCircle
- ImGui::Text("%c", "|/-\\"[(int)(ImGui::GetTime() / 0.05f) & 3]);
+ //ImGui::EndCombo();
}
ImGui::EndDisabled();
}