解决点击继续扫描会重复弹窗进度指示器的问题;BUG-814
This commit is contained in:
parent
cda1388516
commit
cd6298168a
|
@ -1650,45 +1650,32 @@ int scanner::thread_start(void)
|
|||
/*if (indicator_.get() && !IsWindowVisible(indicator_->hwnd()))
|
||||
indicator_->show(true);*/
|
||||
}
|
||||
//else if (indicator_.get())
|
||||
//{
|
||||
// indicator_->notify_scan_over(hg_scanner_err_description(ret), true);
|
||||
//}
|
||||
else
|
||||
{
|
||||
// display error message on progress UI, may be closed immediately by APP, so we hide progress UI and call message_box ...
|
||||
//
|
||||
err_ = ret;
|
||||
#ifdef START_SCAN_IN_THREAD
|
||||
if (callback::show_progress_ui && is_bIndicator && ui_notify && !is_in_working_thread_)
|
||||
{
|
||||
int ev = SANE_EVENT_WORKING;
|
||||
|
||||
ui_notify(SANE_EVENT_SCAN_FINISHED, (void *)hg_scanner_err_description(ret), ret);
|
||||
}
|
||||
else if(!is_in_working_thread_)
|
||||
#endif
|
||||
{
|
||||
scan_over_ = true;
|
||||
if (callback::close_ui)
|
||||
callback::close_ui(UI_INDICATOR);
|
||||
|
||||
if (callback::show_messagebox_ui)
|
||||
{
|
||||
callback::show_messagebox_ui(app_wnd_, ret, (void*)hg_scanner_err_description(ret), 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstring msg(local_trans::a2u(hg_scanner_err_description(ret), CP_UTF8));
|
||||
|
||||
//if (indicator_.get())
|
||||
// indicator_->show(false);
|
||||
if (!IsWindow(app_wnd_))
|
||||
callback::bring_message_box_topmost(local_trans::lang_trans_between_hz936(CONST_STRING_START_FAILED).c_str());
|
||||
MessageBoxW(app_wnd_, msg.c_str(), local_trans::lang_trans_between_hz936(CONST_STRING_START_FAILED).c_str(), MB_OK | MB_ICONERROR);
|
||||
}
|
||||
is_scanning_ = false;
|
||||
//start失败或阻塞时就不再调用回调通知 BUG-814
|
||||
if (ui_notify)
|
||||
{
|
||||
ui_notify(SANE_EVENT_WORKING, NULL, 0);
|
||||
ui_notify(SANE_EVENT_SCAN_FINISHED, (void*)hg_scanner_err_description(ret), ret);
|
||||
while (is_scanning_)
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(3));
|
||||
}
|
||||
else if (callback::show_messagebox_ui)
|
||||
{
|
||||
callback::show_messagebox_ui(app_wnd_, ret, (void*)hg_scanner_err_description(ret), 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstring msg(local_trans::a2u(hg_scanner_err_description(ret), CP_UTF8));
|
||||
if (!IsWindow(app_wnd_))
|
||||
callback::bring_message_box_topmost(local_trans::lang_trans_between_hz936(CONST_STRING_START_FAILED).c_str());
|
||||
MessageBoxW(app_wnd_, msg.c_str(), local_trans::lang_trans_between_hz936(CONST_STRING_START_FAILED).c_str(), MB_OK | MB_ICONERROR);
|
||||
}
|
||||
|
||||
scan_over_ = true;
|
||||
is_scanning_ = false;
|
||||
}
|
||||
prev_start_result_ = ret;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifdef max
|
||||
#ifdef max
|
||||
#undef max
|
||||
#endif
|
||||
#ifdef min
|
||||
|
@ -3927,6 +3927,7 @@ int huagao_ds::handle_scanner_event(int ev, bool from_event_proc)
|
|||
//}
|
||||
break;
|
||||
case SANE_EVENT_TWAIN_XFER_READY:
|
||||
load_sane_util::log_info(L"notifyXferReady ...\r\n", 1);
|
||||
notifyXferReady();
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue