From cf3f5352e3836f2b128b37993b3234c7b129b2d6 Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Tue, 13 Jun 2023 16:56:27 +0800 Subject: [PATCH] =?UTF-8?q?twain=E8=AE=BE=E7=BD=AE=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=97=B6=E5=88=A4=E6=96=AD=E8=BF=94=E5=9B=9E=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scanner2/mainwindow.cpp | 4 +- modules/twainui/TwainUI_zh_CN.qm | Bin 5083 -> 5065 bytes modules/twainui/TwainUI_zh_CN.ts | 152 +++++++++++++++------------ modules/twainui/TwainUI_zh_EN.qm | Bin 8419 -> 8403 bytes modules/twainui/TwainUI_zh_EN.ts | 152 +++++++++++++++------------ modules/twainui/hg_settingdialog.cpp | 54 ++++++++-- 6 files changed, 213 insertions(+), 149 deletions(-) diff --git a/app/scanner2/mainwindow.cpp b/app/scanner2/mainwindow.cpp index adb4fdb2..30c7929b 100644 --- a/app/scanner2/mainwindow.cpp +++ b/app/scanner2/mainwindow.cpp @@ -387,11 +387,11 @@ MainWindow::MainWindow(const QString& appLang, QWidget *parent) connect(m_devUser, SIGNAL(newImage(void*)), this, SLOT(on_newImage(void*)), Qt::DirectConnection); connect(m_devUser, SIGNAL(scanWorkingEvent()), this, SLOT(on_scanWorkingEvent()), Qt::QueuedConnection); connect(m_devUser, SIGNAL(scanFinishEvent()), this, SLOT(on_scanFinishEvent()), Qt::QueuedConnection); - } #if !defined(HG_CMP_MSC) - checkRollerLife(); + checkRollerLife(); #endif + } updateSideBar(); updateActionStatus(); diff --git a/modules/twainui/TwainUI_zh_CN.qm b/modules/twainui/TwainUI_zh_CN.qm index 8f67cef236d1013f1cc7e7d31bbe7e5f0173e67f..f5f9609e3b5fdbeabd25f0b094427e4c5ff636c7 100644 GIT binary patch delta 570 zcmXAmT}YE*6vxl|{qEiSF@>ZJT+6H#Sb34%q_rE9?Luq_iBSY?(Hmoe&W1NGQwa;g zdg&8u7uEtY@*{49(F$eBj~mKhJai=l7iFqxX$>bYEhU zsP+(%SVh!OPyZM9`yljtl5Y1CIV_SM_aIx|h!p{nXMPb0P73V5PQ-qo;#!`lLT8*^ z^F;CB3VQ2&&5EYuR&ud%+R7?D2A2FKh)LFpWOcS`_?IX3Ap z!(f@6s=NTSlJf7y;EwIkOACLbIG3T!nVa z>(i^0Aa2waiTA_EXIo0aSesN@H{HW?uPTW`6b3 zBfBwg<)=D6qe353pUvXF7T3!6=TKMDJC9EQxLpr*5K* zK?tj?u%e$$kj082$O?)OG8}2GZVWc>tS(A0HL_Ok7h#OBJl@f|y$a_yk(^Ujx|pSlnCys!S-o z+yy9#%+_E55VOouaS>pw%r`y+sFTd*kw2g^%RMpCx&8!~_fODZ7gs!3pha>D z$<|M`9Os!G5wS~=+LHh@(~5MogXZ^EkgcyEC-TOXRyvpXqa9JApXBY|M`*tvy#3c0 zVH-c-C7=9mzW8W{a9A)7zoGF4VIV*@bY@{_!a$+T3pX6k$bPMm%3dU$ead8b1QDp4 z#L3PW`Ftm)ca{a;iZjulRNKVgPYJnERiJ;6gj}lCBnj*0)XwTVw115{l0QRO(4=a< zQqZ?Fvs=E<0HXZVZo;FX}Wx`e7Q{W_5CsYqg023VNbyHA7W-r7+1z$NbZbJ_A34YFyE^P diff --git a/modules/twainui/TwainUI_zh_CN.ts b/modules/twainui/TwainUI_zh_CN.ts index cd5a2e64..21f5e14c 100644 --- a/modules/twainui/TwainUI_zh_CN.ts +++ b/modules/twainui/TwainUI_zh_CN.ts @@ -1520,48 +1520,38 @@ Please make sure the two passwords are the same. 扫描状态 - + image recived: 接收图片: - + total image recived: 总计图片接收数: - - image uploaded: - 上传图片: - - - - total image uploaded: - 总计图片上传数: - - - + Cancel Scan 取消扫描 - + Close close 完成扫描 - + start scanning 开始扫描... - + stop scanning 停止扫描... - + Total scanned images: %1 总计图片扫描数:%1 @@ -2831,7 +2821,7 @@ Are you sure to close? 删除配置 - + existing configuration scheme 现有配置方案: @@ -2852,115 +2842,137 @@ Are you sure to close? 删除所有配置 - + confgiuration information: 配置信息: - + about... 关于... - + scan 扫描 - - + + ok 确定 - + cancel 取消 - + configuration scheme management 配置方案管理 - + regional crop 区域裁剪 - + custom tone curve 自定义色调曲线 - + + + + + + + + Prompt + 提示 + + + + + + + + + + The funtion is unsupported + 不支持该功能 + + + about 关于 - - - - - - + + + + + + Not supported 不支持 - + <p>Device model: %1</p> <p>设备型号: %1</p> - + <p>Driver version: %1</p> <p>驱动版本号: %1</p> - + <p>Firmware number: %1</p> <p>设备固件版本号: %1</p> - + <p>Serial number: %1</p> <p>设备序列号: %1</p> - - - + + + <p>Roller count: %1</p> <p>设备滚轴计数: %1</p> - + <p>History count: %1</p> <p>设备历史扫描张数: %1</p> - + Please select to overwrite the original configuration: 请选择覆盖原来的配置: - + ,or add a new configuration ,或者新增配置 - + save the configuration 保存配置 - + Add new scheme 新增配置 - + The configuration scheme already exists 配置方案已存在 @@ -2994,80 +3006,80 @@ No: add new configuration - + <h6><b> <h6><b> - + cover original configuration: 覆盖原来配置: - - + + Default scheme 默认配置 - + Add new 新增 - + Delete 删除 - + Delete all 全部删除 - + add new configuration 新增配置 - + rename: 更名: - - - + + + tips 提示 - + scheme name cannot be empty 配置名不能为空 - + scheme name: 配置名: - + already exists 已存在 - + :</b></h6> :</b></h6> - + <p> <p> - + </p> </p> @@ -3076,18 +3088,18 @@ No: add new configuration 配置改名 - - + + be sure to delete the configuration 确认删除配置 - + Are you sure you want to delete the configuration " 您确认要删除配置 - + " ? @@ -3100,7 +3112,7 @@ No: add new configuration ’ 吗? - + Are you sure you want to delete the configuration? 您确认要删除所有配置吗? diff --git a/modules/twainui/TwainUI_zh_EN.qm b/modules/twainui/TwainUI_zh_EN.qm index d6ed56a06007454ecf29bb984dbca07285f097b2..5b564701aee3afafcbef0395704df923426e3c46 100644 GIT binary patch delta 810 zcmXAnZAepL6vzMf-rc*q?RuxCQ~eQ-I9+j;{y&-m`HtPCzHI>5XB4be6rdE}8b#?A@egK;F*wM0n3t>|9bb5F~Tq z-^kD!A1=0V2w>;AxQG*Uzn44pg7StYa9u`<53b{eEp4HIn8J%PKlbxB_p9h+Oohe^>{X#%+3Rr1rT6lVCasl$Np0e+vU5>U7BiGMB9-6!TnO zInz%+*lBH6XDZp#Xl2NP{gszrv~xG8zd?E0rJNr6x|?bNuiibVyPX|{4CKQMBl1uTE1a;vMl=!~w0h4RwA$&hp@{Cy q$Q8*71bX!u`DSBYvDIm@S&bHlvDoS;w%ct*PIInT!IK|UuKEYW4B93D delta 799 zcmZ`%YeWk3`lzjGLn zl>fESYVduNfHE8DiRS=W0E08HDeoTUx`;zzW1>9o0hNXs9vXxXlJ-9r7*{YOrw0L} ziy4&`0^ym=%*KxdtYX857XtH6u_+T?KxbgH>P$e`D)#b%bnUJ8=crBRBh2%*lSdkAq^5BFSMJRw9 z9`YUJJCMv1EM#=lu6%o*(_B>G_ShXxN3!1|7=kMW6~n~)hlQww|5s|g9 Scan status - + image recived: Image recived: - + total image recived: Total image recived: - - image uploaded: - Image uploaded: - - - - total image uploaded: - Total image uploaded: - - - + Cancel Scan Cancel Scan - + Close close Finish Scan - + start scanning Start scanning... - + stop scanning Stop scanning... - + Total scanned images: %1 Total scanned images: %1 @@ -2490,7 +2480,7 @@ Please go to “Scan to” and change the accessible scan folder and then perfor hg_settingdialog - + existing configuration scheme Existing configuration plan: @@ -2511,193 +2501,215 @@ Please go to “Scan to” and change the accessible scan folder and then perfor Delete all configurations - - + + Default scheme Default scheme - + Add new Add new - + Delete Delete - + Delete all Delete all - + confgiuration information: Configuration information: - + about... About... - + scan Scan - - + + ok OK - + cancel Cancel - + configuration scheme management Configuration plan management - + regional crop Regional crop - + custom tone curve Custom tone curve - + + + + + + + + Prompt + Prompt + + + + + + + + + + The funtion is unsupported + The funtion is unsupported + + + about About - - - - - - + + + + + + Not supported Not supported - + <p>Device model: %1</p> <p>Device model: %1</p> - + <p>Driver version: %1</p> <p>Driver version: %1</p> - + <p>Firmware number: %1</p> <p>Firmware number: %1</p> - + <p>Serial number: %1</p> <p>Serial number: %1</p> - - - + + + <p>Roller count: %1</p> <p>Roller count: %1</p> - + <p>History count: %1</p> <p>History count: %1</p> - + Please select to overwrite the original configuration: Please select overwrite original configuration: - + ,or add a new configuration , or add new configuration - + save the configuration Save configuration - + cover original configuration: Overwrite original configuration: - + add new configuration Add new configuration - + rename: Rename: - - - + + + tips Prompt - + scheme name cannot be empty Configuration name cannot be blank - + scheme name: Configuration name: - + already exists already exists - + <h6><b> <h6><b> - + :</b></h6> :</b></h6> - + <p> <p> - + </p> </p> - + Add new scheme Add new scheme - + The configuration scheme already exists The configuration scheme already exists @@ -2706,18 +2718,18 @@ Please go to “Scan to” and change the accessible scan folder and then perfor Rename configuration - - + + be sure to delete the configuration Delete configuration - + Are you sure you want to delete the configuration " Are you sure you want to delete configuration - + " ? ? @@ -2730,7 +2742,7 @@ Please go to “Scan to” and change the accessible scan folder and then perfor No - + Are you sure you want to delete the configuration? Are you sure you want to delete all configurations? diff --git a/modules/twainui/hg_settingdialog.cpp b/modules/twainui/hg_settingdialog.cpp index 3bc84765..beb6e564 100644 --- a/modules/twainui/hg_settingdialog.cpp +++ b/modules/twainui/hg_settingdialog.cpp @@ -967,7 +967,13 @@ void hg_settingdialog::slot_checkedClicked() m_list_IdValueTitle.append(QPair, QString>(QPair(id, checkBoxcurrentState), md5(opt->title))); SANE_Int method = 0; - m_saneAPI.sane_control_option_api(m_devHandle, id, SANE_ACTION_SET_VALUE, &checkBoxcurrentState, &method); + SANE_Status ret = m_saneAPI.sane_control_option_api(m_devHandle, id, SANE_ACTION_SET_VALUE, &checkBoxcurrentState, &method); + if (ret == SANE_STATUS_UNSUPPORTED) + { + QMessageBox::information(this, tr("Prompt"), tr("The funtion is unsupported")); + return; + } + if((method & SANE_INFO_RELOAD_OPTIONS) == SANE_INFO_RELOAD_OPTIONS) updateUIStatus(); else if(method & SANE_INFO_INEXACT) @@ -1021,7 +1027,13 @@ void hg_settingdialog::slot_string_list_comboBoxClicked() *((SANE_Fixed*)buf) = SANE_FIX(atof(comboBoxcurrentItem.c_str())); else strcpy(buf, comboBoxcurrentItem.c_str()); - m_saneAPI.sane_control_option_api(m_devHandle, id, SANE_ACTION_SET_VALUE, buf, &method); + SANE_Status ret = m_saneAPI.sane_control_option_api(m_devHandle, id, SANE_ACTION_SET_VALUE, buf, &method); + if (ret == SANE_STATUS_UNSUPPORTED) + { + QMessageBox::information(this, tr("Prompt"), tr("The funtion is unsupported")); + return; + } + if((method & SANE_INFO_RELOAD_OPTIONS) == SANE_INFO_RELOAD_OPTIONS) updateUIStatus(); else if(method & SANE_INFO_INEXACT) @@ -1046,7 +1058,13 @@ void hg_settingdialog::slot_pushButtonClicked() after = 0; // restore to default setting ? - m_saneAPI.sane_control_option_api(m_devHandle, id, SANE_ACTION_SET_VALUE, NULL, &after); + SANE_Status ret = m_saneAPI.sane_control_option_api(m_devHandle, id, SANE_ACTION_SET_VALUE, NULL, &after); + if (ret == SANE_STATUS_UNSUPPORTED) + { + QMessageBox::information(this, tr("Prompt"), tr("The funtion is unsupported")); + return; + } + if((after & SANE_INFO_RELOAD_OPTIONS) == SANE_INFO_RELOAD_OPTIONS) updateUIStatus(); @@ -1273,7 +1291,13 @@ void hg_settingdialog::slot_word_list_comboBoxClicked(int value) SANE_Int method = 0; - m_saneAPI.sane_control_option_api(m_devHandle, id, SANE_ACTION_SET_VALUE, &temp, &method); + SANE_Status ret = m_saneAPI.sane_control_option_api(m_devHandle, id, SANE_ACTION_SET_VALUE, &temp, &method); + if (ret == SANE_STATUS_UNSUPPORTED) + { + QMessageBox::information(this, tr("Prompt"), tr("The funtion is unsupported")); + return; + } + if((method & SANE_INFO_RELOAD_OPTIONS) == SANE_INFO_RELOAD_OPTIONS) updateUIStatus(); else if(method & SANE_INFO_INEXACT) @@ -1329,7 +1353,13 @@ void hg_settingdialog::slot_sliderClicked(int value) m_list_IdValueTitle.append(QPair, QString>(QPair(id, temp), md5(opt->title))); } - m_saneAPI.sane_control_option_api(m_devHandle, id, SANE_ACTION_SET_VALUE, &val, &method); + SANE_Status ret = m_saneAPI.sane_control_option_api(m_devHandle, id, SANE_ACTION_SET_VALUE, &val, &method); + if (ret == SANE_STATUS_UNSUPPORTED) + { + QMessageBox::information(this, tr("Prompt"), tr("The funtion is unsupported")); + return; + } + if((method & SANE_INFO_RELOAD_OPTIONS) == SANE_INFO_RELOAD_OPTIONS) updateUIStatus(); else if(method & SANE_INFO_INEXACT) @@ -1398,7 +1428,12 @@ void hg_settingdialog::slot_spinBoxClicked(int value) m_list_IdValueTitle.append(QPair, QString>(QPair(id, temp), md5(opt->title))); SANE_Int method = 0; - m_saneAPI.sane_control_option_api(m_devHandle, id, SANE_ACTION_SET_VALUE, &temp, &method); + SANE_Status ret = m_saneAPI.sane_control_option_api(m_devHandle, id, SANE_ACTION_SET_VALUE, &temp, &method); + if (ret == SANE_STATUS_UNSUPPORTED) + { + QMessageBox::information(this, tr("Prompt"), tr("The funtion is unsupported")); + return; + } if((method & SANE_INFO_RELOAD_OPTIONS) == SANE_INFO_RELOAD_OPTIONS) updateUIStatus(); else if(value != temp) @@ -1449,7 +1484,12 @@ void hg_settingdialog::slot_lineEditInput() buf = malloc(opt->size * 2 + 4); strcpy((char*)buf, lineEditCurrentText.c_str()); } - m_saneAPI.sane_control_option_api(m_devHandle, id, SANE_ACTION_SET_VALUE, buf, &method); + SANE_Status ret = m_saneAPI.sane_control_option_api(m_devHandle, id, SANE_ACTION_SET_VALUE, buf, &method); + if (ret == SANE_STATUS_UNSUPPORTED) + { + QMessageBox::information(this, tr("Prompt"), tr("The funtion is unsupported")); + return; + } if((method & SANE_INFO_RELOAD_OPTIONS) == SANE_INFO_RELOAD_OPTIONS) updateUIStatus(); else if(method & SANE_INFO_INEXACT)