summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlliver Schinagl <o.schinagl@ultimaker.com>2015-05-27 14:53:31 (GMT)
committerOlliver Schinagl <o.schinagl@ultimaker.com>2015-05-27 14:53:31 (GMT)
commit59d916a130d99e1da759c5b97249aa6f87759f94 (patch)
tree7e3df074d3225df20c44f474f41c526fef5b3b30
parentd4f3f1550cf51a629be8d979beb74490874f9d21 (diff)
downloadeulogium-59d916a130d99e1da759c5b97249aa6f87759f94.zip
eulogium-59d916a130d99e1da759c5b97249aa6f87759f94.tar.gz
eulogium-59d916a130d99e1da759c5b97249aa6f87759f94.tar.bz2
Do not update state if it is sthe same as the previous state
Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
-rw-r--r--src/eulogium.c69
1 files changed, 35 insertions, 34 deletions
diff --git a/src/eulogium.c b/src/eulogium.c
index 8812849..ecf8f80 100644
--- a/src/eulogium.c
+++ b/src/eulogium.c
@@ -1290,51 +1290,52 @@ static void eulogium_printer_status_set(struct eulogium_data *eulogium, struct _
EINA_LOG_WARN("Printer status: %s", status->s);
- switch (status->i) {
- Elm_Object_Item *item;
- /* Cases missing: First run wizard, heating, cooling */
+ if (eulogium->printer.status != status->i) {
+ switch (status->i) {
+ Elm_Object_Item *item;
+ /* Cases missing: First run wizard, heating, cooling */
#if 0
- case (FIRST_RUN_WIZARD):
- content = eulogium_multi_screen_menu(eulogium, eulogium->navi, &screen_data, 0, EINA_TRUE);
- if (content)
- elm_naviframe_item_simple_push(eulogium->navi, content);
- break;
+ case (FIRST_RUN_WIZARD):
+ content = eulogium_multi_screen_menu(eulogium, eulogium->navi, &screen_data, 0, EINA_TRUE);
+ if (content)
+ elm_naviframe_item_simple_push(eulogium->navi, content);
+ break;
#endif
- case (PAUSED): /* fall through TODO: make pause screen with resume/other button */
- case (PRINTING):
- eldbus_proxy_call(eulogium->dbus.proxy[HARMA], "getPrintName", _on_get_print_name_ret, eulogium, -1, "");
- content = eulogium_print_progress(eulogium);
- break;
- case (WAIT_FOR_REMOVAL):
- if (eulogium->printer.status != status->i) {
- eulogium_print_data_clear(eulogium);
- content = eulogium_clear_print_bed(eulogium);
- }
- break;
- case (DISCONNECTED): /* fall through */
- case (ERROR):
- eldbus_proxy_call(eulogium->dbus.proxy[PRINTER], "getError", _on_get_error_ret, eulogium, -1, "");
- content = eulogium_generic_error(eulogium, 4);
+ case (PAUSED): /* fall through TODO: make pause screen with resume/other button */
+ case (PRINTING): /* fall through */
+ eldbus_proxy_call(eulogium->dbus.proxy[HARMA], "getPrintName", _on_get_print_name_ret, eulogium, -1, "");
+ content = eulogium_print_progress(eulogium);
break;
- case (IDLE):
- /* Pop to the bottom of the stack. TODO: evaluate if a) we want this in a seperate function, b) popping to the bottom may not be the right frame to pop too? */
- if (eulogium->printer.status != status->i) {
+ case (WAIT_FOR_REMOVAL):
+ if (eulogium->printer.status != status->i) {
+ eulogium_print_data_clear(eulogium);
+ content = eulogium_clear_print_bed(eulogium);
+ }
+ break;
+ case (DISCONNECTED): /* fall through */
+ case (ERROR):
+ eldbus_proxy_call(eulogium->dbus.proxy[PRINTER], "getError", _on_get_error_ret, eulogium, -1, "");
+ content = eulogium_generic_error(eulogium, 4);
+ break;
+ case (IDLE):
+ /* Pop to the bottom of the stack. TODO: evaluate if a) we want this in a seperate function, b) popping to the bottom may not be the right frame to pop too? */
eulogium_print_data_clear(eulogium);
item = elm_naviframe_bottom_item_get(eulogium->navi);
if (item)
elm_naviframe_item_pop_to(item); /* XXX what to do else? | XXX stack corrupted after this? (see error log) */
else
EINA_LOG_CRIT("There is no bottom of the stack!");
+ break;
+ default:
+ break;
}
- break;
- default:
- break;
- }
- if (content)
- elm_naviframe_item_simple_push(eulogium->navi, content);
- /* TODO: When status is printing for example, or waiting_for_Removal, pop to those screens immediatly? */
+ if (content)
+ elm_naviframe_item_simple_push(eulogium->navi, content);
+ //elm_naviframe_item_push(eulogium->navi, NULL, NULL, NULL, content, NULL);
+ /* TODO: When status is printing for example, or waiting_for_Removal, pop to those screens immediatly? */
- eulogium->printer.status = status->i;
+ eulogium->printer.status = status->i;
+ }
}
static void _on_get_file_handlers_ret(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)