Abort after timeout must have own signal.
--HG-- branch : feature
This commit is contained in:
parent
faff2b6d5d
commit
4adce13a4d
|
@ -74,7 +74,8 @@ DialogLayoutProgress::DialogLayoutProgress(QElapsedTimer timer, qint64 timeout,
|
||||||
|
|
||||||
if (timeout <= 1000)
|
if (timeout <= 1000)
|
||||||
{
|
{
|
||||||
emit Abort();
|
emit Timeout();
|
||||||
|
progressTimer->stop();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
progressTimer->start(1000);
|
progressTimer->start(1000);
|
||||||
|
|
|
@ -50,6 +50,7 @@ public:
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void Abort();
|
void Abort();
|
||||||
|
void Timeout();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void Start();
|
void Start();
|
||||||
|
|
|
@ -231,6 +231,7 @@ bool MainWindowsNoGUI::GenerateLayout(VLayoutGenerator& lGenerator)
|
||||||
progressTimer->start(1000);
|
progressTimer->start(1000);
|
||||||
#endif
|
#endif
|
||||||
connect(progress.data(), &DialogLayoutProgress::Abort, &lGenerator, &VLayoutGenerator::Abort);
|
connect(progress.data(), &DialogLayoutProgress::Abort, &lGenerator, &VLayoutGenerator::Abort);
|
||||||
|
connect(progress.data(), &DialogLayoutProgress::Timeout, &lGenerator, &VLayoutGenerator::Timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
progress->Start();
|
progress->Start();
|
||||||
|
|
|
@ -324,6 +324,14 @@ void VLayoutGenerator::Abort()
|
||||||
QThreadPool::globalInstance()->clear();
|
QThreadPool::globalInstance()->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VLayoutGenerator::Timeout()
|
||||||
|
{
|
||||||
|
stopGeneration.store(true);
|
||||||
|
state = LayoutErrors::Timeout;
|
||||||
|
QThreadPool::globalInstance()->clear();
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
bool VLayoutGenerator::IsStripOptimization() const
|
bool VLayoutGenerator::IsStripOptimization() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -130,6 +130,7 @@ public:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void Abort();
|
void Abort();
|
||||||
|
void Timeout();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VLayoutGenerator)
|
Q_DISABLE_COPY(VLayoutGenerator)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user