Merge branch 'master' of http://192.168.100.140:8099/sane/code_app
This commit is contained in:
commit
8aba11e6ec
|
@ -825,29 +825,37 @@ void MainWindow::on_new_image(void *img, int statu)
|
|||
if (1 == m_scanType)
|
||||
{
|
||||
QString fileName = getCacheFileName(image);
|
||||
HGImgFmt_SaveImage(image, 0, nullptr, getStdString(fileName).c_str());
|
||||
HGResult ret = HGImgFmt_SaveImage(image, 0, nullptr, getStdString(fileName).c_str());
|
||||
|
||||
if(statu != SANE_Image_Statu_OK)
|
||||
if(ret == HGBASE_ERR_OK)
|
||||
{
|
||||
int ind = 0;
|
||||
if(m_scanInsertPos == -1)
|
||||
m_thumb->getItemCount(&ind);
|
||||
if(statu != SANE_Image_Statu_OK)
|
||||
{
|
||||
int ind = 0;
|
||||
if(m_scanInsertPos == -1)
|
||||
m_thumb->getItemCount(&ind);
|
||||
else
|
||||
ind = m_scanInsertPos;
|
||||
|
||||
dialog_wrong_img *wi = new dialog_wrong_img(this, fileName, ind, statu);
|
||||
connect(wi, SIGNAL(handle_wrong_img(dialog_wrong_img*, bool)), this, SLOT(on_wrong_image_decide(dialog_wrong_img*, bool)));
|
||||
wrong_imgs_.push_back(wi);
|
||||
wi->show();
|
||||
}
|
||||
else if (-1 == m_scanInsertPos)
|
||||
{
|
||||
m_thumb->addItem(fileName);
|
||||
}
|
||||
else
|
||||
ind = m_scanInsertPos;
|
||||
|
||||
dialog_wrong_img *wi = new dialog_wrong_img(this, fileName, ind, statu);
|
||||
connect(wi, SIGNAL(handle_wrong_img(dialog_wrong_img*, bool)), this, SLOT(on_wrong_image_decide(dialog_wrong_img*, bool)));
|
||||
wrong_imgs_.push_back(wi);
|
||||
wi->show();
|
||||
}
|
||||
else if (-1 == m_scanInsertPos)
|
||||
{
|
||||
m_thumb->addItem(fileName);
|
||||
{
|
||||
m_thumb->insertItem(fileName, m_scanInsertPos);
|
||||
++m_scanInsertPos;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_thumb->insertItem(fileName, m_scanInsertPos);
|
||||
++m_scanInsertPos;
|
||||
m_dialogLog->addLog(tr("save failed"), true);
|
||||
m_wndStatusBar->setDeviceStatusInfo(tr("save failed"), true);
|
||||
}
|
||||
}
|
||||
else if (2 == m_scanType)
|
||||
|
@ -1018,10 +1026,12 @@ void MainWindow::on_new_image(void *img, int statu)
|
|||
saveInfo.tiffCompression = HGIMGFMT_TIFFCOMP_JPEG;
|
||||
}
|
||||
|
||||
saveImage(image, &saveInfo, m_aquireIntoSaveParam.m_isOcr, getStdString(scanFileName).c_str());
|
||||
|
||||
m_thumb->addItem(scanFileName);
|
||||
++m_aquireIntoSaveParam.m_fileNameStartIndex;
|
||||
HGResult ret = saveImage(image, &saveInfo, m_aquireIntoSaveParam.m_isOcr, getStdString(scanFileName).c_str());
|
||||
if(ret == HGBASE_ERR_OK)
|
||||
{
|
||||
m_thumb->addItem(scanFileName);
|
||||
++m_aquireIntoSaveParam.m_fileNameStartIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1873,6 +1883,8 @@ void MainWindow::on_act_save_triggered()
|
|||
else
|
||||
{
|
||||
QMessageBox::information(this, tr("info"), tr("save failed"));
|
||||
m_dialogLog->addLog(tr("save failed"), true);
|
||||
m_wndStatusBar->setDeviceStatusInfo(tr("save failed"), true);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2009,6 +2021,8 @@ void MainWindow::on_act_saveAs_triggered()
|
|||
else
|
||||
{
|
||||
QMessageBox::information(this, tr("info"), tr("save failed"));
|
||||
m_dialogLog->addLog(tr("save failed"), true);
|
||||
m_wndStatusBar->setDeviceStatusInfo(tr("save failed"), true);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue