2007-02-11 07:28:53 -08:00
|
|
|
#include <e.h>
|
2007-09-15 18:46:52 -07:00
|
|
|
#include "e_mod_config.h"
|
2007-02-11 07:28:53 -08:00
|
|
|
#include "e_mod_main.h"
|
|
|
|
#include "e_mod_gadcon.h"
|
|
|
|
#include "e_mod_net.h"
|
|
|
|
|
2007-03-15 06:27:12 -07:00
|
|
|
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);
|
2008-11-03 21:54:59 -08:00
|
|
|
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);
|
2007-03-15 06:27:12 -07:00
|
|
|
|
2007-02-11 07:28:53 -08:00
|
|
|
static const E_Gadcon_Client_Class _gc_class =
|
|
|
|
{
|
|
|
|
GADCON_CLIENT_CLASS_VERSION, "net",
|
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
2009-06-29 07:38:03 -07:00
|
|
|
{_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL, NULL},
|
2007-02-11 07:28:53 -08:00
|
|
|
E_GADCON_CLIENT_STYLE_PLAIN
|
|
|
|
};
|
|
|
|
|
|
|
|
static E_Gadcon_Client *
|
|
|
|
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
|
|
|
{
|
|
|
|
Instance *inst;
|
|
|
|
E_Gadcon_Client *gcc;
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
|
2008-01-03 22:39:21 -08:00
|
|
|
snprintf(buf, sizeof(buf), "%s/net.edj", e_module_dir_get(net_cfg->mod));
|
2007-02-11 07:28:53 -08:00
|
|
|
|
|
|
|
inst = E_NEW(Instance, 1);
|
2010-03-07 22:16:41 -08:00
|
|
|
inst->ci = _net_config_item_get(id);
|
2007-09-15 20:32:39 -07:00
|
|
|
|
2007-02-11 07:28:53 -08:00
|
|
|
inst->o_net = edje_object_add(gc->evas);
|
|
|
|
if (!e_theme_edje_object_set(inst->o_net, "base/theme/modules/net",
|
|
|
|
"modules/net/main"))
|
|
|
|
edje_object_file_set(inst->o_net, buf, "modules/net/main");
|
2007-02-13 00:37:13 -08:00
|
|
|
edje_object_signal_callback_add(inst->o_net, "e,action,mouse,in", "",
|
|
|
|
_cb_mouse_in, inst);
|
|
|
|
edje_object_signal_callback_add(inst->o_net, "e,action,mouse,out", "",
|
|
|
|
_cb_mouse_out, inst);
|
2007-02-11 07:28:53 -08:00
|
|
|
evas_object_show(inst->o_net);
|
|
|
|
|
2007-09-15 18:46:52 -07:00
|
|
|
if (!inst->ci->show_text)
|
2007-02-14 03:48:28 -08:00
|
|
|
edje_object_signal_emit(inst->o_net, "e,state,text,hide", "e");
|
|
|
|
else
|
|
|
|
edje_object_signal_emit(inst->o_net, "e,state,text,show", "e");
|
|
|
|
|
2007-02-11 07:28:53 -08:00
|
|
|
gcc = e_gadcon_client_new(gc, name, id, style, inst->o_net);
|
|
|
|
gcc->data = inst;
|
|
|
|
inst->gcc = gcc;
|
2007-02-12 13:23:07 -08:00
|
|
|
inst->timer = ecore_timer_add(0.5, _cb_poll, inst);
|
2007-02-13 00:37:13 -08:00
|
|
|
|
2007-02-11 07:28:53 -08:00
|
|
|
evas_object_event_callback_add(inst->o_net, EVAS_CALLBACK_MOUSE_DOWN,
|
|
|
|
_cb_mouse_down, inst);
|
2008-01-03 22:39:21 -08:00
|
|
|
|
2008-10-22 06:53:03 -07:00
|
|
|
net_cfg->instances = eina_list_append(net_cfg->instances, inst);
|
2007-02-11 07:28:53 -08:00
|
|
|
return gcc;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_gc_shutdown(E_Gadcon_Client *gcc)
|
|
|
|
{
|
|
|
|
Instance *inst;
|
|
|
|
|
|
|
|
inst = gcc->data;
|
2008-10-22 06:53:03 -07:00
|
|
|
net_cfg->instances = eina_list_remove(net_cfg->instances, inst);
|
2007-02-11 07:28:53 -08:00
|
|
|
if (inst->timer) ecore_timer_del(inst->timer);
|
|
|
|
if (inst->o_net)
|
|
|
|
{
|
|
|
|
evas_object_event_callback_del(inst->o_net, EVAS_CALLBACK_MOUSE_DOWN,
|
|
|
|
_cb_mouse_down);
|
2007-02-13 00:37:13 -08:00
|
|
|
edje_object_signal_callback_del(inst->o_net, "e,action,mouse,in", "",
|
|
|
|
_cb_mouse_in);
|
|
|
|
edje_object_signal_callback_del(inst->o_net, "e,action,mouse,out", "",
|
|
|
|
_cb_mouse_out);
|
2007-02-11 07:28:53 -08:00
|
|
|
evas_object_del(inst->o_net);
|
|
|
|
}
|
|
|
|
E_FREE(inst);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-11-03 21:54:59 -08:00
|
|
|
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient)
|
2007-02-11 07:28:53 -08:00
|
|
|
{
|
|
|
|
e_gadcon_client_aspect_set(gcc, 16, 16);
|
|
|
|
e_gadcon_client_min_size_set(gcc, 16, 16);
|
|
|
|
}
|
|
|
|
|
|
|
|
static char *
|
2008-11-03 21:54:59 -08:00
|
|
|
_gc_label(E_Gadcon_Client_Class *client_class)
|
2007-02-11 07:28:53 -08:00
|
|
|
{
|
2007-03-04 16:09:40 -08:00
|
|
|
return D_("Net");
|
2007-02-11 07:28:53 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
2008-11-03 21:54:59 -08:00
|
|
|
_gc_icon(E_Gadcon_Client_Class *client_class, Evas *evas)
|
2007-02-11 07:28:53 -08:00
|
|
|
{
|
|
|
|
Evas_Object *o;
|
|
|
|
char buf[PATH_MAX];
|
2008-01-03 22:39:21 -08:00
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "%s/e-module-net.edj",
|
|
|
|
e_module_dir_get(net_cfg->mod));
|
2007-02-11 07:28:53 -08:00
|
|
|
o = edje_object_add(evas);
|
|
|
|
edje_object_file_set(o, buf, "icon");
|
|
|
|
return o;
|
|
|
|
}
|
|
|
|
|
2007-09-15 20:32:39 -07:00
|
|
|
static const char *
|
2008-11-03 21:54:59 -08:00
|
|
|
_gc_id_new(E_Gadcon_Client_Class *client_class)
|
2007-09-15 20:32:39 -07:00
|
|
|
{
|
|
|
|
Config_Item *ci;
|
|
|
|
|
2010-03-07 22:16:41 -08:00
|
|
|
ci = _net_config_item_get(NULL);
|
2007-09-15 20:32:39 -07:00
|
|
|
return ci->id;
|
|
|
|
}
|
|
|
|
|
2010-01-22 12:01:01 -08:00
|
|
|
EINTERN void
|
2007-02-11 07:28:53 -08:00
|
|
|
_gc_register(void)
|
|
|
|
{
|
|
|
|
e_gadcon_provider_register(&_gc_class);
|
|
|
|
}
|
|
|
|
|
2010-01-22 12:01:01 -08:00
|
|
|
EINTERN void
|
2007-02-11 07:28:53 -08:00
|
|
|
_gc_unregister(void)
|
|
|
|
{
|
|
|
|
e_gadcon_provider_unregister(&_gc_class);
|
|
|
|
}
|
2007-09-15 20:32:39 -07:00
|
|
|
|
2010-01-22 12:01:01 -08:00
|
|
|
EINTERN const char *
|
2007-09-15 20:32:39 -07:00
|
|
|
_gc_name(void)
|
|
|
|
{
|
|
|
|
return _gc_class.name;
|
|
|
|
}
|