diff --git a/app/scantool/mainwindow.cpp b/app/scantool/mainwindow.cpp index 3cf7905f..b0384ea3 100644 --- a/app/scantool/mainwindow.cpp +++ b/app/scantool/mainwindow.cpp @@ -25,6 +25,7 @@ MainWindow::MainWindow(QWidget *parent) , m_dlgScanInfo(nullptr) , m_devHandle(nullptr) , m_scanning(false) + , m_isFirstConnectServer(false) , m_dpi(200) , m_scanFileName("") , m_scanImgFmtWriter(nullptr) @@ -1262,6 +1263,10 @@ void MainWindow::timerEvent(QTimerEvent *e) this->killTimer(m_timerId); m_timerId = -1; } + else + { + m_timerId = this->startTimer(5000); + } } } @@ -1441,7 +1446,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() diff --git a/app/scantool/mainwindow.h b/app/scantool/mainwindow.h index 1d33c4a0..773f10f5 100644 --- a/app/scantool/mainwindow.h +++ b/app/scantool/mainwindow.h @@ -93,6 +93,7 @@ private: QString m_devName; SANE_Handle m_devHandle; bool m_scanning; + bool m_isFirstConnectServer; HGUInt m_dpi; QString m_scanFileName;