From 9d99f86cd972cb3725b18fa62164554359d7ab85 Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Fri, 11 Nov 2022 11:56:19 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=9B=BA=E4=BB=B6=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/fwupgrade/FWUpgrade_zh_CN.qm | Bin 434 -> 3737 bytes app/fwupgrade/FWUpgrade_zh_CN.ts | 321 ++++++++++++++++++++++++++++--- app/fwupgrade/mainwindow.cpp | 41 ++-- app/fwupgrade/mainwindow.ui | 16 +- 4 files changed, 339 insertions(+), 39 deletions(-) diff --git a/app/fwupgrade/FWUpgrade_zh_CN.qm b/app/fwupgrade/FWUpgrade_zh_CN.qm index 68920b6cf7067f2f70cbfb69b1e66779e2abe69b..38ac753ccc93ec9235a6a819afc4d140c393a08f 100644 GIT binary patch literal 3737 zcma)8e{2&~9DiMJ?X|si%QD6ffjlvTjnvT*bzxC7DxgG*tl)wO%}lG3CsS-Mh}-KmF9Y!A~wciID3gLMV(-*)T$#qwu^Bp^aa_=fl=2 z3?k1t4(#5sR?i9K`4jA2r;+#22-puJ?-2v+pRm@zB@|tA8@_)W8Rq)CYyUwVA^+QD zZFL_b_JG7-DkT1-z&I(G?IYx7q|46j}USn=g6srfZxO&-rNQ& z;!e1Ez`5<2`R#k~eY>Y&#h37Qr6+alb%e_MJh{iR2nF_fa#sdmHN2tE0lzHe9grUa zKC(BrU^B$oz#sVeS9o8|U%XU@kdOFg{JR2h&iU339S8jTeCy^7!TSrogYCeVd&58T z{KLSL_cssiggAc$o;rRAaIOT7)q|-pGSFq5oF4;)SWGk^VBkP{)`b9>c+sf;C-D>clWY zSd)op5S$UEbYo*<$*=`H-ASqA-mSSb=}DI~hn)D15psm)!nk|KDBsnyt3KA;y}o@V z^DKW(O-c&&3z$zI^z;110>;7@O z6p=N@;9Ma~*y)K_uKudWWn;-}qG4oIJ>d)+|E{-XJbYTx3`e^l%{^92v3E`Fzrj4F zW^`3a;;~9#RmY{n^(db8_Qj(RS2*-L~JpWg1cNVo4@W_EpLcJJS7wL|b!HDSvA;T*d;;X;o#J z=-7yhib4|D>;#+=4ICo?Xpl5ct2k^9hK-a-z8bI+dE`}1+v{w&vm9|@vYbA*b0W>cTs zG*pM05T?pTm4H??C(wdK0y{R)Pb`l|EW8$6*Tj^KNu5>V5QaWeWK~Sy4k)=MRkL>q{KS0!O`x`}Q`sxn~@`IDixFzp*#unJj?i*l(f`1ONnPl5bYbc%|Y z1X)O{s_a;6o({;e>tq2VSlOv2q>kQ_b0N@yqFx1^TvOyZVV^Shf_9l)>|UZp_&a7= zxZ5lTEtg2eYyU-BvRRhz47(!+`84}1Mlk8r(!Guwn@5VEO(P6vdI64P!1V-V#sHNd z)|p(~O@8td9U*!IFpw%m#bf%S!a+dHQ?l5xIyslNR%lPg84D5!Fx90r-P~@OA0B~)YY^;v`#dv zC95piNwh}!dYM8+Rn#f?tUQW^kQ1md)51k>MOw^v^BHQL4VB`BKy~CSqx^pwmPzHFQ%LmCF3>1;XO)CQ9r(%mE(dd@wO?qW% z$3(OH(d&bCnmYP<==IEI&*d*@#VyL`55DnKy0nCthO=v|mQJ)vU!03$`19IoBP8T| Of1=ZwbG-4{q5lWcc-ZX# literal 434 zcmcE7ks@*G{hX<16=n7(EZlq7iGhK^f`OqLNHIz=Fw`Fg(zXmaGn0S7LnLxz}%s>W9bZ5s=4v-KV5c7EE6_+ID?FyNB3I#>^=|!o<#X1TF zIjM=osS4$ZnI(F9df1F+nJU@+9&QwCYEe;s5l9_-pnp + + Dialog_upgradeFirmware + + + Dialog + + + + + gif + + + + + text + + + + + + upgrade + 更新升级 + + + + + firmware upgrade in progress, please wait... + 设备固件自动升级中,请稍候... + + + + LoginDialog + + + Login + 用户登录 + + + + account + 账户: + + + + password + 密码: + + + + login + 登录 + + + + help + 帮助 + + + + exit + 取消 + + + + tips + 提示 + + + + wrong account or password + 账户或密码错误 + + + + yes + 确定 + + MainWindow MainWindow - + 扫描仪维护工具 - - gif - + + update firmware + 固件升级 - - text - + + + device list + 设备列表: + + + + online upgrade + 在线升级: + + + + get version list + 获取版本列表 + + + + download and upgrade + 下载更新 + + + + version list + 版本列表: + + + + local upgrade + 本地升级: + + + + file path + 目录: + + + + open file path + 打开本地目录: + + + + upgrade + 更新升级 + + + + manager tools + 管理工具 + + + + roll count: + 滚轴计数: + + + + + 0 + 0 + + + + scan count: + 历史扫描张数: + + + + clear roll count + 清除滚轴计数 + + + + password change + 修改账户密码 + + + + old password + 旧密码: + + + + new password + 新密码: + + + + modify password + 确认修改 + + + + confirm new password + 确认新密码: + + + + exit + 关闭 - Installation - 安装 + 安装 - Installation in progress, please wait... - 安装中,请稍候... + 安装中,请稍候... + + + + open device: %1, firmware version: %2 + 打开设备:%1,固件版本号为:%2 + + + + + do not support + 设备不支持 + + + + open device error: %1 + 打开设备错误:%1 + + + + no device opened + 无设备打开 + + + + + + + + + + tips + 提示: + + + + no version available + 未获取到可升级版本 + + + + + + + + + + yes + 确定 + + + + Open File + 打开目录 + + + + Zip Files(*.zip *.zip) + 压缩文件(* .zip) + + + + + device: %1 upgrade firmware success + 设备:%1 固件升级成功 + + + + device: %1 upgrade firmware failed, download file fail + 设备:%1 固件升级失败,文件下载失败 + + + + + device: %1 upgrade firmware failed, io error + 设备:%1 固件升级失败,IO错误 + + + + Roller scanned count has been set to 0. + 滚轴计数已清零。 + + + + Roller scanned count reset failed. + 清除滚轴计数失败。 + + + + old password is wrong + 旧密码错误 + + + + new password can not be empty + 新密码不能为空 + + + + new password is inconsistent + 新密码不一致 + + + + modify password fail + 密码修改失败 + + + + modify password success + 密码修改成功 QObject - tip - 提示 + 提示 - install succeed! - 安装成功! + 安装成功! - - yes - 确定 + 确定 - error - 错误 + 错误 - install failed! - 安装失败! + 安装失败! diff --git a/app/fwupgrade/mainwindow.cpp b/app/fwupgrade/mainwindow.cpp index 74d4cb43..6924e70e 100644 --- a/app/fwupgrade/mainwindow.cpp +++ b/app/fwupgrade/mainwindow.cpp @@ -205,10 +205,21 @@ void MainWindow::on_comboDevList_currentIndexChanged(int index) } m_curFwVersion = QString::fromStdString(versionNum.c_str()); - ui->labelDevInfo->setText(QString("open device: %1, firmware version: %2").arg(name).arg(m_curFwVersion)); + ui->labelDevInfo->setText(QString(tr("open device: %1, firmware version: %2")).arg(name).arg(m_curFwVersion)); - ui->labelRollCount->setText("do not support"); - ui->labelScanCount->setText("do not support"); + SANE_Int historyScanNum = 0; + unsigned int historyScanNumLen = sizeof(SANE_Int); + SANE_Status ret = sane_io_control(m_curDevHandle, IO_CTRL_CODE_GET_HISTORY_NUM, &historyScanNum, &historyScanNumLen); + if(ret == SANE_STATUS_GOOD && historyScanNum >= 0) + { + ui->labelRollCount->setText(QString(historyScanNum)); + ui->labelScanCount->setText(QString(historyScanNum)); + } + else + { + ui->labelRollCount->setText(tr("do not support")); + ui->labelScanCount->setText(tr("do not support")); + } ui->btnGetVersionList->setEnabled(true); ui->btnOpenFilePath->setEnabled(true); @@ -216,12 +227,12 @@ void MainWindow::on_comboDevList_currentIndexChanged(int index) } else { - ui->labelDevInfo->setText(QString("open device error: %1").arg(name)); + ui->labelDevInfo->setText(QString(tr("open device error: %1")).arg(name)); } } else { - ui->labelDevInfo->setText("no device opened"); + ui->labelDevInfo->setText(tr("no device opened")); } } @@ -301,15 +312,15 @@ void MainWindow::on_btnDownloadUpgrade_clicked() dlg.exec(); if (0 == dlg.getUpgradeStatus()) { - ui->labelDevInfo->setText(QString("device: %1 upgrade firmware success").arg(m_curDevName)); + ui->labelDevInfo->setText(QString(tr("device: %1 upgrade firmware success")).arg(m_curDevName)); } else if (1 == dlg.getUpgradeStatus()) { - ui->labelDevInfo->setText(QString("device: %1 upgrade firmware failed, download file fail").arg(m_curDevName)); + ui->labelDevInfo->setText(QString(tr("device: %1 upgrade firmware failed, download file fail")).arg(m_curDevName)); } else if (2 == dlg.getUpgradeStatus()) { - ui->labelDevInfo->setText(QString("device: %1 upgrade firmware failed, io error").arg(m_curDevName)); + ui->labelDevInfo->setText(QString(tr("device: %1 upgrade firmware failed, io error")).arg(m_curDevName)); } } } @@ -323,11 +334,11 @@ void MainWindow::on_btnUpgrade_clicked() dlg.exec(); if (0 == dlg.getUpgradeStatus()) { - ui->labelDevInfo->setText(QString("device: %1 upgrade firmware success").arg(m_curDevName)); + ui->labelDevInfo->setText(QString(tr("device: %1 upgrade firmware success")).arg(m_curDevName)); } else if (2 == dlg.getUpgradeStatus()) { - ui->labelDevInfo->setText(QString("device: %1 upgrade firmware failed, io error").arg(m_curDevName)); + ui->labelDevInfo->setText(QString(tr("device: %1 upgrade firmware failed, io error")).arg(m_curDevName)); } } } @@ -364,7 +375,7 @@ void MainWindow::on_btnModifyPassword_clicked() if (password != ui->editOldPassword->text()) { - QMessageBox msg(QMessageBox::Information, tr("tips"), "old password is wrong", QMessageBox::Yes, this); + QMessageBox msg(QMessageBox::Information, tr("tips"), tr("old password is wrong"), QMessageBox::Yes, this); msg.setButtonText(QMessageBox::Yes, tr("yes")); msg.exec(); return; @@ -372,7 +383,7 @@ void MainWindow::on_btnModifyPassword_clicked() if (ui->editNewPassword->text().isEmpty()) { - QMessageBox msg(QMessageBox::Information, tr("tips"), "new password can not be empty", QMessageBox::Yes, this); + QMessageBox msg(QMessageBox::Information, tr("tips"), tr("new password can not be empty"), QMessageBox::Yes, this); msg.setButtonText(QMessageBox::Yes, tr("yes")); msg.exec(); return; @@ -380,7 +391,7 @@ void MainWindow::on_btnModifyPassword_clicked() if (ui->editNewPassword->text() != ui->editNewPassword_2->text()) { - QMessageBox msg(QMessageBox::Information, tr("tips"), "new password is inconsistent", QMessageBox::Yes, this); + QMessageBox msg(QMessageBox::Information, tr("tips"), tr("new password is inconsistent"), QMessageBox::Yes, this); msg.setButtonText(QMessageBox::Yes, tr("yes")); msg.exec(); return; @@ -388,13 +399,13 @@ void MainWindow::on_btnModifyPassword_clicked() if (HGBASE_ERR_OK != HGBase_SetProfileString(cfgPath, "login", "password", passwordEncrypt(ui->editNewPassword->text()).toStdString().c_str())) { - QMessageBox msg(QMessageBox::Information, tr("tips"), "modify password fail", QMessageBox::Yes, this); + QMessageBox msg(QMessageBox::Information, tr("tips"), tr("modify password fail"), QMessageBox::Yes, this); msg.setButtonText(QMessageBox::Yes, tr("yes")); msg.exec(); return; } - QMessageBox msg(QMessageBox::Information, tr("tips"), "modify password success", QMessageBox::Yes, this); + QMessageBox msg(QMessageBox::Information, tr("tips"), tr("modify password success"), QMessageBox::Yes, this); msg.setButtonText(QMessageBox::Yes, tr("yes")); msg.exec(); } diff --git a/app/fwupgrade/mainwindow.ui b/app/fwupgrade/mainwindow.ui index 7ae482f6..dcf2c10b 100644 --- a/app/fwupgrade/mainwindow.ui +++ b/app/fwupgrade/mainwindow.ui @@ -6,10 +6,22 @@ 0 0 - 740 + 739 497 + + + 739 + 497 + + + + + 739 + 497 + + MainWindow @@ -398,7 +410,7 @@ 0 0 - 740 + 739 22