Make the erase have a percentage complete.
This commit is contained in:
parent
7b12247d36
commit
ae9c73f2b4
@ -159,7 +159,7 @@ group {
|
||||
|
||||
rel1 {
|
||||
to: "progress_outline";
|
||||
relative: 0.0 0.0;
|
||||
relative: 0.0 0.7;
|
||||
offset: 5 5;
|
||||
}
|
||||
|
||||
@ -185,6 +185,39 @@ group {
|
||||
}
|
||||
}
|
||||
|
||||
part {
|
||||
name: "progress_percent";
|
||||
type: TEXT;
|
||||
effect: SOFT_SHADOW;
|
||||
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
fixed: 1 1;
|
||||
color: 200 200 200 255;
|
||||
color3: 20 20 20 255;
|
||||
|
||||
rel1 {
|
||||
to: "progress_outline";
|
||||
relative: 0.0 0.0;
|
||||
offset: 5 5;
|
||||
}
|
||||
|
||||
rel2 {
|
||||
to: "progress_outline";
|
||||
relative: 1.0 0.7;
|
||||
offset: -6 -6;
|
||||
}
|
||||
|
||||
text {
|
||||
text: "0%";
|
||||
font: "ecdb/default";
|
||||
min: 1 1;
|
||||
size: 72;
|
||||
align: 0.5 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
part {
|
||||
name: "disabled_hack";
|
||||
type: RECT;
|
||||
|
@ -178,7 +178,7 @@ ecdb_drive_progress_update(void *data)
|
||||
stat = burn_drive_get_status(drive, &p);
|
||||
if (stat == BURN_DRIVE_SPAWNING)
|
||||
{
|
||||
sleep(1);
|
||||
usleep(100000);
|
||||
continue;
|
||||
}
|
||||
else if (stat == BURN_DRIVE_IDLE)
|
||||
@ -192,7 +192,7 @@ ecdb_drive_progress_update(void *data)
|
||||
}
|
||||
|
||||
ecore_pipe_write(proj->pipe, &p, sizeof(p));
|
||||
sleep(1);
|
||||
usleep(100000);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -95,24 +95,36 @@ ecdb_erase_progress_handler(void *data, void *buffer, unsigned int nbyte)
|
||||
BurnProgress *p;
|
||||
Evas_Object *swallow;
|
||||
char buf[1024];
|
||||
char *text = buffer;
|
||||
static int last_sector = 0;
|
||||
|
||||
if ((nbyte != sizeof(BurnProgress)) || (!strcmp(text, "AC")))
|
||||
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;
|
||||
text = NULL;
|
||||
}
|
||||
|
||||
|
||||
/* 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),
|
||||
"erase_page");
|
||||
snprintf(buf, sizeof(buf), "%d/%d", p->sector, p->sectors);
|
||||
printf("buf: %s\n", buf);
|
||||
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
|
||||
|
@ -356,6 +356,9 @@ ecdb_cb_erase_page_buttons_clicked(void *data, Evas_Object *o,
|
||||
{
|
||||
char *signal;
|
||||
|
||||
edje_object_part_text_set(swallow, "progress_text",
|
||||
"Begin Erase");
|
||||
edje_object_part_text_set(swallow, "progress_percent", "0%");
|
||||
signal = evas_object_data_get(swallow, "hide_signal");
|
||||
edje_object_signal_emit(swallow, signal, "ecdb");
|
||||
ecdb_welcome_page_show();
|
||||
|
Loading…
Reference in New Issue
Block a user