void InitTask::errorMsg(const QString& str, InitStates retryState){ mutex.lock(); QApplication::postEvent(eventReceiver, new mayBeRetryInitEvent(QString(str),this, retryState)); condition.wait(&mutex); mutex.unlock();}
void Pls1Widget::customEvent ( QEvent * event ){ if(event->type() == RETRY_INIT) { mayBeRetryInitEvent* e = (mayBeRetryInitEvent*) event; int ret = QMessageBox::warning(this, appName, e->message, tr("Повторить"), tr("Прервать"), "", 0, 1); if(ret == 0) { e->initTask->initState = e->retryState; e->initTask->setCompleted(false); } else { e->initTask->initState = InitTask::INIT_FINISHED_ERROR; e->initTask->setCompleted(true); } e->initTask->condition.wakeAll(); }