恢复设置语言时,通过回调重新加载属性,在流程中过滤不重复加载
This commit is contained in:
parent
f04fa05a4e
commit
776541ad77
|
@ -532,7 +532,7 @@ hg_sane_middleware::hg_sane_middleware(void) : opt_0_(nullptr), init_ok_(false)
|
||||||
|
|
||||||
if (lang_get_cur_code_page() != DEFAULT_CODE_PAGE)
|
if (lang_get_cur_code_page() != DEFAULT_CODE_PAGE)
|
||||||
lang_refresh_language();
|
lang_refresh_language();
|
||||||
// register_language_changed_notify(&hg_sane_middleware::language_changed, true); - called when reload_option
|
register_language_changed_notify(&hg_sane_middleware::language_changed, true);
|
||||||
|
|
||||||
#if !defined(WIN32) && !defined(_WIN64)
|
#if !defined(WIN32) && !defined(_WIN64)
|
||||||
char path[512] = { 0 };
|
char path[512] = { 0 };
|
||||||
|
@ -1977,6 +1977,7 @@ SANE_Status hg_sane_middleware::set_option(SANE_Handle h, const void* option, SA
|
||||||
{
|
{
|
||||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "the setting '%s' affects other options value, RELOAD ...\n", desc_title.c_str());
|
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "the setting '%s' affects other options value, RELOAD ...\n", desc_title.c_str());
|
||||||
//on_SCANNER_ERR_CONFIGURATION_CHANGED(dev);
|
//on_SCANNER_ERR_CONFIGURATION_CHANGED(dev);
|
||||||
|
if(dev->fixed_id.count(SANE_OPT_ID_LANGUAGE) && dev->fixed_id[SANE_OPT_ID_LANGUAGE] != id) // language reload by callback already
|
||||||
reload_options(handle);
|
reload_options(handle);
|
||||||
err = (scanner_err)SANE_INFO_RELOAD_OPTIONS;
|
err = (scanner_err)SANE_INFO_RELOAD_OPTIONS;
|
||||||
}
|
}
|
||||||
|
@ -1989,6 +1990,7 @@ SANE_Status hg_sane_middleware::set_option(SANE_Handle h, const void* option, SA
|
||||||
{
|
{
|
||||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "the setting '%s' affects image parameter and options, APP should re-get image info and reload options...\n", desc_title.c_str());
|
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "the setting '%s' affects image parameter and options, APP should re-get image info and reload options...\n", desc_title.c_str());
|
||||||
//on_SCANNER_ERR_CONFIGURATION_CHANGED(dev);
|
//on_SCANNER_ERR_CONFIGURATION_CHANGED(dev);
|
||||||
|
if (dev->fixed_id.count(SANE_OPT_ID_LANGUAGE) && dev->fixed_id[SANE_OPT_ID_LANGUAGE] != id) // language reload by callback already
|
||||||
reload_options(handle);
|
reload_options(handle);
|
||||||
err = (scanner_err)(SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS);
|
err = (scanner_err)(SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue