sane双张提示只弹窗一次
This commit is contained in:
parent
5536b0a932
commit
5b85b3ef02
|
@ -216,6 +216,7 @@ DeviceUser::DeviceUser(QWidget *wnd, HGSaneSource source, const QString &passwor
|
|||
m_source = source;
|
||||
m_saneDev = nullptr;
|
||||
m_password = password;
|
||||
m_reserveImage = false;
|
||||
}
|
||||
|
||||
DeviceUser::~DeviceUser()
|
||||
|
@ -366,6 +367,7 @@ void HGAPI DeviceUser::DeviceEventFunc(HGSaneDevice dev, HGUInt event, HGPointer
|
|||
if (HGSANE_EVENT_TYPE_SCANFINISHED == event)
|
||||
{
|
||||
emit p->scanFinishEvent();
|
||||
p->m_reserveImage = false;
|
||||
}
|
||||
else if (HGSANE_EVENT_TYPE_WORKING == event)
|
||||
{
|
||||
|
@ -377,13 +379,14 @@ HGUInt HGAPI DeviceUser::DeviceImageFunc(HGSaneDevice dev, HGImage image, HGUInt
|
|||
{
|
||||
DeviceUser* p = (DeviceUser*)param;
|
||||
HGUInt result = HGBASE_ERR_OK;
|
||||
if (HGSANE_IMAGE_TYPE_DOUBLE == type)
|
||||
if (HGSANE_IMAGE_TYPE_DOUBLE == type && !p->m_reserveImage)
|
||||
{
|
||||
emit p->abnormalImage(image, &result);
|
||||
}
|
||||
|
||||
if (HGBASE_ERR_OK == result)
|
||||
{
|
||||
p->m_reserveImage = true;
|
||||
emit p->newImage(image);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -133,6 +133,8 @@ private:
|
|||
HGSaneSource m_source;
|
||||
HGSaneDevice m_saneDev;
|
||||
QString m_password;
|
||||
|
||||
bool m_reserveImage;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -7,8 +7,9 @@ Dialog_AbnormalImage::Dialog_AbnormalImage(HGImage image, QWidget *parent) :
|
|||
ui(new Ui::Dialog_AbnormalImage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint | Qt::WindowStaysOnTopHint);
|
||||
|
||||
m_result = HGBASE_ERR_OK;
|
||||
m_result = HGBASE_ERR_FAIL;
|
||||
|
||||
m_view = new HGImgView(this);
|
||||
m_view->addImage(image);
|
||||
|
|
Loading…
Reference in New Issue