默认打开设备失败支持弹窗显示

This commit is contained in:
yangjiaxuan 2023-06-19 14:56:36 +08:00
parent 22254e0aaa
commit 25ebf4c4fc
2 changed files with 1 additions and 10 deletions

View File

@ -166,7 +166,6 @@ HGResult HGTwainDSMImpl::OpenDS(HGUInt index, class HGTwainDSImpl** dsImpl)
return ret;
}
saveCfgValue("twain", "showMsgBox", true);
std::string DSName = m_vds[index].ProductName;
saveCfgValue("twain", "source", DSName);
m_listDSImpl.push_back(newDSImpl);
@ -186,7 +185,6 @@ HGResult HGTwainDSMImpl::OpenDefaultDS(class HGTwainDSImpl** dsImpl)
return HGBASE_ERR_FAIL;
}
saveCfgValue("twain", "showMsgBox", false);
std::string sourceName = getCfgValue("twain", "source", std::string(""));
int index = -1;
@ -226,8 +224,6 @@ HGResult HGTwainDSMImpl::OpenSelectedDS(class HGTwainDSImpl** dsImpl)
return HGBASE_ERR_INVALIDARG;
}
saveCfgValue("twain", "showMsgBox", true);
TW_IDENTITY selectDS;
if (TWRC_SUCCESS != m_pDSMProc(&m_AppId, NULL, DG_CONTROL, DAT_IDENTITY, MSG_USERSELECT, &selectDS))
{
@ -256,7 +252,6 @@ HGResult HGTwainDSMImpl::OpenSelectedDSEx(class HGTwainDSImpl** dsImpl)
return HGBASE_ERR_INVALIDARG;
}
saveCfgValue("twain", "showMsgBox", true);
std::string sourceName = getCfgValue("twain", "source", std::string(""));
TW_IDENTITY selectDS;

View File

@ -207,11 +207,7 @@ int show_messagebox_ui(HWND parent, int event, void *msg, int flag)
g_manager = new Manager;
}
bool showMsgBox = getCfgValue("twain", "showMsgBox", true);
if (showMsgBox)
return g_manager->showMessageBoxUi(nullptr == g_hThread, parent, event, msg, flag);
return 0;
return g_manager->showMessageBoxUi(nullptr == g_hThread, parent, event, msg, flag);
}
int show_twain_srclist_ui(const TW_IDENTITY *vds, HGUInt count, const HGChar *defDsName, HGWindow parent, TW_IDENTITY *ds)