From dc8e642555b5a2d7c9702e83aa6c6d3512d6dd9d Mon Sep 17 00:00:00 2001 From: Olliver Schinagl Date: Fri, 8 May 2015 15:30:17 +0200 Subject: Remove start print 'state-mini-machine' The UI is fully controlled by the states of griffin.printer.getState and thus we don't worry about various states when starting a print, we let griffin.printer worry about that. It should be noted that the griffin.printer state machine is far from complete and we may still end up in a strange state. Signed-off-by: Olliver Schinagl --- src/eulogium.c | 38 ++++++-------------------------------- 1 file changed, 6 insertions(+), 32 deletions(-) diff --git a/src/eulogium.c b/src/eulogium.c index 53bb4bb..f79be9c 100644 --- a/src/eulogium.c +++ b/src/eulogium.c @@ -644,24 +644,10 @@ static void _on_start_print_ret(void *data EINA_UNUSED, const Eldbus_Message *ms EINA_LOG_ERR("Failed to start print."); return; } - if (print_started == EINA_TRUE) { - content = eulogium_print_progress(eulogium); - } else { - EINA_LOG_WARN("Bed was unable to be Cleared."); - content = eulogium_generic_error(eulogium, 0); /* TODO, proper error codes LUT */ - } - /* TODO: check why the print failed, and possibly show progress. Currently the status_changed does print the error */ - elm_naviframe_item_simple_push(eulogium->navi, content); -} - -static void eulogium_print_start(struct eulogium_data *eulogium) -{ - /* TODO: calling startPrint may have a longer then expected timeout. While unlikely we may want to inform - * the user about this via a screen. Difficulty being here, is that we don't want to 'flash' a screen - * too shortly but may not want to delay without reason. - */ - eldbus_proxy_call(eulogium->dbus.proxy[HARMA], "startPrint", _on_start_print_ret, eulogium, -1, "sss", - eulogium->print.name, eulogium->print.file, eulogium->print.flags); + if (print_started == EINA_TRUE) + EINA_LOG_INFO("Print has been successfully started"); + else + EINA_LOG_ERR("Unable to start print"); } static void _on_cleared_printer_ret(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) @@ -736,20 +722,8 @@ static void _cb_select_file(void *data, Evas_Object *obj EINA_UNUSED, void *even elm_naviframe_item_simple_push(eulogium->navi, content); } else { eulogium_print_data_set(eulogium, filepath); - switch (eulogium->printer.status) { - Evas_Object *content; - - case IDLE: - eulogium_print_start(eulogium); - break; - case WAIT_FOR_REMOVAL: - eulogium_clear_print_bed_and_start_print(eulogium); - break; - default: - content = eulogium_generic_error(eulogium, 0); /* TODO, proper error codes LUT */ - elm_naviframe_item_simple_push(eulogium->navi, content); - break; - } + eldbus_proxy_call(eulogium->dbus.proxy[HARMA], "startPrint", _on_start_print_ret, eulogium, -1, "sss", + eulogium->print.name, eulogium->print.file, eulogium->print.flags); } } } -- cgit v0.12