File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed
Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -55,10 +55,13 @@ CBackend::OnInitReturnValue CBackendFtpServer::OnInit()
5555 }
5656 }
5757 if (bListen) {
58- qInfo (log) << " The ftp server listen in" << m_Para->GetPort ();
58+ QString szMsg = tr (" Ftp server listen in %1" ).arg (m_Para->GetPort ());
59+ qInfo (log) << szMsg;
60+ emit sigInformation (szMsg);
5961 } else {
60- QString szErr = tr (" The ftp server is not listening in %1" ).arg (m_Para->GetPort ());
62+ QString szErr = tr (" Ftp server is not listening in %1" ).arg (m_Para->GetPort ());
6163 emit sigError (-1 , szErr);
64+ return OnInitReturnValue::Fail;
6265 }
6366 return OnInitReturnValue::NotUseOnProcess;
6467}
Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ QSharedPointer<CParameterFtpServer> COperateFtpServer::GetParameter()
141141void COperateFtpServer::slotStart (bool checked)
142142{
143143 qDebug (log) << Q_FUNC_INFO << m_pStart->isChecked ();
144+ bool check = false ;
144145 if (!checked) {
145146 m_pStart->setText (tr (" Start server" ));
146147 m_pStart->setToolTip (m_pStart->text ());
@@ -163,6 +164,10 @@ void COperateFtpServer::slotStart(bool checked)
163164 qCritical (log) << " new CBackendThread fail" ;
164165 return ;
165166 }
166-
167+ check = connect (this , &COperateFtpServer::sigError,
168+ this , [this ](const int nError, const QString &szError){
169+ m_pStart->setChecked (false );
170+ });
171+ Q_ASSERT (check);
167172 m_pThread->start ();
168173}
Original file line number Diff line number Diff line change 1414class PLUGIN_EXPORT CBackendThread : public QThread
1515{
1616 Q_OBJECT
17+
1718public:
1819 explicit CBackendThread (COperate *pOperate = nullptr , bool bSignal = true );
1920 virtual ~CBackendThread () override ;
@@ -22,6 +23,7 @@ class PLUGIN_EXPORT CBackendThread : public QThread
2223 * \note Use this replace QThread::quit, QThread::exit, QThread::terminate
2324 */
2425 virtual void quit ();
26+
2527protected:
2628 virtual void run () override ;
2729 COperate* m_pOperate;
You can’t perform that action at this time.
0 commit comments