微调按颜色模式建立文件夹,增加部分日志

This commit is contained in:
yangjiaxuan 2022-10-28 10:45:32 +08:00
parent ec756ddc0f
commit 09a7fd1f97
5 changed files with 347 additions and 360 deletions

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
#include "dialog_updateprogress.h" #include "dialog_updateprogress.h"
#include "ui_dialog_updateprogress.h" #include "ui_dialog_updateprogress.h"
#include "base/HGInfo.h"
#include <QMessageBox> #include <QMessageBox>
#include <QFile> #include <QFile>
#include <QDir> #include <QDir>
@ -59,6 +60,8 @@ void HGAPI Dialog_updateProgress::ThreadFunc(HGThread thread, HGPointer param)
if (HGBASE_ERR_OK != ret) if (HGBASE_ERR_OK != ret)
{ {
QFile::remove(p->m_savePath.toStdString().c_str()); QFile::remove(p->m_savePath.toStdString().c_str());
HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "UpgradeHttpDownload:%u", ret);
} }
emit p->finish(); emit p->finish();

View File

@ -356,12 +356,16 @@ HGResult MainWindow::saveImage(HGImage image, const HGImgFmtSaveInfo* info, bool
} }
HGResult ret = HGBASE_ERR_FAIL; HGResult ret = HGBASE_ERR_FAIL;
// 忽略info // 蹇界暐info
HGOCRMgr ocrMgr = nullptr; HGOCRMgr ocrMgr = nullptr;
HGImgProc_CreateOCRMgr(0, &ocrMgr); HGImgProc_CreateOCRMgr(0, &ocrMgr);
if (nullptr != ocrMgr) if (nullptr != ocrMgr)
{ {
ret = HGImgProc_ImageOCRToFile(ocrMgr, image, 0, fileName); ret = HGImgProc_ImageOCRToFile(ocrMgr, image, 0, fileName);
if (ret != HGBASE_ERR_OK)
{
HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "HGImgProc_ImageOCRToFile:%u", ret);
}
HGImgProc_DestroyOCRMgr(ocrMgr); HGImgProc_DestroyOCRMgr(ocrMgr);
} }
@ -542,7 +546,7 @@ void MainWindow::on_currItemChanged(int index)
bool save = false; bool save = false;
if(auto_save_changes_) if(auto_save_changes_)
{ {
// 切æ<EFBFBD>¢å¾ç‰‡æ—¶ï¼Œè‡ªåŠ¨ä¿<EFBFBD>å­˜ç¼è¾è¿‡çš„å¾åƒ<EFBFBD>ã€è¥æƒ³å<EFBFBD>消,请å<EFBFBD>消å¾é€‰è<EFBFBD>œå<EFBFBD>•é¡¹ï¼šå¾åƒ?>自动ä¿<C3A4>å­˜ // 鍒囨崲鍥剧墖鏃讹紝鑷姩淇濆瓨缂栬緫杩囩殑鍥惧儚銆傝嫢鎯冲彇娑堬紝璇峰彇娑堝嬀閫夎彍鍗曢」锛氬浘鍍?>鑷姩淇濆瓨
QString info(tr("Automatically save the edited the edited iamge when switching pictures. To cancel, uncheck the menu item: image-> automatically save")); QString info(tr("Automatically save the edited the edited iamge when switching pictures. To cancel, uncheck the menu item: image-> automatically save"));
m_wndStatusBar->setDeviceStatusInfo(info, false); m_wndStatusBar->setDeviceStatusInfo(info, false);
save = true; save = true;
@ -924,7 +928,11 @@ void MainWindow::on_new_image(void *img, int statu)
if (nullptr == m_scanImgFmtWriter) if (nullptr == m_scanImgFmtWriter)
{ {
assert(m_scanFileName.isEmpty()); assert(m_scanFileName.isEmpty());
HGBase_CreateDir(getStdString(m_aquireIntoSaveParam.m_savePath).c_str()); HGResult ret = HGBase_CreateDir(getStdString(m_aquireIntoSaveParam.m_savePath).c_str());
if (ret != HGBASE_ERR_OK)
{
HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "HGBase_CreateDir:%u", ret);
}
QString scanFileName; QString scanFileName;
while (1) while (1)
@ -1014,16 +1022,20 @@ void MainWindow::on_new_image(void *img, int statu)
HGImageInfo imgInfo; HGImageInfo imgInfo;
HGBase_GetImageInfo(image, &imgInfo); HGBase_GetImageInfo(image, &imgInfo);
if (HGBASE_IMGTYPE_BINARY == imgInfo.type) if (HGBASE_IMGTYPE_BINARY == imgInfo.type)
colorModeName = StdStringToUtf8("黑白").c_str(); colorModeName = tr("binary");
else if (HGBASE_IMGTYPE_GRAY == imgInfo.type) else if (HGBASE_IMGTYPE_GRAY == imgInfo.type)
colorModeName = StdStringToUtf8("ç<EFBFBD>°åº¦").c_str(); colorModeName = tr("gray");
else else
colorModeName = StdStringToUtf8("彩色").c_str(); colorModeName = tr("rgb");
savePath = getStdFileName(savePath + colorModeName + "/"); savePath = getStdFileName(savePath + colorModeName + "/");
} }
HGBase_CreateDir(getStdString(savePath).c_str()); HGResult result = HGBase_CreateDir(getStdString(savePath).c_str());
if (result != HGBASE_ERR_OK)
{
HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "HGBase_CreateDir:%u file:%s line:%d", result, __FILE__, __LINE__);
}
QString scanFileName; QString scanFileName;
while (1) while (1)
@ -2811,7 +2823,7 @@ void MainWindow::my_url_handler(const QUrl& url)
{ {
info = tr("Roller scanned count has been set to 0."); info = tr("Roller scanned count has been set to 0.");
// +请é‡<EFBFBD>æ°è¿å…¥å…³äºŽç•Œé<EFBFBD>¢ä»¥èŽ·å<EFBFBD>最æ°å€? info += tr("Please re-enter the Abount screen to obtain the latest value"); // +璇烽噸鏂拌繘鍏ュ叧浜庣晫闈互鑾峰彇鏈€鏂板€? info += tr("Please re-enter the Abount screen to obtain the latest value");
} }
else else
info = tr("Roller scanned count reset failed."); info = tr("Roller scanned count reset failed.");
@ -3596,7 +3608,11 @@ void MainWindow::on_actionact_update_triggered()
{ {
HGVersionInfo *versionInfo = NULL; HGVersionInfo *versionInfo = NULL;
HGUInt versionCount = 0; HGUInt versionCount = 0;
m_versionDll->GetVersionList(HGVERSION_APPNAME_SCANNER, &versionInfo, &versionCount); HGResult ret = m_versionDll->GetVersionList(HGVERSION_APPNAME_SCANNER, &versionInfo, &versionCount);
if (ret != HGBASE_ERR_OK)
{
HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "GetVersionList:%u", ret);
}
if(versionCount > 0) if(versionCount > 0)
{ {
Dialog_upgrade dlg(m_versionDll, versionInfo, versionCount, this); Dialog_upgrade dlg(m_versionDll, versionInfo, versionCount, this);
@ -3681,10 +3697,10 @@ void MainWindow::on_act_driver_log_triggered()
QDesktopServices::openUrl(QUrl::fromLocalFile(log_file_path)); QDesktopServices::openUrl(QUrl::fromLocalFile(log_file_path));
} }
else { else {
if(statu == SANE_STATUS_UNSUPPORTED) // 设备ä¸<EFBFBD>支æŒ<EFBFBD>该æ“<EFBFBD>作 if(statu == SANE_STATUS_UNSUPPORTED) // 璁惧涓嶆敮鎸佽鎿嶄綔
QMessageBox::information(this, windowTitle(), tr("The device does not support this operation")); QMessageBox::information(this, windowTitle(), tr("The device does not support this operation"));
else else
QMessageBox::information(this, windowTitle(), tr("IO error")); // IO错误 QMessageBox::information(this, windowTitle(), tr("IO error")); // IO閿欒
} }
} }

View File

@ -598,66 +598,14 @@ Page range will be &quot;Chosen Pages&quot;.
<source>TextSize</source> <source>TextSize</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>6</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>7</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>8</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>9</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>10</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>11</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>12</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>14</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>16</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>18</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>20</source> <source>20</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>22</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>24</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>26</source> <source>26</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>28</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>36</source> <source>36</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -726,6 +674,22 @@ Page range will be &quot;Chosen Pages&quot;.
<source>Zoomout</source> <source>Zoomout</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>96</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>128</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>160</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>200</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>Dialog_ImageInfo</name> <name>Dialog_ImageInfo</name>
@ -1881,26 +1845,10 @@ Please finish scanning first.</source>
<source>success</source> <source>success</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>apply setting </source>
<translation type="unfinished"></translation>
</message>
<message>
<source> success</source>
<translation type="unfinished"></translation>
</message>
<message>
<source> failed</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>failed</source> <source>failed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>lost config</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>apply setting</source> <source>apply setting</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -1950,10 +1898,6 @@ Are you sure to close?</source>
<source>Are you sure to clear the rollor acount?</source> <source>Are you sure to clear the rollor acount?</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Please re-enter the Abount screen to obtain the latest value</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>roller number</source> <source>roller number</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -2094,6 +2038,18 @@ Are you sure to close?</source>
<source>already waked up device</source> <source>already waked up device</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>binary</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>gray</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>rgb</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>Phonon::</name> <name>Phonon::</name>
@ -8248,10 +8204,6 @@ Please choose a different file name.</source>
</context> </context>
<context> <context>
<name>hg_settingdialog</name> <name>hg_settingdialog</name>
<message>
<source>set</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>delete all configurations</source> <source>delete all configurations</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>