handle more properties for .desktop fiels in config panel

SVN revision: 34647
This commit is contained in:
Carsten Haitzler 2008-05-23 14:40:51 +00:00
parent 251411d2b6
commit cf330f0023
1 changed files with 24 additions and 3 deletions

View File

@ -75,6 +75,8 @@ _e_configure_efreet_desktop_update(void)
{ {
char *s; char *s;
char *cfg_cat_item; char *cfg_cat_item;
char *cfg_cat_name;
char *cfg_cat_icon;
char *cfg_cat; char *cfg_cat;
char *cfg_cat_cfg; char *cfg_cat_cfg;
char *cfg_icon; char *cfg_icon;
@ -86,12 +88,24 @@ _e_configure_efreet_desktop_update(void)
cfg_icon = NULL; cfg_icon = NULL;
cfg_cat_cfg = NULL; cfg_cat_cfg = NULL;
cfg_pri = 1000; cfg_pri = 1000;
cfg_cat_name = NULL;
cfg_cat_icon = NULL;
label = NULL; label = NULL;
if (desktop->x) if (desktop->x)
{ {
cfg_cat_cfg = ecore_hash_get(desktop->x, "X-Enlightenment-Config-Category"); cfg_cat_cfg = ecore_hash_get(desktop->x, "X-Enlightenment-Config-Category");
s = ecore_hash_get(desktop->x, "X-Enlightenment-Config-Priority"); s = ecore_hash_get(desktop->x, "X-Enlightenment-Config-Priority");
if (s) cfg_pri = atoi(s); if (s) cfg_pri = atoi(s);
cfg_cat_name = ecore_hash_get(desktop->x, "X-Enlightenment-Config-Category-Name");
cfg_cat_icon = ecore_hash_get(desktop->x, "X-Enlightenment-Config-Category-Icon");
if (cfg_cat_icon)
{
if (cfg_cat_icon[0] == '/')
cfg_cat_icon = strdup(cfg_cat_icon);
else
cfg_cat_icon = efreet_icon_path_find(e_config->icon_theme,
cfg_cat_icon, "64x64");
}
} }
if (desktop->icon) if (desktop->icon)
{ {
@ -106,12 +120,16 @@ _e_configure_efreet_desktop_update(void)
else label = "???"; else label = "???";
if (!cfg_cat_cfg) if (!cfg_cat_cfg)
{ {
char *ic;
snprintf(buf, sizeof(buf), "system/%s", label); snprintf(buf, sizeof(buf), "system/%s", label);
cfg_cat_cfg = buf; cfg_cat_cfg = buf;
ic = cfg_cat_icon;
if (!ic) ic = "enlightenment/system";
e_configure_registry_category_add("system", e_configure_registry_category_add("system",
1000, _("System"), 1000, _("System"),
NULL, NULL,
"enlightenment/system"); // FIXME: another icon? ic);
} }
else else
{ {
@ -119,10 +137,12 @@ _e_configure_efreet_desktop_update(void)
if (!cfg_cat) cfg_cat = strdup(cfg_cat_cfg); if (!cfg_cat) cfg_cat = strdup(cfg_cat_cfg);
if (cfg_cat) if (cfg_cat)
{ {
if (!cfg_cat_name)
cfg_cat_name = cfg_cat;
e_configure_registry_category_add(cfg_cat, e_configure_registry_category_add(cfg_cat,
1000, cfg_cat, 1000, cfg_cat_name,
NULL, NULL,
NULL); // FIXME: icon? cfg_cat_icon);
free(cfg_cat); free(cfg_cat);
cfg_cat = NULL; cfg_cat = NULL;
} }
@ -132,6 +152,7 @@ _e_configure_efreet_desktop_update(void)
NULL, NULL, NULL, NULL,
desktop); desktop);
if (cfg_icon) free(cfg_icon); if (cfg_icon) free(cfg_icon);
if (cfg_cat_icon) free(cfg_cat_icon);
} }
} }