From f3c24c7d069d1b8893aa2ed492a2e91da6a8f413 Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Thu, 24 Nov 2022 17:02:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/fwupgrade/mainwindow.cpp | 12 +- app/scanner/Scanner_zh_CN.qm | Bin 35052 -> 35687 bytes app/scanner/Scanner_zh_CN.ts | 586 +++++++++++--------- app/scanner/dialog_exportimagefile.cpp | 52 +- app/scanner/dialog_exportimagefile.h | 4 +- app/scanner/dialog_multirotateimagefile.cpp | 19 +- app/scanner/dialog_multirotateimagefile.h | 4 +- app/scanner/mainwindow.cpp | 121 ++-- app/scanner/mainwindow.h | 1 + app/scanner/qt_zh_CN.ts | 32 +- 10 files changed, 463 insertions(+), 368 deletions(-) diff --git a/app/fwupgrade/mainwindow.cpp b/app/fwupgrade/mainwindow.cpp index 84ad30d3..0364c6dd 100644 --- a/app/fwupgrade/mainwindow.cpp +++ b/app/fwupgrade/mainwindow.cpp @@ -411,11 +411,7 @@ void MainWindow::on_btnDownloadUpgrade_clicked() HGChar savePath[512]; HGBase_GetConfigPath(savePath, 512); - HGResult ret = HGBase_CreateDir(savePath); - if(ret != HGBASE_ERR_OK) - { - HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "create DownloadUpgrade dir failed,%s", savePath); - } + HGBase_CreateDir(savePath); HGChar fileName[128]; sprintf(fileName, "%s.%s", versionNum.toStdString().c_str(), suffix); strcat(savePath, fileName); @@ -521,11 +517,7 @@ void MainWindow::on_btnModifyPassword_clicked() { HGChar cfgPath[256]= {0}; HGBase_GetConfigPath(cfgPath, 256); - HGResult ret = HGBase_CreateDir(cfgPath); - if(ret != HGBASE_ERR_OK) - { - HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "while modifying password, create config path failed, %s", cfgPath); - } + HGBase_CreateDir(cfgPath); strcat(cfgPath, "config.ini"); HGChar str[256] = {0}; HGBase_GetProfileString(cfgPath, "login", "password", "", str, 256); diff --git a/app/scanner/Scanner_zh_CN.qm b/app/scanner/Scanner_zh_CN.qm index f1522eea71e0645be5ffd57c26ae1c5fe234a438..b89c89c79d3ee09e3d13a1011e95217640e1af41 100644 GIT binary patch delta 4409 zcmY+H2UJw&w#WCJIc4TdL!=3cBZ!nJA|R0}QlwWS2vUUs2I)nJCQKBKvBYRbjlQT? zgL1t>Y=|!sgL>7cBvx#R#u81_L^O7DuX_LExhrcu)|&O3bNI?G|GmF&eqX`-vYJ_L zBl~rQZJ25DcSQ13q9J3!3~&Qj0=@#9i5y3RpMf8O{|62balu3Zt>AQ`p*tmxI!q*_ z5NWZVg;5tJ8o!q~yBx%LR+4mmiKdlNgio(gGG5HKXHa=>^mfX5=PXxhS;T>iGpqrdj|g>evR0R2!Hhp zi8W`5{dEyhN+qkxX)h1~`&X2` z6*>!Vq}+dPg|1>LZ*32>QRq#jmW|z7sH`cFsOe)Wvl!s)OXU^=>UC6Z+1S}k<;O75 z5KI-8jcqSUH2j_Fc0pk5O{(AgH=>+{RDT62%Soc<^C)F~pm`WO#58{{_K4X+AGswH zRVC1>nT^mzH?^fNAaWl=d(U%9ll+*h5r!-6Tt7(HBNr z%aZS*f?VBYQ`LEtRPhtpz+L=b{;upES4T7}l;I~JIB%QIFoWCw z7wO&33_1R9qLK(^Sm0VB{%ywN9x5b33+^O}Kgo>y9iFH*FyRjyQ0@nrctszPxR%L0 zgbfVOn5;W)h*%d>bY=?rj0e-C8jl9(ATjwg)8vLMCBI;r22dC&W0>XLttj`gyO_`C z!PBZiOpl8*O1zIb5b6yNUoi(mtBKya%N$O_h8gFWBX{6=$w$nkv%3*G8|J(A79zV# z%$@UbM4oNT{kj-*(QM{v95#MCm-+W`OZqp+`FVMeg(weqK_$+T%VT$A-r#(>v7m}f zlsryuY=OmTW91*)!vG4A@6v;_pUL}1`x9k`$*Js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SuoWNVdChZW^Q;)dD> hi7$E^N4tD!t3Xu{kN>LN#Qfy)rwJCdZ3{OT{U38KNCW@? diff --git a/app/scanner/Scanner_zh_CN.ts b/app/scanner/Scanner_zh_CN.ts index 28cafb0a..2b0d15be 100644 --- a/app/scanner/Scanner_zh_CN.ts +++ b/app/scanner/Scanner_zh_CN.ts @@ -327,20 +327,20 @@ 所有页 - - - - + + + + e.g. '%1%2' 例如.“%1%2” - + ok 确定 - + cancel 取消 @@ -528,17 +528,25 @@ Page range will be 'Chosen Pages'. 停止导出 - + tip 提示 - + export succeed 导出完成 - + Insufficient access rights + 文件访问权限不足 + + + Ocr processing failed + OCR功能处理失败 + + + ok 确定 @@ -548,7 +556,7 @@ Page range will be 'Chosen Pages'. Dialog - + @@ -1353,6 +1361,21 @@ This operation will NOT rotate the files that may contain multiple pages, such a stop 停止批量旋转 + + + operation success + 操作成功 + + + + tip + 提示 + + + + ok + 确定 + Dialog_OpenImageIndex @@ -1569,12 +1592,12 @@ Please make sure the two passwords are the same. Dialog - + detect result. versionNum: - + @@ -1697,7 +1720,7 @@ bug description: Dialog - + @@ -1793,382 +1816,382 @@ bug description: 文件 - + menu_scan 扫描 - + menu_view 视图 - + menu_Auto_Image_Size menuAuto_Image_Size 自动图片尺寸 - + menu_page 页面 - + menu_multiPages 多页 - + menu_image 图像 - + menuRotate 旋转 - + menu_user 用户 - + menu_info 信息 - + menu_device 设备 - + toolBar 工具栏 - + act_open 打开... - + act_insert 插入本地文件... - + act_save 保存 - + act_saveAs 另存为... - + act_Export 导出... - + act_closeFile 关闭选中项 - + act_closeAll 关闭所有项 - + act_imageInfo 图像信息 - + act_exit 退出 - + act_scannerSettings 扫描设置... - + act_acquire 扫描 - + act_acquireSingle 扫描单张 - + act_acquireInto 扫描至... - + act_fullscreen 全屏显示 - + act_fitWindowSize 适应视图框尺寸 - + act_fitWindowWidth 适应视图框宽度 - + act_realSize 真实大小 - + act_zoomIn 放大 - + act_zoomOut 缩小 - + act_toolBar 工具栏 - + act_statusBar 状态栏 - + act_thumbnailBar 缩略图栏 - + act_colorInfo 色彩信息 - + act_previous 上一张 - + act_next 下一张 - + act_first 第一张 - + act_last 最后一张 - + act_openPageNum 跳转至... - + act_previousPage 上一页 - + act_nextPage 下一页 - + act_firstPage 第一页 - + act_lastPage 最后一页 - + act_adjust 亮度/对比度/伽马... - + act_90Left 左旋转90度 - + act_90Right 右旋转90度 - + act_180 旋转180度 - + act_multiRotate 多页旋转... - + act_autoCrop 自动裁剪... - + act_signIn 登录... - + act_passwordChange 密码修改... - + act_signOut 登出 - + act_log 日志管理... - + act_clrCache 清除缓存... - + act_consume 耗材状态... - + act_help 帮助 - + act_about 关于... - + act_insertFromScanner 从扫描插入... - + act_clearRoller 清除滚轴计数 - + act_imageEdit 图像编辑... - + act_sortPages 书籍排序 - + act_autoSave 自动保存 - + act_update 检查更新... - + act_feedback 意见反馈... - + act_device_log 导出设备日志 - + act_driver_log 导出驱动日志 - + HuaGoScan 华高扫描软件 - + Grid 多列显示 - + Move To... 移动到... - + Insert files 插入文件 - - - + + + nodevice 没有发现扫描仪 - - - - - - + + + + + + Question 警告 - - + + modified, save it? 图像已被修改。 是否保存修改? - + file lost, remove it? 文件已丢失,是否删除? @@ -2177,7 +2200,7 @@ bug description: 已连接 - + disconnected 已断开连接 @@ -2194,39 +2217,39 @@ bug description: 扫描完成 - + Clear, then start scan 清空并启动扫描 - + Do NOT clear, then start scan 不清空并启动扫描 - + Already exist images in image list. Do you want to clear? 图像列表中已存在图像。 是否清空? - + Information 消息 - + Insufficient disk space 磁盘空间不足,请删除不需要的文件,以保证有足够的空间 - + Open images 打开图片 - + Insert images 插入图片 @@ -2235,230 +2258,239 @@ Do you want to clear? 信息 - - - - - - - - - save failed - 保存失败 + 保存失败 - + binary 黑白 - + gray 256级灰度 - + rgb 24位彩色 - + thumbnailBar enabled 显示缩略图栏 - + thumbnailBar hidden 隐藏缩略图栏 - - - + + + save succeed 保存成功 - - + + find savePath in thumbnail 图片名在列表中已存在 - + 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 彩色 - + Warning 警告 - + Device is Running! Please finish scanning first. 设备正在运行! 请先结束扫描。 - - - - - - - - - - + + Image processing failed + 图像处理失败 + + + + + + + + + + + + already waked up device 已唤醒设备 - + be ready 就绪 - - - - - - + + + + + + folder limit 无法访问“我的文档”, 请前往“扫描至”更换可访问的扫描目录再进行扫描。 - + + Insufficient access rights + 文件访问权限不足 + + + export succeed + 导出完成 + + + Ocr processing failed + 图像处理失败 + + + Are you sure to close 您确定要关闭 - + ? 吗? - - + + close 关闭 - + tip 提示 - + Other versions not available 未获取到其他版本 - - + + The device does not support this operation 设备不支持该操作 - - + + IO error IO错误 - - - + + + error 错误 @@ -2473,17 +2505,17 @@ Continue to close? 是否继续关闭? - + Sure to sign out administrator account? 是否确定登出管理员账户? - + confirm the operation 确认操作 - + Are you sure to clear the rollor acount? 你确定要清除滚轴计数吗 @@ -2492,34 +2524,34 @@ Continue to close? 请重新进入关于界面以获取最新值 - + <p>%1: <a href='%2'>%3</a> - + - + <p>%1: %2 - + - + roller number 滚轴张数 - + open scanner 打开扫描仪 - - + + app name 华高扫描软件 - - + + success 成功 @@ -2536,18 +2568,18 @@ Continue to close? 失败 - - + + failed 失败 - + warning 警告 - + the disk space in the current path is unsufficient, please select a new path or clear the disk space in time. 当前路径磁盘空间不足, 请重新选择路径或及时清理磁盘空间。 @@ -2557,219 +2589,218 @@ Continue to close? 配置丢失 - + apply setting 应用配置 - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + start failed 启动失败 - + HanvonScan 汉王扫描软件 - + LanxumScan 立思辰扫描软件 - + CumtennScan 沧田扫描软件 - + 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 切换图片时,自动保存编辑过的图像。若想取消,请取消勾选菜单项:图像->自动保存 - - - - - - - - - - - + + + + + + + + + + + yes 确定 - + save, do not remind again 保存,不再提醒 - - - - - - - - - + + + + + + + + + no 取消 - + found device 发现设备 - + reconnected 重新连接 - + already connected, but open faild 已经连接,但打开失败 - - + + %1%2%3.%4 %1%2%3.%4 - + start failed! 启动安装程序失败! - + There are pictures that have not been saved. Are you sure to close? 有图像未保存,确定关闭? - - - - - - - - - + + + + + + + + + tips 提示 - + Are you sure to close? 确定关闭? - + confirm operation 确认操作 - + are you sure to clear the roller count? 您确定要清除滚轴计数吗 - - - + + + hint 提示 - - + + Roller scanned count has been set to 0. 辊轴计数已置零 - - + + Roller scanned count reset failed. 重置滚轴计数失败 - + Error 错误 - + Document missing! It would be deleted or renamed. 文档丢失!文档可能已被删除或被重命名。 @@ -2802,28 +2833,28 @@ Are you sure to close? <br>导航地址: <a href='https://j.map.baidu.com/7e/1TO'>百度地图访问</a> - + About %1 关于 %1 - + <p>%1</p><p>Version: %2<br>CopyRight: &#169; %3</p><p>%4%5%6%7%8%9</p> <p>%1</p><p>版本: %2<br>版权: &#169; %3</p><p>%4%5%6%7%8%9</p> - + about %1 关于 %1 - + <p>Version: %1</p> <p>版本: %1</p> <p>版本: %1</p> - + <p>CopyRight: &#169; %1</p> <p>版权: &#169; %1</p> <p>版权: &#169; %1</p> @@ -2979,7 +3010,7 @@ Are you sure to close? (epicycle scanning images %u picture) - (本轮共扫描 %u 幅) + (本轮共扫描 %u 幅) fold @@ -3192,7 +3223,8 @@ No: add new configuration - 自定 + 自定义 + 自定 diff --git a/app/scanner/dialog_exportimagefile.cpp b/app/scanner/dialog_exportimagefile.cpp index 0250a129..e1f0efb4 100644 --- a/app/scanner/dialog_exportimagefile.cpp +++ b/app/scanner/dialog_exportimagefile.cpp @@ -52,6 +52,7 @@ void HGAPI Dialog_ExportImageFile::ThreadFunc(HGThread thread, HGPointer param) { (void)thread; Dialog_ExportImageFile *p = (Dialog_ExportImageFile *)param; + HGResult ret = HGBASE_ERR_FAIL; if (p->m_isSaveAsMulti) { @@ -60,8 +61,8 @@ void HGAPI Dialog_ExportImageFile::ThreadFunc(HGThread thread, HGPointer param) if (p->m_isOcr) { HGOCRMgr ocrMgr = nullptr; - HGImgProc_CreateOCRMgr(0, &ocrMgr); - if (nullptr != ocrMgr) + ret = HGImgProc_CreateOCRMgr(0, &ocrMgr); + if (HGBASE_ERR_OK == ret) { for (int i = 0; i < p->m_srcFiles.size(); ++i) { @@ -89,28 +90,36 @@ void HGAPI Dialog_ExportImageFile::ThreadFunc(HGThread thread, HGPointer param) HGImgFmt_LoadImageFromReader(imgFmtReader, j, nullptr, 0, HGBASE_IMGORIGIN_TOP, &img); if (nullptr != img) { - HGImgProc_AddToImageOCRList(ocrMgr, img); + ret = HGImgProc_AddToImageOCRList(ocrMgr, img); HGBase_DestroyImage(img); + + if (ret != HGBASE_ERR_OK) + { + break; + } } } HGImgFmt_CloseImageReader(imgFmtReader); } + + if (ret != HGBASE_ERR_OK) + break; } - HGResult ret = HGImgProc_ImageListOCRToFile(ocrMgr, 0, getStdString(fileName).c_str(), NULL, NULL); - if(ret != HGBASE_ERR_OK) + if (ret == HGBASE_ERR_OK) { - HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "HGImgProc_ImageListOCRToFile:%u", ret); + ret = HGImgProc_ImageListOCRToFile(ocrMgr, 0, getStdString(fileName).c_str(), NULL, NULL); } + HGImgProc_DestroyOCRMgr(ocrMgr); } } else { HGImgFmtWriter imgFmtWriter = nullptr; - HGImgFmt_OpenImageWriter(getStdString(fileName).c_str(), 0, &imgFmtWriter); - if (nullptr != imgFmtWriter) + ret = HGImgFmt_OpenImageWriter(getStdString(fileName).c_str(), 0, &imgFmtWriter); + if (HGBASE_ERR_OK == ret) { for (int i = 0; i < p->m_srcFiles.size(); ++i) { @@ -160,13 +169,21 @@ void HGAPI Dialog_ExportImageFile::ThreadFunc(HGThread thread, HGPointer param) saveInfo.tiffCompression = HGIMGFMT_TIFFCOMP_JPEG; } - HGImgFmt_SaveImageToWriter(imgFmtWriter, img, &saveInfo); + ret = HGImgFmt_SaveImageToWriter(imgFmtWriter, img, &saveInfo); HGBase_DestroyImage(img); + + if (ret != HGBASE_ERR_OK) + { + break; + } } } HGImgFmt_CloseImageReader(imgFmtReader); } + + if (ret != HGBASE_ERR_OK) + break; } HGImgFmt_CloseImageWriter(imgFmtWriter); @@ -236,17 +253,23 @@ void HGAPI Dialog_ExportImageFile::ThreadFunc(HGThread thread, HGPointer param) saveInfo.tiffCompression = HGIMGFMT_TIFFCOMP_JPEG; } - MainWindow::saveImage(img, &saveInfo, p->m_isOcr, getStdString(saveFileName).c_str()); + ret = MainWindow::saveImage(img, &saveInfo, p->m_isOcr, getStdString(saveFileName).c_str()); HGBase_DestroyImage(img); + + if (ret != HGBASE_ERR_OK) + break; } } HGImgFmt_CloseImageReader(imgFmtReader); + + if (ret != HGBASE_ERR_OK) + break; } } } - emit p->finish(); + emit p->finish(ret); } void Dialog_ExportImageFile::on_updateProgress(int value) @@ -254,12 +277,13 @@ void Dialog_ExportImageFile::on_updateProgress(int value) ui->progressBar->setValue(value); } -void Dialog_ExportImageFile::on_finish() +void Dialog_ExportImageFile::on_finish(HGResult ret) { - QMessageBox msg(QMessageBox::Information, tr("tip"), tr("export succeed"), QMessageBox::Ok, this); + QString str = (ret == HGBASE_ERR_OK) ? tr("export succeed") : MainWindow::getLogInfo(ret); + QMessageBox msg(QMessageBox::Information, tr("tip"), str, QMessageBox::Ok, this); msg.setButtonText(QMessageBox::Ok, tr("ok")); - close(); msg.exec(); + close(); } void Dialog_ExportImageFile::on_pushButton_clicked() diff --git a/app/scanner/dialog_exportimagefile.h b/app/scanner/dialog_exportimagefile.h index 75b04ef3..64242fe1 100644 --- a/app/scanner/dialog_exportimagefile.h +++ b/app/scanner/dialog_exportimagefile.h @@ -23,10 +23,10 @@ private: signals: void updateProgress(int value); - void finish(); + void finish(HGResult ret); private slots: void on_updateProgress(int value); - void on_finish(); + void on_finish(HGResult ret); void on_pushButton_clicked(); diff --git a/app/scanner/dialog_multirotateimagefile.cpp b/app/scanner/dialog_multirotateimagefile.cpp index a57d8afc..88d4cd24 100644 --- a/app/scanner/dialog_multirotateimagefile.cpp +++ b/app/scanner/dialog_multirotateimagefile.cpp @@ -2,6 +2,8 @@ #include "ui_dialog_multirotateimagefile.h" #include "imgfmt/HGImgFmt.h" #include "HGUIGlobal.h" +#include "mainwindow.h" +#include Dialog_MultiRotateImageFile::Dialog_MultiRotateImageFile(const QStringList &fileList, int rotateType, QWidget *parent) : QDialog(parent), @@ -38,6 +40,7 @@ void HGAPI Dialog_MultiRotateImageFile::ThreadFunc(HGThread thread, HGPointer pa { (void)thread; Dialog_MultiRotateImageFile *p = (Dialog_MultiRotateImageFile *)param; + HGResult ret = HGBASE_ERR_FAIL; for (int i = 0; i < (int)p->m_fileList.count(); ++i) { @@ -102,16 +105,22 @@ void HGAPI Dialog_MultiRotateImageFile::ThreadFunc(HGThread thread, HGPointer pa if (nullptr != img) { - if (HGBASE_ERR_OK == HGImgFmt_SaveImage(img, 0, nullptr, getStdString(p->m_fileList[i]).c_str())) + ret = HGImgFmt_SaveImage(img, 0, nullptr, getStdString(p->m_fileList[i]).c_str()); + if (HGBASE_ERR_OK == ret) { emit p->updateImageFile(p->m_fileList[i]); } HGBase_DestroyImage(img); } + + if (ret != HGBASE_ERR_OK) + { + break; + } } - emit p->finish(); + emit p->finish(ret); } void Dialog_MultiRotateImageFile::on_updateProgress(int value) @@ -124,8 +133,12 @@ void Dialog_MultiRotateImageFile::on_updateImageFile(QString fileName) emit refreshImageFile(fileName); } -void Dialog_MultiRotateImageFile::on_finish() +void Dialog_MultiRotateImageFile::on_finish(HGResult ret) { + QString str = (ret == HGBASE_ERR_OK) ? tr("operation success") : MainWindow::getLogInfo(ret); + QMessageBox msg(QMessageBox::Information, tr("tip"), str, QMessageBox::Ok, this); + msg.setButtonText(QMessageBox::Ok, tr("ok")); + msg.exec(); close(); } diff --git a/app/scanner/dialog_multirotateimagefile.h b/app/scanner/dialog_multirotateimagefile.h index 40c31d16..32b496cc 100644 --- a/app/scanner/dialog_multirotateimagefile.h +++ b/app/scanner/dialog_multirotateimagefile.h @@ -25,11 +25,11 @@ private: signals: void updateProgress(int value); void updateImageFile(QString fileName); - void finish(); + void finish(HGResult ret); private slots: void on_updateProgress(int value); void on_updateImageFile(QString fileName); - void on_finish(); + void on_finish(HGResult ret); void on_pushButton_clicked(); diff --git a/app/scanner/mainwindow.cpp b/app/scanner/mainwindow.cpp index 2c3380c4..69d3d51d 100644 --- a/app/scanner/mainwindow.cpp +++ b/app/scanner/mainwindow.cpp @@ -378,14 +378,10 @@ HGResult MainWindow::saveImage(HGImage image, const HGImgFmtSaveInfo* info, bool HGResult ret = HGBASE_ERR_FAIL; // 韫囩晫鏆恑nfo HGOCRMgr ocrMgr = nullptr; - HGImgProc_CreateOCRMgr(0, &ocrMgr); - if (nullptr != ocrMgr) + ret = HGImgProc_CreateOCRMgr(0, &ocrMgr); + if (HGBASE_ERR_OK == ret) { ret = HGImgProc_ImageOCRToFile(ocrMgr, image, 0, fileName); - if (ret != HGBASE_ERR_OK) - { - HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "HGImgProc_ImageOCRToFile:%u", ret); - } HGImgProc_DestroyOCRMgr(ocrMgr); } @@ -926,8 +922,8 @@ void MainWindow::on_new_image(void *img, int statu) } else { - m_dialogLog->addLog(tr("save failed"), true); - m_wndStatusBar->setDeviceStatusInfo(tr("save failed"), true); + m_dialogLog->addLog(getLogInfo(ret), true); + m_wndStatusBar->setDeviceStatusInfo(getLogInfo(ret), true); } } else if (2 == m_scanType) @@ -961,7 +957,8 @@ void MainWindow::on_new_image(void *img, int statu) HGResult ret = HGBase_CreateDir(getStdString(m_aquireIntoSaveParam.m_savePath).c_str()); if (ret != HGBASE_ERR_OK) { - HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "create aquireInto path failed, %s", getStdString(m_aquireIntoSaveParam.m_savePath).c_str()); + m_dialogLog->addLog(getLogInfo(ret), true); + m_wndStatusBar->setDeviceStatusInfo(getLogInfo(ret), true); } QString scanFileName; @@ -982,7 +979,13 @@ void MainWindow::on_new_image(void *img, int statu) } } - HGImgFmt_OpenImageWriter(getStdString(getStdFileName(scanFileName)).c_str(), 0, &m_scanImgFmtWriter); + ret = HGImgFmt_OpenImageWriter(getStdString(getStdFileName(scanFileName)).c_str(), 0, &m_scanImgFmtWriter); + if(ret != HGBASE_ERR_OK) + { + m_dialogLog->addLog(getLogInfo(ret), true); + m_wndStatusBar->setDeviceStatusInfo(getLogInfo(ret), true); + } + if (nullptr != m_scanImgFmtWriter) m_scanFileName = scanFileName; } @@ -1011,7 +1014,13 @@ void MainWindow::on_new_image(void *img, int statu) saveInfo.tiffCompression = HGIMGFMT_TIFFCOMP_JPEG; } - HGImgFmt_SaveImageToWriter(m_scanImgFmtWriter, image, &saveInfo); + HGResult ret = HGImgFmt_SaveImageToWriter(m_scanImgFmtWriter, image, &saveInfo); + if(ret != HGBASE_ERR_OK) + { + m_dialogLog->addLog(getLogInfo(ret), true); + m_wndStatusBar->setDeviceStatusInfo(getLogInfo(ret), true); + } + ++m_aquireIntoMultiPageCount; } } @@ -1061,10 +1070,11 @@ void MainWindow::on_new_image(void *img, int statu) savePath = getStdFileName(savePath + colorModeName + "/"); } - HGResult result = HGBase_CreateDir(getStdString(savePath).c_str()); - if (result != HGBASE_ERR_OK) + HGResult ret = HGBase_CreateDir(getStdString(savePath).c_str()); + if(ret != HGBASE_ERR_OK) { - HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "HGBase_CreateDir:%u file:%s line:%d", result, __FILE__, __LINE__); + m_dialogLog->addLog(getLogInfo(ret), true); + m_wndStatusBar->setDeviceStatusInfo(getLogInfo(ret), true); } QString scanFileName; @@ -1107,12 +1117,17 @@ void MainWindow::on_new_image(void *img, int statu) saveInfo.tiffCompression = HGIMGFMT_TIFFCOMP_JPEG; } - HGResult ret = saveImage(image, &saveInfo, m_aquireIntoSaveParam.m_isOcr, getStdString(scanFileName).c_str()); + 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; } + else + { + m_dialogLog->addLog(getLogInfo(ret), true); + m_wndStatusBar->setDeviceStatusInfo(getLogInfo(ret), true); + } } } @@ -1394,11 +1409,7 @@ QString MainWindow::getCacheFileName(HGImage img) HGBase_GetImageInfo(img, &imgInfo); QString cachePath = Dialog_ClrCache::getCachePath(); - HGResult ret = HGBase_CreateDir(getStdString(cachePath).c_str()); - if(ret != HGBASE_ERR_OK) - { - HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "create cache file failed, %s", getStdString(cachePath).c_str()); - } + HGBase_CreateDir(getStdString(cachePath).c_str()); char uuid[256] = {0}; HGBase_GetUuid(uuid, 256); @@ -1916,6 +1927,7 @@ void MainWindow::on_act_exit_triggered() void MainWindow::on_act_save_triggered() { + HGResult ret = HGBASE_ERR_FAIL; HGImage img = nullptr; m_view->getImage(&img); if (nullptr == img || -1 == m_currIndex || 1 != m_multiPageCount) @@ -2033,7 +2045,8 @@ void MainWindow::on_act_save_triggered() saveInfo.tiffCompression = HGIMGFMT_TIFFCOMP_JPEG; } - if (HGBASE_ERR_OK == saveImage(img, &saveInfo, isOcr, getStdString(savePath).c_str())) + ret = saveImage(img, &saveInfo, isOcr, getStdString(savePath).c_str()); + if (HGBASE_ERR_OK == ret) { if (auto_save_changes_) { @@ -2051,9 +2064,9 @@ void MainWindow::on_act_save_triggered() } else { - QMessageBox::critical(this, tr("tips"), tr("save failed")); - m_dialogLog->addLog(tr("save failed"), true); - m_wndStatusBar->setDeviceStatusInfo(tr("save failed"), true); + QMessageBox::critical(this, tr("tips"), getLogInfo(ret)); + m_dialogLog->addLog(getLogInfo(ret), true); + m_wndStatusBar->setDeviceStatusInfo(getLogInfo(ret), true); } } else @@ -2091,8 +2104,8 @@ void MainWindow::on_act_save_triggered() tiffInfo.yResolution = yDpi; HGTiffWriter tiffWriter = nullptr; - HGImgFmt_OpenTiffWriter(getStdString(m_currFilePath).c_str(), &tiffWriter); - if (nullptr != tiffWriter) + saveRet = HGImgFmt_OpenTiffWriter(getStdString(m_currFilePath).c_str(), &tiffWriter); + if (HGBASE_ERR_OK == saveRet) { saveRet = HGImgFmt_SaveImageToTiffWriter(tiffWriter, img, &tiffInfo); HGImgFmt_CloseTiffWriter(tiffWriter); @@ -2117,7 +2130,9 @@ void MainWindow::on_act_save_triggered() } else { - QMessageBox::critical(this, tr("tips"), tr("save failed")); + QMessageBox::critical(this, tr("tips"), getLogInfo(ret)); + m_dialogLog->addLog(getLogInfo(ret), true); + m_wndStatusBar->setDeviceStatusInfo(getLogInfo(ret), true); } } @@ -2187,7 +2202,8 @@ void MainWindow::on_act_saveAs_triggered() saveInfo.tiffCompression = HGIMGFMT_TIFFCOMP_JPEG; } - if (HGBASE_ERR_OK == saveImage(img, &saveInfo, isOcr, getStdString(savePath).c_str())) + HGResult ret = saveImage(img, &saveInfo, isOcr, getStdString(savePath).c_str()); + if (HGBASE_ERR_OK == ret) { if(!auto_save_changes_) { @@ -2196,9 +2212,9 @@ void MainWindow::on_act_saveAs_triggered() } else { - QMessageBox::critical(this, tr("tips"), tr("save failed")); - m_dialogLog->addLog(tr("save failed"), true); - m_wndStatusBar->setDeviceStatusInfo(tr("save failed"), true); + QMessageBox::critical(this, tr("tips"), getLogInfo(ret)); + m_dialogLog->addLog(getLogInfo(ret), true); + m_wndStatusBar->setDeviceStatusInfo(getLogInfo(ret), true); } } else @@ -2556,11 +2572,7 @@ void HGAPI MainWindow::FwUpgradeAndDevLockThread(HGThread thread, HGPointer para HGChar savePath[512]; HGBase_GetConfigPath(savePath, 512); - HGResult ret = HGBase_CreateDir(savePath); - if(ret != HGBASE_ERR_OK) - { - HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "create fwUpgrade file failed, %s", savePath); - } + HGBase_CreateDir(savePath); HGChar fileName[128]; sprintf(fileName, "%s.%s", versionInfo[0].version, suffix); strcat(savePath, fileName); @@ -3670,29 +3682,23 @@ bool MainWindow::isLimitAccessFolder(QString filePath) HGChar procName[512]; HGBase_GetProcessName(procName, 512); strcat(documentsPath, procName); - HGResult ret = HGBase_CreateDir(getStdString(documentsPath).c_str()); - if (ret != HGBASE_ERR_OK) - { - HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "Mainwindow::isLimitAccessFolder(), create documentsPath1 file failed, %s", getStdString(documentsPath).c_str()); - } + HGBase_CreateDir(getStdString(documentsPath).c_str()); HGChar uuid[512]; HGBase_GetUuid(uuid, 512); strcat(documentsPath, "/"); strcat(documentsPath, uuid); - HGResult result = HGBase_CreateDir(getStdString(documentsPath).c_str()); - if(result != HGBASE_ERR_OK) + HGResult ret = HGBase_CreateDir(getStdString(documentsPath).c_str()); + if(ret != HGBASE_ERR_OK) { - HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "Mainwindow::isLimitAccessFolder(), create documentsPath2 file failed, %s", getStdString(documentsPath).c_str()); if(!filePath.isEmpty()) { HGChar uuid2[512]; HGBase_GetUuid(uuid2, 512); filePath += uuid2; - HGResult result2 = HGBase_CreateDir(getStdString(filePath).c_str()); - if (result2 != HGBASE_ERR_OK) + ret = HGBase_CreateDir(getStdString(filePath).c_str()); + if (ret != HGBASE_ERR_OK) { - HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "Mainwindow::isLimitAccessFolder(), create scanPath3 file failed, %s", getStdString(filePath).c_str()); QMessageBox::critical(this, tr("error"), tr("folder limit")); m_dialogLog->addLog(tr("folder limit"), true); m_wndStatusBar->setDeviceStatusInfo(tr("folder limit"), true); @@ -3824,6 +3830,21 @@ void MainWindow::upgradeFwAndLockDevice() } } +QString MainWindow::getLogInfo(HGResult ret) +{ + QString str; + if (HGBASE_ERR_ACCESSDENIED == ret) + { + str = tr("Insufficient access rights"); + } + else if (HGIMGPROC_ERR_FAIL == ret) + { + str = tr("Image processing failed"); + } + + return str; +} + //void MainWindow::deleteFile(QString filePath) //{ // QDir dir(filePath); @@ -3962,11 +3983,7 @@ void MainWindow::on_actionact_update_triggered() HGChar savePath[512]; HGBase_GetConfigPath(savePath, 512); - HGResult ret = HGBase_CreateDir(savePath); - if(ret != HGBASE_ERR_OK) - { - HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "create upgrade app savefile failed, %s", savePath); - } + HGBase_CreateDir(savePath); HGChar fileName[128]; sprintf(fileName, "%s.%s", versionNum.toStdString().c_str(), suffix); diff --git a/app/scanner/mainwindow.h b/app/scanner/mainwindow.h index 5db024e4..4c8a1a91 100644 --- a/app/scanner/mainwindow.h +++ b/app/scanner/mainwindow.h @@ -83,6 +83,7 @@ public: void exitFullScreen(); static HGResult saveImage(HGImage image, const HGImgFmtSaveInfo* info, bool ocr, const HGChar *fileName); + static QString getLogInfo(HGResult ret); private slots: void on_act_90Left_triggered(); diff --git a/app/scanner/qt_zh_CN.ts b/app/scanner/qt_zh_CN.ts index 949fe181..3079560b 100644 --- a/app/scanner/qt_zh_CN.ts +++ b/app/scanner/qt_zh_CN.ts @@ -1051,6 +1051,18 @@ This operation will NOT rotate the files that may contain multiple pages, such a stop + + operation success + + + + tip + + + + ok + + Dialog_OpenImageIndex @@ -1727,10 +1739,6 @@ Do you want to clear? Insert images - - save failed - - find savePath in thumbnail @@ -2089,6 +2097,14 @@ Are you sure to close? CumtennScan + + Insufficient access rights + + + + Image processing failed + + Phonon:: @@ -8356,10 +8372,6 @@ No: add new configuration 自定义色调曲线 - - 自定 - - 负片(RGB) @@ -8408,5 +8420,9 @@ No: add new configuration 输出: + + 自定义 + +