* e_fm_op_registry : rename duration to eta

* e_fm_op : report sizes (done and total) now refer to the whole task, not the single file
 * e_fwin : better operation monitor label (and add a delay on delete)



SVN revision: 39787
devs/princeamd/enlightenment-0.17-elive
Davide Andreoli 14 years ago
parent f9b373fe0e
commit 44883d6cf0
  1. 6
      src/bin/e_fm.c
  2. 2
      src/bin/e_fm_op.c
  3. 2
      src/bin/e_fm_op_registry.h
  4. 41
      src/modules/fileman/e_fwin.c

@ -613,11 +613,11 @@ _e_fm2_op_registry_entry_print(const E_Fm2_Op_Registry_Entry *ere)
status = status_strings[0];
printf("id: %8d, op: %2d [%s] finished: %hhu, needs_attention: %hhu\n"
" %3d%% (%8zd/%8zd), time: %10.0f + %5ds, xwin: %#x\n"
" %3d%% (%8zd/%8zd), start_time: %10.0f, eta: %5ds, xwin: %#x\n"
" src=[%s]\n"
" dst=[%s]\n",
ere->id, ere->op, status, ere->finished, ere->needs_attention,
ere->percent, ere->done, ere->total, ere->start_time, ere->duration,
ere->percent, ere->done, ere->total, ere->start_time, ere->eta,
e_fm2_op_registry_entry_xwin_get(ere),
ere->src, ere->dst);
}
@ -2952,7 +2952,7 @@ e_fm2_client_data(Ecore_Ipc_Event_Client_Data *e)
ere->percent = percent;
ere->done = done;
ere->total = total;
ere->duration = seconds;
ere->eta = seconds;
e_fm2_op_registry_entry_files_set(ere, src, dst);
if (ere->percent == 100)
{

@ -998,7 +998,7 @@ _e_fm_op_update_progress(E_Fm_Op_Task *task, long long _plus_e_fm_op_done, long
peta = eta;
ptask = task;
_e_fm_op_update_progress_report(percent, eta, ctime - stime,
task->dst.done, task->src.st.st_size,
_e_fm_op_done, _e_fm_op_total,
task->src.name, task->dst.name);
}
}

@ -28,7 +28,7 @@ struct _E_Fm2_Op_Registry_Entry
const char *src; /* stringshared */
const char *dst; /* stringshared */
double start_time;
int duration; /* XXX use double? */
int eta; /* XXX use double? */
E_Fm_Op_Type op;
E_Fm2_Op_Status status;
Eina_Bool needs_attention:1;

@ -319,42 +319,46 @@ e_fwin_zone_find(E_Zone *zone)
/* e_fm_op_registry */
static void
_e_fwin_op_registry_listener_cb(void *data, const E_Fm2_Op_Registry_Entry *ere)
{
Evas_Object *o = data;
char buf[PATH_MAX];
char *done, *total;
char *total;
// Update element
edje_object_part_drag_size_set(o, "e.gauge.bar", ((double)(ere->percent)) / 100, 1.0);
done = e_util_size_string_get(ere->done);
total = e_util_size_string_get(ere->total);
switch (ere->op)
{
case E_FM_OP_COPY:
edje_object_signal_emit(o, "e,action,icon,copy", "e");
if (ere->finished)
snprintf(buf, sizeof(buf), "Copy of %s complete", total, done);
snprintf(buf, sizeof(buf), "Copy of %s done", total);
else
snprintf(buf, sizeof(buf), "Copying %s (done %s)", total, done);
snprintf(buf, sizeof(buf), "Copying %s (eta: %d sec)", total, ere->eta);
break;
case E_FM_OP_MOVE:
edje_object_signal_emit(o, "e,action,icon,move", "e");
snprintf(buf, sizeof(buf), "Moving %s (done %s)", total, done);
if (ere->finished)
snprintf(buf, sizeof(buf), "Move of %s done", total);
else
snprintf(buf, sizeof(buf), "Moving %s (eta: %d sec)", total, ere->eta);
break;
case E_FM_OP_REMOVE:
edje_object_signal_emit(o, "e,action,icon,delete", "e");
snprintf(buf, sizeof(buf), "Deleting %s (done %s)", total, done);
if (ere->finished)
snprintf(buf, sizeof(buf), "Delete done");
else
snprintf(buf, sizeof(buf), "Deleting %s (eta: %d sec", total, ere->eta);
break;
default:
edje_object_signal_emit(o, "e,action,icon,unknow", "e");
snprintf(buf, sizeof(buf), "Unknow operation :/ (slave #%d)", ere->id);
snprintf(buf, sizeof(buf), "Unknow operation from slave %d)", ere->id);
break;
}
edje_object_part_text_set(o, "e.text.label1", buf);
if (ere->needs_attention)
@ -362,13 +366,20 @@ _e_fwin_op_registry_listener_cb(void *data, const E_Fm2_Op_Registry_Entry *ere)
else
edje_object_signal_emit(o, "e,action,set,normal", "e");
E_FREE(done);
E_FREE(total);
}
void _e_fwin_op_registry_free_data(void *data)
static int
_e_fwin_op_registry_free_data_delayed(void *data)
{
evas_object_del((Evas_Object*)data);
return ECORE_CALLBACK_CANCEL;
}
static void
_e_fwin_op_registry_free_data(void *data)
{
ecore_timer_add(5.0, _e_fwin_op_registry_free_data_delayed, data);
}
static int
@ -379,7 +390,8 @@ _e_fwin_op_registry_entry_add_cb(void *data, int type, void *event)
Evas_Object *o;
int mw, mh;
if (!(ere->op == E_FM_OP_COPY || ere->op == E_FM_OP_MOVE))
if (!(ere->op == E_FM_OP_COPY || ere->op == E_FM_OP_MOVE ||
ere->op == E_FM_OP_REMOVE))
return ECORE_CALLBACK_RENEW;
o = edje_object_add(e_win_evas_get(fwin->win));
@ -389,12 +401,15 @@ _e_fwin_op_registry_entry_add_cb(void *data, int type, void *event)
evas_object_resize(o, mw * e_scale, mh * e_scale);
//evas_object_event_callback_add(o, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
// _size_hint_changed_cb, NULL);
evas_object_show(o);
//Update the element
_e_fwin_op_registry_listener_cb(o, ere);
// Append the element to the box
edje_object_part_box_append(e_scrollframe_edje_object_get(fwin->scrollframe_obj),
"e.box.operations", o);
evas_object_size_hint_align_set(o, 1.0, 1.0); //FIXME this should be theme-configurable
evas_object_show(o);
//Listen to progress changes
e_fm2_op_registry_entry_listener_add(ere, _e_fwin_op_registry_listener_cb,

Loading…
Cancel
Save