List of changes:

1. Gadcon sities:
      -- 'E_Gadcon_Site' enum to list all available sities,
      -- added 'is_site' callback for distinguish gadcon sities,
      -- 'e_gadcon_site_is_*' helpers written to use in gadget modules,
      -- gadcon config dialogs modified to show only gadgets that appropriate
         to selected gadcon site,
      -- all gadget modules updated for using new callback.
      
      When callback is not provided in module, then gadget can be used in 
      any gadcon site.
      
   2. Filemanager:
      -- added error icon to unexisting path dialog,
      -- added callback 'func.abort' to 'E_Fm2_Op_Registry_Entry' to specify
         abort operation sequence (if not provided, then operation is not
         cancelable),
      -- added parameter to 'e_fm2_op_registry_entry_add' to specify abort
         method on construct 'E_Fm2_Op_Registry_Entry' or make non-cancelable
         operation if this function is not provided,
      -- added 'e_fm2_operation_abort' call to cancel efm2 operation,
      -- added method '_e_fm2_operation_abort_internal' that represent efm2
         default handler of operation cancelling,
      -- 'done' and 'total' fields of 'E_Fm2_Op_Registry_Entry' changed to
         off_t type, also all message handlers modified to work with it
         (to show progress for large files correctly),
      -- improved file operation progress processing,
      -- added cancel button to operation progress gadget in filemanager window,
      -- added delete file glyph to operation progress gadget,
      -- improved status message for efm2 operation progress.

   3. Filemanager slave:
      -- fixed critical bug in message handling via stdin/stdout,
      -- fixed critical bug in removing task from list,
      -- improved 'E_FM_OP_ABORT' handling,
      -- fix rollback counting on moving files.

   4. Fileman_opinfo module:
      -- a new theme writed: status string and gadget for view operation status
         in summary and detail modes,
      -- summary mode: operation glyph, state message, progressbar, abort button,
      -- detail mode: all for summary + from filename, to filename,
      -- summary/detailed button works as trigger,
      -- added source of module theme and used images.
      
   4. Pathbar module:
      -- non-critical fix, just for safety.

   Also patch contains several minor updates to serve main task.


SVN revision: 41224
devs/princeamd/enlightenment-0.17-elive
semernin 14 years ago committed by semernin
parent ff7db5ee54
commit 2f76dd5d99
  1. 137
      data/themes/default.edc
  2. BIN
      data/themes/images/icon_efm_file_del.png
  3. 61
      src/bin/e_fm.c
  4. 2
      src/bin/e_fm.h
  5. 12
      src/bin/e_fm_main.c
  6. 20
      src/bin/e_fm_op.c
  7. 12
      src/bin/e_fm_op_registry.c
  8. 15
      src/bin/e_fm_op_registry.h
  9. 46
      src/bin/e_gadcon.c
  10. 20
      src/bin/e_gadcon.h
  11. 40
      src/bin/e_int_gadcon_config.c
  12. 2
      src/modules/battery/e_mod_main.c
  13. 2
      src/modules/clock/e_mod_main.c
  14. 3
      src/modules/conf/e_mod_main.c
  15. 3
      src/modules/connman/e_mod_main.c
  16. 2
      src/modules/cpufreq/e_mod_main.c
  17. 82
      src/modules/fileman/e_fwin.c
  18. BIN
      src/modules/fileman_opinfo/e-module-fileman_opinfo.edj
  19. 360
      src/modules/fileman_opinfo/e_mod_main.c
  20. 2
      src/modules/gadman/e_mod_config.c
  21. 3
      src/modules/ibar/e_mod_main.c
  22. 3
      src/modules/ibox/e_mod_main.c
  23. 3
      src/modules/illume/e_mod_gad_bluetooth.c
  24. 3
      src/modules/illume/e_mod_gad_gsm.c
  25. 3
      src/modules/illume/e_mod_gad_usb.c
  26. 3
      src/modules/illume/e_mod_gad_wifi.c
  27. 5
      src/modules/mixer/e_mod_main.c
  28. 3
      src/modules/pager/e_mod_main.c
  29. 3
      src/modules/start/e_mod_main.c
  30. 5
      src/modules/systray/e_mod_main.c
  31. 3
      src/modules/temperature/e_mod_main.c

@ -11881,6 +11881,9 @@ collections { /* begin the collection of edje groups that are in this file */
}
group { name: "e/fileman/default/progress";
min: 250 40;
images {
image: "icon_efm_file_del.png" COMP;
}
parts {
part { name: "bg";
type: IMAGE;
@ -11910,7 +11913,7 @@ collections { /* begin the collection of edje groups that are in this file */
description { state: "default" 0.0;
min: 32 32;
max: 32 32;
align: 0.02 0.5;
align: 0.01 0.5;
rel1.to: "bg";
rel2.to: "bg";
image.normal: "icon_efm_dnd_ask.png";
@ -11923,6 +11926,10 @@ collections { /* begin the collection of edje groups that are in this file */
inherit: "default" 0.0;
image.normal: "icon_efm_dnd_move.png";
}
description { state: "delete" 0.0;
inherit: "default" 0.0;
image.normal: "icon_efm_file_del.png";
}
}
part { name: "gauge_bg";
type: IMAGE;
@ -11964,15 +11971,21 @@ collections { /* begin the collection of edje groups that are in this file */
confine:"gauge_confine";
}
}
part { name: "e.text.label1";
part { name: "e.text.info";
type: TEXT;
mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
rel1.to: "icon";
rel1.relative: 1.0 0.0;
rel2.to: "bg";
rel2.relative: 1.0 0.6;
rel1 {
relative: 1.0 0.0;
to_x: "icon";
to_y: "bg";
}
rel2 {
relative: 0.0 0.6;
to_x: "bt_abort";
to_y: "icon";
}
color: 0 0 0 255;
text {
font: "Sans";
@ -11982,26 +11995,73 @@ collections { /* begin the collection of edje groups that are in this file */
}
}
}
//~ part { name: "e.text.label2";
//~ type: TEXT;
//~ mouse_events: 0;
//~ scale: 1;
//~ description { state: "default" 0.0;
//~ align: 0.5 0.0;
//~ rel1.to: "e.text.label1";
//~ rel1.relative: 0.0 1.3;
//~ //rel1.offset: 5 0;
//~ rel2.to: "e.text.label1";
//~ rel2.relative: 1.0 3.0;
//~ color: 0 0 0 255;
//~ text {
//~ font: "Sans";
//~ size: 9;
//~ min: 1 0;
//~ align: 0.0 1.0;
//~ }
//~ }
//~ }
part { name: "bt_abort";
type: IMAGE;
mouse_events: 0;
description { state: "default" 0.0;
align: 1.0 0.5;
min: 19 19;
max: 19 19;
aspect: 1.0 1.0;
aspect_preference: VERTICAL;
rel1 {
relative: 1.0 0.0;
to_x: "e.text.info";
to_y: "bg";
}
rel2 {
relative: 0.99 1.0;
to_x: "bg";
to_y: "e.text.info";
}
image.normal: "bd_button_close_shadow.png";
}
}
part { name: "bt_abort_unfoc";
type: IMAGE;
mouse_events: 0;
description { state: "default" 0.0;
visible: 1;
color: 255 255 255 255;
rel1.to: "bt_abort";
rel2.to: "bt_abort";
image.normal: "bd_button_close_unfocused.png";
}
description { state: "active" 0.0;
inherit: "default" 0.0;
visible: 0;
color: 255 255 255 0;
rel1.offset: 0 1;
rel2.offset: -1 0;
}
}
part { name: "bt_abort_foc";
type: IMAGE;
mouse_events: 0;
description { state: "default" 0.0;
visible: 0;
color: 255 255 255 0;
rel1.to: "bt_abort";
rel2.to: "bt_abort";
image.normal: "bd_button_close_focused.png";
}
description { state: "active" 0.0;
inherit: "default" 0.0;
visible: 1;
color: 255 255 255 255;
rel1.offset: 0 1;
rel2.offset: -1 0;
}
}
part { name: "e.event.abort";
type: RECT;
mouse_events: 1;
description { state: "default" 0.0;
rel1.to: "bt_abort";
rel2.to: "bt_abort";
color: 0 0 0 0;
}
}
}
programs {
program { name: "set_need_attention";
@ -12043,6 +12103,31 @@ collections { /* begin the collection of edje groups that are in this file */
action: STATE_SET "move" 0.0;
target: "icon";
}
program { name: "set_icon_delete";
signal: "e,action,icon,delete";
source: "e";
action: STATE_SET "delete" 0.0;
target: "icon";
}
program { name: "bt_abort_down";
signal: "mouse,down,*";
source: "e.event.abort";
action: STATE_SET "active" 0.0;
target: "bt_abort_unfoc";
target: "bt_abort_foc";
}
program { name: "bt_abort_up";
signal: "mouse,up,*";
source: "e.event.abort";
action: STATE_SET "default" 0.0;
target: "bt_abort_unfoc";
target: "bt_abort_foc";
}
program { name: "bt_abort_click";
signal: "mouse,clicked,*";
source: "e.event.abort";
action: SIGNAL_EMIT "e,fm,operation,abort" "";
}
}
}
group { name: "e/fileman/default/scrollframe";

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

@ -419,6 +419,8 @@ static void _e_fm2_volume_eject(void *data, E_Menu *m, E_Menu_Item *mi);
static void _e_fm2_icon_removable_update(E_Fm2_Icon *ic);
static void _e_fm2_volume_icon_update(E_Volume *v);
static void _e_fm2_operation_abort_internal(E_Fm2_Op_Registry_Entry *ere);
static char *_e_fm2_meta_path = NULL;
static Evas_Smart *_e_fm2_smart = NULL;
static Eina_List *_e_fm2_list = NULL;
@ -630,7 +632,7 @@ _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), start_time: %10.0f, eta: %5ds, xwin: %#x\n"
" %3d%% (%lld/%lld), 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,
@ -933,6 +935,7 @@ e_fm2_path_set(Evas_Object *obj, const char *dev, const char *path)
e_dialog_button_add(dialog, _("Close"), NULL, NULL, dialog);
e_dialog_button_focus_num(dialog, 0);
e_dialog_title_set(dialog, _("Nonexistent path"));
e_dialog_icon_set(dialog, "dialog-error", 64);
snprintf(text, sizeof(text),
_("%s doesn't exist."),
@ -2463,7 +2466,7 @@ static int
_e_fm_client_file_del(const char *files, Evas_Object *e_fm)
{
int id = _e_fm_client_send_new(E_FM_OP_REMOVE, (void *)files, strlen(files) + 1);
e_fm2_op_registry_entry_add(id, e_fm, E_FM_OP_REMOVE);
e_fm2_op_registry_entry_add(id, e_fm, E_FM_OP_REMOVE, _e_fm2_operation_abort_internal);
return id;
}
@ -2471,7 +2474,7 @@ static int
_e_fm2_client_file_trash(const char *path, Evas_Object *e_fm)
{
int id = _e_fm_client_send_new(E_FM_OP_TRASH, (void *)path, strlen(path) + 1);
e_fm2_op_registry_entry_add(id, e_fm, E_FM_OP_TRASH);
e_fm2_op_registry_entry_add(id, e_fm, E_FM_OP_TRASH, _e_fm2_operation_abort_internal);
return id;
}
@ -2492,7 +2495,7 @@ _e_fm2_client_file_mkdir(const char *path, const char *rel, int rel_to, int x, i
memcpy(d + l1 + 1 + l2 + 1 + (2 * sizeof(int)), &y, sizeof(int));
id = _e_fm_client_send_new(E_FM_OP_MKDIR, (void *)d, l);
e_fm2_op_registry_entry_add(id, e_fm, E_FM_OP_MKDIR);
e_fm2_op_registry_entry_add(id, e_fm, E_FM_OP_MKDIR, _e_fm2_operation_abort_internal);
return id;
}
@ -2500,7 +2503,7 @@ static int
_e_fm_client_file_move(const char *args, Evas_Object *e_fm)
{
int id = _e_fm_client_send_new(E_FM_OP_MOVE, (void *)args, strlen(args) + 1);
e_fm2_op_registry_entry_add(id, e_fm, E_FM_OP_MOVE);
e_fm2_op_registry_entry_add(id, e_fm, E_FM_OP_MOVE, _e_fm2_operation_abort_internal);
return id;
}
@ -2543,7 +2546,7 @@ _e_fm2_client_file_symlink(const char *path, const char *dest, const char *rel,
}
id = _e_fm_client_send_new(E_FM_OP_SYMLINK, (void *)d, l);
e_fm2_op_registry_entry_add(id, e_fm, E_FM_OP_SYMLINK);
e_fm2_op_registry_entry_add(id, e_fm, E_FM_OP_SYMLINK, _e_fm2_operation_abort_internal);
return id;
#else
char *args = NULL;
@ -2564,7 +2567,7 @@ static int
_e_fm_client_file_copy(const char *args, Evas_Object *e_fm)
{
int id = _e_fm_client_send_new(E_FM_OP_COPY, (void *)args, strlen(args) + 1);
e_fm2_op_registry_entry_add(id, e_fm, E_FM_OP_COPY);
e_fm2_op_registry_entry_add(id, e_fm, E_FM_OP_COPY, _e_fm2_operation_abort_internal);
return id;
}
@ -2572,7 +2575,7 @@ static int
_e_fm_client_file_symlink(const char *args, Evas_Object *e_fm)
{
int id = _e_fm_client_send_new(E_FM_OP_SYMLINK, (void *)args, strlen(args) + 1);
e_fm2_op_registry_entry_add(id, e_fm, E_FM_OP_SYMLINK);
e_fm2_op_registry_entry_add(id, e_fm, E_FM_OP_SYMLINK, _e_fm2_operation_abort_internal);
return id;
}
@ -3085,7 +3088,7 @@ e_fm2_client_data(Ecore_Ipc_Event_Client_Data *e)
case E_FM_OP_PROGRESS:/*progress*/
{
int percent, seconds;
size_t done, total;
off_t done, total;
char *src = NULL;
char *dst = NULL;
void *p = e->data;
@ -3095,8 +3098,8 @@ e_fm2_client_data(Ecore_Ipc_Event_Client_Data *e)
#define UP(value, type) (value) = *(type *)p; p += sizeof(type)
UP(percent, int);
UP(seconds, int);
UP(done, size_t);
UP(total, size_t);
UP(done, off_t);
UP(total, off_t);
#undef UP
src = p;
dst = p + strlen(src) + 1;
@ -3119,8 +3122,17 @@ e_fm2_client_data(Ecore_Ipc_Event_Client_Data *e)
break;
case E_FM_OP_QUIT:/*finished*/
e_fm2_op_registry_entry_del(e->ref);
break;
{
E_Fm2_Op_Registry_Entry *ere = e_fm2_op_registry_entry_get(e->ref);
if (ere)
{
ere->finished = 1;
ere->eta = 0;
e_fm2_op_registry_entry_changed(ere);
}
e_fm2_op_registry_entry_del(e->ref);
}
break;
default:
break;
@ -9803,3 +9815,26 @@ _e_fm2_icon_removable_update(E_Fm2_Icon *ic)
v = e_fm2_hal_volume_find(ic->info.link);
_update_volume_icon(v, ic);
}
static void
_e_fm2_operation_abort_internal(E_Fm2_Op_Registry_Entry *ere)
{
ere->status = E_FM2_OP_STATUS_ABORTED;
ere->finished = 1;
ere->needs_attention = 0;
e_fm2_op_registry_entry_changed(ere);
_e_fm_client_send(E_FM_OP_ABORT, ere->id, NULL, 0);
}
EAPI void
e_fm2_operation_abort(int id)
{
E_Fm2_Op_Registry_Entry *ere;
ere = e_fm2_op_registry_entry_get(id);
if (!ere) return;
e_fm2_op_registry_entry_ref(ere);
e_fm2_op_registry_entry_abort(ere);
e_fm2_op_registry_entry_unref(ere);
}

@ -168,6 +168,8 @@ EAPI void e_fm2_pan_child_size_get(Evas_Object *obj, Evas_Coord
EAPI void e_fm2_all_icons_update(void);
EAPI void e_fm2_operation_abort(int id);
EAPI Evas_Object *
e_fm2_icon_get(Evas *evas, E_Fm2_Icon *ic,
void (*gen_func) (void *data, Evas_Object *obj, void *event_info),

@ -1639,6 +1639,13 @@ _e_ipc_cb_server_data(void *data, int type, void *event)
}
}
break;
case E_FM_OP_ABORT: // abort copy/move/delete operation by user
{
E_Fm_Slave *slave = _e_fm_slave_get(e->ref);
if (slave)
_e_fm_slave_send(slave, e->minor, NULL, 0);
}
break;
case E_FM_OP_ERROR_RESPONSE_IGNORE_THIS:
case E_FM_OP_ERROR_RESPONSE_IGNORE_ALL:
case E_FM_OP_ERROR_RESPONSE_ABORT:
@ -1777,8 +1784,8 @@ static int _e_fm_slave_data_cb(void *data, int type, void *event)
sdata = e->data;
ssize = e->size;
while (ssize)
{
while (ssize >= 3 * sizeof(int))
{
memcpy(&magic, sdata, sizeof(int));
memcpy(&id, sdata + sizeof(int), sizeof(int));
memcpy(&size, sdata + sizeof(int) + sizeof(int), sizeof(int));
@ -1786,6 +1793,7 @@ static int _e_fm_slave_data_cb(void *data, int type, void *event)
if (magic != E_FM_OP_MAGIC)
{
printf("%s:%s(%d) Wrong magic number from slave #%d. ", __FILE__, __FUNCTION__, __LINE__, slave->id);
break;
}
sdata += 3 * sizeof(int);

@ -52,7 +52,7 @@ static int _e_fm_op_scan_idler(void *data);
static void _e_fm_op_send_error(E_Fm_Op_Task * task, E_Fm_Op_Type type, const char *fmt, ...);
static void _e_fm_op_rollback(E_Fm_Op_Task * task);
static void _e_fm_op_update_progress_report_simple(int percent, const char *src, const char *dst);
static void _e_fm_op_update_progress(E_Fm_Op_Task *task, long long _plus_e_fm_op_done, long long _plus_e_fm_op_total);
static void _e_fm_op_update_progress(E_Fm_Op_Task *task, off_t _plus_e_fm_op_done, off_t _plus_e_fm_op_total);
static void _e_fm_op_copy_stat_info(E_Fm_Op_Task *task);
static int _e_fm_op_handle_overwrite(E_Fm_Op_Task *task);
@ -73,7 +73,7 @@ Ecore_Fd_Handler *_e_fm_op_stdin_handler = NULL;
Eina_List *_e_fm_op_work_queue = NULL, *_e_fm_op_scan_queue = NULL;
Ecore_Idler *_e_fm_op_work_idler_p = NULL, *_e_fm_op_scan_idler_p = NULL;
long long _e_fm_op_done, _e_fm_op_total; /* Type long long should be 64 bits wide everywhere,
off_t _e_fm_op_done, _e_fm_op_total; /* Type long long should be 64 bits wide everywhere,
this means that it's max value is 2^63 - 1, which
is 8 388 608 terabytes, and this should be enough.
Well, we'll be multipling _e_fm_op_done by 100, but
@ -370,11 +370,14 @@ _e_fm_op_task_free(void *t)
static void
_e_fm_op_remove_link_task(E_Fm_Op_Task *task)
{
E_Fm_Op_Task *ltask;
if (task->link)
{
ltask = eina_list_data_get(task->link);
_e_fm_op_work_queue =
eina_list_remove_list(_e_fm_op_work_queue, task->link);
_e_fm_op_task_free(task->link);
_e_fm_op_task_free(ltask);
task->link = NULL;
}
}
@ -892,13 +895,14 @@ _e_fm_op_rollback(E_Fm_Op_Task *task)
}
if (task->type == E_FM_OP_COPY)
_e_fm_op_update_progress(task, -task->dst.done, -task->src.st.st_size);
_e_fm_op_update_progress(task, -task->dst.done,
-task->src.st.st_size - (task->link ? REMOVECHUNKSIZE : 0));
else
_e_fm_op_update_progress(task, -REMOVECHUNKSIZE, -REMOVECHUNKSIZE);
}
static void
_e_fm_op_update_progress_report(int percent, int eta, double elapsed, size_t done, size_t total, const char *src, const char *dst)
_e_fm_op_update_progress_report(int percent, int eta, double elapsed, off_t done, off_t total, const char *src, const char *dst)
{
const int magic = E_FM_OP_MAGIC;
const int id = E_FM_OP_PROGRESS;
@ -908,7 +912,7 @@ _e_fm_op_update_progress_report(int percent, int eta, double elapsed, size_t don
src_len = strlen(src);
dst_len = strlen(dst);
size = 2 * sizeof(int) + 2 * sizeof(size_t) + src_len + 1 + dst_len + 1;
size = 2 * sizeof(int) + 2 * sizeof(off_t) + src_len + 1 + dst_len + 1;
data = alloca(3 * sizeof(int) + size);
if (!data) return;
p = data;
@ -921,7 +925,7 @@ _e_fm_op_update_progress_report(int percent, int eta, double elapsed, size_t don
P(eta);
#undef P
#define P(value) memcpy(p, &(value), sizeof(size_t)); p += sizeof(size_t)
#define P(value) memcpy(p, &(value), sizeof(off_t)); p += sizeof(off_t)
P(done);
P(total);
#undef P
@ -955,7 +959,7 @@ _e_fm_op_update_progress_report_simple(int percent, const char *src, const char
* packed and written to STDOUT.
*/
static void
_e_fm_op_update_progress(E_Fm_Op_Task *task, long long _plus_e_fm_op_done, long long _plus_e_fm_op_total)
_e_fm_op_update_progress(E_Fm_Op_Task *task, off_t _plus_e_fm_op_done, off_t _plus_e_fm_op_total)
{
static int ppercent = -1;
int percent;

@ -145,7 +145,7 @@ _e_fm2_op_registry_entry_internal_event(E_Fm2_Op_Registry_Entry_Internal *e, int
}
Eina_Bool
e_fm2_op_registry_entry_add(int id, Evas_Object *e_fm, E_Fm_Op_Type op)
e_fm2_op_registry_entry_add(int id, Evas_Object *e_fm, E_Fm_Op_Type op, E_Fm2_Op_Registry_Abort_Func abort)
{
E_Fm2_Op_Registry_Entry_Internal *e;
@ -157,6 +157,7 @@ e_fm2_op_registry_entry_add(int id, Evas_Object *e_fm, E_Fm_Op_Type op)
e->entry.start_time = ecore_loop_time_get();
e->entry.op = op;
e->entry.status = E_FM2_OP_STATUS_IN_PROGRESS;
e->entry.func.abort = abort;
e->references = 1;
if (!eina_hash_add(_e_fm2_op_registry, &id, e))
@ -504,3 +505,12 @@ e_fm2_op_registry_shutdown(void)
return 0;
}
EAPI void
e_fm2_op_registry_entry_abort(E_Fm2_Op_Registry_Entry *entry)
{
if (!entry) return;
if (entry->func.abort)
entry->func.abort(entry);
}

@ -18,12 +18,14 @@ typedef struct _E_Fm2_Op_Registry_Entry E_Fm2_Op_Registry_Entry;
#ifndef E_FM_OP_REGISTRY_H
#define E_FM_OP_REGISTRY_H
typedef void (*E_Fm2_Op_Registry_Abort_Func)(E_Fm2_Op_Registry_Entry *entry);
struct _E_Fm2_Op_Registry_Entry
{
int id;
int percent; /* XXX use char? */
size_t done;
size_t total;
off_t done;
off_t total;
Evas_Object *e_fm;
const char *src; /* stringshared */
const char *dst; /* stringshared */
@ -33,6 +35,12 @@ struct _E_Fm2_Op_Registry_Entry
E_Fm2_Op_Status status;
Eina_Bool needs_attention:1;
Eina_Bool finished:1;
// service callbacks
struct
{
E_Fm2_Op_Registry_Abort_Func abort;
} func;
};
extern EAPI int E_EVENT_FM_OP_REGISTRY_ADD;
@ -55,12 +63,13 @@ EAPI void e_fm2_op_registry_get_all_free(Eina_List *list);
EAPI Eina_Bool e_fm2_op_registry_is_empty(void);
EAPI int e_fm2_op_registry_count(void);
EAPI void e_fm2_op_registry_entry_abort(E_Fm2_Op_Registry_Entry *entry);
EAPI unsigned int e_fm2_op_registry_init(void);
EAPI unsigned int e_fm2_op_registry_shutdown(void);
/* E internal/private functions, symbols not exported outside e binary (e_fm.c mainly) */
Eina_Bool e_fm2_op_registry_entry_add(int id, Evas_Object *e_fm, E_Fm_Op_Type op);
Eina_Bool e_fm2_op_registry_entry_add(int id, Evas_Object *e_fm, E_Fm_Op_Type op, E_Fm2_Op_Registry_Abort_Func abort);
Eina_Bool e_fm2_op_registry_entry_del(int id);
void e_fm2_op_registry_entry_changed(const E_Fm2_Op_Registry_Entry *entry);
void e_fm2_op_registry_entry_e_fm_set(E_Fm2_Op_Registry_Entry *entry, Evas_Object *e_fm);

@ -5143,3 +5143,49 @@ _e_gadcon_provider_populate_unrequest(const E_Gadcon_Client_Class *cc)
populate_idler = NULL;
}
}
EAPI Eina_Bool
e_gadcon_site_is_shelf (E_Gadcon_Site site)
{
return site == E_GADCON_SITE_SHELF;
}
EAPI Eina_Bool
e_gadcon_site_is_desktop (E_Gadcon_Site site)
{
return site == E_GADCON_SITE_DESKTOP;
}
EAPI Eina_Bool
e_gadcon_site_is_efm_toolbar(E_Gadcon_Site site)
{
return site == E_GADCON_SITE_EFM_TOOLBAR;
}
EAPI Eina_Bool
e_gadcon_site_is_any_toolbar(E_Gadcon_Site site)
{
switch (site)
{
// there should be all toolbar sities identifiers
case E_GADCON_SITE_TOOLBAR:
case E_GADCON_SITE_EFM_TOOLBAR:
return EINA_TRUE;
}
return EINA_FALSE;
}
EAPI Eina_Bool
e_gadcon_site_is_not_toolbar(E_Gadcon_Site site)
{
switch (site)
{
// there should be all toolbar sities identifiers
case E_GADCON_SITE_TOOLBAR:
case E_GADCON_SITE_EFM_TOOLBAR:
return EINA_FALSE;
}
return EINA_TRUE;
}

@ -31,6 +31,16 @@ typedef enum _E_Gadcon_Orient
E_GADCON_ORIENT_CORNER_RB
} E_Gadcon_Orient;
typedef enum _E_Gadcon_Site
{
E_GADCON_SITE_UNKNOWN = 0, // when target site is unknown
/* generic sities */
E_GADCON_SITE_SHELF,
E_GADCON_SITE_DESKTOP,
E_GADCON_SITE_TOOLBAR, // generic toolbar
E_GADCON_SITE_EFM_TOOLBAR // filemanager window toolbar
} E_Gadcon_Site;
#define E_GADCON_CLIENT_STYLE_PLAIN "plain"
#define E_GADCON_CLIENT_STYLE_INSET "inset"
@ -134,6 +144,7 @@ struct _E_Gadcon_Client_Class
/* Del an id when a gadcon client is removed from the system */
void (*id_del) (E_Gadcon_Client_Class *client_class, const char *id);
/* All members below are part of version 3 */
Eina_Bool (*is_site) (E_Gadcon_Site site);
} func;
char *default_style;
};
@ -257,5 +268,14 @@ EAPI void e_gadcon_client_util_menu_attach(E_Gadcon_Client *gcc);
EAPI void e_gadcon_locked_set(E_Gadcon *gc, int lock);
EAPI void e_gadcon_urgent_show(E_Gadcon *gc);
/* site helpers */
EAPI Eina_Bool e_gadcon_site_is_shelf (E_Gadcon_Site site);
EAPI Eina_Bool e_gadcon_site_is_desktop (E_Gadcon_Site site);
EAPI Eina_Bool e_gadcon_site_is_efm_toolbar(E_Gadcon_Site site);
EAPI Eina_Bool e_gadcon_site_is_any_toolbar(E_Gadcon_Site site); // all toolbar sities
EAPI Eina_Bool e_gadcon_site_is_not_toolbar(E_Gadcon_Site site); // all non-toolbar sities
#endif
#endif

@ -1,8 +1,10 @@
#include "e.h"
/* local function protos */
static void _e_int_gadcon_config(E_Gadcon *gc, const char *title);
static void _e_int_gadcon_config(E_Gadcon *gc, const char *title, void *(*data_func)(E_Config_Dialog*));
static void *_create_data(E_Config_Dialog *cfd);
static void *_create_data_shelf(E_Config_Dialog *cfd);
static void *_create_data_toolbar(E_Config_Dialog *cfd);
static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static Evas_Object *_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
static int _cb_mod_update(void *data, int type, void *event);
@ -17,6 +19,8 @@ static int _gad_list_sort(void *data1, void *data2);
struct _E_Config_Dialog_Data
{
E_Gadcon_Site site;
Evas_Object *o_avail, *o_sel;
Evas_Object *o_add, *o_del;
Evas_Object *o_desc;
@ -29,18 +33,18 @@ struct _E_Config_Dialog_Data
EAPI void
e_int_gadcon_config_shelf(E_Gadcon *gc)
{
_e_int_gadcon_config(gc, _("Shelf Contents"));
_e_int_gadcon_config(gc, _("Shelf Contents"), _create_data_shelf);
}
EAPI void
e_int_gadcon_config_toolbar(E_Gadcon *gc)
{
_e_int_gadcon_config(gc, _("Toolbar Contents"));
_e_int_gadcon_config(gc, _("Toolbar Contents"), _create_data_toolbar);
}
/* local functions */
static void
_e_int_gadcon_config(E_Gadcon *gc, const char *title)
_e_int_gadcon_config(E_Gadcon *gc, const char *title, void *(*data_func)(E_Config_Dialog*))
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
@ -51,7 +55,7 @@ _e_int_gadcon_config(E_Gadcon *gc, const char *title)
con = e_container_current_get(e_manager_current_get());
v->create_cfdata = _create_data;
v->create_cfdata = data_func ? data_func : _create_data;
v->free_cfdata = _free_data;
v->basic.create_widgets = _basic_create;
@ -67,6 +71,29 @@ _create_data(E_Config_Dialog *cfd)
E_Config_Dialog_Data *cfdata;
cfdata = E_NEW(E_Config_Dialog_Data, 1);
cfdata->site = E_GADCON_SITE_UNKNOWN;
cfdata->gc = cfd->data;
return cfdata;
}
static void *
_create_data_shelf(E_Config_Dialog *cfd)
{
E_Config_Dialog_Data *cfdata;
cfdata = E_NEW(E_Config_Dialog_Data, 1);
cfdata->site = E_GADCON_SITE_SHELF;
cfdata->gc = cfd->data;
return cfdata;
}
static void *
_create_data_toolbar(E_Config_Dialog *cfd)
{
E_Config_Dialog_Data *cfdata;
cfdata = E_NEW(E_Config_Dialog_Data, 1);
cfdata->site = E_GADCON_SITE_EFM_TOOLBAR;
cfdata->gc = cfd->data;
return cfdata;
}
@ -207,6 +234,9 @@ _load_avail_gadgets(void *data)
const char *lbl = NULL;
if (!(cc = l->data)) continue;
// check the current site is allowed for this gadcon client
if (cc->func.is_site && !cc->func.is_site(cfdata->site))
continue;
if (cc->func.label) lbl = cc->func.label(cc);
if (!lbl) lbl = cc->name;
if (cc->func.icon) icon = cc->func.icon(cc, evas);

@ -24,7 +24,7 @@ static const E_Gadcon_Client_Class _gadcon_class =
GADCON_CLIENT_CLASS_VERSION,
"battery",
{
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL, NULL
},
E_GADCON_CLIENT_STYLE_PLAIN
};

@ -19,7 +19,7 @@ static const E_Gadcon_Client_Class _gadcon_class =
GADCON_CLIENT_CLASS_VERSION,
"clock",
{
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL, NULL
},
E_GADCON_CLIENT_STYLE_PLAIN
};

@ -38,7 +38,8 @@ static const E_Gadcon_Client_Class _gadcon_class =
GADCON_CLIENT_CLASS_VERSION,
"configuration",
{
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL,
e_gadcon_site_is_not_toolbar
},
E_GADCON_CLIENT_STYLE_PLAIN
};

@ -36,7 +36,8 @@ static const E_Gadcon_Client_Class _gadcon_class =
GADCON_CLIENT_CLASS_VERSION,
"connman",
{
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL,
e_gadcon_site_is_not_toolbar
},
E_GADCON_CLIENT_STYLE_PLAIN
};

@ -24,7 +24,7 @@ static const E_Gadcon_Client_Class _gadcon_class =
GADCON_CLIENT_CLASS_VERSION,
"cpufreq",
{
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL, NULL
},
E_GADCON_CLIENT_STYLE_PLAIN
};

@ -139,6 +139,7 @@ static int _e_fwin_dlg_cb_desk_list_sort(const void *data1, const void *data2);
static void _e_fwin_op_registry_listener_cb(void *data, const E_Fm2_Op_Registry_Entry *ere);
static int _e_fwin_op_registry_entry_add_cb(void *data, int type, void *event);
static void _e_fwin_op_registry_entry_iter(E_Fwin_Page *page);
static void _e_fwin_op_registry_abort_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
/* local subsystem globals */
static Eina_List *fwins = NULL;
@ -2174,43 +2175,75 @@ _e_fwin_op_registry_listener_cb(void *data, const E_Fm2_Op_Registry_Entry *ere)
// Update element
edje_object_part_drag_size_set(o, "e.gauge.bar", ((double)(ere->percent)) / 100, 1.0);
total = e_util_size_string_get(ere->total);
// Update icon
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 done", total);
else
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");
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");
if (ere->finished)
snprintf(buf, sizeof(buf), "Delete done");
else
snprintf(buf, sizeof(buf), "Deleting files...");
break;
default:
edje_object_signal_emit(o, "e,action,icon,unknow", "e");
snprintf(buf, sizeof(buf), "Unknow operation from slave %d", ere->id);
}
// Update information text
switch (ere->status)
{
case E_FM2_OP_STATUS_ABORTED:
switch (ere->op)
{
case E_FM_OP_COPY:
snprintf(buf, sizeof(buf), _("Copying is aborted"));
break;
case E_FM_OP_MOVE:
snprintf(buf, sizeof(buf), _("Moving is aborted"));
break;
case E_FM_OP_REMOVE:
snprintf(buf, sizeof(buf), _("Deleting is aborted"));
break;
default:
snprintf(buf, sizeof(buf), _("Unknown operation from slave is aborted"));
}
break;
default:
total = e_util_size_string_get(ere->total);
switch (ere->op)
{
case E_FM_OP_COPY:
if (ere->finished)
snprintf(buf, sizeof(buf), _("Copy of %s done"), total);
else
snprintf(buf, sizeof(buf), _("Copying %s (eta: %d sec)"), total, ere->eta);
break;
case E_FM_OP_MOVE:
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:
if (ere->finished)
snprintf(buf, sizeof(buf), _("Delete done"));
else
snprintf(buf, sizeof(buf), _("Deleting files..."));
break;
default:
snprintf(buf, sizeof(buf), _("Unknow operation from slave %d"), ere->id);
}
E_FREE(total);
}
edje_object_part_text_set(o, "e.text.label1", buf);
edje_object_part_text_set(o, "e.text.info", buf);
if (ere->needs_attention)
edje_object_signal_emit(o, "e,action,set,need_attention", "e");
else
edje_object_signal_emit(o, "e,action,set,normal", "e");
E_FREE(total);
}
static int
@ -2255,6 +2288,10 @@ _e_fwin_op_registry_entry_add_cb(void *data, int type, void *event)
evas_object_size_hint_align_set(o, 1.0, 1.0); //FIXME this should be theme-configurable
evas_object_show(o);
// add abort button callback with id of operation in registry
edje_object_signal_callback_add(o, "e,fm,operation,abort", "",
_e_fwin_op_registry_abort_cb, (void*)ere->id);
//Listen to progress changes
e_fm2_op_registry_entry_listener_add(ere, _e_fwin_op_registry_listener_cb,
o, _e_fwin_op_registry_free_data);
@ -2273,3 +2310,14 @@ _e_fwin_op_registry_entry_iter(E_Fwin_Page *page)
_e_fwin_op_registry_entry_add_cb(page, 0, ere);
eina_iterator_free(itr);
}
static void
_e_fwin_op_registry_abort_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
{
int id;
id = (int)data;
if (!id) return;
e_fm2_operation_abort(id);
}

@ -4,90 +4,327 @@
#include "e.h"
#include "e_mod_main.h"
typedef struct _Instance Instance;
struct _Instance
typedef struct _Instance
{
char *theme_file;
E_Gadcon_Client *gcc;
Evas_Object *o_btn;
Ecore_Event_Handler *fm_op_entry_add_handler;
Ecore_Event_Handler *fm_op_entry_del_handler;
};
Evas_Object *o_box,
*o_status;
Ecore_Event_Handler *fm_op_entry_add_handler,
*fm_op_entry_del_handler;
} Instance;
/* gadcon requirements */
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style);
static void _gc_shutdown(E_Gadcon_Client *gcc);
static void _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient);
static char *_gc_label(E_Gadcon_Client_Class *client_class);
static Evas_Object *_gc_icon(E_Gadcon_Client_Class *client_class, Evas *evas);
static const char *_gc_id_new(E_Gadcon_Client_Class *client_class);
static E_Gadcon_Client *_gc_init (E_Gadcon *gc, const char *name, const char *id, const char *style);
static void _gc_shutdown(E_Gadcon_Client *gcc);
static void _gc_orient (E_Gadcon_Client *gcc, E_Gadcon_Orient orient);
static char *_gc_label (E_Gadcon_Client_Class *client_class);
static Evas_Object *_gc_icon (E_Gadcon_Client_Class *client_class, Evas *evas);
static const char *_gc_id_new (E_Gadcon_Client_Class *client_class);
static const E_Gadcon_Client_Class _gadcon_class = {
GADCON_CLIENT_CLASS_VERSION, "efm_info", {
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL
}, E_GADCON_CLIENT_STYLE_PLAIN
GADCON_CLIENT_CLASS_VERSION, "efm_info",
{
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL,
e_gadcon_site_is_desktop
},
E_GADCON_CLIENT_STYLE_PLAIN
};
/******************** PROTOS *******************************************/
void _opinfo_button_cb(void *data, void *data2);
static void _opinfo_update_gadget(Instance *inst);
static int _opinfo_op_registry_entry_add_cb (void *data, int type, void *event);
static int _opinfo_op_registry_entry_del_cb (void *data, int type, void *event);
static void _opinfo_op_registry_update_all (Instance *inst);
static void _opinfo_op_registry_listener (void *data, const E_Fm2_Op_Registry_Entry *ere);
static void _opinfo_op_registry_free_data (void *data);
static int _opinfo_op_registry_free_data_delayed(void *data);
static void _opinfo_op_registry_abort_cb (void *data, Evas_Object *obj, const char *emission, const char *source);
static void _opinfo_op_registry_summary_cb (void *data, Evas_Object *obj, const char *emission, const char *source);
static void _opinfo_op_registry_detailed_cb (void *data, Evas_Object *obj, const char *emission, const char *source);
static void _opinfo_op_registry_update_status (Instance *inst);
/******************** GLOBALS ******************************************/
static E_Module *opinfo_module = NULL;
/******************** OP_REGISTRY *************************************/
static void
_opinfo_op_registry_listener(void *data, const E_Fm2_Op_Registry_Entry *ere)
{
Evas_Object *o = data;
char *total, buf[PATH_MAX];
if (!o || !ere) return;
// Update icon
switch (ere->op)
{
case E_FM_OP_COPY:
edje_object_signal_emit(o, "e,action,icon,copy", "e");
break;
case E_FM_OP_MOVE:
edje_object_signal_emit(o, "e,action,icon,move", "e");
break;
case E_FM_OP_REMOVE:
edje_object_signal_emit(o, "e,action,icon,delete", "e");
break;
default:
edje_object_signal_emit(o, "e,action,icon,unknow", "e");
}
// Update information text
switch (ere->status)
{
case E_FM2_OP_STATUS_ABORTED:
switch (ere->op)
{
case E_FM_OP_COPY:
snprintf(buf, sizeof(buf), _("Copying is aborted"));
break;
case E_FM_OP_MOVE:
snprintf(buf, sizeof(buf), _("Moving is aborted"));
break;
case E_FM_OP_REMOVE:
snprintf(buf, sizeof(buf), _("Deleting is aborted"));
break;
default:
snprintf(buf, sizeof(buf), _("Unknown operation from slave is aborted"));
}
break;
default:
total = e_util_size_string_get(ere->total);
switch (ere->op)
{
case E_FM_OP_COPY:
if (ere->finished)
snprintf(buf, sizeof(buf), _("Copy of %s done"), total);
else
snprintf(buf, sizeof(buf), _("Copying %s (eta: %d sec)"), total, ere->eta);
break;
case E_FM_OP_MOVE:
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:
if (ere->finished)
snprintf(buf, sizeof(buf), _("Delete done"));
else
snprintf(buf, sizeof(buf), _("Deleting files..."));
break;
default:
snprintf(buf, sizeof(buf), _("Unknow operation from slave %d"), ere->id);
}
E_FREE(total);
}
edje_object_part_text_set(o, "e.text.info", buf);
// Update detailed information
if (!ere->src)
edje_object_part_text_set(o, "e.text.src", _("(no information)"));
else
{
if (ere->op == E_FM_OP_REMOVE)
snprintf(buf, sizeof(buf), _("File: %s"), ere->src);
else
snprintf(buf, sizeof(buf), _("From: %s"), ere->src);
edje_object_part_text_set(o, "e.text.src", buf);
}
if (!ere->dst || ere->op == E_FM_OP_REMOVE)
edje_object_part_text_set(o, "e.text.dest", _("(no information)"));
else
{
snprintf(buf, sizeof(buf), _("To: %s"), ere->dst);
edje_object_part_text_set(o, "e.text.dest", buf);
}
// Update gauge
edje_object_part_drag_size_set(o, "e.gauge.bar", ere->percent / 100.0, 1.0);
snprintf(buf, sizeof(buf), "%3i%%", ere->percent);
edje_object_part_text_set(o, "e.text.percent", buf);
// Update attention
if (ere->needs_attention)
edje_object_signal_emit(o, "e,action,set,need_attention", "e");
else
edje_object_signal_emit(o, "e,action,set,normal", "e");
}
static void
_opinfo_op_registry_free_data(void *data)
{
ecore_timer_add(5.0, _opinfo_op_registry_free_data_delayed, data);
}
static int
_opinfo_op_registry_free_data_delayed(void *data)
{
Evas_Object *o = data;
if (o)
{
e_box_unpack(o);
evas_object_del(o);
}
return ECORE_CALLBACK_CANCEL;
}
static void
_opinfo_op_registry_abort_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
{
int id;
id = (int)data;
if (!id) return;
e_fm2_operation_abort(id);
}
static void
_opinfo_op_registry_summary_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
{
int mw, mh;
edje_object_signal_emit(obj, "state,set,summary", "fileman_opinfo");
edje_object_size_min_get(obj, &mw, &mh);
e_box_pack_options_set(obj, 1, 0, 1, 0, 0.0, 0.0, mw, mh, 9999, mh);
}
static void
_opinfo_op_registry_detailed_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
{
int mw, xh;
edje_object_signal_emit(obj, "state,set,detailed", "fileman_opinfo");
edje_object_size_min_calc(obj, &mw, NULL);
edje_object_size_max_get(obj, NULL, &xh);
e_box_pack_options_set(obj, 1, 0, 1, 0, 0.0, 0.0, mw, xh, 9999, xh);
}
static int
_opinfo_op_registry_entry_cb(void *data, int type, void *event)
_opinfo_op_registry_entry_add_cb(void *data, int type, void *event)
{
_opinfo_update_gadget(data);
E_Fm2_Op_Registry_Entry *ere = event;
Instance *inst = data;
Evas_Object *o;
int mw, mh, xh;
if (!inst || !ere)
return ECORE_CALLBACK_RENEW;
_opinfo_op_registry_update_status(inst);
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(evas_object_evas_get(inst->o_box));
if (!e_theme_edje_object_set(o, "base/theme/modules/fileman_opinfo",
"modules/fileman_opinfo/main"))
edje_object_file_set(o, inst->theme_file, "modules/fileman_opinfo/main");
_opinfo_op_registry_listener(o, ere);
e_box_pack_before(inst->o_box, o, inst->o_status);
evas_object_show(o);
_opinfo_op_registry_summary_cb(inst, o, NULL, NULL);
edje_object_signal_callback_add(o, "e,fm,operation,abort", "",
_opinfo_op_registry_abort_cb, (void*)ere->id);
edje_object_signal_callback_add(o, "state,request,summary", "fileman_opinfo",
_opinfo_op_registry_summary_cb, inst);
edje_object_signal_callback_add(o, "state,request,detailed", "fileman_opinfo",
_opinfo_op_registry_detailed_cb, inst);
e_fm2_op_registry_entry_listener_add(ere, _opinfo_op_registry_listener,
o, _opinfo_op_registry_free_data);
return ECORE_CALLBACK_RENEW;
}
static void
_opinfo_update_gadget(Instance *inst)
static int
_opinfo_op_registry_entry_del_cb(void *data, int type, void *event)
{
char buf[1024];
int count;
Instance *inst = data;
if (!inst)
return ECORE_CALLBACK_RENEW;
count = e_fm2_op_registry_count();
if (count)
snprintf(buf, sizeof(buf), _("%d operations"), count);
else
snprintf(buf, sizeof(buf), _("idle"));
e_widget_button_label_set(inst->o_btn, buf);
e_widget_disabled_set(inst->o_btn, count ? 0 : 1);
_opinfo_op_registry_update_status(inst);
return ECORE_CALLBACK_RENEW;
}
void
_opinfo_button_cb(void *data, void *data2)
static void
_opinfo_op_registry_update_all(Instance *inst)
{
Ecore_X_Window win;
Eina_Iterator *itr;
E_Fm2_Op_Registry_Entry *ere;
itr = e_fm2_op_registry_iterator_new();
EINA_ITERATOR_FOREACH(itr, ere)
_opinfo_op_registry_entry_add_cb(inst, 0, ere);
eina_iterator_free(itr);
_opinfo_op_registry_update_status(inst);
}
static void
_opinfo_op_registry_update_status(Instance *inst)
{
int cnt;
char buf[256];
cnt = e_fm2_op_registry_count();
if (cnt)
{
win = e_fm2_op_registry_entry_xwin_get(ere);
e_util_dialog_show("TODO","What to show here ?");
//ecore_x_window_show(win);
snprintf(buf, sizeof(buf), _("Processing %d operation(s)"), cnt);
edje_object_part_text_set(inst->o_status, "e.text.info", buf);
}
eina_iterator_free(itr);
else
edje_object_part_text_set(inst->o_status, "e.text.info", _("Filemanager is idle"));