void settings_init(void) { prop_t *n, *d; prop_t *s1; settings_root = prop_create(prop_get_global(), "settings"); prop_set_string(prop_create(settings_root, "type"), "settings"); set_title2(settings_root, _p("Global settings")); settings_nodes = prop_create_root(NULL); s1 = prop_create_root(NULL); struct prop_nf *pnf; pnf = prop_nf_create(s1, settings_nodes, NULL, PROP_NF_AUTODESTROY); prop_nf_sort(pnf, "node.metadata.title", 0, 0, NULL, 1); settings_apps = prop_create_root(NULL); settings_sd = prop_create_root(NULL); prop_concat_t *pc; pc = prop_concat_create(prop_create(settings_root, "nodes"), 0); prop_concat_add_source(pc, s1, NULL); // Applications and plugins n = prop_create(settings_apps, "nodes"); d = prop_create_root(NULL); set_title2(d, _p("Applications and installed plugins")); prop_set_string(prop_create(d, "type"), "separator"); prop_concat_add_source(pc, n, d); d = prop_create_root(NULL); set_title2(d, _p("Discovered media sources")); prop_set_string(prop_create(d, "type"), "separator"); n = prop_create(settings_sd, "nodes"); prop_concat_add_source(pc, n, d); // General settings settings_general = settings_add_dir(NULL, _p("General"), NULL, NULL, _p("System related settings"), "settings:general"); // Developer settings, only available via its URI init_dev_settings(); }
static prop_t * setting_add(prop_t *parent, prop_t *title, const char *type, int flags) { prop_t *p = setting_get(parent, flags); if(title != NULL) set_title2(p, title); prop_set_string(prop_create(p, "type"), type); return p; }