diff --git a/app/scanner2/Scanner_zh_CN.qm b/app/scanner2/Scanner_zh_CN.qm index 67ab2e1d..fb603370 100644 Binary files a/app/scanner2/Scanner_zh_CN.qm and b/app/scanner2/Scanner_zh_CN.qm differ diff --git a/app/scanner2/Scanner_zh_CN.ts b/app/scanner2/Scanner_zh_CN.ts index 421d6e8b..94599301 100644 --- a/app/scanner2/Scanner_zh_CN.ts +++ b/app/scanner2/Scanner_zh_CN.ts @@ -13,28 +13,28 @@ - - + + Select log file path 选择日志保存路径 - - + + text(*.txt) 文本文件(*.txt) - - + + Prompt 提示 - - + + Scanner not found! 没有找到扫描仪! @@ -60,6 +60,24 @@ 未找到设备源! + + Dialog_AbnormalImage + + + Dialog + 异常图片 + + + + Reserve + 保留图像 + + + + Discard + 丢弃图像 + + Dialog_Admin @@ -1996,14 +2014,6 @@ bug description: 设备固件自动更新升级中,请稍候... - - Dialog_wrong_img - - - Dialog - - - GraphicsScene @@ -2209,7 +2219,7 @@ bug description: - + act_acquireInto 扫描至... @@ -2439,22 +2449,22 @@ bug description: 选择设备源... - + HuaGoScan 华高扫描软件 - + Grid 多列显示 - + Move To... 移动到... - + Insert files 插入文件 @@ -2463,22 +2473,22 @@ bug description: 没有发现扫描仪 - - - - - + + + + + Question 询问 - + modified, save it? 图像已被修改。 是否保存修改? - + file lost, remove it? 文件已丢失,是否删除? @@ -2503,17 +2513,17 @@ bug description: 扫描完成 - + Clear, then start scan 清空并启动扫描 - + Do NOT clear, then start scan 不清空并启动扫描 - + Already exist images in image list. Do you want to clear? 图像列表中已存在图像。 @@ -2528,12 +2538,12 @@ Do you want to clear? 磁盘空间不足,请删除不需要的文件,以保证有足够的空间 - + Open images 打开图片 - + Insert images 插入图片 @@ -2546,17 +2556,17 @@ Do you want to clear? 保存失败 - + binary 黑白 - + gray 256级灰度 - + rgb 24位彩色 @@ -2565,24 +2575,24 @@ Do you want to clear? 请手动唤醒设备 - + UniScan 紫光扫描软件 - + Scan 扫描软件 - + DeliScan 得力扫描软件 - - - + + + Please go to 'Menu Bar ->Scan' to select a device 请前往菜单栏“扫描->选择设备源...”选择设备 @@ -2591,229 +2601,229 @@ Do you want to clear? 未找到设备源! - - + + default scheme 默认配置方案 - + This scan is complete. Do you want to continue scanning? 本次扫描完成,是否继续扫描? - + thumbnailBar enabled 显示缩略图栏 - + thumbnailBar hidden 隐藏缩略图栏 - + cancel 取消 - - - + + + save succeed 保存成功 - - + + find savePath in thumbnail 图片名在列表中已存在 - + Please select at least one picture before export 请至少选中一张图片再进行导出 - + File name 文件名 - + File path 文件路径 - + File size 文件大小 - + Creation date/time 创建时间 - + Modified date/time 修改时间 - + Accessed date/time 访问时间 - + Format 格式 - + Width 宽度 - + Height 高度 - + depth 深度 - + Color model 色彩模式 - + DPI 每英寸像素点 - + Print size 打印尺寸 - + Frame - + None - + Mono 黑白 - + Gray 灰度 - + Color 彩色 - + Not supported 不支持 - + Warning 警告 - + Device is Running! Please finish scanning first. 设备正在运行! 请先结束扫描。 - + <p>After-sale telephone: %1</p> <p>售后电话: %1</p> - + <p>Company GPS: <a href="%1">%2</a></p> <p>公司地图定位: <a href="%1">%2</a></p> - + Device is offline 设备已断开 - + Open failed 打开失败 - - - - + + + + Prompt 提示 - + <p>DriverVer: %1</p> <p>版本号: %1</p> - - - + + + <p>Vendor: %1</p> <p>制造商: %1</p> - - - + + + <p>Copyright: %1</p> <p>版权信息: %1</p> - - - + + + <p>Company website: <a href="%1">%1</a></p> <p>Company website: <a href=%1>%1</p> <p>公司网址: <a href="%1">%1</p> - - - + + + <p>Company address: %1</p> <p>公司地址: %1</p> - - - + + + <p>Company telephone: %1</p> <p>公司电话: %1</p> - + Baidu map access 百度地图访问 @@ -2834,8 +2844,8 @@ Please finish scanning first. 扫描张数: %1 - - + + Device %1 is open 设备 %1 已打开 @@ -2844,76 +2854,76 @@ Please finish scanning first. 关于 - + cache path folder limit:%1 无法访问当前缓存路径:%1 请尝试在【用户】菜单登录管理员账户,前往【缓存设置】更改缓存路径。 - + aquireinto folder limit:%1 无法访问当前缓存路径:%1 请尝试在【扫描到】更改缓存路径。 - + Image processing failed 图像处理失败 - + Ocr init failed OCR初始化错误 - + Ocr failed OCR错误 - + File does not exist 文件不存在 - + Failed to load dynamic library 加载动态库失败 - + File data error 文件数据错误 - + Image format processing error 图像格式处理错误 - + Out of memory 内存不足 - + Failed 错误 - + The Device has reached roller life 纸轮搓纸次数已超过设计使用范围,扫描过程中搓纸失败、歪斜、搓多张等异常频次可能会明显增多, 请注意及时清洁、并联系设备供应商购买替换纸轮! - - + + The language switch is successful and takes effect the next time the software is started! 语言切换成功,下次启动软件时生效! - + Are you sure to delete selected file? 您确定彻底删除选中项文件? @@ -2931,7 +2941,7 @@ Please finish scanning first. 请尝试在【用户】菜单登录管理员账户,前往【缓存设置】更改缓存路径 - + Insufficient access rights 文件访问权限不足 @@ -2956,18 +2966,18 @@ Please finish scanning first. 关闭 - + tip 提示 - + Other versions not available 未获取到其他版本 - - + + The device does not support this operation 操作失败 @@ -2976,8 +2986,8 @@ Please finish scanning first. IO错误 - - + + error 错误 @@ -2992,7 +3002,7 @@ Continue to close? 是否继续关闭? - + Sure to sign out administrator account? 是否确定登出管理员账户? @@ -3062,92 +3072,92 @@ Continue to close? 启动失败 - + HanvonScan 汉王扫描软件 - + LanxumScan 立思辰扫描软件 - + CumtennScan 沧田扫描软件 - + MicrotekScan Microtek DocWizard EX 扫描软件 - + menu_language 语言 - + act_simpCN 简体中文 - + act_English English - + auto save 自动保存 - + when switching pictures, save the edited pictures directly without reminding 切换图片时,不提醒,直接保存编辑过的图片 - + statusBar displayed 显示状态栏 - + statusBar hidden 隐藏状态栏 - + toolBar displayed 显示工具栏 - + toolBar hidden 隐藏工具栏 - + colorInfo enabled 启用图像信息 - + colorInfo disenabled 关闭图像信息 - + enabling automatic saving 启用自动保存 - + cancel auto save 取消自动保存 - + Automatically save the edited the edited iamge when switching pictures. To cancel, uncheck the menu item: image-> automatically save 切换图片时,自动保存编辑过的图像。若想取消,请取消勾选菜单项:图像->自动保存 @@ -3192,12 +3202,12 @@ Continue to close? 创建图片文件失败: - - - - - - + + + + + + save image doc failed: 保存图片文件失败: @@ -3236,17 +3246,17 @@ Continue to close? 滚轴张数: %1 - + Detected that there is less than 1GB of disk space. Do you want to continue? 检测到磁盘空间已不足1GB,是否继续? - + start failed! 启动安装程序失败! - + There are pictures that have not been saved. Are you sure to close? 有图像未保存,确定关闭? @@ -3256,39 +3266,39 @@ Are you sure to close? 发现设备 : %1 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + tips 提示 - + Are you sure to close? 确定关闭应用软件? - + confirm operation 确认操作 - + are you sure to clear the roller count? 您确定要清除滚轴计数吗 @@ -3297,22 +3307,22 @@ Are you sure to close? 提示 - + Roller scanned count has been set to 0. 辊轴计数已置零 - + Roller scanned count reset failed. 重置滚轴计数失败 - + Error 错误 - + Document missing! It would be deleted or renamed. 文档丢失!文档可能已被删除或被重命名。 @@ -3353,7 +3363,7 @@ Are you sure to close? <p>%1</p><p>版本: %2<br>版权: &#169; %3</p><p>%4%5%6%7%8%9</p> - + about %1 关于 %1 diff --git a/app/scanner2/Scanner_zh_EN.qm b/app/scanner2/Scanner_zh_EN.qm index 0e500e13..67c49ebb 100644 Binary files a/app/scanner2/Scanner_zh_EN.qm and b/app/scanner2/Scanner_zh_EN.qm differ diff --git a/app/scanner2/Scanner_zh_EN.ts b/app/scanner2/Scanner_zh_EN.ts index 16ec98f9..ea8e412d 100644 --- a/app/scanner2/Scanner_zh_EN.ts +++ b/app/scanner2/Scanner_zh_EN.ts @@ -41,28 +41,28 @@ - - + + Select log file path Select log file path - - + + text(*.txt) Text(*.txt) - - + + Prompt Prompt - - + + Scanner not found! Scanner not found! @@ -84,6 +84,24 @@ Device source not found! + + Dialog_AbnormalImage + + + Dialog + Abnormal image + + + + Reserve + Reserve image + + + + Discard + Discard image + + Dialog_Admin @@ -1868,14 +1886,6 @@ Please make sure the two passwords are the same. Device firmware currently updating; please wait... - - Dialog_wrong_img - - - Dialog - - - GraphicsScene @@ -2065,7 +2075,7 @@ Please make sure the two passwords are the same. - + act_acquireInto Scan to... @@ -2295,62 +2305,62 @@ Please make sure the two passwords are the same. Select device source... - + HanvonScan Hanvon scanning software - + LanxumScan LANXUM scanning software - + CumtennScan CUMTENN scanning software - + MicrotekScan Microtek DocWizard EX V1.0 - + DeliScan Deli scanning software - + HuaGoScan HUAGOSCAN scanning software - + menu_language Language - + act_simpCN 简体中文 - + act_English English - + Grid Multi-column display - + Move To... Move to... - + Insert files Insert file @@ -2359,76 +2369,76 @@ Please make sure the two passwords are the same. No scanner detected - + auto save Auto save - + when switching pictures, save the edited pictures directly without reminding Do not show prompt and save the edited images directly when switching images. - + statusBar displayed Show status bar - + statusBar hidden Hide status bar - + toolBar displayed Show toolbar - + toolBar hidden Hide toolbar - + colorInfo enabled Enable image information - + colorInfo disenabled Disable image information - + enabling automatic saving Enable auto save - + cancel auto save Cancel auto save - + Automatically save the edited the edited iamge when switching pictures. To cancel, uncheck the menu item: image-> automatically save Save edited images automatically when switching images. If you want to cancel, please deselect the menu item: Auto save images. - - - - - + + + + + Question Ask - + This scan is complete. Do you want to continue scanning? This scan is complete. Do you want to continue scanning? - + modified, save it? Image modified, save changes? @@ -2445,7 +2455,7 @@ Please make sure the two passwords are the same. No - + file lost, remove it? File lost; delete? @@ -2491,34 +2501,34 @@ Please reselect a path or clear disk space immediately. Failed to create image file: - - - - - - + + + + + + save image doc failed: Failed to save image: - + binary Black and white - - - + + + Please go to 'Menu Bar ->Scan' to select a device Please go to the menu bar 'Scan ->Select device source...' to select a device - + gray Grayscale - + rgb Color @@ -2527,13 +2537,13 @@ Please reselect a path or clear disk space immediately. Failed to start - + UniScan UNI scanning software - - + + default scheme Default scheme @@ -2542,7 +2552,7 @@ Please reselect a path or clear disk space immediately. Please wake up the device manually - + Scan Scanning software @@ -2551,267 +2561,267 @@ Please reselect a path or clear disk space immediately. Device is awake - + thumbnailBar enabled Show thumbnail bar - + thumbnailBar hidden Hide thumbnail bar - + Clear, then start scan Clear and start scan - + Do NOT clear, then start scan Do not clear and start scan - + cancel Cancel - + Already exist images in image list. Do you want to clear? Image already exists in the list of images. Clear? - + Open images Open image - + Insert images Insert image - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + tips prompt - - - + + + save succeed Saved successfully - - + + find savePath in thumbnail Image name already exists in the list - + Please select at least one picture before export Please select at least one image and then export - + File name File name - + File path File path - + File size File size - + Creation date/time Creation time - + Modified date/time Modification time - + Accessed date/time Access time - + Format Format - + Width Width - + Height Height - + depth Depth - + Color model Color mode - + DPI Pixels per inch - + Print size Print size - + Frame Frame - + None None - + Mono Black and white - + Gray Gray scale - + Color Color - + Not supported Not supported - + Warning Warning - + Device is Running! Please finish scanning first. Device is currently running! Please stop scanning first. - + There are pictures that have not been saved. Are you sure to close? There are unsaved images; are you sure you want to close? - + Are you sure to close? Are you sure you want to close? - + Sure to sign out administrator account? Are you sure you want to log out of the administrator account? - + <p>After-sale telephone: %1</p> <p>After-sale telephone: %1</p> - + <p>Company GPS: <a href="%1">%2</a></p> <p>Company Location: <a href="%1">%2</a></p> - + Device is offline Device is offline - + Open failed Open failed - + The Device has reached roller life The paper roller has reached its service life, and the frequency of abnormalities during the scanning process may increase. Please contact the equipment supplier promptly to purchase a replacement paper roller! - - - - + + + + Prompt Prompt - + <p>DriverVer: %1</p> <p>Version: %1</p> - - - + + + <p>Vendor: %1</p> <p>Manufacturer: %1</p> - - - + + + <p>Copyright: %1</p> <p>Copyright: %1</p> - - - + + + <p>Company website: <a href="%1">%1</a></p> <p>Company website: <a href=%1>%1</p> <p>Website: <a href="%1">%1</p> @@ -2821,21 +2831,21 @@ Please contact the equipment supplier promptly to purchase a replacement paper r Device source not found! - - - + + + <p>Company address: %1</p> <p>Address: %1</p> - - - + + + <p>Company telephone: %1</p> <p>Phone Number: %1</p> - + Baidu map access Baidu map access @@ -2890,23 +2900,23 @@ Please contact the equipment supplier promptly to purchase a replacement paper r Total count: %1 - + Detected that there is less than 1GB of disk space. Do you want to continue? Detected that there is less than 1GB of disk space. Do you want to continue? - - + + Device %1 is open Device %1 is open - + confirm operation Confirm operation - + are you sure to clear the roller count? Are you sure you want to clear the roller count? @@ -2915,22 +2925,22 @@ Please contact the equipment supplier promptly to purchase a replacement paper r Prompt - + Roller scanned count has been set to 0. Roller count reset to zero. - + Roller scanned count reset failed. Failed to reset roller count. - + Error Error - + Document missing! It would be deleted or renamed. File lost! File may be deleted or renamed. @@ -2947,13 +2957,13 @@ Please contact the equipment supplier promptly to purchase a replacement paper r About - + cache path folder limit:%1 Unable to access the current path:%1 Please try to log in to the administrator account in the [User] menu and go to the [Cache settings] to change the cache path. - + aquireinto folder limit:%1 Unable to access the current path:%1 Please try to change the cache path in [Scan to]. @@ -2967,7 +2977,7 @@ Please try to change the cache path in [Scan to]. <p>%1</p><p>Version: %2<br>Copyright: &#169; %3</p><p>%4%5%6%7%8%9</p> - + about %1 About %1 @@ -3012,13 +3022,13 @@ Please try to change the cache path in [Scan to]. failed - - + + error Error - + start failed! Failed to start! @@ -3028,52 +3038,52 @@ Please try to change the cache path in [Scan to]. Please go to “Scan to” and change the accessible scan folder and then perform the scan. - + Insufficient access rights Insufficient file access permissions - + Image processing failed Image processing failed - + Ocr init failed OCR initialization error - + Ocr failed OCR failed - + File does not exist File does not exist - + Failed to load dynamic library Failed to load dynamic library - + File data error File data error - + Image format processing error Image format processing error - + Out of memory Insufficient memory - + Failed Failed @@ -3094,18 +3104,18 @@ Please go to “Scan to” and change the accessible scan folder and then perfor Close - + tip Prompt - + Other versions not available No other versions obtained - - + + The device does not support this operation Operation failed @@ -3114,13 +3124,13 @@ Please go to “Scan to” and change the accessible scan folder and then perfor IO error - - + + The language switch is successful and takes effect the next time the software is started! The language switch is successful and takes effect the next time the software is started! - + Are you sure to delete selected file? Are you sure to delete the selected file completely? diff --git a/app/scanner2/device_user.cpp b/app/scanner2/device_user.cpp index ba0b10df..77d5d6d7 100644 --- a/app/scanner2/device_user.cpp +++ b/app/scanner2/device_user.cpp @@ -216,6 +216,8 @@ DeviceUser::DeviceUser(QWidget *wnd, HGSaneSource source, const QString &passwor m_source = source; m_saneDev = nullptr; m_password = password; + m_abnormlImageStatus = HGSANE_IMAGE_STATUS_NO_STATUS; + m_abnormalImageResult = HGBASE_ERR_OK; } DeviceUser::~DeviceUser() @@ -366,29 +368,37 @@ void HGAPI DeviceUser::DeviceEventFunc(HGSaneDevice dev, HGUInt event, HGPointer if (HGSANE_EVENT_TYPE_SCANFINISHED == event) { emit p->scanFinishEvent(); + p->m_abnormlImageStatus = HGSANE_IMAGE_STATUS_NO_STATUS; + p->m_abnormalImageResult = HGBASE_ERR_OK; } else if (HGSANE_EVENT_TYPE_WORKING == event) { emit p->scanWorkingEvent(); + p->m_abnormlImageStatus = HGSANE_IMAGE_STATUS_NO_STATUS; + p->m_abnormalImageResult = HGBASE_ERR_OK; } } HGUInt HGAPI DeviceUser::DeviceImageFunc(HGSaneDevice dev, HGImage image, HGUInt type, HGPointer param) { DeviceUser* p = (DeviceUser*)param; - HGUInt result = HGBASE_ERR_OK; - if (HGSANE_IMAGE_TYPE_DOUBLE == type) + + if (HGSANE_IMAGE_TYPE_DOUBLE == type && HGSANE_IMAGE_STATUS_NO_STATUS == p->m_abnormlImageStatus) { - emit p->abnormalImage(image, &result); + emit p->abnormalImage(image, &p->m_abnormalImageResult); } - if (HGBASE_ERR_OK == result) + if (HGBASE_ERR_OK == p->m_abnormalImageResult || HGSANE_IMAGE_STATUS_RESERVE == p->m_abnormlImageStatus) { + if (HGSANE_IMAGE_TYPE_DOUBLE == type) + p->m_abnormlImageStatus = HGSANE_IMAGE_STATUS_RESERVE; + emit p->newImage(image); } else { - return HGSANE_ERR_STOPSCAN; + p->m_abnormlImageStatus = HGSANE_IMAGE_STATUS_DISCARD; + return HGBASE_ERR_FAIL; } return HGBASE_ERR_OK; diff --git a/app/scanner2/device_user.h b/app/scanner2/device_user.h index 9e214752..8d446525 100644 --- a/app/scanner2/device_user.h +++ b/app/scanner2/device_user.h @@ -133,6 +133,9 @@ private: HGSaneSource m_source; HGSaneDevice m_saneDev; QString m_password; + + HGUInt m_abnormlImageStatus; + HGUInt m_abnormalImageResult; }; #endif diff --git a/app/scanner2/dialog_abnormalimage.cpp b/app/scanner2/dialog_abnormalimage.cpp index fc4d09fa..825f0a6a 100644 --- a/app/scanner2/dialog_abnormalimage.cpp +++ b/app/scanner2/dialog_abnormalimage.cpp @@ -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); diff --git a/modules/sane_user/HGSane.h b/modules/sane_user/HGSane.h index 411de9af..72efd407 100644 --- a/modules/sane_user/HGSane.h +++ b/modules/sane_user/HGSane.h @@ -42,6 +42,10 @@ typedef struct #define HGSANE_IMAGE_TYPE_NORMAL 0L #define HGSANE_IMAGE_TYPE_DOUBLE 1L +#define HGSANE_IMAGE_STATUS_NO_STATUS 0L +#define HGSANE_IMAGE_STATUS_RESERVE 1L +#define HGSANE_IMAGE_STATUS_DISCARD 2L + /* Sane回调 */ typedef void (HGAPI* HGSane_DeviceEventFunc)(HGSaneDevice dev, HGUInt event, HGPointer param); diff --git a/modules/sane_user/HGSaneImpl.cpp b/modules/sane_user/HGSaneImpl.cpp index 133d4388..b8ed0410 100644 --- a/modules/sane_user/HGSaneImpl.cpp +++ b/modules/sane_user/HGSaneImpl.cpp @@ -1121,8 +1121,7 @@ void HGAPI HGSaneDeviceImpl::ThreadFunc(HGThread thread, HGPointer param) HGUInt type = (SCANNER_ERR_DEVICE_DOUBLE_FEEDING == stat1) ? HGSANE_IMAGE_TYPE_DOUBLE : HGSANE_IMAGE_TYPE_NORMAL; HGUInt imgRet = p->m_imageFunc((HGSaneDevice)p, img, type, p->m_imageParam); - if (HGSANE_ERR_STOPSCAN == imgRet) - stopScan = true; + HGBase_DestroyImage(img); } } @@ -1131,13 +1130,13 @@ void HGAPI HGSaneDeviceImpl::ThreadFunc(HGThread thread, HGPointer param) buffer = NULL; bufferSize = 0; - if (stopScan) - { - saneAPI.sane_cancel_api(p->m_devHandle); - if (NULL != p->m_scanNotify) - p->m_scanNotify((int)SANE_EVENT_SCAN_FINISHED, NULL, 0); - break; - } +// if (stopScan) +// { +// saneAPI.sane_cancel_api(p->m_devHandle); +// if (NULL != p->m_scanNotify) +// p->m_scanNotify((int)SANE_EVENT_SCAN_FINISHED, NULL, 0); +// break; +// } if (!p->m_cancelScan) { diff --git a/modules/twainui/Manager.cpp b/modules/twainui/Manager.cpp index c887ded0..d3ea3c04 100644 --- a/modules/twainui/Manager.cpp +++ b/modules/twainui/Manager.cpp @@ -242,6 +242,7 @@ int Manager::showAbnormalImgUi(bool qt, SANE_Image *img) #endif emit createAbnormalImgUi(qt, image); + HGBase_DestroyImage(image); #ifdef HG_CMP_MSC if (!qt) diff --git a/modules/twainui/dialog_abnormal_img_select.cpp b/modules/twainui/dialog_abnormal_img_select.cpp index 988a0b45..54055b58 100644 --- a/modules/twainui/dialog_abnormal_img_select.cpp +++ b/modules/twainui/dialog_abnormal_img_select.cpp @@ -8,7 +8,7 @@ Dialog_abnormal_img_select::Dialog_abnormal_img_select(HGImage image, QWidget *p ui->setupUi(this); setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint); - m_view = new HGImgView(); + m_view = new HGImgView(this); m_view->addImage(image); ui->stackedWidget->addWidget(m_view); ui->stackedWidget->setCurrentWidget(m_view);