Beispiel #1
0
void
connman_init(void)
{
  TAILQ_INIT(&connman_services);

  netconf_model = prop_create_root(NULL);
  prop_concat_t *pc = prop_concat_create(prop_create(netconf_model, "nodes"));

  net_state     = prop_create(netconf_model, "status");
  prop_set(netconf_model, "type", PROP_SET_STRING, "directory");

  prop_t *m = prop_create(netconf_model, "metadata");
  prop_set(m, "title", PROP_SET_RSTRING, _("Network connections"));


  // service_nodes contains list of items we receive from connman
  service_nodes = prop_create_root(NULL);
  prop_concat_add_source(pc, service_nodes, NULL);

  // settings
  connman_settings = prop_create_root(NULL);

  prop_t *delim = prop_create_root(NULL);
  prop_set_string(prop_create(delim, "type"), "separator");
  prop_concat_add_source(pc, prop_create(connman_settings, "nodes"), delim);

  settings_add_url(gconf.settings_network,
		   _p("Network connections"), NULL, NULL, NULL, MYURL,
		   SETTINGS_FIRST);

  hts_thread_create_detached("connman", connman_thread, NULL,
			     THREAD_PRIO_BGTASK);
}
Beispiel #2
0
void
settings_init(void)
{
  prop_t *n, *d, *model;
  prop_t *s1;

  settings_root = prop_create(prop_get_global(), "settings");
  prop_set_string(prop_create(settings_root, "type"), "settings");
  set_title(settings_root, _p("Global settings"));




  settings_nodes = prop_create_root(NULL);
  s1 = prop_create_root(NULL);

  prop_nf_create(s1,
		 settings_nodes, NULL, "node.model.metadata.title",
		 PROP_NF_AUTODESTROY);


  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(prop_create(settings_apps, "model"), "nodes");

  d = prop_create_root(NULL);
  model = prop_create(d, "model");
  set_title(model, _p("Applications and installed plugins"));
  prop_set_string(prop_create(model, "type"), "divider");
  prop_concat_add_source(pc, n, d);


  d = prop_create_root(NULL);
  model = prop_create(d, "model");
  set_title(model, _p("Discovered media sources"));
  prop_set_string(prop_create(model, "type"), "divider");

  n = prop_create(prop_create(settings_sd, "model"), "nodes");
  prop_concat_add_source(pc, n, d);

  // General settings

  settings_general = settings_add_dir(NULL, _p("General"), NULL, NULL,
				      _p("System related settings"));
}
Beispiel #3
0
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();
}