Compare commits

...

3 Commits

6 changed files with 96 additions and 60 deletions

View File

@ -782,6 +782,7 @@ void MainWindow::on_AcquireInto2()
if (HGSANE_ERR_DEVICEOFFLINE == ret)
{
deviceIsOnline = false;
QMessageBox::information(this, tr("Prompt"), tr("Device is offline"));
}
#endif
@ -1536,6 +1537,7 @@ void MainWindow::on_scanFinishEvent()
if (HGSANE_ERR_DEVICEOFFLINE == ret)
{
deviceIsOnline = false;
QMessageBox::information(this, tr("Prompt"), tr("Device is offline"));
}
#endif
@ -3740,6 +3742,7 @@ void MainWindow::on_act_acquire_triggered()
if (HGSANE_ERR_DEVICEOFFLINE == ret)
{
deviceIsOnline = false;
QMessageBox::information(this, tr("Prompt"), tr("Device is offline"));
}
#endif
@ -3872,6 +3875,7 @@ void MainWindow::on_act_acquireInto_triggered()
if (HGSANE_ERR_DEVICEOFFLINE == ret)
{
deviceIsOnline = false;
QMessageBox::information(this, tr("Prompt"), tr("Device is offline"));
}
#endif
@ -3960,6 +3964,7 @@ void MainWindow::on_act_insertFromScanner_triggered()
if (HGSANE_ERR_DEVICEOFFLINE == ret)
{
deviceIsOnline = false;
QMessageBox::information(this, tr("Prompt"), tr("Device is offline"));
}
#endif

Binary file not shown.

View File

@ -162,33 +162,41 @@
<context>
<name>Form_DeviceConfig</name>
<message>
<location filename="form_deviceconfig.cpp" line="259"/>
<location filename="form_deviceconfig.cpp" line="269"/>
<source>Default</source>
<translation></translation>
</message>
<message>
<location filename="form_deviceconfig.cpp" line="432"/>
<location filename="form_deviceconfig.cpp" line="442"/>
<source>Custom gamma</source>
<translation>线</translation>
</message>
<message>
<location filename="form_deviceconfig.cpp" line="817"/>
<location filename="form_deviceconfig.cpp" line="827"/>
<location filename="form_deviceconfig.cpp" line="893"/>
<location filename="form_deviceconfig.cpp" line="1390"/>
<source>Prompt</source>
<translation></translation>
</message>
<message>
<location filename="form_deviceconfig.cpp" line="873"/>
<location filename="form_deviceconfig.cpp" line="903"/>
<location filename="form_deviceconfig.cpp" line="933"/>
<location filename="form_deviceconfig.cpp" line="971"/>
<location filename="form_deviceconfig.cpp" line="1009"/>
<location filename="form_deviceconfig.cpp" line="1053"/>
<location filename="form_deviceconfig.cpp" line="1083"/>
<location filename="form_deviceconfig.cpp" line="1121"/>
<location filename="form_deviceconfig.cpp" line="1365"/>
<location filename="form_deviceconfig.cpp" line="883"/>
<location filename="form_deviceconfig.cpp" line="920"/>
<location filename="form_deviceconfig.cpp" line="950"/>
<location filename="form_deviceconfig.cpp" line="988"/>
<location filename="form_deviceconfig.cpp" line="1026"/>
<location filename="form_deviceconfig.cpp" line="1070"/>
<location filename="form_deviceconfig.cpp" line="1100"/>
<location filename="form_deviceconfig.cpp" line="1138"/>
<location filename="form_deviceconfig.cpp" line="1382"/>
<source>The funtion is unsupported</source>
<translation></translation>
</message>
<message>
<location filename="form_deviceconfig.cpp" line="893"/>
<location filename="form_deviceconfig.cpp" line="1390"/>
<source>This function may cause a decrease in the speed of drawing.</source>
<translation>.</translation>
</message>
</context>
<context>
<name>Form_SaveParam</name>
@ -381,23 +389,24 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="form_saveparam.cpp" line="35"/>
<location filename="form_saveparam.cpp" line="270"/>
<location filename="form_saveparam.cpp" line="297"/>
<location filename="form_saveparam.cpp" line="304"/>
<location filename="form_saveparam.cpp" line="34"/>
<location filename="form_saveparam.cpp" line="257"/>
<location filename="form_saveparam.cpp" line="284"/>
<location filename="form_saveparam.cpp" line="291"/>
<source>e.g. &apos;%1%2&apos;</source>
<translation>.%1%2</translation>
</message>
<message>
<location filename="form_saveparam.cpp" line="216"/>
<source>Browse directory</source>
<translation type="vanished"></translation>
<translation></translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<location filename="mainwindow.ui" line="14"/>
<location filename="mainwindow.cpp" line="46"/>
<location filename="mainwindow.cpp" line="48"/>
<source>Scan Tool</source>
<translation></translation>
</message>
@ -427,106 +436,107 @@
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="51"/>
<location filename="mainwindow.cpp" line="53"/>
<source>Show</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="53"/>
<location filename="mainwindow.cpp" line="55"/>
<source>Exit</source>
<translation>退</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="70"/>
<location filename="mainwindow.cpp" line="72"/>
<source>Device Type</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="71"/>
<location filename="mainwindow.cpp" line="73"/>
<source>Button Id</source>
<translation>ID</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="72"/>
<location filename="mainwindow.cpp" line="74"/>
<source>Device Config</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="73"/>
<location filename="mainwindow.cpp" line="75"/>
<source>Save Param</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="90"/>
<location filename="mainwindow.cpp" line="1053"/>
<location filename="mainwindow.cpp" line="1491"/>
<location filename="mainwindow.cpp" line="92"/>
<location filename="mainwindow.cpp" line="1055"/>
<location filename="mainwindow.cpp" line="1505"/>
<source>Manual</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="90"/>
<location filename="mainwindow.cpp" line="1053"/>
<location filename="mainwindow.cpp" line="1491"/>
<location filename="mainwindow.cpp" line="92"/>
<location filename="mainwindow.cpp" line="1055"/>
<location filename="mainwindow.cpp" line="1505"/>
<source>Button 1</source>
<translation> 1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="90"/>
<location filename="mainwindow.cpp" line="1053"/>
<location filename="mainwindow.cpp" line="1491"/>
<location filename="mainwindow.cpp" line="92"/>
<location filename="mainwindow.cpp" line="1055"/>
<location filename="mainwindow.cpp" line="1505"/>
<source>Button 2</source>
<translation> 2</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="90"/>
<location filename="mainwindow.cpp" line="1053"/>
<location filename="mainwindow.cpp" line="1491"/>
<location filename="mainwindow.cpp" line="92"/>
<location filename="mainwindow.cpp" line="1055"/>
<location filename="mainwindow.cpp" line="1505"/>
<source>Button 3</source>
<translation> 3</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="90"/>
<location filename="mainwindow.cpp" line="1053"/>
<location filename="mainwindow.cpp" line="1491"/>
<location filename="mainwindow.cpp" line="92"/>
<location filename="mainwindow.cpp" line="1055"/>
<location filename="mainwindow.cpp" line="1505"/>
<source>Button 4</source>
<translation> 4</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="90"/>
<location filename="mainwindow.cpp" line="1053"/>
<location filename="mainwindow.cpp" line="1491"/>
<location filename="mainwindow.cpp" line="92"/>
<location filename="mainwindow.cpp" line="1055"/>
<location filename="mainwindow.cpp" line="1505"/>
<source>Button 5</source>
<translation> 5</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="612"/>
<location filename="mainwindow.cpp" line="1023"/>
<location filename="mainwindow.cpp" line="1456"/>
<location filename="mainwindow.cpp" line="1462"/>
<location filename="mainwindow.cpp" line="1476"/>
<location filename="mainwindow.cpp" line="1508"/>
<location filename="mainwindow.cpp" line="614"/>
<location filename="mainwindow.cpp" line="1025"/>
<location filename="mainwindow.cpp" line="1465"/>
<location filename="mainwindow.cpp" line="1471"/>
<location filename="mainwindow.cpp" line="1484"/>
<location filename="mainwindow.cpp" line="1490"/>
<location filename="mainwindow.cpp" line="1522"/>
<source>Tips</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="612"/>
<location filename="mainwindow.cpp" line="1023"/>
<location filename="mainwindow.cpp" line="1462"/>
<location filename="mainwindow.cpp" line="614"/>
<location filename="mainwindow.cpp" line="1025"/>
<location filename="mainwindow.cpp" line="1471"/>
<source>Device is offline</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="927"/>
<location filename="mainwindow.cpp" line="929"/>
<source>binary</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="929"/>
<location filename="mainwindow.cpp" line="931"/>
<source>gray</source>
<translation>256</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="931"/>
<location filename="mainwindow.cpp" line="933"/>
<source>rgb</source>
<translation>24</translation>
</message>
@ -535,13 +545,13 @@
<translation type="vanished"> %1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1456"/>
<location filename="mainwindow.cpp" line="1508"/>
<location filename="mainwindow.cpp" line="1465"/>
<location filename="mainwindow.cpp" line="1522"/>
<source>No item selected</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1476"/>
<location filename="mainwindow.cpp" line="1490"/>
<source>Device type mismatch</source>
<translation></translation>
</message>
@ -550,12 +560,12 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1512"/>
<location filename="mainwindow.cpp" line="1526"/>
<source>Question</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1513"/>
<location filename="mainwindow.cpp" line="1527"/>
<source>Are you sure you want to remove the item?</source>
<translation></translation>
</message>

View File

@ -886,6 +886,13 @@ void Form_DeviceConfig::on_string_list_comboBoxClicked()
return;
}
bool ok = false;
if ((deviceConfigEx->name == SANE_STD_OPT_NAME_TEXT_DIRECTION) &&
0 == strcmp(to_default_language(comboBox->currentText().toStdString().c_str(), &ok), OPTION_VALUE_WGFX_ZDWBFXSB))
{
QMessageBox::information(this, tr("Prompt"), tr("This function may cause a decrease in the speed of drawing."));
}
deviceConfigEx->stringValue = currentText;
if ((method & SANE_INFO_RELOAD_OPTIONS) == SANE_INFO_RELOAD_OPTIONS)
{
@ -1378,6 +1385,11 @@ void Form_DeviceConfig::on_checkedClicked()
return;
}
if (currentState && (deviceConfigEx->name == SANE_STD_OPT_NAME_RID_MORR))
{
QMessageBox::information(this, tr("Prompt"), tr("This function may cause a decrease in the speed of drawing."));
}
deviceConfigEx->boolValue = currentState;
if ((method & SANE_INFO_RELOAD_OPTIONS) == SANE_INFO_RELOAD_OPTIONS)
{

View File

@ -25,6 +25,7 @@ MainWindow::MainWindow(QWidget *parent)
, m_dlgScanInfo(nullptr)
, m_devHandle(nullptr)
, m_scanning(false)
, m_isFirstConnectServer(true)
, m_dpi(200)
, m_scanFileName("")
, m_scanImgFmtWriter(nullptr)
@ -1441,7 +1442,14 @@ void MainWindow::on_saneEventCloseDevice(void* devHandle, bool isOnline)
}
if (isOnline)
m_timerId = this->startTimer(5000);
{
int time = 5000;
if (m_isFirstConnectServer)
time = 15000;
m_timerId = this->startTimer(time);
m_isFirstConnectServer = false;
}
}
void MainWindow:: on_pushButtonAdd_clicked()

View File

@ -93,6 +93,7 @@ private:
QString m_devName;
SANE_Handle m_devHandle;
bool m_scanning;
bool m_isFirstConnectServer;
HGUInt m_dpi;
QString m_scanFileName;