mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 22:01:13 +00:00
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:
parent
6576a62d86
commit
80593b4f71
4 changed files with 13 additions and 18 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue