X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fhints_dialog.cc;h=cb0de450a73ad7d141941536c003f4f057cfddf7;hb=88cad1112178c84086cc9dcfc24af8c27c426620;hp=18e8a6f9eb1cea6e3e7ddc87d5ad52532ada9c99;hpb=d43434e463f5ef76ee448046ffb09ffe4b05ea8d;p=dcpomatic.git diff --git a/src/wx/hints_dialog.cc b/src/wx/hints_dialog.cc index 18e8a6f9e..cb0de450a 100644 --- a/src/wx/hints_dialog.cc +++ b/src/wx/hints_dialog.cc @@ -40,7 +40,7 @@ using boost::dynamic_pointer_cast; HintsDialog::HintsDialog (wxWindow* parent, boost::weak_ptr film, bool ok) : wxDialog (parent, wxID_ANY, _("Hints")) , _film (film) - , _hints (new Hints (film)) + , _hints (0) , _finished (false) { wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL); @@ -82,11 +82,6 @@ HintsDialog::HintsDialog (wxWindow* parent, boost::weak_ptr film, bool ok) _film_content_change_connection = locked_film->ContentChange.connect (boost::bind (&HintsDialog::film_content_change, this, _1)); } - _hints->Hint.connect (bind (&HintsDialog::hint, this, _1)); - _hints->Progress.connect (bind (&HintsDialog::progress, this, _1)); - _hints->Pulse.connect (bind (&HintsDialog::pulse, this)); - _hints->Finished.connect (bind (&HintsDialog::finished, this)); - film_change (CHANGE_TYPE_DONE); } @@ -111,6 +106,12 @@ HintsDialog::film_change (ChangeType type) _gauge->SetValue (0); update (); _finished = false; + + _hints.reset (new Hints (_film)); + _hints->Hint.connect (bind (&HintsDialog::hint, this, _1)); + _hints->Progress.connect (bind (&HintsDialog::progress, this, _1)); + _hints->Pulse.connect (bind (&HintsDialog::pulse, this)); + _hints->Finished.connect (bind (&HintsDialog::finished, this)); _hints->start (); } @@ -162,6 +163,12 @@ HintsDialog::pulse () void HintsDialog::finished () { + try { + _hints->rethrow (); + } catch (std::exception& e) { + error_dialog (this, wxString::Format(_("A problem occurred when looking for hints (%s)"), std_to_wx(e.what()))); + } + _finished = true; update (); _gauge->Hide ();