module.desktop almost working, but e_module_dialog_show has issues with

it.  Probably something silly.


SVN revision: 25346
This commit is contained in:
David Walter Seikel 2006-09-02 11:58:53 +00:00
parent e543d1ba2d
commit 9b37ece08c
3 changed files with 58 additions and 26 deletions

View File

@ -1536,35 +1536,60 @@ e_app_valid_exe_get(E_App *a)
return ok;
}
static Evas_Object *
_e_app_icon_path_add(Evas *evas, E_App *a)
{
Evas_Object *o;
char *ext;
o = e_icon_add(evas);
ext = strrchr(a->icon_path, '.');
if (ext)
{
if (strcmp(ext, ".edj") == 0)
e_icon_file_edje_set(o, a->icon_path, "icon");
else
e_icon_file_set(o, a->icon_path);
}
else
e_icon_file_set(o, a->icon_path);
e_icon_fill_inside_set(o, 1);
return o;
}
EAPI Evas_Object *
e_app_icon_add(Evas *evas, E_App *a)
{
Evas_Object *o;
o = edje_object_add(evas);
if (!e_util_edje_icon_list_set(o, a->icon_class))
if (a->icon_path)
o = _e_app_icon_path_add(evas, a);
else
{
if (edje_object_file_set(o, a->path, "icon"))
{
; /* It's a bit more obvious this way. */
}
else if (a->icon_class) /* If that fails, then this might be an FDO icon. */
{
char *v;
o = edje_object_add(evas);
if (!e_util_edje_icon_list_set(o, a->icon_class))
{
if (edje_object_file_set(o, a->path, "icon"))
{
; /* It's a bit more obvious this way. */
}
else if (a->icon_class) /* If that fails, then this might be an FDO icon. */
{
char *v;
/* FIXME: Use a real icon size. */
v = (char *) ecore_desktop_icon_find(a->icon_class, NULL, e_config->icon_theme);
if (v)
a->icon_path = evas_stringshare_add(v);
}
/* FIXME: Use a real icon size. */
v = (char *) ecore_desktop_icon_find(a->icon_class, NULL, e_config->icon_theme);
if (v)
a->icon_path = evas_stringshare_add(v);
}
if (a->icon_path)
{
/* Free the aborted object first. */
if (o) evas_object_del(o);
o = e_icon_add(evas);
e_icon_file_set(o, a->icon_path);
e_icon_fill_inside_set(o, 1);
if (a->icon_path)
{
/* Free the aborted object first. */
if (o) evas_object_del(o);
o = _e_app_icon_path_add(evas, a);
}
}
}

View File

@ -264,13 +264,14 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
{
if (m->enabled) cm->state = MOD_ENABLED;
}
snprintf(buf, sizeof(buf), "%s/module.eap", cm->path);
snprintf(buf, sizeof(buf), "%s/module.desktop", cm->path);
if (!ecore_file_exists(buf))
snprintf(buf, sizeof(buf), "%s/module.eap", cm->path);
a = e_app_new(buf, 0);
if (a)
{
oc = edje_object_add(evas);
edje_object_file_set(oc, buf, "icon");
oc = e_app_icon_add(evas, a);
e_widget_ilist_append(ilist, oc, a->name, NULL, NULL, cm->name);
e_object_unref(E_OBJECT(a));
}

View File

@ -379,9 +379,11 @@ e_module_dialog_show(E_Module *m, const char *title, const char *body)
{
E_App *app;
printf("e_module_dialog_show() - Trying %s\n", eap);
app = e_app_new(eap, 0);
if (app)
{
printf("e_module_dialog_show() - Trying %s, and it exists.\n", eap);
dia->icon_object = e_app_icon_add(e_win_evas_get(dia->win), app);
edje_extern_object_min_size_set(dia->icon_object, 64, 64);
edje_object_part_swallow(dia->bg_object, "icon_swallow", dia->icon_object);
@ -393,10 +395,14 @@ e_module_dialog_show(E_Module *m, const char *title, const char *body)
{
snprintf(eap, sizeof(eap), "%s/module.edj", e_module_dir_get(m));
if (ecore_file_exists(eap))
_e_module_dialog_icon_set(dia, eap);
{
printf("e_module_dialog_show() - Trying %s\n", eap);
_e_module_dialog_icon_set(dia, eap);
}
else
{
snprintf(eap, sizeof(eap), "%s/module.eap", e_module_dir_get(m));
printf("e_module_dialog_show() - Trying %s\n", eap);
_e_module_dialog_icon_set(dia, eap);
}
}