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 f1522eea..b89c89c7 100644
Binary files a/app/scanner/Scanner_zh_CN.qm and b/app/scanner/Scanner_zh_CN.qm differ
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 @@
所有页
-
-
-
-
+
+
+
+
例如.“%1%2”
-
+
确定
-
+
取消
@@ -528,17 +528,25 @@ Page range will be 'Chosen Pages'.
停止导出
-
+
提示
-
+
导出完成
-
+
+ 文件访问权限不足
+
+
+
+ OCR功能处理失败
+
+
+
确定
@@ -548,7 +556,7 @@ Page range will be 'Chosen Pages'.
-
+
@@ -1353,6 +1361,21 @@ This operation will NOT rotate the files that may contain multiple pages, such a
停止批量旋转
+
+
+
+ 操作成功
+
+
+
+
+ 提示
+
+
+
+
+ 确定
+
Dialog_OpenImageIndex
@@ -1569,12 +1592,12 @@ Please make sure the two passwords are the same.
-
+
-
+
@@ -1697,7 +1720,7 @@ bug description:
-
+
@@ -1793,382 +1816,382 @@ bug description:
文件
-
+
扫描
-
+
视图
-
+
menuAuto_Image_Size
自动图片尺寸
-
+
页面
-
+
多页
-
+
图像
-
+
旋转
-
+
用户
-
+
信息
-
+
设备
-
+
工具栏
-
+
打开...
-
+
插入本地文件...
-
+
保存
-
+
另存为...
-
+
导出...
-
+
关闭选中项
-
+
关闭所有项
-
+
图像信息
-
+
退出
-
+
扫描设置...
-
+
扫描
-
+
扫描单张
-
+
扫描至...
-
+
全屏显示
-
+
适应视图框尺寸
-
+
适应视图框宽度
-
+
真实大小
-
+
放大
-
+
缩小
-
+
工具栏
-
+
状态栏
-
+
缩略图栏
-
+
色彩信息
-
+
上一张
-
+
下一张
-
+
第一张
-
+
最后一张
-
+
跳转至...
-
+
上一页
-
+
下一页
-
+
第一页
-
+
最后一页
-
+
亮度/对比度/伽马...
-
+
左旋转90度
-
+
右旋转90度
-
+
旋转180度
-
+
多页旋转...
-
+
自动裁剪...
-
+
登录...
-
+
密码修改...
-
+
登出
-
+
日志管理...
-
+
清除缓存...
-
+
耗材状态...
-
+
帮助
-
+
关于...
-
+
从扫描插入...
-
+
清除滚轴计数
-
+
图像编辑...
-
+
书籍排序
-
+
自动保存
-
+
检查更新...
-
+
意见反馈...
-
+
导出设备日志
-
+
导出驱动日志
-
+
华高扫描软件
-
+
多列显示
-
+
移动到...
-
+
插入文件
-
-
-
+
+
+
没有发现扫描仪
-
-
-
-
-
-
+
+
+
+
+
+
警告
-
-
+
+
图像已被修改。
是否保存修改?
-
+
文件已丢失,是否删除?
@@ -2177,7 +2200,7 @@ bug description:
已连接
-
+
已断开连接
@@ -2194,39 +2217,39 @@ bug description:
扫描完成
-
+
清空并启动扫描
-
+
不清空并启动扫描
-
+
图像列表中已存在图像。
是否清空?
-
+
消息
-
+
磁盘空间不足,请删除不需要的文件,以保证有足够的空间
-
+
打开图片
-
+
插入图片
@@ -2235,230 +2258,239 @@ Do you want to clear?
信息
-
-
-
-
-
-
-
-
-
- 保存失败
+ 保存失败
-
+
黑白
-
+
256级灰度
-
+
24位彩色
-
+
显示缩略图栏
-
+
隐藏缩略图栏
-
-
-
+
+
+
保存成功
-
-
+
+
图片名在列表中已存在
-
+
文件名
-
+
文件路径
-
+
文件大小
-
+
创建时间
-
+
修改时间
-
+
访问时间
-
+
格式
-
+
宽度
-
+
高度
-
+
深度
-
+
色彩模式
-
+
每英寸像素点
-
+
打印尺寸
-
+
帧
-
+
无
-
+
黑白
-
+
灰度
-
+
彩色
-
+
警告
-
+
设备正在运行!
请先结束扫描。
-
-
-
-
-
-
-
-
-
-
+
+
+ 图像处理失败
+
+
+
+
+
+
+
+
+
+
+
+
已唤醒设备
-
+
就绪
-
-
-
-
-
-
+
+
+
+
+
+
无法访问“我的文档”,
请前往“扫描至”更换可访问的扫描目录再进行扫描。
-
+
+
+ 文件访问权限不足
+
+
+
+ 导出完成
+
+
+
+ 图像处理失败
+
+
+
您确定要关闭
-
+
吗?
-
-
+
+
关闭
-
+
提示
-
+
未获取到其他版本
-
-
+
+
设备不支持该操作
-
-
+
+
IO错误
-
-
-
+
+
+
错误
@@ -2473,17 +2505,17 @@ Continue to close?
是否继续关闭?
-
+
是否确定登出管理员账户?
-
+
确认操作
-
+
你确定要清除滚轴计数吗
@@ -2492,34 +2524,34 @@ Continue to close?
请重新进入关于界面以获取最新值
-
+
-
+
-
+
-
+
-
+
滚轴张数
-
+
打开扫描仪
-
-
+
+
华高扫描软件
-
-
+
+
成功
@@ -2536,18 +2568,18 @@ Continue to close?
失败
-
-
+
+
失败
-
+
警告
-
+
当前路径磁盘空间不足,
请重新选择路径或及时清理磁盘空间。
@@ -2557,219 +2589,218 @@ Continue to close?
配置丢失
-
+
应用配置
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
启动失败
-
+
汉王扫描软件
-
+
立思辰扫描软件
-
+
沧田扫描软件
-
+
自动保存
-
-
+
切换图片时,不提醒,直接保存编辑过的图片
-
+
显示状态栏
-
+
隐藏状态栏
-
+
显示工具栏
-
+
隐藏工具栏
-
+
启用图像信息
-
+
关闭图像信息
-
+
启用自动保存
-
+
取消自动保存
-
+
切换图片时,自动保存编辑过的图像。若想取消,请取消勾选菜单项:图像->自动保存
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
确定
-
+
保存,不再提醒
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
取消
-
+
发现设备
-
+
重新连接
-
+
已经连接,但打开失败
-
-
+
+
%1%2%3.%4
-
+
启动安装程序失败!
-
+
有图像未保存,确定关闭?
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
提示
-
+
确定关闭?
-
+
确认操作
-
+
您确定要清除滚轴计数吗
-
-
-
+
+
+
提示
-
-
+
+
辊轴计数已置零
-
-
+
+
重置滚轴计数失败
-
+
错误
-
+
文档丢失!文档可能已被删除或被重命名。
@@ -2802,28 +2833,28 @@ Are you sure to close?
<br>导航地址: <a href='https://j.map.baidu.com/7e/1TO'>百度地图访问</a>
-
+
关于 %1
-
+
<p>%1</p><p>版本: %2<br>版权: © %3</p><p>%4%5%6%7%8%9</p>
-
+
关于 %1
-
+
<p>版本: %1</p>
<p>版本: %1</p>
-
+
<p>版权: © %1</p>
<p>版权: © %1</p>
@@ -2979,7 +3010,7 @@ Are you sure to close?
- (本轮共扫描 %u 幅)
+ (本轮共扫描 %u 幅)
@@ -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
+
+
+
+
+
+
+
+
+
+
+
+
Dialog_OpenImageIndex
@@ -1727,10 +1739,6 @@ Do you want to clear?
-
-
-
-
@@ -2089,6 +2097,14 @@ Are you sure to close?
+
+
+
+
+
+
+
+
Phonon::
@@ -8356,10 +8372,6 @@ No: add new configuration
-
-
-
-
@@ -8408,5 +8420,9 @@ No: add new configuration
+
+
+
+