diff --git a/app/fwupgrade/FWUpgrade_zh_CN.qm b/app/fwupgrade/FWUpgrade_zh_CN.qm index 3638fe45..fbf77a31 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 f7c9a46e..d2cb4394 100644 --- a/app/fwupgrade/FWUpgrade_zh_CN.ts +++ b/app/fwupgrade/FWUpgrade_zh_CN.ts @@ -76,12 +76,12 @@ 取消 - + tips 提示 - + wrong account or password 账户或密码错误 @@ -98,18 +98,17 @@ 扫描仪维护工具 - + update firmware 固件升级 - + device list 设备列表: - - + device information 设备信息 @@ -158,128 +157,128 @@ 管理工具 - + roll count: 滚轴计数: - + 0 0 - + scan count: 历史扫描张数: - + clear roll count 清除滚轴计数 - + Serial number: 序列号: - + Firmware number: 固件号: - + Speed mode: 速度模式: - + correction 畸变校正 - + Color 24位彩色 - + Gray 256级灰度 - + 200 200 - + 300 300 - + 600 600 - + Color mode: 颜色模式: - + Dpi: 分辨率: - + Get distortion 获取畸变值 - + Set distortion 设置畸变值 - + Correct 开始自动校正 - + Have not corrected 未校正 - + password change 修改账户密码 - + old password 旧密码: - + new password 新密码: - + modify password 确认修改 - + confirm new password 确认新密码: - + exit 关闭 @@ -296,41 +295,40 @@ 打开设备:%1,固件版本号为:%2 - - - - - + + + + + do not support 不支持 - open device error: %1 - 打开设备错误:%1 + 打开设备错误:%1 - + no device opened 无设备打开 - - - - - - - - - - - + + + + + + + + + + + tips 提示 - + no version available 未获取到可升级版本 @@ -339,7 +337,7 @@ 确定 - + Open File 打开文件 @@ -348,9 +346,9 @@ 压缩文件(* .zip) - - - + + + device: %1 upgrade firmware success 设备:%1 固件升级成功 @@ -363,18 +361,24 @@ 设备: %1, 固件版本: %2, 升级: %3 - + support 支持 - + + upgrade: %1 + upgrade: %2 + 固件更新: %1 + + + ZIP Files(*.zip *.zip) 压缩文件(*.zip) - - + + the selected firmware is not newer than the current version 选择的固件版本比当前版本低 @@ -383,7 +387,7 @@ 固件不匹配 - + firmware file mismatch, continue? 固件文件版本不匹配,是否继续? @@ -392,101 +396,110 @@ 取消 - device: %1, upgrade: %2 - 设备: %1, 固件升级: %2 + 设备: %1, 固件升级: %2 - + FirmWare number: %1 固件号: %1 - + Serial number: %1 序列号: %1 - + speed mode: %1 速度模式: %1 - - - + + Device is opened by other process + 设备被其他进程占用 + + + + open device error + 打开设备失败 + + + + + device: %1 upgrade firmware failed, io error 设备:%1 固件升级失败,IO错误 - + download firmware fail 下载固件失败 - + Roller scanned count has been set to 0. 滚轴计数已清零 - + Do not supported 设备不支持 - + 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 密码修改成功 - - - + + + Prompt 提示 - + Get failed 获取失败 - + Set failed 设置失败 - + Correct failed 校正失败 - + Have already corrected 已校正 diff --git a/app/fwupgrade/logindialog.cpp b/app/fwupgrade/logindialog.cpp index 9651066a..c0dbcc51 100644 --- a/app/fwupgrade/logindialog.cpp +++ b/app/fwupgrade/logindialog.cpp @@ -11,6 +11,9 @@ LoginDialog::LoginDialog(const QString &account, const QString &password, QWidge { ui->setupUi(this); + setWindowFlags(Qt::WindowCloseButtonHint); + + ui->editAccount->setEnabled(false); ui->editAccount->setText(m_account); ui->editPassword->setEchoMode(QLineEdit::EchoMode::Password); diff --git a/app/fwupgrade/main.cpp b/app/fwupgrade/main.cpp index 33fc88b0..03a1d881 100644 --- a/app/fwupgrade/main.cpp +++ b/app/fwupgrade/main.cpp @@ -65,10 +65,6 @@ int main(int argc, char *argv[]) if (translator_qt.load(":translation/qt_zh_CN.qm")) a.installTranslator(&translator_qt); - MainWindow w; - QScreen *screen = QGuiApplication::primaryScreen(); - w.move((screen->size().width() - w.width()) / 2, (screen->size().height() - w.height()) / 2); - HGChar cfgPath[256]= {0}; GetConfigPath(cfgPath, 256); strcat(cfgPath, "config.ini"); @@ -76,9 +72,13 @@ int main(int argc, char *argv[]) HGBase_GetProfileString(cfgPath, "login", "password", "", str, 256); QString password = (0 == *str) ? "huagoscan" : MainWindow::passwordDecrypt(str); - LoginDialog login("admin", password, &w); + LoginDialog login("admin", password, nullptr); if (login.exec()) { + MainWindow w; + QScreen *screen = QGuiApplication::primaryScreen(); + w.move((screen->size().width() - w.width()) / 2, (screen->size().height() - w.height()) / 2); + w.show(); a.exec(); } diff --git a/app/fwupgrade/mainwindow.cpp b/app/fwupgrade/mainwindow.cpp index b817a9e0..0e7b6cb6 100644 --- a/app/fwupgrade/mainwindow.cpp +++ b/app/fwupgrade/mainwindow.cpp @@ -10,6 +10,7 @@ #include "dialog_updateprogress.h" #include "base/HGBase.h" #include "base/HGInc.h" +#include "huagao/hgscanner_error.h" #include "sane/sane_option_definitions.h" #include "HGString.h" #include @@ -312,6 +313,8 @@ void MainWindow::on_comboDevList_currentIndexChanged(int index) ui->editFilePath->clear(); ui->labelRollCount->setText("0"); ui->labelScanCount->setText("0"); + ui->label_deviceError->clear(); + ui->labelDevInfo->clear(); if (nullptr != m_curDevHandle) { @@ -328,10 +331,18 @@ void MainWindow::on_comboDevList_currentIndexChanged(int index) ui->btnUpgrade->setEnabled(false); ui->btnClearRollCount->setEnabled(false); + ui->comboBox_colorMode->setEnabled(false); + ui->comboBox_dpi->setEnabled(false); + ui->pushButton_getDistortion->setEnabled(false); + ui->pushButton_setDistortion->setEnabled(false); + ui->lineEdit_distortion->setEnabled(false); + ui->pushButton_correct->setEnabled(false); + if (-1 != index) { QString name = ui->comboDevList->itemText(index); - if (SANE_STATUS_GOOD == sane_open(name.toStdString().c_str(), &m_curDevHandle)) + SANE_Status ret = sane_open(name.toStdString().c_str(), &m_curDevHandle); + if (SANE_STATUS_GOOD == ret) { m_curDevName = name; @@ -357,8 +368,7 @@ void MainWindow::on_comboDevList_currentIndexChanged(int index) m_curFwVersion = QString::fromStdString(fwVersionNum.c_str()); QString devType = GetDevType(m_curFwVersion, NULL); - ui->labelDevInfo->setText(QString(tr("device: %1, upgrade: %2")).arg(name) - .arg(!devType.isEmpty() ? tr("support") : tr("do not support"))); + ui->labelDevInfo->setText(QString(tr("upgrade: %1")).arg(!devType.isEmpty() ? tr("support") : tr("do not support"))); ui->label_fwNum->setText(QString((!m_curFwVersion.isEmpty()) ? tr("FirmWare number: %1").arg(m_curFwVersion) : tr("do not support"))); ui->label_sn->setText(QString((!m_curSerialNum.isEmpty()) ? tr("Serial number: %1").arg(m_curSerialNum) : tr("do not support"))); ui->label_speedMode->setText(QString(tr("speed mode: %1").arg(getSpeedMode()))); @@ -393,15 +403,26 @@ void MainWindow::on_comboDevList_currentIndexChanged(int index) ui->btnOpenFilePath->setEnabled(true); } ui->btnClearRollCount->setEnabled(true); + + ui->comboBox_colorMode->setEnabled(true); + ui->comboBox_dpi->setEnabled(true); + ui->pushButton_getDistortion->setEnabled(true); + ui->pushButton_setDistortion->setEnabled(true); + ui->lineEdit_distortion->setEnabled(true); + ui->pushButton_correct->setEnabled(true); + } + else if (SCANNER_ERR_OPENED_BY_OTHER_PROCESS == ret) + { + ui->label_deviceError->setText(QString(tr("Device is opened by other process"))); } else { - ui->labelDevInfo->setText(QString(tr("open device error: %1")).arg(name)); + ui->label_deviceError->setText(QString(tr("open device error"))); } } else { - ui->labelDevInfo->setText(tr("no device opened")); + ui->label_deviceError->setText(tr("no device opened")); } } diff --git a/app/fwupgrade/mainwindow.ui b/app/fwupgrade/mainwindow.ui index f3558ffb..dc17c60a 100644 --- a/app/fwupgrade/mainwindow.ui +++ b/app/fwupgrade/mainwindow.ui @@ -52,6 +52,13 @@ + + + + + + + @@ -70,30 +77,17 @@ - 2 + 1 update firmware - - - - 70 - 30 - 391 - 20 - - - - device information - - - 70 - 80 + 80 + 60 501 111 @@ -154,8 +148,8 @@ - 70 - 220 + 80 + 190 501 111 @@ -213,6 +207,19 @@ + + + + 80 + 10 + 108 + 31 + + + + + + @@ -221,7 +228,7 @@ - 170 + 220 180 71 20 @@ -234,7 +241,7 @@ - 240 + 310 180 81 21 @@ -247,7 +254,7 @@ - 260 + 310 230 81 21 @@ -260,7 +267,7 @@ - 170 + 220 230 81 20 @@ -273,7 +280,7 @@ - 270 + 240 280 111 31 @@ -286,7 +293,7 @@ - 170 + 220 30 321 16 @@ -299,7 +306,7 @@ - 170 + 220 80 321 16 @@ -312,7 +319,7 @@ - 170 + 220 130 321 16