diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-03-26 13:36:12 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-03-26 13:36:12 +0000 |
| commit | 5dc5a43bf61847cf863b29ef47d0046a9d4fdef0 (patch) | |
| tree | 4313f2543c16ffbf660eea705851e2038ce3dd41 /src | |
| parent | 82f638e4170b0eb29227aefb70e0b9321addc7d3 (diff) | |
Start of Dolby certificate download.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/dolby_certificate_dialog.cc | 147 | ||||
| -rw-r--r-- | src/wx/dolby_certificate_dialog.h | 38 | ||||
| -rw-r--r-- | src/wx/doremi_certificate_dialog.cc | 126 | ||||
| -rw-r--r-- | src/wx/doremi_certificate_dialog.h (renamed from src/wx/progress.h) | 19 | ||||
| -rw-r--r-- | src/wx/download_certificate_dialog.cc | 54 | ||||
| -rw-r--r-- | src/wx/download_certificate_dialog.h (renamed from src/wx/progress.cc) | 62 | ||||
| -rw-r--r-- | src/wx/screen_dialog.cc | 102 | ||||
| -rw-r--r-- | src/wx/screen_dialog.h | 2 | ||||
| -rw-r--r-- | src/wx/wscript | 4 | ||||
| -rw-r--r-- | src/wx/wx_util.cc | 8 | ||||
| -rw-r--r-- | src/wx/wx_util.h | 1 |
11 files changed, 424 insertions, 139 deletions
diff --git a/src/wx/dolby_certificate_dialog.cc b/src/wx/dolby_certificate_dialog.cc new file mode 100644 index 000000000..d44c9e737 --- /dev/null +++ b/src/wx/dolby_certificate_dialog.cc @@ -0,0 +1,147 @@ +/* + Copyright (C) 2014 Carl Hetherington <cth@carlh.net> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include <curl/curl.h> +#include "lib/compose.hpp" +#include "dolby_certificate_dialog.h" +#include "wx_util.h" + +using std::list; +using std::string; +using std::stringstream; +using std::cout; + +DolbyCertificateDialog::DolbyCertificateDialog (wxWindow* parent, boost::function<void (boost::filesystem::path)> load) + : DownloadCertificateDialog (parent, load) +{ + wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); + + _country = new wxChoice (this, wxID_ANY); + add_label_to_sizer (table, this, _("Country"), true); + table->Add (_country, 1, wxEXPAND | wxLEFT | wxRIGHT, DCPOMATIC_SIZER_X_GAP); + _country->Append (N_("Hashemite Kingdom of Jordan")); + + _cinema = new wxChoice (this, wxID_ANY); + add_label_to_sizer (table, this, _("Cinema"), true); + table->Add (_cinema, 1, wxEXPAND | wxLEFT | wxRIGHT, DCPOMATIC_SIZER_X_GAP); + _cinema->Append (N_("Wometco Dominicana Palacio Del Cine")); + _overall_sizer->Add (table); + + add_common_widgets (); + + _country->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DolbyCertificateDialog::country_selected, this)); + _cinema->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DolbyCertificateDialog::cinema_selected, this)); + + _country->Clear (); + _cinema->Clear (); +} + +static size_t +ftp_data_ls (void* buffer, size_t size, size_t nmemb, void* data) +{ + string* s = reinterpret_cast<string *> (data); + uint8_t* b = reinterpret_cast<uint8_t *> (buffer); + for (size_t i = 0; i < (size * nmemb); ++i) { + *s += b[i]; + } + return nmemb; +} + +list<string> +DolbyCertificateDialog::ftp_ls (string dir) const +{ + CURL* curl = curl_easy_init (); + if (!curl) { + _message->SetLabel (N_("Could not set up libcurl")); + return list<string> (); + } + + string url = String::compose ("ftp://dolbyrootcertificates:houro61l@ftp.dolby.co.uk/SHA256/%1", dir); + if (url.substr (url.length() - 1, 1) != "/") { + url += "/"; + } + curl_easy_setopt (curl, CURLOPT_URL, url.c_str ()); + + string ls_raw; + struct curl_slist* commands = 0; + commands = curl_slist_append (commands, "NLST"); + curl_easy_setopt (curl, CURLOPT_POSTQUOTE, commands); + curl_easy_setopt (curl, CURLOPT_WRITEDATA, &ls_raw); + curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, ftp_data_ls); + curl_easy_setopt (curl, CURLOPT_FTP_USE_EPSV, 0); + CURLcode const r = curl_easy_perform (curl); + if (r != CURLE_OK) { + _message->SetLabel (_("Problem occurred when contacting Dolby.")); + return list<string> (); + } + + stringstream s (ls_raw); + string line; + list<string> ls; + while (s.good ()) { + getline (s, line); + if (line.length() > 55) { + string const file = line.substr (55); + if (file != "." && file != "..") { + ls.push_back (file); + } + } + } + + curl_easy_cleanup (curl); + + return ls; +} + +void +DolbyCertificateDialog::setup () +{ + _message->SetLabel (_("Fetching available countries")); + run_gui_loop (); + list<string> const countries = ftp_ls (""); + for (list<string>::const_iterator i = countries.begin(); i != countries.end(); ++i) { + _country->Append (std_to_wx (*i)); + } + _message->SetLabel (""); +} + +void +DolbyCertificateDialog::country_selected () +{ + _message->SetLabel (_("Fetching available cinemas")); + run_gui_loop (); + list<string> const cinemas = ftp_ls (wx_to_std (_country->GetStringSelection())); + _cinema->Clear (); + for (list<string>::const_iterator i = cinemas.begin(); i != cinemas.end(); ++i) { + _cinema->Append (std_to_wx (*i)); + } + _message->SetLabel (""); +} + +void +DolbyCertificateDialog::cinema_selected () +{ + _download->Enable (true); +} + +void +DolbyCertificateDialog::download () +{ + +} diff --git a/src/wx/dolby_certificate_dialog.h b/src/wx/dolby_certificate_dialog.h new file mode 100644 index 000000000..7c8e6c525 --- /dev/null +++ b/src/wx/dolby_certificate_dialog.h @@ -0,0 +1,38 @@ +/* + Copyright (C) 2014 Carl Hetherington <cth@carlh.net> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include <curl/curl.h> +#include "download_certificate_dialog.h" + +class DolbyCertificateDialog : public DownloadCertificateDialog +{ +public: + DolbyCertificateDialog (wxWindow *, boost::function<void (boost::filesystem::path)>); + + void setup (); + +private: + void download (); + void country_selected (); + void cinema_selected (); + std::list<std::string> ftp_ls (std::string) const; + + wxChoice* _country; + wxChoice* _cinema; +}; diff --git a/src/wx/doremi_certificate_dialog.cc b/src/wx/doremi_certificate_dialog.cc new file mode 100644 index 000000000..51f2a3579 --- /dev/null +++ b/src/wx/doremi_certificate_dialog.cc @@ -0,0 +1,126 @@ +/* + Copyright (C) 2014 Carl Hetherington <cth@carlh.net> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include <curl/curl.h> +#include <zip.h> +#include "lib/compose.hpp" +#include "lib/util.h" +#include "doremi_certificate_dialog.h" +#include "wx_util.h" + +using std::string; +using boost::function; + +DoremiCertificateDialog::DoremiCertificateDialog (wxWindow* parent, function<void (boost::filesystem::path)> load) + : DownloadCertificateDialog (parent, load) +{ + wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); + + add_label_to_sizer (table, this, _("Server serial number"), true); + _serial = new wxTextCtrl (this, wxID_ANY); + table->Add (_serial, 1, wxEXPAND); + + _overall_sizer->Add (table, 1, wxALL, DCPOMATIC_DIALOG_BORDER); + + add_common_widgets (); +} + + + +static size_t +ftp_data (void* buffer, size_t size, size_t nmemb, void* stream) +{ + FILE* f = reinterpret_cast<FILE*> (stream); + return fwrite (buffer, size, nmemb, f); +} + +void +DoremiCertificateDialog::download () +{ + string const serial = wx_to_std (_serial->GetValue ()); + if (serial.length() != 6) { + _message->SetLabel (_("Doremi serial numbers must have 6 digits")); + return; + } + + CURL* curl = curl_easy_init (); + if (!curl) { + _message->SetLabel (N_("Could not set up libcurl")); + return; + } + + string const url = String::compose ( + "ftp://service:t3chn1c1an@ftp.doremilabs.com/Certificates/%1xxx/dcp2000-%2.dcicerts.zip", + serial.substr(0, 3), serial + ); + + curl_easy_setopt (curl, CURLOPT_URL, url.c_str ()); + + ScopedTemporary temp_zip; + FILE* f = temp_zip.open ("wb"); + curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, ftp_data); + curl_easy_setopt (curl, CURLOPT_WRITEDATA, f); + + _message->SetLabel (_("Downloading certificate from Doremi")); + run_gui_loop (); + + CURLcode const cr = curl_easy_perform (curl); + + _gauge->SetValue (50); + run_gui_loop (); + + temp_zip.close (); + curl_easy_cleanup (curl); + if (cr != CURLE_OK) { + _message->SetLabel (wxString::Format (_("Certificate download failed (%d)"), cr)); + return; + } + + _message->SetLabel (_("Unpacking")); + run_gui_loop (); + + struct zip* zip = zip_open (temp_zip.c_str(), 0, 0); + if (!zip) { + _message->SetLabel (N_("Could not open certificate ZIP file")); + return; + } + + string const name_in_zip = String::compose ("dcp2000-%1.cert.sha256.pem", serial); + struct zip_file* zip_file = zip_fopen (zip, name_in_zip.c_str(), 0); + if (!zip_file) { + _message->SetLabel (N_("Could not find certificate in ZIP file")); + return; + } + + ScopedTemporary temp_cert; + f = temp_cert.open ("wb"); + char buffer[4096]; + while (1) { + int const N = zip_fread (zip_file, buffer, sizeof (buffer)); + fwrite (buffer, 1, N, f); + if (N < int (sizeof (buffer))) { + break; + } + } + temp_cert.close (); + + _gauge->SetValue (100); + _message->SetLabel (_("OK")); + _load (temp_cert.file ()); +} diff --git a/src/wx/progress.h b/src/wx/doremi_certificate_dialog.h index 9ce3243fb..c2cb15dfd 100644 --- a/src/wx/progress.h +++ b/src/wx/doremi_certificate_dialog.h @@ -17,22 +17,15 @@ */ -#include <wx/wx.h> +#include "download_certificate_dialog.h" -class Progress : public wxPanel +class DoremiCertificateDialog : public DownloadCertificateDialog { public: - Progress (wxWindow* parent); - - /** Set progress value. - * @param v Progress from 0 to 100. - */ - void set_value (int v); - void set_message (wxString); + DoremiCertificateDialog (wxWindow *, boost::function<void (boost::filesystem::path)>); private: - void run_gui_loop (); - - wxGauge* _gauge; - wxStaticText* _label; + void download (); + + wxTextCtrl* _serial; }; diff --git a/src/wx/download_certificate_dialog.cc b/src/wx/download_certificate_dialog.cc new file mode 100644 index 000000000..44a366bfa --- /dev/null +++ b/src/wx/download_certificate_dialog.cc @@ -0,0 +1,54 @@ +/* + Copyright (C) 2014 Carl Hetherington <cth@carlh.net> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include <boost/bind.hpp> +#include "download_certificate_dialog.h" +#include "wx_util.h" + +using boost::function; + +DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent, function<void (boost::filesystem::path)> load) + : wxDialog (parent, wxID_ANY, _("Download certificate")) + , _load (load) +{ + _overall_sizer = new wxBoxSizer (wxVERTICAL); +} + +void +DownloadCertificateDialog::add_common_widgets () +{ + _download = new wxButton (this, wxID_ANY, _("Download")); + _overall_sizer->Add (_download, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_X_GAP); + _gauge = new wxGauge (this, wxID_ANY, 100); + _overall_sizer->Add (_gauge, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_X_GAP); + _message = new wxStaticText (this, wxID_ANY, wxT ("")); + _overall_sizer->Add (_message, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_X_GAP); + + wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL); + if (buttons) { + _overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); + } + + SetSizer (_overall_sizer); + _overall_sizer->Layout (); + _overall_sizer->SetSizeHints (this); + + _download->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DownloadCertificateDialog::download, this)); + _download->Enable (false); +} diff --git a/src/wx/progress.cc b/src/wx/download_certificate_dialog.h index 9e3da6c41..11f1afe42 100644 --- a/src/wx/progress.cc +++ b/src/wx/download_certificate_dialog.h @@ -17,44 +17,30 @@ */ -#include <string> -#include "progress.h" -#include "wx_util.h" +#ifndef DCPOMATIC_DOWNLOAD_CERTIFICATE_DIALOG_H +#define DCPOMATIC_DOWNLOAD_CERTIFICATE_DIALOG_H -using std::string; +#include <wx/wx.h> +#include <boost/function.hpp> +#include <boost/filesystem.hpp> -Progress::Progress (wxWindow* parent) - : wxPanel (parent, wxID_ANY) +class DownloadCertificateDialog : public wxDialog { - wxBoxSizer* s = new wxBoxSizer (wxVERTICAL); - - _gauge = new wxGauge (this, wxID_ANY, 100); - s->Add (_gauge, 1, wxEXPAND); - _label = new wxStaticText (this, wxID_ANY, wxT ("")); - s->Add (_label, 1, wxEXPAND); - - SetSizerAndFit (s); -} - -void -Progress::set_value (int v) -{ - _gauge->SetValue (v); - run_gui_loop (); -} - -void -Progress::set_message (wxString s) -{ - _label->SetLabel (s); - run_gui_loop (); -} - -void -Progress::run_gui_loop () -{ - while (wxTheApp->Pending ()) { - wxTheApp->Dispatch (); - } -} - +public: + DownloadCertificateDialog (wxWindow *, boost::function<void (boost::filesystem::path)>); + virtual void setup () {} + +protected: + void add_common_widgets (); + + boost::function<void (boost::filesystem::path)> _load; + wxSizer* _overall_sizer; + wxGauge* _gauge; + wxStaticText* _message; + wxButton* _download; + +private: + virtual void download () = 0; +}; + +#endif diff --git a/src/wx/screen_dialog.cc b/src/wx/screen_dialog.cc index b077a9bf9..ca278a233 100644 --- a/src/wx/screen_dialog.cc +++ b/src/wx/screen_dialog.cc @@ -19,14 +19,13 @@ #include <wx/filepicker.h> #include <wx/validate.h> -#include <curl/curl.h> -#include <zip.h> #include <libdcp/exceptions.h> #include "lib/compose.hpp" #include "lib/util.h" #include "screen_dialog.h" #include "wx_util.h" -#include "progress.h" +#include "doremi_certificate_dialog.h" +#include "dolby_certificate_dialog.h" using std::string; using std::cout; @@ -47,11 +46,7 @@ ScreenDialog::ScreenDialog (wxWindow* parent, string title, string name, shared_ _manufacturer = new wxChoice (this, wxID_ANY); table->Add (_manufacturer, 1, wxEXPAND); - add_label_to_sizer (table, this, "Server serial number", true); - _serial = new wxTextCtrl (this, wxID_ANY); - table->Add (_serial, 1, wxEXPAND); - - add_label_to_sizer (table, this, "Certificate", true); + add_label_to_sizer (table, this, _("Certificate"), true); wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); _load_certificate = new wxButton (this, wxID_ANY, _("Load from file...")); _download_certificate = new wxButton (this, wxID_ANY, _("Download")); @@ -60,10 +55,6 @@ ScreenDialog::ScreenDialog (wxWindow* parent, string title, string name, shared_ table->Add (s, 1, wxEXPAND); table->AddSpacer (0); - _progress = new Progress (this); - table->Add (_progress, 1, wxEXPAND); - - table->AddSpacer (0); _certificate_text = new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, wxSize (320, 256), wxTE_MULTILINE | wxTE_READONLY); if (certificate) { _certificate_text->SetValue (certificate->certificate ()); @@ -87,13 +78,13 @@ ScreenDialog::ScreenDialog (wxWindow* parent, string title, string name, shared_ _manufacturer->Append (_("Unknown")); _manufacturer->Append (_("Doremi")); + _manufacturer->Append (_("Dolby")); _manufacturer->Append (_("Other")); _manufacturer->SetSelection (0); _load_certificate->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ScreenDialog::select_certificate, this)); _download_certificate->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ScreenDialog::download_certificate, this)); _manufacturer->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&ScreenDialog::setup_sensitivity, this)); - _serial->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&ScreenDialog::setup_sensitivity, this)); setup_sensitivity (); } @@ -125,89 +116,27 @@ void ScreenDialog::select_certificate () { wxFileDialog* d = new wxFileDialog (this, _("Select Certificate File")); - if (d->ShowModal () == wxID_OK) { load_certificate (boost::filesystem::path (wx_to_std (d->GetPath ()))); } - d->Destroy (); setup_sensitivity (); } -static size_t -ftp_data (void* buffer, size_t size, size_t nmemb, void* stream) -{ - FILE* f = reinterpret_cast<FILE*> (stream); - return fwrite (buffer, size, nmemb, f); -} - void ScreenDialog::download_certificate () { if (_manufacturer->GetStringSelection() == _("Doremi")) { - string const serial = wx_to_std (_serial->GetValue ()); - if (serial.length() != 6) { - error_dialog (this, _("Doremi serial numbers must have 6 numbers")); - return; - } - - CURL* curl = curl_easy_init (); - if (!curl) { - error_dialog (this, N_("Could not set up libcurl")); - return; - } - - string const url = String::compose ( - "ftp://service:t3chn1c1an@ftp.doremilabs.com/Certificates/%1xxx/dcp2000-%2.dcicerts.zip", - serial.substr(0, 3), serial - ); - - curl_easy_setopt (curl, CURLOPT_URL, url.c_str ()); - - ScopedTemporary temp_zip; - FILE* f = temp_zip.open ("wb"); - curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, ftp_data); - curl_easy_setopt (curl, CURLOPT_WRITEDATA, f); - _progress->set_message (_("Downloading certificate from Doremi")); - CURLcode const cr = curl_easy_perform (curl); - _progress->set_value (50); - temp_zip.close (); - curl_easy_cleanup (curl); - if (cr != CURLE_OK) { - _progress->set_message (wxString::Format (_("Certificate download failed (%d)"), cr)); - return; - } - - _progress->set_message (_("Unpacking")); - struct zip* zip = zip_open (temp_zip.c_str(), 0, 0); - if (!zip) { - _progress->set_message ("Could not open certificate ZIP file"); - return; - } - - string const name_in_zip = String::compose ("dcp2000-%1.cert.sha256.pem", serial); - struct zip_file* zip_file = zip_fopen (zip, name_in_zip.c_str(), 0); - if (!zip_file) { - _progress->set_message ("Could not find certificate in ZIP file"); - return; - } - - ScopedTemporary temp_cert; - f = temp_cert.open ("wb"); - char buffer[4096]; - while (1) { - int const N = zip_fread (zip_file, buffer, sizeof (buffer)); - fwrite (buffer, 1, N, f); - if (N < int (sizeof (buffer))) { - break; - } - } - temp_cert.close (); - - _progress->set_value (100); - _progress->set_message (_("OK")); - load_certificate (temp_cert.file ()); + DownloadCertificateDialog* d = new DoremiCertificateDialog (this, boost::bind (&ScreenDialog::load_certificate, this, _1)); + d->setup (); + d->ShowModal (); + d->Destroy (); + } else if (_manufacturer->GetStringSelection() == _("Dolby")) { + DownloadCertificateDialog* d = new DolbyCertificateDialog (this, boost::bind (&ScreenDialog::load_certificate, this, _1)); + d->setup (); + d->ShowModal (); + d->Destroy (); } } @@ -217,5 +146,8 @@ ScreenDialog::setup_sensitivity () wxButton* ok = dynamic_cast<wxButton*> (FindWindowById (wxID_OK, this)); ok->Enable (_certificate); - _download_certificate->Enable (_manufacturer->GetStringSelection() == _("Doremi") && !_serial->GetValue().IsEmpty ()); + _download_certificate->Enable ( + _manufacturer->GetStringSelection() == _("Doremi") || + _manufacturer->GetStringSelection() == _("Dolby") + ); } diff --git a/src/wx/screen_dialog.h b/src/wx/screen_dialog.h index 1fcc8d564..385707ea8 100644 --- a/src/wx/screen_dialog.h +++ b/src/wx/screen_dialog.h @@ -39,8 +39,6 @@ private: wxTextCtrl* _name; wxChoice* _manufacturer; - wxTextCtrl* _serial; - Progress* _progress; wxButton* _load_certificate; wxButton* _download_certificate; wxTextCtrl* _certificate_text; diff --git a/src/wx/wscript b/src/wx/wscript index 56476c4ce..2fa37216b 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -17,6 +17,9 @@ sources = """ content_menu.cc dci_metadata_dialog.cc dir_picker_ctrl.cc + dolby_certificate_dialog.cc + doremi_certificate_dialog.cc + download_certificate_dialog.cc film_editor.cc film_editor_panel.cc film_viewer.cc @@ -29,7 +32,6 @@ sources = """ kdm_dialog.cc new_film_dialog.cc preset_colour_conversion_dialog.cc - progress.cc properties_dialog.cc repeat_dialog.cc screen_dialog.cc diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index 367d1edbb..96278b82b 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -296,3 +296,11 @@ wx_get (wxChoice* w) { return w->GetSelection (); } + +void +run_gui_loop () +{ + while (wxTheApp->Pending ()) { + wxTheApp->Dispatch (); + } +} diff --git a/src/wx/wx_util.h b/src/wx/wx_util.h index 8ac824c50..0afd82b90 100644 --- a/src/wx/wx_util.h +++ b/src/wx/wx_util.h @@ -48,6 +48,7 @@ extern wxStaticText* add_label_to_grid_bag_sizer (wxGridBagSizer *, wxWindow *, extern std::string wx_to_std (wxString); extern wxString std_to_wx (std::string); extern void dcpomatic_setup_i18n (); +extern void run_gui_loop (); /** @class ThreadedStaticText * |
