设备断开点击设置增加提示

This commit is contained in:
yangjiaxuan 2023-06-29 16:10:09 +08:00
parent 7cacce1d66
commit 19325f5530
8 changed files with 149 additions and 87 deletions

Binary file not shown.

View File

@ -636,17 +636,17 @@ Page range will be &apos;Chosen Pages&apos;.</source>
<translation></translation>
</message>
<message>
<location filename="dialog_exportimagefile.cpp" line="378"/>
<location filename="dialog_exportimagefile.cpp" line="355"/>
<source>export failed: </source>
<translation> </translation>
</message>
<message>
<location filename="dialog_exportimagefile.cpp" line="379"/>
<location filename="dialog_exportimagefile.cpp" line="356"/>
<source>tip</source>
<translation></translation>
</message>
<message>
<location filename="dialog_exportimagefile.cpp" line="378"/>
<location filename="dialog_exportimagefile.cpp" line="355"/>
<source>export succeed</source>
<translation></translation>
</message>
@ -2522,13 +2522,14 @@ Do you want to clear?</source>
<message>
<location filename="mainwindow.cpp" line="334"/>
<location filename="mainwindow.cpp" line="2870"/>
<location filename="mainwindow.cpp" line="3887"/>
<location filename="mainwindow.cpp" line="3671"/>
<location filename="mainwindow.cpp" line="3914"/>
<source>Please go to &apos;Menu Bar -&gt;Scan&apos; to select a device</source>
<translation>-&gt;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="667"/>
<location filename="mainwindow.cpp" line="3615"/>
<location filename="mainwindow.cpp" line="3627"/>
<source>default scheme</source>
<translation></translation>
</message>
@ -2679,10 +2680,22 @@ Please finish scanning first.</source>
<translation>
</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2902"/>
<source>Device is offline</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2907"/>
<source>Open failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1241"/>
<location filename="mainwindow.cpp" line="2870"/>
<location filename="mainwindow.cpp" line="3659"/>
<location filename="mainwindow.cpp" line="2902"/>
<location filename="mainwindow.cpp" line="2907"/>
<location filename="mainwindow.cpp" line="3686"/>
<source>Prompt</source>
<translation></translation>
</message>
@ -2744,7 +2757,7 @@ Please finish scanning first.</source>
</message>
<message>
<location filename="mainwindow.cpp" line="389"/>
<location filename="mainwindow.cpp" line="3895"/>
<location filename="mainwindow.cpp" line="3922"/>
<source>Device %1 is open</source>
<translation> %1 </translation>
</message>
@ -2753,76 +2766,76 @@ Please finish scanning first.</source>
<translation type="obsolete"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3389"/>
<location filename="mainwindow.cpp" line="3401"/>
<source>cache path folder limit:%1</source>
<translation>访%1
</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3393"/>
<location filename="mainwindow.cpp" line="3405"/>
<source>aquireinto folder limit:%1</source>
<translation>访%1
</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3477"/>
<location filename="mainwindow.cpp" line="3489"/>
<source>Image processing failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3481"/>
<location filename="mainwindow.cpp" line="3493"/>
<source>Ocr init failed</source>
<translation>OCR初始化错误</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3485"/>
<location filename="mainwindow.cpp" line="3497"/>
<source>Ocr failed</source>
<translation>OCR错误</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3489"/>
<location filename="mainwindow.cpp" line="3501"/>
<source>File does not exist</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3493"/>
<location filename="mainwindow.cpp" line="3505"/>
<source>Failed to load dynamic library</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3497"/>
<location filename="mainwindow.cpp" line="3509"/>
<source>File data error</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3501"/>
<location filename="mainwindow.cpp" line="3513"/>
<source>Image format processing error</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3505"/>
<location filename="mainwindow.cpp" line="3517"/>
<source>Out of memory</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3509"/>
<location filename="mainwindow.cpp" line="3521"/>
<source>Failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3659"/>
<location filename="mainwindow.cpp" line="3686"/>
<source>The Device has reached roller life</source>
<translation>使
</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3805"/>
<location filename="mainwindow.cpp" line="3824"/>
<location filename="mainwindow.cpp" line="3832"/>
<location filename="mainwindow.cpp" line="3851"/>
<source>The language switch is successful and takes effect the next time the software is started!</source>
<translation>!</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3862"/>
<location filename="mainwindow.cpp" line="3889"/>
<source>Are you sure to delete selected file?</source>
<translation></translation>
</message>
@ -2840,7 +2853,7 @@ Please finish scanning first.</source>
</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3473"/>
<location filename="mainwindow.cpp" line="3485"/>
<source>Insufficient access rights</source>
<translation>访</translation>
</message>
@ -2865,18 +2878,18 @@ Please finish scanning first.</source>
<translation type="vanished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3747"/>
<location filename="mainwindow.cpp" line="3774"/>
<source>tip</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3747"/>
<location filename="mainwindow.cpp" line="3774"/>
<source>Other versions not available</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3767"/>
<location filename="mainwindow.cpp" line="3783"/>
<location filename="mainwindow.cpp" line="3794"/>
<location filename="mainwindow.cpp" line="3810"/>
<source>The device does not support this operation</source>
<translation></translation>
</message>
@ -2885,8 +2898,8 @@ Please finish scanning first.</source>
<translation type="vanished">IO错误</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3358"/>
<location filename="mainwindow.cpp" line="3396"/>
<location filename="mainwindow.cpp" line="3370"/>
<location filename="mainwindow.cpp" line="3408"/>
<source>error</source>
<translation></translation>
</message>
@ -3145,12 +3158,12 @@ Continue to close?</source>
<translation type="vanished">: %1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3173"/>
<location filename="mainwindow.cpp" line="3185"/>
<source>Detected that there is less than 1GB of disk space. Do you want to continue?</source>
<translation>1GB?</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3359"/>
<location filename="mainwindow.cpp" line="3371"/>
<source>start failed!</source>
<translation></translation>
</message>
@ -3177,12 +3190,12 @@ Are you sure to close?</source>
<location filename="mainwindow.cpp" line="2432"/>
<location filename="mainwindow.cpp" line="2781"/>
<location filename="mainwindow.cpp" line="2785"/>
<location filename="mainwindow.cpp" line="3173"/>
<location filename="mainwindow.cpp" line="3767"/>
<location filename="mainwindow.cpp" line="3783"/>
<location filename="mainwindow.cpp" line="3804"/>
<location filename="mainwindow.cpp" line="3823"/>
<location filename="mainwindow.cpp" line="3862"/>
<location filename="mainwindow.cpp" line="3185"/>
<location filename="mainwindow.cpp" line="3794"/>
<location filename="mainwindow.cpp" line="3810"/>
<location filename="mainwindow.cpp" line="3831"/>
<location filename="mainwindow.cpp" line="3850"/>
<location filename="mainwindow.cpp" line="3889"/>
<source>tips</source>
<translation></translation>
</message>
@ -3304,7 +3317,7 @@ Are you sure to close?</source>
<name>Widget</name>
<message>
<source>zuobiaozhou</source>
<translation type="vanished"></translation>
<translation></translation>
</message>
</context>
<context>

Binary file not shown.

View File

@ -642,17 +642,17 @@ The page range will be “selected pages”</translation>
<translation>Stop exporting</translation>
</message>
<message>
<location filename="dialog_exportimagefile.cpp" line="378"/>
<location filename="dialog_exportimagefile.cpp" line="355"/>
<source>export succeed</source>
<translation>Export completed</translation>
</message>
<message>
<location filename="dialog_exportimagefile.cpp" line="378"/>
<location filename="dialog_exportimagefile.cpp" line="355"/>
<source>export failed: </source>
<translation>Export failed: </translation>
</message>
<message>
<location filename="dialog_exportimagefile.cpp" line="379"/>
<location filename="dialog_exportimagefile.cpp" line="356"/>
<source>tip</source>
<translation>Prompt</translation>
</message>
@ -2452,7 +2452,8 @@ Please reselect a path or clear disk space immediately.</translation>
<message>
<location filename="mainwindow.cpp" line="334"/>
<location filename="mainwindow.cpp" line="2870"/>
<location filename="mainwindow.cpp" line="3887"/>
<location filename="mainwindow.cpp" line="3671"/>
<location filename="mainwindow.cpp" line="3914"/>
<source>Please go to &apos;Menu Bar -&gt;Scan&apos; to select a device</source>
<translation>Please go to &apos;Menu Bar -&gt;Scan&apos; to select a device</translation>
</message>
@ -2477,7 +2478,7 @@ Please reselect a path or clear disk space immediately.</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="667"/>
<location filename="mainwindow.cpp" line="3615"/>
<location filename="mainwindow.cpp" line="3627"/>
<source>default scheme</source>
<translation>Default scheme</translation>
</message>
@ -2549,12 +2550,12 @@ Clear?</translation>
<location filename="mainwindow.cpp" line="2432"/>
<location filename="mainwindow.cpp" line="2781"/>
<location filename="mainwindow.cpp" line="2785"/>
<location filename="mainwindow.cpp" line="3173"/>
<location filename="mainwindow.cpp" line="3767"/>
<location filename="mainwindow.cpp" line="3783"/>
<location filename="mainwindow.cpp" line="3804"/>
<location filename="mainwindow.cpp" line="3823"/>
<location filename="mainwindow.cpp" line="3862"/>
<location filename="mainwindow.cpp" line="3185"/>
<location filename="mainwindow.cpp" line="3794"/>
<location filename="mainwindow.cpp" line="3810"/>
<location filename="mainwindow.cpp" line="3831"/>
<location filename="mainwindow.cpp" line="3850"/>
<location filename="mainwindow.cpp" line="3889"/>
<source>tips</source>
<translation>prompt</translation>
</message>
@ -2700,7 +2701,17 @@ Are you sure to close?</source>
<translation>Are you sure you want to log out of the administrator account?</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3659"/>
<location filename="mainwindow.cpp" line="2902"/>
<source>Device is offline</source>
<translation>Device is offline</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2907"/>
<source>Open failed</source>
<translation>Open failed</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3686"/>
<source>The Device has reached roller life</source>
<translation>The paper roller has reached its service life, and the frequency of abnormalities during the scanning process may increase.
Please contact the equipment supplier promptly to purchase a replacement paper roller!</translation>
@ -2708,7 +2719,9 @@ Please contact the equipment supplier promptly to purchase a replacement paper r
<message>
<location filename="mainwindow.cpp" line="1241"/>
<location filename="mainwindow.cpp" line="2870"/>
<location filename="mainwindow.cpp" line="3659"/>
<location filename="mainwindow.cpp" line="2902"/>
<location filename="mainwindow.cpp" line="2907"/>
<location filename="mainwindow.cpp" line="3686"/>
<source>Prompt</source>
<translation>Prompt</translation>
</message>
@ -2803,13 +2816,13 @@ Please contact the equipment supplier promptly to purchase a replacement paper r
<translation type="vanished">Total count: %1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3173"/>
<location filename="mainwindow.cpp" line="3185"/>
<source>Detected that there is less than 1GB of disk space. Do you want to continue?</source>
<translation>Detected that there is less than 1GB of disk space. Do you want to continue?</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="389"/>
<location filename="mainwindow.cpp" line="3895"/>
<location filename="mainwindow.cpp" line="3922"/>
<source>Device %1 is open</source>
<translation>Device %1 is open</translation>
</message>
@ -2860,13 +2873,13 @@ Please contact the equipment supplier promptly to purchase a replacement paper r
<translation type="vanished">About</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3389"/>
<location filename="mainwindow.cpp" line="3401"/>
<source>cache path folder limit:%1</source>
<translation>Unable to access the current path:%1
Please try to log in to the administrator account in the [User] menu and go to the [Cache settings] to change the cache path.</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3393"/>
<location filename="mainwindow.cpp" line="3405"/>
<source>aquireinto folder limit:%1</source>
<translation>Unable to access the current path:%1
Please try to change the cache path in [Scan to].</translation>
@ -2925,13 +2938,13 @@ Please try to change the cache path in [Scan to].</translation>
<translation type="vanished">failed</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3358"/>
<location filename="mainwindow.cpp" line="3396"/>
<location filename="mainwindow.cpp" line="3370"/>
<location filename="mainwindow.cpp" line="3408"/>
<source>error</source>
<translation>Error</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3359"/>
<location filename="mainwindow.cpp" line="3371"/>
<source>start failed!</source>
<translation>Failed to start!</translation>
</message>
@ -2941,52 +2954,52 @@ Please try to change the cache path in [Scan to].</translation>
Please go to Scan to and change the accessible scan folder and then perform the scan.</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3473"/>
<location filename="mainwindow.cpp" line="3485"/>
<source>Insufficient access rights</source>
<translation>Insufficient file access permissions</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3477"/>
<location filename="mainwindow.cpp" line="3489"/>
<source>Image processing failed</source>
<translation>Image processing failed</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3481"/>
<location filename="mainwindow.cpp" line="3493"/>
<source>Ocr init failed</source>
<translation>OCR initialization error</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3485"/>
<location filename="mainwindow.cpp" line="3497"/>
<source>Ocr failed</source>
<translation>OCR failed</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3489"/>
<location filename="mainwindow.cpp" line="3501"/>
<source>File does not exist</source>
<translation>File does not exist</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3493"/>
<location filename="mainwindow.cpp" line="3505"/>
<source>Failed to load dynamic library</source>
<translation>Failed to load dynamic library</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3497"/>
<location filename="mainwindow.cpp" line="3509"/>
<source>File data error</source>
<translation>File data error</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3501"/>
<location filename="mainwindow.cpp" line="3513"/>
<source>Image format processing error</source>
<translation>Image format processing error</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3505"/>
<location filename="mainwindow.cpp" line="3517"/>
<source>Out of memory</source>
<translation>Insufficient memory</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3509"/>
<location filename="mainwindow.cpp" line="3521"/>
<source>Failed</source>
<translation>Failed</translation>
</message>
@ -3007,18 +3020,18 @@ Please go to “Scan to” and change the accessible scan folder and then perfor
<translation type="vanished">Close </translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3747"/>
<location filename="mainwindow.cpp" line="3774"/>
<source>tip</source>
<translation>Prompt</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3747"/>
<location filename="mainwindow.cpp" line="3774"/>
<source>Other versions not available</source>
<translation>No other versions obtained</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3767"/>
<location filename="mainwindow.cpp" line="3783"/>
<location filename="mainwindow.cpp" line="3794"/>
<location filename="mainwindow.cpp" line="3810"/>
<source>The device does not support this operation</source>
<translation>Device does not support this operation</translation>
</message>
@ -3027,13 +3040,13 @@ Please go to “Scan to” and change the accessible scan folder and then perfor
<translation type="vanished">IO error</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3805"/>
<location filename="mainwindow.cpp" line="3824"/>
<location filename="mainwindow.cpp" line="3832"/>
<location filename="mainwindow.cpp" line="3851"/>
<source>The language switch is successful and takes effect the next time the software is started!</source>
<translation>The language switch is successful and takes effect the next time the software is started!</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3862"/>
<location filename="mainwindow.cpp" line="3889"/>
<source>Are you sure to delete selected file?</source>
<translation>Are you sure to delete the selected file completely?</translation>
</message>
@ -3053,7 +3066,7 @@ Please go to “Scan to” and change the accessible scan folder and then perfor
<name>Widget</name>
<message>
<source>zuobiaozhou</source>
<translation type="vanished">Coordinate axis</translation>
<translation>Coordinate axis</translation>
</message>
</context>
<context>

View File

@ -2895,7 +2895,19 @@ void MainWindow::on_act_about_triggered()
void MainWindow::on_act_scannerSettings_triggered()
{
if (nullptr != m_devUser)
m_devUser->ShowSettingDlg();
{
HGResult ret = m_devUser->ShowSettingDlg();
if (HGTWAIN_ERR_DEVICEOFFLINE == ret)
{
QMessageBox::information(this, tr("Prompt"), tr("Device is offline"));
deleteDevUser();
}
else if (ret == HGTWAIN_ERR_FAIL)
{
QMessageBox::information(this, tr("Prompt"), tr("Open failed"));
deleteDevUser();
}
}
}
void MainWindow::on_act_acquire_triggered()
@ -3646,6 +3658,21 @@ void MainWindow::updateSideBar()
m_propertyAnimation2->setDuration(600);
}
void MainWindow::deleteDevUser()
{
if (nullptr != m_devUser)
{
disconnect(m_devUser, SIGNAL(newImage(void*)), this, SLOT(on_newImage(void*)));
disconnect(m_devUser, SIGNAL(scanWorkingEvent()), this, SLOT(on_scanWorkingEvent()));
disconnect(m_devUser, SIGNAL(scanFinishEvent()), this, SLOT(on_scanFinishEvent()));
m_devUser->Logout();
delete m_devUser;
m_devUser = nullptr;
m_wndStatusBar->setDeviceStatusInfo(tr("Please go to 'Menu Bar ->Scan' to select a device"), false);
updateActionStatus();
}
}
#if !defined(HG_CMP_MSC)
void MainWindow::checkRollerLife()
{

View File

@ -244,6 +244,7 @@ private:
void deleteUpgradePkg(const QString& cfgFilePath);
void initAcquireIntoComboBox();
void updateSideBar();
void deleteDevUser();
#if !defined(HG_CMP_MSC)
void checkRollerLife();

View File

@ -7,4 +7,7 @@
/* UI取消操作 */
#define HGTWAIN_ERR_CANCELUI 0x00001002L
/* 设备离线 */
#define HGTWAIN_ERR_DEVICEOFFLINE 0x00001003L
#endif /* __HGTWAINERR_H__ */

View File

@ -619,6 +619,11 @@ HGResult HGTwainDSImpl::EnableUIOnly(HWND parent, HGDSEventFunc eventFunc, HGPoi
USHORT ret = m_dsmImpl->m_pDSMProc(&m_dsmImpl->m_AppId, &m_iden, DG_CONTROL, DAT_USERINTERFACE, MSG_ENABLEDSUIONLY, (TW_MEMREF)&twUI);
if (TWRC_SUCCESS != ret)
{
TW_STATUS status;
m_dsmImpl->m_pDSMProc(&m_dsmImpl->m_AppId, &m_iden, DG_CONTROL, DAT_STATUS, MSG_GET, (TW_MEMREF)&status);
if (status.ConditionCode == TWCC_CHECKDEVICEONLINE)
return HGTWAIN_ERR_DEVICEOFFLINE;
return HGTWAIN_ERR_FAIL;
}