Propagate resolved ip address to the UI layer (both upload dialog and notification)

This commit is contained in:
David Kocik 2022-05-09 12:56:24 +02:00
parent bc167ce90b
commit 89e288dcf8
18 changed files with 84 additions and 28 deletions

View file

@ -93,6 +93,7 @@ struct PrintHostJobQueue::priv
void emit_progress(int progress);
void emit_error(wxString error);
void emit_cancel(size_t id);
void emit_resolve(wxString host);
void start_bg_thread();
void stop_bg_thread();
void bg_thread_main();
@ -131,6 +132,13 @@ void PrintHostJobQueue::priv::emit_cancel(size_t id)
wxQueueEvent(queue_dialog, evt);
}
void PrintHostJobQueue::priv::emit_resolve(wxString host)
{
auto evt = new PrintHostQueueDialog::Event(GUI::EVT_PRINTHOST_RESOLVE, queue_dialog->GetId(), job_id, host);
wxQueueEvent(queue_dialog, evt);
}
void PrintHostJobQueue::priv::start_bg_thread()
{
if (bg_thread.joinable()) { return; }
@ -258,6 +266,9 @@ void PrintHostJobQueue::priv::perform_job(PrintHostJob the_job)
[this](Http::Progress progress, bool &cancel) { this->progress_fn(std::move(progress), cancel); },
[this](wxString error) {
emit_error(std::move(error));
},
[this](wxString host) {
emit_resolve(std::move(host));
}
);