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 @@ - + Manual 手动 - + Button 按键 - + Modify 修改 - + Tips 提示 - + Item find in list 配置已存在 @@ -162,38 +162,30 @@ Form_DeviceConfig - + Default 恢复默认 - + Custom gamma 自定义色调曲线 - - - - - - - - - + Prompt 提示 - - - - - - - - - + + + + + + + + + The funtion is unsupported 此版本不支持该功能 @@ -389,24 +381,23 @@ 用户自定义页数 - - + - + + e.g. '%1%2' 例如.“%1%2” - Browse directory - 文件夹路径 + 文件夹路径 MainWindow - + Scan Tool 扫描工具 @@ -436,131 +427,130 @@ 选择设备 - + Show 打开 - + Exit 退出 - + Device Type 设备类型 - + Button Id 按键ID - + Device Config 设备配置 - + Save Param 保存参数 - - - - + + + Manual 手动 - - - - + + + Button 1 按键 1 - - - - + + + Button 2 按键 2 - - - - + + + Button 3 按键 3 - - - - + + + Button 4 按键 4 - - - - - + + + + + Tips 提示 - - - + + + Device is offline 设备已断开 - + binary 黑白 - + gray 256级灰度 - + rgb 24位彩色 - + + Do not supported to open %1 + 不支持打开设备 %1 + + + No item selected 请选择配置项 - + Device type mismatch 设备类型不匹配 - Manual configuration items cannot be deleted - 手动扫描配置不可被删除 + 手动扫描配置不可被删除 - + Question 询问 - + Are you sure you want to remove the item? 确认删除配置项? 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()