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 @@
取消
-
+
提示
-
+
账户或密码错误
@@ -98,18 +98,17 @@
扫描仪维护工具
-
+
固件升级
-
+
设备列表:
-
-
+
设备信息
@@ -158,128 +157,128 @@
管理工具
-
+
滚轴计数:
-
+
0
-
+
历史扫描张数:
-
+
清除滚轴计数
-
+
序列号:
-
+
固件号:
-
+
速度模式:
-
+
畸变校正
-
+
24位彩色
-
+
256级灰度
-
+
200
-
+
300
-
+
600
-
+
颜色模式:
-
+
分辨率:
-
+
获取畸变值
-
+
设置畸变值
-
+
开始自动校正
-
+
未校正
-
+
修改账户密码
-
+
旧密码:
-
+
新密码:
-
+
确认修改
-
+
确认新密码:
-
+
关闭
@@ -296,41 +295,40 @@
打开设备:%1,固件版本号为:%2
-
-
-
-
-
+
+
+
+
+
不支持
-
- 打开设备错误:%1
+ 打开设备错误:%1
-
+
无设备打开
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
提示
-
+
未获取到可升级版本
@@ -339,7 +337,7 @@
确定
-
+
打开文件
@@ -348,9 +346,9 @@
压缩文件(* .zip)
-
-
-
+
+
+
设备:%1 固件升级成功
@@ -363,18 +361,24 @@
设备: %1, 固件版本: %2, 升级: %3
-
+
支持
-
+
+
+ upgrade: %2
+ 固件更新: %1
+
+
+
压缩文件(*.zip)
-
-
+
+
选择的固件版本比当前版本低
@@ -383,7 +387,7 @@
固件不匹配
-
+
固件文件版本不匹配,是否继续?
@@ -392,101 +396,110 @@
取消
-
- 设备: %1, 固件升级: %2
+ 设备: %1, 固件升级: %2
-
+
固件号: %1
-
+
序列号: %1
-
+
速度模式: %1
-
-
-
+
+
+ 设备被其他进程占用
+
+
+
+
+ 打开设备失败
+
+
+
+
+
设备:%1 固件升级失败,IO错误
-
+
下载固件失败
-
+
滚轴计数已清零
-
+
设备不支持
-
+
清除滚轴计数失败
-
+
旧密码错误
-
+
新密码不能为空
-
+
新密码不一致
-
+
密码修改失败
-
+
密码修改成功
-
-
-
+
+
+
提示
-
+
获取失败
-
+
设置失败
-
+
校正失败
-
+
已校正
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