HGGitLab

Commit 2c70a9ad authored by yangjiaxuan's avatar yangjiaxuan

“增加扫描错误提示”

parent c3128453
......@@ -1273,7 +1273,7 @@ Please make sure the two passwords are the same.</source>
</message>
<message>
<location filename="mainwindow.cpp" line="58"/>
<location filename="mainwindow.cpp" line="1933"/>
<location filename="mainwindow.cpp" line="1942"/>
<source>HuaGoScan</source>
<translation>华高扫描软件</translation>
</message>
......@@ -1288,295 +1288,303 @@ Please make sure the two passwords are the same.</source>
<translation>插入文件</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="219"/>
<location filename="mainwindow.cpp" line="220"/>
<source>nodevice</source>
<translation>没有发现扫描仪</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="386"/>
<location filename="mainwindow.cpp" line="1251"/>
<location filename="mainwindow.cpp" line="1286"/>
<location filename="mainwindow.cpp" line="1548"/>
<location filename="mainwindow.cpp" line="1839"/>
<location filename="mainwindow.cpp" line="387"/>
<location filename="mainwindow.cpp" line="1258"/>
<location filename="mainwindow.cpp" line="1293"/>
<location filename="mainwindow.cpp" line="1555"/>
<location filename="mainwindow.cpp" line="1848"/>
<source>Question</source>
<translation>警告</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="387"/>
<location filename="mainwindow.cpp" line="1252"/>
<location filename="mainwindow.cpp" line="1287"/>
<location filename="mainwindow.cpp" line="388"/>
<location filename="mainwindow.cpp" line="1259"/>
<location filename="mainwindow.cpp" line="1294"/>
<source>modified, save it?</source>
<translation>图像已被修改。
是否保存修改?</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="672"/>
<location filename="mainwindow.cpp" line="673"/>
<location filename="mainwindow.cpp" line="674"/>
<source> already connected</source>
<translation> 已连接</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="715"/>
<location filename="mainwindow.cpp" line="716"/>
<source> disconnected</source>
<translation> 已断开连接</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="771"/>
<location filename="mainwindow.cpp" line="790"/>
<location filename="mainwindow.cpp" line="778"/>
<location filename="mainwindow.cpp" line="797"/>
<source>%1/%2%3.%4</source>
<translation>%1/%2%3.%4</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="810"/>
<location filename="mainwindow.cpp" line="815"/>
<location filename="mainwindow.cpp" line="817"/>
<location filename="mainwindow.cpp" line="822"/>
<source>scan starting...</source>
<translation>开始扫描...</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="825"/>
<location filename="mainwindow.cpp" line="836"/>
<location filename="mainwindow.cpp" line="832"/>
<location filename="mainwindow.cpp" line="843"/>
<source>scan finished</source>
<translation>扫描完成</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1210"/>
<location filename="mainwindow.cpp" line="1217"/>
<source>Open images</source>
<translation>打开图片</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1216"/>
<location filename="mainwindow.cpp" line="1223"/>
<source>Insert images</source>
<translation>插入图片</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1468"/>
<location filename="mainwindow.cpp" line="1475"/>
<source>File name</source>
<translation>文件名</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1468"/>
<location filename="mainwindow.cpp" line="1475"/>
<source>File path</source>
<translation>文件路径</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1468"/>
<location filename="mainwindow.cpp" line="1475"/>
<source>File size</source>
<translation>文件大小</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1468"/>
<location filename="mainwindow.cpp" line="1475"/>
<source>Creation date/time</source>
<translation>创建时间</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1468"/>
<location filename="mainwindow.cpp" line="1475"/>
<source>Modified date/time</source>
<translation>修改时间</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1468"/>
<location filename="mainwindow.cpp" line="1475"/>
<source>Accessed date/time</source>
<translation>访问时间</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1511"/>
<location filename="mainwindow.cpp" line="1518"/>
<source>Format</source>
<translation>格式</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1511"/>
<location filename="mainwindow.cpp" line="1518"/>
<source>Width</source>
<translation>宽度</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1511"/>
<location filename="mainwindow.cpp" line="1518"/>
<source>Height</source>
<translation>高度</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1511"/>
<location filename="mainwindow.cpp" line="1518"/>
<source>depth</source>
<translation>深度</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1511"/>
<location filename="mainwindow.cpp" line="1518"/>
<source>Color model</source>
<translation>色彩模式</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1511"/>
<location filename="mainwindow.cpp" line="1518"/>
<source>DPI</source>
<translation>每英寸像素点</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1511"/>
<location filename="mainwindow.cpp" line="1518"/>
<source>Print size</source>
<translation>打印尺寸</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1511"/>
<location filename="mainwindow.cpp" line="1518"/>
<source>Frame</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1519"/>
<location filename="mainwindow.cpp" line="1526"/>
<source>None</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1519"/>
<location filename="mainwindow.cpp" line="1526"/>
<source>Mono</source>
<translation>黑白</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1519"/>
<location filename="mainwindow.cpp" line="1526"/>
<source>Gray</source>
<translation>灰度</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1519"/>
<location filename="mainwindow.cpp" line="1526"/>
<source>Color</source>
<translation>彩色</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1540"/>
<location filename="mainwindow.cpp" line="1547"/>
<source>Warning</source>
<translation>警告</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1540"/>
<location filename="mainwindow.cpp" line="1547"/>
<source>Device is Running!
Please finish scanning first.</source>
<translation>设备正在运行!
请先结束扫描。</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1549"/>
<location filename="mainwindow.cpp" line="1556"/>
<source>Application is about to close.Make sure all needed files are saved.
Continue to close?</source>
<translation>应用程序即将关闭。请确认所有需要的文件已被保存。
是否继续关闭?</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1840"/>
<location filename="mainwindow.cpp" line="1849"/>
<source>Sure to sign out administrator account?</source>
<translation>是否确定登出管理员账户?</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="389"/>
<location filename="mainwindow.cpp" line="1254"/>
<location filename="mainwindow.cpp" line="1289"/>
<location filename="mainwindow.cpp" line="1551"/>
<location filename="mainwindow.cpp" line="1841"/>
<location filename="mainwindow.cpp" line="2055"/>
<location filename="mainwindow.cpp" line="2056"/>
<location filename="mainwindow.cpp" line="2114"/>
<location filename="mainwindow.cpp" line="2115"/>
<source>start failed</source>
<translation>启动失败</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="390"/>
<location filename="mainwindow.cpp" line="1261"/>
<location filename="mainwindow.cpp" line="1296"/>
<location filename="mainwindow.cpp" line="1558"/>
<location filename="mainwindow.cpp" line="1850"/>
<source>yes</source>
<translation>确定</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="390"/>
<location filename="mainwindow.cpp" line="1255"/>
<location filename="mainwindow.cpp" line="1290"/>
<location filename="mainwindow.cpp" line="1552"/>
<location filename="mainwindow.cpp" line="1842"/>
<location filename="mainwindow.cpp" line="391"/>
<location filename="mainwindow.cpp" line="1262"/>
<location filename="mainwindow.cpp" line="1297"/>
<location filename="mainwindow.cpp" line="1559"/>
<location filename="mainwindow.cpp" line="1851"/>
<source>no</source>
<translation>取消</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1899"/>
<location filename="mainwindow.cpp" line="1901"/>
<location filename="mainwindow.cpp" line="1908"/>
<location filename="mainwindow.cpp" line="1910"/>
<source>hint</source>
<translation>提示</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1899"/>
<location filename="mainwindow.cpp" line="1908"/>
<source>Roller scanned count has been set to 0.</source>
<translation>辊轴计数已置零</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1901"/>
<location filename="mainwindow.cpp" line="1910"/>
<source>Roller scanned count reset failed.</source>
<translation>重置辊轴计数失败</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1915"/>
<location filename="mainwindow.cpp" line="1924"/>
<source>Error</source>
<translation>错误</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1915"/>
<location filename="mainwindow.cpp" line="1924"/>
<source>Document missing! It would be deleted or renamed.</source>
<translation>文档丢失!文档可能已被删除或被重命名。</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1934"/>
<location filename="mainwindow.cpp" line="1943"/>
<source>HuaGoScan Application</source>
<translation>华高扫描应用程序</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1935"/>
<location filename="mainwindow.cpp" line="1944"/>
<source>2018-2022 HuaGoScan</source>
<translation>2018-2021 HUAGOSCAN</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1936"/>
<location filename="mainwindow.cpp" line="1945"/>
<source>Manufacturer/Developer: Ningbo Huagao Info&amp;Tech co.,ltd.</source>
<translation>制造商/开发商: 宁波华高信息科技有限公司</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1937"/>
<location filename="mainwindow.cpp" line="1946"/>
<source>&lt;br&gt;Company website: &lt;a href=&apos;http://www.huagaochina.com/&apos;&gt;www.huagaochina.com&lt;/a&gt;</source>
<translation>&lt;br&gt;公司网址: &lt;a href=&apos;http://www.huagaochina.com/&apos;&gt;www.huagaochina.com&lt;/a&gt;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1938"/>
<location filename="mainwindow.cpp" line="1947"/>
<source>&lt;br&gt;Contact: +86 0574 27974866</source>
<translation>&lt;br&gt;联系电话: +86 0574 27974866</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1940"/>
<location filename="mainwindow.cpp" line="1949"/>
<source>&lt;br&gt;Company address: No.655,Xueshi Road,Yinzhou district,Ningbo,Zhejiang,China(PRC)</source>
<translation>&lt;br&gt;地址: 浙江省宁波市鄞州区学士路655 C211</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1941"/>
<location filename="mainwindow.cpp" line="1950"/>
<source>Navigation: &lt;a href=&apos;https://j.map.baidu.com/7e/1TO&apos;&gt;Visit in Baidu map.&lt;/a&gt;</source>
<translation>&lt;br&gt;导航地址: &lt;a href=&apos;https://j.map.baidu.com/7e/1TO&apos;&gt;百度地图访问&lt;/a&gt;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1944"/>
<location filename="mainwindow.cpp" line="1963"/>
<location filename="mainwindow.cpp" line="1953"/>
<location filename="mainwindow.cpp" line="1972"/>
<source>About %1</source>
<translation>关于 %1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1945"/>
<location filename="mainwindow.cpp" line="1964"/>
<location filename="mainwindow.cpp" line="1954"/>
<location filename="mainwindow.cpp" line="1973"/>
<source>&lt;p&gt;%1&lt;/p&gt;&lt;p&gt;Version: %2&lt;br&gt;CopyRight: &amp;#169; %3&lt;/p&gt;&lt;p&gt;%4%5%6%7%8%9&lt;/p&gt;</source>
<translation>&lt;p&gt;%1&lt;/p&gt;&lt;p&gt;版本: %2&lt;br&gt;版权: &amp;#169; %3&lt;/p&gt;&lt;p&gt;%4%5%6%7%8%9&lt;/p&gt;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1978"/>
<location filename="mainwindow.cpp" line="1987"/>
<source>about %1</source>
<translation>关于 %1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1979"/>
<location filename="mainwindow.cpp" line="1988"/>
<source>&lt;p&gt;Version: %1&lt;/p&gt;</source>
<oldsource>&lt;p&gt;版本: %1&lt;/p&gt;</oldsource>
<translation>&lt;p&gt;版本: %1&lt;/p&gt;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1980"/>
<location filename="mainwindow.cpp" line="1989"/>
<source>&lt;p&gt;CopyRight: &amp;#169; %1&lt;/p&gt;</source>
<oldsource>&lt;p&gt;版权: &amp;#169; %1&lt;/p&gt;</oldsource>
<translation>&lt;p&gt;版权: &amp;#169; %1&lt;/p&gt;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1984"/>
<location filename="mainwindow.cpp" line="1993"/>
<source>&lt;p&gt;%1: &lt;a href=&apos;%2&apos;&gt;%3&lt;/a&gt;&lt;/p&gt;</source>
<translation>&lt;p&gt;%1: &lt;a href=&apos;%2&apos;&gt;%3&lt;/a&gt;&lt;/p&gt;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1986"/>
<location filename="mainwindow.cpp" line="1995"/>
<source>&lt;p&gt;%1: %2&lt;/p&gt;</source>
<translation>&lt;p&gt;%1: %2&lt;/p&gt;</translation>
</message>
......
......@@ -213,6 +213,7 @@ MainWindow::MainWindow(QWidget *parent)
connect(this, SIGNAL(new_image(void *)), this, SLOT(on_new_image(void *)), Qt::QueuedConnection);
connect(this, SIGNAL(scan_working()), this, SLOT(on_scan_working()), Qt::QueuedConnection);
connect(this, SIGNAL(scan_finish()), this, SLOT(on_scan_finish()), Qt::QueuedConnection);
connect(this, SIGNAL(sane_dev_error(QString)), this, SLOT(on_sane_dev_error(QString)), Qt::QueuedConnection);
connect(m_dialog_log, SIGNAL(continuScan(void)), this, SLOT(on_act_acquire_triggered(void)), Qt::QueuedConnection);
connect(m_dialog_log, SIGNAL(invoke_stop(void)), this, SLOT(on_act_acquireStop_triggered(void)), Qt::QueuedConnection);
......@@ -716,6 +717,12 @@ void MainWindow::on_sane_dev_remove(QString devName)
}
}
void MainWindow::on_sane_dev_error(QString errorInfo)
{
m_wndStatusBar->setDeviceStatusInfo(errorInfo);
m_dialog_log->add_log(errorInfo, true);
}
bool MainWindow::eventFilter(QObject *obj, QEvent *event)
{
if(obj == m_view)
......@@ -1627,6 +1634,8 @@ int MainWindow::sane_ex_callback(SANE_Handle hdev, int code, void *data, unsigne
break;
case SANE_EVENT_ERROR:
{
QString errorInfo((char*)data);
emit p->sane_dev_error(errorInfo);
}
break;
case SANE_EVENT_WORKING:
......@@ -2039,7 +2048,14 @@ void MainWindow::on_act_acquire_triggered()
}
#else
if (nullptr != m_saneDeviceHandle)
sane_start(m_saneDeviceHandle);
{
SANE_Status ret = sane_start(m_saneDeviceHandle);
if(ret != SANE_STATUS_GOOD)
{
m_wndStatusBar->setDeviceStatusInfo(tr("start failed"));
m_dialog_log->add_log(tr("start failed"), true);
}
}
#endif
}
......@@ -2091,7 +2107,14 @@ void MainWindow::on_act_acquireInto_triggered()
}
#else
if (nullptr != m_saneDeviceHandle)
sane_start(m_saneDeviceHandle);
{
SANE_Status ret = sane_start(m_saneDeviceHandle);
if(ret != SANE_STATUS_GOOD)
{
m_wndStatusBar->setDeviceStatusInfo(tr("start failed"));
m_dialog_log->add_log(tr("start failed"), true);
}
}
#endif
}
}
......
......@@ -82,6 +82,7 @@ signals:
#if !defined(HG_CMP_MSC) || !defined(APP_USE_TWAIN)
void sane_dev_arrive(QString devName);
void sane_dev_remove(QString devName);
void sane_dev_error(QString errorInfo);
#endif
void new_image(void *img);
void scan_working();
......@@ -105,6 +106,7 @@ private slots:
void on_devMenu_action_triggered();
void on_sane_dev_arrive(QString devName);
void on_sane_dev_remove(QString devName);
void on_sane_dev_error(QString errorInfo);
virtual bool eventFilter(QObject* obj, QEvent* event) override;
#endif
void on_new_image(void *img);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment