From b63d5d9ff5d0fee34dc32230c755b15347a22fdd Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Mon, 2 Sep 2024 15:50:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E9=94=AE=E6=89=AB=E6=8F=8F=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E9=A6=96=E6=AC=A1=E6=89=93=E5=BC=80=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=BB=B6=E6=97=B6=E6=94=B9=E4=B8=BA15=E7=A7=92=EF=BC=8C?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=BF=9B=E7=A8=8B=E5=8D=A0=E7=94=A8=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=9BBUG-1251?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scantool/mainwindow.cpp | 14 +++++++++++++- app/scantool/mainwindow.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) 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;