diff --git a/app/scantool/Scantool_zh_CN.qm b/app/scantool/Scantool_zh_CN.qm
index eb05fb48..1a2c33b9 100644
Binary files a/app/scantool/Scantool_zh_CN.qm and b/app/scantool/Scantool_zh_CN.qm differ
diff --git a/app/scantool/Scantool_zh_CN.ts b/app/scantool/Scantool_zh_CN.ts
index b8b01724..44ea71b7 100644
--- a/app/scantool/Scantool_zh_CN.ts
+++ b/app/scantool/Scantool_zh_CN.ts
@@ -40,28 +40,28 @@
-
+
手动
-
+
按键
-
+
修改
-
+
提示
-
+
配置已存在
@@ -162,38 +162,30 @@
Form_DeviceConfig
-
+
恢复默认
-
+
自定义色调曲线
-
-
-
-
-
-
-
-
-
+
提示
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
此版本不支持该功能
@@ -389,24 +381,23 @@
用户自定义页数
-
-
+
-
+
+
例如.“%1%2”
-
- 文件夹路径
+ 文件夹路径
MainWindow
-
+
扫描工具
@@ -436,131 +427,130 @@
选择设备
-
+
打开
-
+
退出
-
+
设备类型
-
+
按键ID
-
+
设备配置
-
+
保存参数
-
-
-
-
+
+
+
手动
-
-
-
-
+
+
+
按键 1
-
-
-
-
+
+
+
按键 2
-
-
-
-
+
+
+
按键 3
-
-
-
-
+
+
+
按键 4
-
-
-
-
-
+
+
+
+
+
提示
-
-
-
+
+
+
设备已断开
-
+
黑白
-
+
256级灰度
-
+
24位彩色
-
+
+
+ 不支持打开设备 %1
+
+
+
请选择配置项
-
+
设备类型不匹配
-
- 手动扫描配置不可被删除
+ 手动扫描配置不可被删除
-
+
询问
-
+
确认删除配置项?
diff --git a/app/scantool/mainwindow.cpp b/app/scantool/mainwindow.cpp
index 5d0896e8..e58c4c3b 100644
--- a/app/scantool/mainwindow.cpp
+++ b/app/scantool/mainwindow.cpp
@@ -10,6 +10,7 @@
#include "base/HGCrash.h"
#include "imgproc/HGImgProc.h"
#include "imgproc/HGOCR.h"
+#include "huagao/hgscanner_error.h"
#include "dialog_scaninfo.h"
#include "form_saveparam.h"
#include "sqlite3.h"
@@ -1259,6 +1260,11 @@ void MainWindow::timerEvent(QTimerEvent *e)
this->killTimer(m_timerId);
m_timerId = -1;
}
+ else if (SCANNER_ERR_DEVICE_NOT_SUPPORT == status)
+ {
+ this->killTimer(m_timerId);
+ m_timerId = -1;
+ }
}
}
@@ -1381,9 +1387,13 @@ void MainWindow::on_comboBox_currentIndexChanged(const QString &arg1)
ui->pushButtonAdd->setEnabled(true);
ui->pushButtonModify->setEnabled(true);
}
+ else if (SCANNER_ERR_DEVICE_NOT_SUPPORT == status)
+ {
+ QMessageBox::information(this, tr("Tips"), tr("Do not supported to open %1").arg(arg1));
+ }
else
{
- m_timerId = this->startTimer(2000);
+ m_timerId = this->startTimer(5000);
}
}
@@ -1416,19 +1426,19 @@ void MainWindow::on_showMainWindowDlg()
void MainWindow::on_saneEventCloseDevice(void* devHandle)
{
- if (devHandle == m_devHandle)
- {
- assert(nullptr != m_devHandle || nullptr != devHandle);
- StopScan();
- emit closeDevice();
- sane_close(m_devHandle);
- m_devHandle = NULL;
- m_devName.clear();
+ assert(nullptr != m_devHandle || nullptr != devHandle);
+ if (devHandle != m_devHandle)
+ return;
- ui->pushButtonScan->setEnabled(false);
- ui->pushButtonAdd->setEnabled(false);
- ui->pushButtonModify->setEnabled(false);
- }
+ StopScan();
+ emit closeDevice();
+ sane_close(m_devHandle);
+ m_devHandle = NULL;
+ m_devName.clear();
+
+ ui->pushButtonScan->setEnabled(false);
+ ui->pushButtonAdd->setEnabled(false);
+ ui->pushButtonModify->setEnabled(false);
if (-1 != m_timerId)
{
@@ -1436,7 +1446,7 @@ void MainWindow::on_saneEventCloseDevice(void* devHandle)
m_timerId = -1;
}
- m_timerId = this->startTimer(2000);
+ m_timerId = this->startTimer(5000);
}
void MainWindow:: on_pushButtonAdd_clicked()