|
|
@ -51,6 +51,10 @@ static void _page_hide_finished(void *data, Evas_Object *o, |
|
|
|
const char *emission, |
|
|
|
const char *source); |
|
|
|
|
|
|
|
// Burn callbacks and functions |
|
|
|
static void _ecdb_burn_data_do_burn(Ecdb_Page *page, Ecdb_Data_Project *proj); |
|
|
|
void _ecdb_burn_data_unmount_cb(void *data, void *reply_data, DBusError *err); |
|
|
|
|
|
|
|
static void |
|
|
|
_page_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *ev __UNUSED__) |
|
|
|
{ |
|
|
@ -139,9 +143,7 @@ _button_cb_begin(void *data, Evas_Object *obj __UNUSED__, |
|
|
|
{ |
|
|
|
Ecdb_Data_Project *proj; |
|
|
|
Ecdb_Page *page; |
|
|
|
char *buf; |
|
|
|
Ecdb_Burn_Result burn_result; |
|
|
|
int drive, speed, idx; |
|
|
|
int drive, speed; |
|
|
|
|
|
|
|
page = data; |
|
|
|
proj = evas_object_data_get(page->data, "proj"); |
|
|
@ -188,52 +190,16 @@ _button_cb_begin(void *data, Evas_Object *obj __UNUSED__, |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (!ecdb_aquire_drive(ECDB_PROJECT(proj))) |
|
|
|
if (!(ECDB_PROJECT(proj)->drive->status & ECDB_DISC_BLANK)) |
|
|
|
{ |
|
|
|
EINA_ERROR_PWARN("Couldn't grab drive!\n"); |
|
|
|
edje_object_part_text_set(page->data, "progress_text", |
|
|
|
"Couldn't grab the drive!"); |
|
|
|
return; |
|
|
|
ecdb_hal_request_unmount(ECDB_PROJECT(proj)->drive, |
|
|
|
_ecdb_burn_data_unmount_cb, |
|
|
|
page); |
|
|
|
} |
|
|
|
|
|
|
|
edje_object_part_text_set(page->data, "progress_text", "Commencing..."); |
|
|
|
|
|
|
|
burn_result = ecdb_burn_project(ECDB_BURN(proj), page); |
|
|
|
switch (burn_result) |
|
|
|
else |
|
|
|
{ |
|
|
|
case ECDB_ERROR_NONE: |
|
|
|
edje_object_signal_emit(page->gui, "ecdb,filelist,hide", "ecdb"); |
|
|
|
edje_object_signal_emit(page->data, "ecdb,burn_data,start", "ecdb"); |
|
|
|
Evas_Object *objs[] = {proj->capacity, proj->settings, |
|
|
|
proj->filelist_swallow, ECDB_BURN(proj)->speed_combo, |
|
|
|
ECDB_PROJECT(proj)->ret, ECDB_PROJECT(proj)->begin, |
|
|
|
NULL}; |
|
|
|
for (idx = 0; objs[idx] != NULL; idx++) |
|
|
|
{ |
|
|
|
edje_object_signal_emit(objs[idx], "ecdb,disable", "ecdb"); |
|
|
|
printf("disabling controls...\n"); |
|
|
|
} |
|
|
|
return; |
|
|
|
|
|
|
|
case ECDB_ERROR_IMAGE_CREATE: |
|
|
|
buf = "Invalid file!"; |
|
|
|
break; |
|
|
|
|
|
|
|
case ECDB_ERROR_SOURCE_ATTACH: |
|
|
|
buf = "Couldn't attach source data!"; |
|
|
|
break; |
|
|
|
|
|
|
|
case ECDB_ERROR_WRITE_MODE: |
|
|
|
buf = "No suitable burn mode!"; |
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
buf = "Unknown error :-("; |
|
|
|
_ecdb_burn_data_do_burn(page, proj); |
|
|
|
} |
|
|
|
|
|
|
|
edje_object_part_text_set(page->data, "progress_text", buf); |
|
|
|
burn_drive_release(ECDB_PROJECT(proj)->drive->tangible[0].drive, 0); |
|
|
|
burn_drive_info_free(ECDB_PROJECT(proj)->drive->tangible); |
|
|
|
} |
|
|
|
|
|
|
|
static void |
|
|
@ -755,3 +721,112 @@ ecdb_burn_data_cleanup(Ecdb_Page *page) |
|
|
|
src); |
|
|
|
} |
|
|
|
|
|
|
|
void |
|
|
|
_ecdb_burn_data_unmount_cb(void *data, void *reply_data __UNUSED__, |
|
|
|
DBusError *err) |
|
|
|
{ |
|
|
|
Ecdb_Data_Project *proj; |
|
|
|
Ecdb_Page *page; |
|
|
|
|
|
|
|
page = data; |
|
|
|
|
|
|
|
if (!page) |
|
|
|
{ |
|
|
|
EINA_ERROR_PWARN("NULL page!\n"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
proj = evas_object_data_get(page->data, "proj"); |
|
|
|
if (!proj) |
|
|
|
{ |
|
|
|
EINA_ERROR_PWARN("NULL project!\n"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (dbus_error_is_set(err)) |
|
|
|
{ |
|
|
|
if (!strcmp(err->name, "org.freedesktop.Hal.Device.Volume.NotMounted")) |
|
|
|
{ |
|
|
|
_ecdb_burn_data_do_burn(page, proj); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
edje_object_part_text_set(page->data, "progress_text", |
|
|
|
"Can not unmount drive!"); |
|
|
|
EINA_ERROR_PWARN("Unmount error:\n%s\n%s\n", err->name, err->message); |
|
|
|
} |
|
|
|
dbus_error_free(err); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
_ecdb_burn_data_do_burn(page, proj); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
static void |
|
|
|
_ecdb_burn_data_do_burn(Ecdb_Page *page, Ecdb_Data_Project *proj) |
|
|
|
{ |
|
|
|
char *buf; |
|
|
|
int idx; |
|
|
|
Ecdb_Burn_Result burn_result; |
|
|
|
|
|
|
|
if (!proj) |
|
|
|
{ |
|
|
|
EINA_ERROR_PWARN("NULL project!\n"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (!page) |
|
|
|
{ |
|
|
|
EINA_ERROR_PWARN("NULL page!\n"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (!ecdb_aquire_drive(ECDB_PROJECT(proj))) |
|
|
|
{ |
|
|
|
EINA_ERROR_PWARN("Couldn't grab drive!\n"); |
|
|
|
edje_object_part_text_set(page->data, "progress_text", |
|
|
|
"Couldn't grab the drive!"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
edje_object_part_text_set(page->data, "progress_text", "Commencing..."); |
|
|
|
|
|
|
|
burn_result = ecdb_burn_project(ECDB_BURN(proj), page); |
|
|
|
switch (burn_result) |
|
|
|
{ |
|
|
|
case ECDB_ERROR_NONE: |
|
|
|
edje_object_signal_emit(page->gui, "ecdb,filelist,hide", "ecdb"); |
|
|
|
edje_object_signal_emit(page->data, "ecdb,burn_data,start", "ecdb"); |
|
|
|
Evas_Object *objs[] = {proj->capacity, proj->settings, |
|
|
|
proj->filelist_swallow, ECDB_BURN(proj)->speed_combo, |
|
|
|
ECDB_PROJECT(proj)->ret, ECDB_PROJECT(proj)->begin, |
|
|
|
NULL}; |
|
|
|
for (idx = 0; objs[idx] != NULL; idx++) |
|
|
|
{ |
|
|
|
edje_object_signal_emit(objs[idx], "ecdb,disable", "ecdb"); |
|
|
|
printf("disabling controls...\n"); |
|
|
|
} |
|
|
|
return; |
|
|
|
|
|
|
|
case ECDB_ERROR_IMAGE_CREATE: |
|
|
|
buf = "Invalid file!"; |
|
|
|
break; |
|
|
|
|
|
|
|
case ECDB_ERROR_SOURCE_ATTACH: |
|
|
|
buf = "Couldn't attach source data!"; |
|
|
|
break; |
|
|
|
|
|
|
|
case ECDB_ERROR_WRITE_MODE: |
|
|
|
buf = "No suitable burn mode!"; |
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
buf = "Unknown error :-("; |
|
|
|
} |
|
|
|
|
|
|
|
edje_object_part_text_set(page->data, "progress_text", buf); |
|
|
|
burn_drive_release(ECDB_PROJECT(proj)->drive->tangible[0].drive, 0); |
|
|
|
burn_drive_info_free(ECDB_PROJECT(proj)->drive->tangible); |
|
|
|
} |
|
|
|
|