Some small fixes, and a little polishing of erase function.
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
#include "ecdb.h"
|
||||
|
||||
int ecdb_erase_project_init(Ecdb_Erase_Project *proj);
|
||||
static void ecdb_erase_progress_handler(void *data, void *buffer, int nbyte);
|
||||
static void ecdb_erase_progress_handler(void *data, void *buffer,
|
||||
unsigned int nbyte);
|
||||
int ecdb_erase_finished(void *data, int type, void *event);
|
||||
|
||||
Ecdb_Erase_Project *
|
||||
ecdb_erase_project_new(void)
|
||||
@@ -76,6 +78,9 @@ ecdb_erase_disc(Ecdb_Erase_Project *proj)
|
||||
pthread_create(&progress_update, NULL,
|
||||
ecdb_drive_progress_update, proj);
|
||||
pthread_detach(progress_update);
|
||||
ECDB_PROJECT(proj)->ev_handler = ecore_event_handler_add
|
||||
(ECDB_DRIVE_ACTION_FINISHED,
|
||||
ecdb_erase_finished, proj);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
@@ -86,14 +91,38 @@ ecdb_erase_disc(Ecdb_Erase_Project *proj)
|
||||
}
|
||||
|
||||
static void
|
||||
ecdb_erase_progress_handler(void *data, void *buffer, int nbyte)
|
||||
ecdb_erase_progress_handler(void *data, void *buffer, unsigned int nbyte)
|
||||
{
|
||||
BurnProgress *p = buffer;
|
||||
Evas_Object *swallow;
|
||||
char buf[1024];
|
||||
|
||||
// Is this correct?
|
||||
if (p->sector >= p->sectors)
|
||||
{
|
||||
ecore_event_add(ECDB_DRIVE_ACTION_FINISHED, NULL, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
int
|
||||
ecdb_erase_finished(void *data, int type, void *event)
|
||||
{
|
||||
Ecdb_Erase_Project *proj;
|
||||
|
||||
proj = data;
|
||||
|
||||
burn_drive_release(ECDB_PROJECT(proj)->drive->tangible[0].drive, 0);
|
||||
burn_drive_info_free(ECDB_PROJECT(proj)->drive->tangible);
|
||||
ecore_event_handler_del(ECDB_PROJECT(proj)->ev_handler);
|
||||
ecdb_erase_project_destroy(proj);
|
||||
ecdb_gui_erase_cleanup();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user