degesch: start using "on_change" notifications

Terminal attributes can be changed on the fly now.
This commit is contained in:
2015-07-05 15:57:53 +02:00
parent 34c1df5171
commit 3a922c3c1a
2 changed files with 68 additions and 27 deletions

View File

@@ -1911,8 +1911,6 @@ config_schema_initialize_item (struct config_schema *schema,
item->schema = schema;
item->user_data = user_data;
if (schema->on_change)
schema->on_change (item);
}
static void
@@ -1924,6 +1922,22 @@ config_schema_apply_to_object (struct config_schema *schema_array,
config_schema_initialize_item (schema_array++, object, user_data);
}
static void
config_schema_call_changed (struct config_item_ *item)
{
if (item->type == CONFIG_ITEM_OBJECT)
{
struct str_map_iter iter;
str_map_iter_init (&iter, &item->value.object);
struct config_item_ *child;
while ((child = str_map_iter_next (&iter)))
config_schema_call_changed (child);
}
else if (item->schema && item->schema->on_change)
item->schema->on_change (item);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// XXX: this doesn't necessarily have to be well designed at all