- run_gui_loop ();
-
- list<string> const countries = get_dir ("");
- _country->Clear ();
- for (list<string>::const_iterator i = countries.begin(); i != countries.end(); ++i) {
- _country->Append (std_to_wx (*i));
+
+ /* See DoremiCertificateDialog for discussion about this daft delay */
+ wxMilliSleep (200);
+
+ signal_manager->when_idle (boost::bind (&DolbyCertificateDialog::finish_setup_countries, this));
+}
+
+void
+DolbyCertificateDialog::finish_setup_countries ()
+{
+ try {
+ list<string> const c = get_dir ("");
+ _country->Clear ();
+ BOOST_FOREACH (string i, c) {
+ _country->Append (std_to_wx (i));
+ }
+ } catch (NetworkError& e) {
+ error_dialog (this, wxString::Format (_("Could not get country list (%s)"), e.what()));
+ _country->Clear ();