Hi, don't know who is the maintainer of Execwatch...
The attached patch add a new configuration entry (icon path)
to Execwtch. You can now set a custom icon for your instance.
When the 'custom icon' is visible the 'status icon' will
be shown in the upper right corner (like an emblem).
Hope you like
Dave
Index: e_mod_config.c
===================================================================
--- e_mod_config.c (revisione 37669)
+++ e_mod_config.c (copia locale)
@@ -7,6 +7,7 @@
struct _E_Config_Dialog_Data
{
char *display_name;
+ char *icon_path;
char *status_cmd;
char *dblclk_cmd;
char *okstate_string;
@@ -57,6 +58,10 @@ _fill_data(Config_Item * ci, E_Config_Di
cfdata->display_name = strdup(ci->display_name);
else
cfdata->display_name = strdup("");
+ if (ci->icon_path)
+ cfdata->icon_path = strdup(ci->icon_path);
+ else
+ cfdata->icon_path = strdup("");
if (ci->status_cmd)
cfdata->status_cmd = strdup(ci->status_cmd);
else
@@ -160,15 +165,21 @@ _basic_create_widgets(E_Config_Dialog *
e_widget_min_size_set(ob, 150, 1);
e_widget_frametable_object_append(of, ob, 1, 0, 1, 1, 1, 0, 1, 0);
- ob = e_widget_label_add(evas, D_("Doubleclick Command"));
+ ob = e_widget_label_add(evas, D_("Icon Path"));
e_widget_frametable_object_append(of, ob, 0, 1, 1, 1, 1, 0, 1, 0);
- ob = e_widget_entry_add(evas, &cfdata->dblclk_cmd, NULL, NULL, NULL);
+ ob = e_widget_entry_add(evas, &cfdata->icon_path, NULL, NULL, NULL);
e_widget_min_size_set(ob, 150, 1);
e_widget_frametable_object_append(of, ob, 1, 1, 1, 1, 1, 0, 1, 0);
- ob = e_widget_check_add(evas, D_("Refresh after Command"), &(cfdata->refresh_after_dblclk_cmd));
+ ob = e_widget_label_add(evas, D_("Doubleclick Command"));
+ e_widget_frametable_object_append(of, ob, 0, 2, 1, 1, 1, 0, 1, 0);
+ ob = e_widget_entry_add(evas, &cfdata->dblclk_cmd, NULL, NULL, NULL);
+ e_widget_min_size_set(ob, 150, 1);
e_widget_frametable_object_append(of, ob, 1, 2, 1, 1, 1, 0, 1, 0);
+ ob = e_widget_check_add(evas, D_("Refresh after Command"), &(cfdata->refresh_after_dblclk_cmd));
+ e_widget_frametable_object_append(of, ob, 1, 3, 1, 1, 1, 0, 1, 0);
+
e_widget_list_object_append(o, of, 1, 1, 0.5);
return o;
@@ -191,6 +202,8 @@ _basic_apply_data(E_Config_Dialog * cfd,
if (ci->display_name) eina_stringshare_del(ci->display_name);
ci->display_name = eina_stringshare_add(cfdata->display_name);
+ if (ci->icon_path) eina_stringshare_del(ci->icon_path);
+ ci->icon_path = eina_stringshare_add(cfdata->icon_path);
if (ci->status_cmd) eina_stringshare_del(ci->status_cmd);
ci->status_cmd = eina_stringshare_add(cfdata->status_cmd);
if (strlen(cfdata->okstate_string))
Index: execwatch.edc
===================================================================
--- execwatch.edc (revisione 37665)
+++ execwatch.edc (copia locale)
@@ -35,6 +35,8 @@ collections
group
{
name: "modules/execwatch/main";
+ min: 40 40;
+ max: 128 128;
parts
{
part
@@ -52,6 +54,22 @@ collections
}
part
{
+ name: "custom_icon";
+ type: SWALLOW;
+ mouse_events: 0;
+ description
+ {
+ state: "default" 0.0;
+ visible: 0;
+ }
+ description
+ {
+ state: "small" 0.0;
+ visible: 1;
+ }
+ }
+ part
+ {
name: "icon";
type: SWALLOW;
mouse_events: 0;
@@ -71,6 +89,21 @@ collections
offset: -1 -1;
}
}
+ description
+ {
+ state: "small" 0.0;
+ aspect_preference: BOTH;
+ rel1
+ {
+ relative: 0.5 0.0;
+ offset: 0 0;
+ }
+ rel2
+ {
+ relative: 1.0 0.5;
+ offset: -1 -1;
+ }
+ }
}
part
{
@@ -85,7 +118,7 @@ collections
{
relative: 0.0 1.0;
offset: -1 -1;
- to_x: "icon";
+ to_x: "base";
}
rel2
{
@@ -108,6 +141,27 @@ collections
}
}
}
+ programs
+ {
+ program
+ {
+ name: "set_icon_small";
+ signal: "e,visibility,small";
+ source: "e";
+ action: STATE_SET "small" 0.0;
+ target: "icon";
+ target: "custom_icon";
+ }
+ program
+ {
+ name: "set_icon_big";
+ signal: "e,visibility,big";
+ source: "e";
+ action: STATE_SET "default" 0.0;
+ target: "icon";
+ target: "custom_icon";
+ }
+ }
}
EXECWATCH_ICON("cmd_edit")
Index: e_mod_main.c
===================================================================
--- e_mod_main.c (revisione 37665)
+++ e_mod_main.c (copia locale)
@@ -30,6 +30,7 @@ struct _Execwatch
Instance *inst;
Evas_Object *execwatch_obj;
Evas_Object *icon_obj;
+ Evas_Object *icon_custom_obj;
};
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style);
@@ -87,6 +88,7 @@ _gc_init(E_Gadcon *gc, const char *name,
edje_object_file_set(execwatch->execwatch_obj, buf, "modules/execwatch/main");
evas_object_show(execwatch->execwatch_obj);
execwatch->icon_obj = edje_object_add(gc->evas);
+ execwatch->icon_custom_obj = e_icon_add(gc->evas);
gcc = e_gadcon_client_new(gc, name, id, style, execwatch->execwatch_obj);
gcc->data = inst;
@@ -211,6 +213,7 @@ _config_item_get(const char *id)
ci = E_NEW(Config_Item, 1);
ci->id = eina_stringshare_add(id);
ci->display_name = eina_stringshare_add("Edit!");
+ ci->icon_path = eina_stringshare_add("");
ci->status_cmd = eina_stringshare_add("");
ci->dblclk_cmd = eina_stringshare_add("");
ci->okstate_mode = 0;
@@ -241,6 +244,15 @@ _execwatch_icon(Instance *inst, char *ic
"base/theme/modules/execwatch/icons", buf))
edje_object_file_set(execwatch->icon_obj, m, buf);
edje_object_part_swallow(execwatch->execwatch_obj, "icon", execwatch->icon_obj);
+
+ if (inst->ci->icon_path && ecore_file_exists(inst->ci->icon_path))
+ {
+ e_icon_file_set(execwatch->icon_custom_obj, inst->ci->icon_path);
+ edje_object_part_swallow(execwatch->execwatch_obj, "custom_icon", execwatch->icon_custom_obj);
+ edje_object_signal_emit(execwatch->execwatch_obj,"e,visibility,small","e");
+ }
+ else
+ edje_object_signal_emit(execwatch->execwatch_obj,"e,visibility,big","e");
}
static int
@@ -566,6 +578,7 @@ e_modapi_init(E_Module *m)
#define D conf_item_edd
E_CONFIG_VAL(D, T, id, STR);
E_CONFIG_VAL(D, T, display_name, STR);
+ E_CONFIG_VAL(D, T, icon_path, STR);
E_CONFIG_VAL(D, T, status_cmd, STR);
E_CONFIG_VAL(D, T, dblclk_cmd, STR);
E_CONFIG_VAL(D, T, okstate_mode, INT);
@@ -591,6 +604,7 @@ e_modapi_init(E_Module *m)
ci = E_NEW(Config_Item, 1);
ci->id = eina_stringshare_add("0");
ci->display_name = eina_stringshare_add("Edit!");
+ ci->icon_path = eina_stringshare_add("");
ci->status_cmd = eina_stringshare_add("");
ci->dblclk_cmd = eina_stringshare_add("");
ci->okstate_mode = 0;
Index: e_mod_main.h
===================================================================
--- e_mod_main.h (revisione 37665)
+++ e_mod_main.h (copia locale)
@@ -21,6 +21,7 @@ struct _Config_Item
const char *id;
const char *display_name;
+ const char *icon_path;
const char *status_cmd;
const char *dblclk_cmd;
const char *okstate_string;
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel