diff --git a/app/fwupgrade/FWUpgrade_zh_CN.qm b/app/fwupgrade/FWUpgrade_zh_CN.qm index 68920b6c..38ac753c 100644 Binary files a/app/fwupgrade/FWUpgrade_zh_CN.qm and b/app/fwupgrade/FWUpgrade_zh_CN.qm differ diff --git a/app/fwupgrade/FWUpgrade_zh_CN.ts b/app/fwupgrade/FWUpgrade_zh_CN.ts index 02eafdbb..7d713ae5 100644 --- a/app/fwupgrade/FWUpgrade_zh_CN.ts +++ b/app/fwupgrade/FWUpgrade_zh_CN.ts @@ -1,61 +1,338 @@ + + 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