Use known data for burning disc initialization, helps to not block the interface.
This commit is contained in:
@@ -62,7 +62,7 @@ _button_cb_begin(void *data, Evas_Object *obj __UNUSED__,
|
||||
Ecdb_Image_Project *proj;
|
||||
Ecdb_Page *page;
|
||||
Ecdb_Source *iso_file;
|
||||
char *file, buf[1024];
|
||||
char *file, *buf;
|
||||
Ecdb_Burn_Result burn_result;
|
||||
int drive, speed, idx;
|
||||
|
||||
@@ -100,9 +100,31 @@ _button_cb_begin(void *data, Evas_Object *obj __UNUSED__,
|
||||
else
|
||||
ECDB_BURN(proj)->speed = speed;
|
||||
|
||||
snprintf(buf, sizeof(buf), "Commencing...");
|
||||
edje_object_part_text_set(page->image, "progress_text", buf);
|
||||
if (!ecdb_aquire_drive(ECDB_PROJECT(proj), drive))
|
||||
if (!ecdb_set_project_drive(ECDB_PROJECT(proj), drive))
|
||||
{
|
||||
EINA_ERROR_PWARN("Drive index doesn't exist!\n");
|
||||
edje_object_part_text_set(page->image, "progress_text",
|
||||
"Drive index doesn't exist!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ECDB_PROJECT(proj)->drive->fresh_info)
|
||||
{
|
||||
EINA_ERROR_PDBG("Insert a disc into the drive!\n");
|
||||
edje_object_part_text_set(page->image, "progress_text",
|
||||
"Insert a disc into the drive!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(ECDB_PROJECT(proj)->drive->status & ECDB_DISC_BLANK))
|
||||
{
|
||||
EINA_ERROR_PDBG("Insert a blank disc!\n");
|
||||
edje_object_part_text_set(page->image, "progress_text",
|
||||
"Insert a blank disc!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ecdb_aquire_drive(ECDB_PROJECT(proj)))
|
||||
{
|
||||
EINA_ERROR_PWARN("Couldn't grab drive!\n");
|
||||
edje_object_part_text_set(page->image, "progress_text",
|
||||
@@ -110,6 +132,7 @@ _button_cb_begin(void *data, Evas_Object *obj __UNUSED__,
|
||||
return;
|
||||
}
|
||||
|
||||
edje_object_part_text_set(page->image, "progress_text", "Commencing...");
|
||||
burn_result = ecdb_burn_project(ECDB_BURN(proj), page);
|
||||
switch (burn_result)
|
||||
{
|
||||
@@ -124,23 +147,23 @@ _button_cb_begin(void *data, Evas_Object *obj __UNUSED__,
|
||||
return;
|
||||
|
||||
case ECDB_ERROR_IMAGE_CREATE:
|
||||
snprintf(buf, sizeof(buf), "Invalid file!");
|
||||
buf = "Invalid file!";
|
||||
break;
|
||||
|
||||
case ECDB_ERROR_SOURCE_ATTACH:
|
||||
snprintf(buf, sizeof(buf), "Couldn't attach source data!");
|
||||
buf = "Couldn't attach source data!";
|
||||
break;
|
||||
|
||||
case ECDB_ERROR_WRITE_MODE:
|
||||
snprintf(buf, sizeof(buf), "No suitable burn mode!");
|
||||
buf = "No suitable burn mode!";
|
||||
break;
|
||||
|
||||
default:
|
||||
snprintf(buf, sizeof(buf), "Unknown error :-(");
|
||||
buf = "Unknown error :-(";
|
||||
}
|
||||
|
||||
edje_object_part_text_set(page->image, "progress_text", buf);
|
||||
burn_drive_release(ECDB_PROJECT(proj)->drive->tangible[0].drive, 1);
|
||||
burn_drive_release(ECDB_PROJECT(proj)->drive->tangible[0].drive, 0);
|
||||
burn_drive_info_free(ECDB_PROJECT(proj)->drive->tangible);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user