forked from enlightenment/enlightenment
parent
b0d91c41a0
commit
4c5af3776c
|
@ -125,13 +125,13 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
||||||
/* generate the core widget layout for a basic dialog */
|
/* generate the core widget layout for a basic dialog */
|
||||||
Evas_Object *o, *o2, *fr, *im = NULL;
|
Evas_Object *o, *o2, *fr, *im = NULL;
|
||||||
Evas_Object *il;
|
Evas_Object *il;
|
||||||
char buf[4096];
|
|
||||||
char *homedir;
|
char *homedir;
|
||||||
Evas_Object *theme;
|
Evas_Object *theme;
|
||||||
char fulltheme[PATH_MAX];
|
char fulltheme[PATH_MAX];
|
||||||
int i = 0, j, selnum = -1;
|
int i = 0, selnum = -1;
|
||||||
Ecore_Evas *eebuf;
|
Ecore_Evas *eebuf;
|
||||||
Evas *evasbuf;
|
Evas *evasbuf;
|
||||||
|
Evas_List *l, *paths;
|
||||||
|
|
||||||
theme = edje_object_add(evas);
|
theme = edje_object_add(evas);
|
||||||
|
|
||||||
|
@ -145,42 +145,52 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
||||||
eebuf = ecore_evas_buffer_new(1, 1);
|
eebuf = ecore_evas_buffer_new(1, 1);
|
||||||
evasbuf = ecore_evas_get(eebuf);
|
evasbuf = ecore_evas_get(eebuf);
|
||||||
o2 = edje_object_add(evasbuf);
|
o2 = edje_object_add(evasbuf);
|
||||||
|
|
||||||
for (j = 0; j < 2; j++)
|
paths = e_path_dir_list_get(path_themes);
|
||||||
|
for (l = paths; l; l = l->next)
|
||||||
{
|
{
|
||||||
Ecore_List *themes;
|
Ecore_List *themes;
|
||||||
char *themefile;
|
char *themefile;
|
||||||
|
E_Path_Dir *ep;
|
||||||
if (j == 0)
|
int detected;
|
||||||
{
|
|
||||||
homedir = e_user_homedir_get();
|
ep = l->data;
|
||||||
if (homedir)
|
|
||||||
{
|
if (!ecore_file_is_dir(ep->dir)) continue;
|
||||||
snprintf(buf, sizeof(buf), "%s/.e/e/themes", homedir);
|
themes = ecore_file_ls(ep->dir);
|
||||||
free(homedir);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else if (j == 1)
|
|
||||||
snprintf(buf, sizeof(buf), "%s/data/themes", e_prefix_data_get());
|
|
||||||
if (!ecore_file_is_dir(buf)) continue;
|
|
||||||
themes = ecore_file_ls(buf);
|
|
||||||
if (!themes) continue;
|
if (!themes) continue;
|
||||||
if (j == 0)
|
|
||||||
|
detected = 0;
|
||||||
|
homedir = e_user_homedir_get();
|
||||||
|
if (homedir)
|
||||||
{
|
{
|
||||||
e_widget_ilist_header_append(il, NULL, _("Personal"));
|
if (!strncmp(ep->dir, homedir, strlen(homedir)))
|
||||||
i++;
|
{
|
||||||
|
e_widget_ilist_header_append(il, NULL, _("Personal"));
|
||||||
|
i++;
|
||||||
|
detected = 1;
|
||||||
|
}
|
||||||
|
free(homedir);
|
||||||
}
|
}
|
||||||
else if (j == 1)
|
if (!detected)
|
||||||
{
|
{
|
||||||
e_widget_ilist_header_append(il, NULL, _("System"));
|
if (!strncmp(ep->dir, e_prefix_data_get(), strlen(e_prefix_data_get())))
|
||||||
|
{
|
||||||
|
e_widget_ilist_header_append(il, NULL, _("System"));
|
||||||
|
i++;
|
||||||
|
detected = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!detected)
|
||||||
|
{
|
||||||
|
e_widget_ilist_header_append(il, NULL, _("Other"));
|
||||||
i++;
|
i++;
|
||||||
|
detected = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((themefile = ecore_list_next(themes)))
|
while ((themefile = ecore_list_next(themes)))
|
||||||
{
|
{
|
||||||
snprintf(fulltheme, sizeof(fulltheme), "%s/%s", buf, themefile);
|
snprintf(fulltheme, sizeof(fulltheme), "%s/%s", ep->dir, themefile);
|
||||||
if (ecore_file_is_dir(fulltheme)) continue;
|
if (ecore_file_is_dir(fulltheme)) continue;
|
||||||
|
|
||||||
/* minimum theme requirements */
|
/* minimum theme requirements */
|
||||||
|
@ -220,6 +230,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
||||||
free(themefile);
|
free(themefile);
|
||||||
ecore_list_destroy(themes);
|
ecore_list_destroy(themes);
|
||||||
}
|
}
|
||||||
|
if (paths) e_path_dir_list_free(paths);
|
||||||
evas_object_del(o2);
|
evas_object_del(o2);
|
||||||
ecore_evas_free(eebuf);
|
ecore_evas_free(eebuf);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue