X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fwx%2Fdolby_certificate_dialog.cc;h=5e094844de59697771c0af68827733ceddebf983;hb=51f024b9d818db44e5d0db7bc4a5c03e324c25fb;hp=e5bb1896207fe396464624e7ca730093b8d217ab;hpb=6bc5caa116382d3540678dbc1ea97cb23dd4e5ef;p=dcpomatic.git diff --git a/src/wx/dolby_certificate_dialog.cc b/src/wx/dolby_certificate_dialog.cc index e5bb18962..5e094844d 100644 --- a/src/wx/dolby_certificate_dialog.cc +++ b/src/wx/dolby_certificate_dialog.cc @@ -21,13 +21,13 @@ #include #include "lib/compose.hpp" #include "lib/internet.h" +#include "lib/ui_signaller.h" #include "dolby_certificate_dialog.h" #include "wx_util.h" using std::list; using std::string; using std::vector; -using std::stringstream; using std::cout; using boost::optional; using boost::algorithm::split; @@ -75,8 +75,17 @@ DolbyCertificateDialog::setup_countries () _country->Append (_("Fetching...")); _country->SetSelection (0); - run_gui_loop (); - + +#ifdef DCPOMATIC_OSX + /* See DoremiCertificateDialog for discussion about this daft delay */ + wxMilliSleep (200); +#endif + ui_signaller->when_idle (boost::bind (&DolbyCertificateDialog::finish_setup_countries, this)); +} + +void +DolbyCertificateDialog::finish_setup_countries () +{ list const countries = get_dir (""); _country->Clear (); for (list::const_iterator i = countries.begin(); i != countries.end(); ++i) { @@ -90,8 +99,16 @@ DolbyCertificateDialog::country_selected () _cinema->Clear (); _cinema->Append (_("Fetching...")); _cinema->SetSelection (0); - run_gui_loop (); - + +#ifdef DCPOMATIC_OSX + wxMilliSleep (200); +#endif + ui_signaller->when_idle (boost::bind (&DolbyCertificateDialog::finish_country_selected, this)); +} + +void +DolbyCertificateDialog::finish_country_selected () +{ list const cinemas = get_dir (wx_to_std (_country->GetStringSelection())); _cinema->Clear (); for (list::const_iterator i = cinemas.begin(); i != cinemas.end(); ++i) { @@ -105,8 +122,16 @@ DolbyCertificateDialog::cinema_selected () _serial->Clear (); _serial->Append (_("Fetching...")); _serial->SetSelection (0); - run_gui_loop (); +#ifdef DCPOMATIC_OSX + wxMilliSleep (200); +#endif + ui_signaller->when_idle (boost::bind (&DolbyCertificateDialog::finish_cinema_selected, this)); +} + +void +DolbyCertificateDialog::finish_cinema_selected () +{ string const dir = String::compose ("%1/%2", wx_to_std (_country->GetStringSelection()), wx_to_std (_cinema->GetStringSelection())); list const zips = get_dir (dir); @@ -130,8 +155,17 @@ void DolbyCertificateDialog::download () { _message->SetLabel (_("Downloading certificate")); - run_gui_loop (); +#ifdef DCPOMATIC_OSX + wxMilliSleep (200); +#endif + + ui_signaller->when_idle (boost::bind (&DolbyCertificateDialog::finish_download, this)); +} + +void +DolbyCertificateDialog::finish_download () +{ string const zip = string_client_data (_serial->GetClientObject (_serial->GetSelection ())); string const file = String::compose (