From bcea7bba32713be9ab8f7cf09aa772b32ac941cb Mon Sep 17 00:00:00 2001 From: Jaime Thomas Date: Wed, 5 Nov 2008 17:02:35 +0000 Subject: [PATCH] Fix a couple bugs, and now errors are displayed to progress text. --- experimental/ecdb/trunk/src/ecdb_drives.c | 3 --- experimental/ecdb/trunk/src/ecdb_erase.c | 8 ++++++-- experimental/ecdb/trunk/src/ecdb_gui.c | 9 +++++++++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/experimental/ecdb/trunk/src/ecdb_drives.c b/experimental/ecdb/trunk/src/ecdb_drives.c index e394d206..eafd20bf 100644 --- a/experimental/ecdb/trunk/src/ecdb_drives.c +++ b/experimental/ecdb/trunk/src/ecdb_drives.c @@ -10,8 +10,6 @@ ecdb_aquire_drive_info(void) struct burn_drive_info *drives_current; struct burn_speed_descriptor *speeds; - ecdb_burn_init(); - ret = 0; if (em->drives) ecore_list_destroy(em->drives); @@ -75,7 +73,6 @@ ecdb_aquire_drive_info(void) } burn_drive_info_free(drives_current); - burn_finish(); return TRUE; } diff --git a/experimental/ecdb/trunk/src/ecdb_erase.c b/experimental/ecdb/trunk/src/ecdb_erase.c index 3cd2d39f..deeff135 100644 --- a/experimental/ecdb/trunk/src/ecdb_erase.c +++ b/experimental/ecdb/trunk/src/ecdb_erase.c @@ -38,7 +38,6 @@ void ecdb_erase_project_destroy(Ecdb_Erase_Project *proj) { ecdb_project_destroy(ECDB_PROJECT(proj)); - free(proj); } int @@ -90,6 +89,11 @@ static void ecdb_erase_progress_handler(void *data, void *buffer, int nbyte) { BurnProgress *p = buffer; + Evas_Object *swallow; + char buf[1024]; - printf("Sector %d of %d\n", p->sector, p->sectors); + swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee), + "erase_page"); + snprintf(buf, sizeof(buf), "%d/%d", p->sector, p->sectors); + edje_object_part_text_set(swallow, "progress_text", buf); } diff --git a/experimental/ecdb/trunk/src/ecdb_gui.c b/experimental/ecdb/trunk/src/ecdb_gui.c index 17a129f6..a11f3859 100644 --- a/experimental/ecdb/trunk/src/ecdb_gui.c +++ b/experimental/ecdb/trunk/src/ecdb_gui.c @@ -363,17 +363,26 @@ ecdb_cb_erase_page_buttons_clicked(void *data, Evas_Object *o, int speed; Ecdb_Erase_Project *proj; proj = ecdb_erase_project_new(); + char buf[1024]; + snprintf(buf, sizeof(buf), "Commencing..."); + edje_object_part_text_set(swallow, "progress_text", buf); if (!ecdb_aquire_drive(ECDB_PROJECT(proj), 0)) { printf("Couldn't grab drive!\n"); ecdb_erase_project_destroy(proj); + snprintf(buf, sizeof(buf), "Couldn't grab drive!"); + edje_object_part_text_set(swallow, "progress_text", buf); + return; } if (!ecdb_erase_disc(proj)) { printf("Couldn't begin burn!\n"); ecdb_erase_project_destroy(proj); + snprintf(buf, sizeof(buf), "Disc not erasable!"); + edje_object_part_text_set(swallow, "progress_text", buf); + return; } proj->quick = speed;