Move some stuff into DownloadCertificatePanel; add name().
[dcpomatic.git] / src / wx / download_certificate_panel.cc
index 4052e44a6e8245ff7d1bde1f146eeef9e09f5d1d..0c78901eba551e21e9a76fc3b94f1467e09413d2 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -20,6 +20,7 @@
 
 #include "wx_util.h"
 #include "download_certificate_panel.h"
+#include "lib/signal_manager.h"
 #include <dcp/util.h>
 #include <dcp/exceptions.h>
 #include <boost/bind.hpp>
@@ -62,3 +63,14 @@ DownloadCertificatePanel::certificate () const
 {
        return _certificate;
 }
+
+void
+DownloadCertificatePanel::download (wxStaticText* message)
+{
+       message->SetLabel (_("Downloading certificate"));
+
+       /* Hack: without this the SetLabel() above has no visible effect */
+       wxMilliSleep (200);
+
+       signal_manager->when_idle (boost::bind (&DownloadCertificatePanel::do_download, this, message));
+}