Lots of work... Add an entry widget (semi-broken), image burning now works, xdnd stuff.
This commit is contained in:
@@ -65,7 +65,7 @@ ecdb_burn_project_destroy(Ecdb_Burn_Project *proj)
|
||||
FREE(proj->abstract_id);
|
||||
FREE(proj->biblio_id);
|
||||
ecdb_project_destroy(ECDB_PROJECT(proj));
|
||||
free(proj);
|
||||
FREE(proj);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -87,6 +87,8 @@ ecdb_burn_project(Ecdb_Burn_Project *proj)
|
||||
return FALSE;
|
||||
}
|
||||
data->proj = ECDB_PROJECT(proj);
|
||||
data->sources = ecore_list_new();
|
||||
data->tracks = ecore_list_new();
|
||||
|
||||
if (proj->burn_mode != BURN_AUDIO)
|
||||
padding = 300*1024;
|
||||
@@ -102,14 +104,14 @@ ecdb_burn_project(Ecdb_Burn_Project *proj)
|
||||
if (!source)
|
||||
{
|
||||
printf("Failed to add any files to burn disc!\n");
|
||||
return FALSE;
|
||||
return ECDB_ERROR_IMAGE_CREATE;
|
||||
}
|
||||
|
||||
if (burn_track_set_source(track, source) != BURN_SOURCE_OK)
|
||||
{
|
||||
printf("Error: Cannot attach source object to track "
|
||||
"object!\n");
|
||||
return FALSE;
|
||||
return ECDB_ERROR_SOURCE_ATTACH;
|
||||
}
|
||||
|
||||
burn_session_add_track(data->session, track, BURN_POS_END);
|
||||
@@ -133,7 +135,7 @@ ecdb_burn_project(Ecdb_Burn_Project *proj)
|
||||
{
|
||||
printf("Error: Failed to find a suitable write mode for "
|
||||
"disc!\n");
|
||||
return FALSE;
|
||||
return ECDB_ERROR_WRITE_MODE;
|
||||
}
|
||||
|
||||
burn_disc_write(opts, data->disc);
|
||||
@@ -149,7 +151,7 @@ ecdb_burn_project(Ecdb_Burn_Project *proj)
|
||||
(ECDB_DRIVE_ACTION_FINISHED, ecdb_burn_finished,
|
||||
data);
|
||||
|
||||
return TRUE;
|
||||
return ECDB_ERROR_NONE;
|
||||
}
|
||||
|
||||
/* This function is pretty naive... Should probably update it at some time */
|
||||
@@ -191,9 +193,39 @@ ecdb_drive_progress_update(void *data)
|
||||
static void
|
||||
ecdb_burn_progress_handler(void *data, void *buffer, unsigned int nbyte)
|
||||
{
|
||||
BurnProgress *p = buffer;
|
||||
BurnProgress *p;
|
||||
Evas_Object *swallow;
|
||||
char buf[1024];
|
||||
static int last_sector = 0;
|
||||
|
||||
printf("Sector %d of %d\n", p->sector, p->sectors);
|
||||
if ((nbyte != sizeof(BurnProgress)) || (!strcmp((char *)buffer, "AC")))
|
||||
{
|
||||
ecore_event_add(ECDB_DRIVE_ACTION_FINISHED, NULL, NULL, NULL);
|
||||
last_sector = 0;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
p = buffer;
|
||||
}
|
||||
|
||||
|
||||
/* Libburn reports p->sector as being 0 right at the end of the job,
|
||||
* so store the last sector and use that to determine the proper
|
||||
* percentage/sector to set
|
||||
*/
|
||||
if (last_sector <= p->sector)
|
||||
last_sector = p->sector;
|
||||
else
|
||||
last_sector = p->sectors;
|
||||
|
||||
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
|
||||
"burn_image_page");
|
||||
snprintf(buf, sizeof(buf), "%d/%d", last_sector, p->sectors);
|
||||
edje_object_part_text_set(swallow, "progress_text", buf);
|
||||
snprintf(buf, sizeof(buf), "%d%%", (int)((double)(last_sector + 1) /
|
||||
(double)p->sectors * 100.0));
|
||||
edje_object_part_text_set(swallow, "progress_percent", buf);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -227,14 +259,18 @@ ecdb_burn_finished(void *data, int type, void *event)
|
||||
burn_drive_info_free(proj->proj->drive->tangible);
|
||||
printf("Burn Complete\n");
|
||||
|
||||
ecore_event_handler_del(ECDB_PROJECT(proj)->ev_handler);
|
||||
ecore_event_handler_del(proj->proj->ev_handler);
|
||||
|
||||
switch (proj->proj->type)
|
||||
{
|
||||
case ECDB_AUDIO_PROJECT:
|
||||
ecdb_audio_project_destroy(ECDB_AUDIO(proj->proj));
|
||||
break;
|
||||
default:
|
||||
ecdb_burn_project_destroy(ECDB_BURN(proj->proj));
|
||||
}
|
||||
FREE(proj);
|
||||
|
||||
/* To be removed from here at some point */
|
||||
Ecdb_Burn_Project *t;
|
||||
t = ECDB_BURN(proj->proj);
|
||||
FREE(t->files);
|
||||
FREE(t);
|
||||
FREE(proj);
|
||||
ecore_event_add(ECORE_EVENT_SIGNAL_EXIT, NULL, NULL, NULL);
|
||||
return TRUE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user