Revert the use of enums in the printer demo (#4778)

This reverts commit 060f63ad56, as it broke the C++ interpreted demo and makes it impossible to implement the demo "fully" in JavaScript and Python.

cc #4777
This commit is contained in:
Simon Hausmann 2024-03-06 18:54:33 +01:00 committed by GitHub
parent 6576a62d86
commit 80593b4f71
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 18 deletions

View file

@ -76,7 +76,7 @@ int main()
char time_buf[100] = { 0 };
std::strftime(time_buf, sizeof(time_buf), "%H:%M:%S %d/%m/%Y", std::localtime(&now));
slint::interpreter::Struct item { { "status", Value(slint::SharedString("WAITING...")) },
slint::interpreter::Struct item { { "status", Value(slint::SharedString("waiting")) },
{ "progress", Value(0.) },
{ "title", args[0] },
{ "owner", slint::SharedString("joe@example.com") },
@ -98,7 +98,7 @@ int main()
auto top_item = *(*printer_queue->row_data(0)).to_struct();
auto progress = *top_item.get_field("progress")->to_number() + 1.;
top_item.set_field("progress", progress);
top_item.set_field("status", slint::SharedString("PRINTING"));
top_item.set_field("status", slint::SharedString("printing"));
if (progress > 100) {
printer_queue->erase(0);
} else {