forked from enlightenment/enlightenment
module.desktop almost working, but e_module_dialog_show has issues with
it. Probably something silly. SVN revision: 25346
This commit is contained in:
parent
e543d1ba2d
commit
9b37ece08c
|
@ -1536,11 +1536,37 @@ 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;
|
||||
|
||||
if (a->icon_path)
|
||||
o = _e_app_icon_path_add(evas, a);
|
||||
else
|
||||
{
|
||||
o = edje_object_add(evas);
|
||||
if (!e_util_edje_icon_list_set(o, a->icon_class))
|
||||
{
|
||||
|
@ -1562,9 +1588,8 @@ e_app_icon_add(Evas *evas, E_App *a)
|
|||
{
|
||||
/* 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);
|
||||
o = _e_app_icon_path_add(evas, a);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.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));
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue