invoke sane_opt_provider::enable when options changed

This commit is contained in:
gb 2023-11-30 08:59:51 +08:00
parent 0b5aeff5ab
commit 123a0c5a31
1 changed files with 18 additions and 1 deletions

View File

@ -1304,7 +1304,24 @@ gb_json* device_option::copy_opt(gb_json* from)
// 2: enabled ...
if (slaver_.count(to->key()))
to->set_value("enabled", slaver_[to->key()]->value(&device_option::calc_simple_logic_expression, this));
{
bool enable = slaver_[to->key()]->value(&device_option::calc_simple_logic_expression, this);
to->set_value("enabled", enable);
if (src_.count(to->key()))
{
src_[to->key()]->enable(to->key().c_str(), enable);
sane_opt_provider* next = src_[to->key()]->get_following(to->key().c_str());
while (next)
{
next->enable(to->key().c_str(), enable);
sane_opt_provider* next1 = next->get_following(to->key().c_str());
next->release();
next = next1;
}
}
}
// 3: default value ...
if (init_value_.count(to->key()))