projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6788ff5
)
Similar fix to Dolby cert downloads.
author
Carl Hetherington
<cth@carlh.net>
Tue, 2 Sep 2014 23:37:51 +0000
(
00:37
+0100)
committer
Carl Hetherington
<cth@carlh.net>
Tue, 2 Sep 2014 23:37:51 +0000
(
00:37
+0100)
ChangeLog
patch
|
blob
|
history
src/wx/dolby_certificate_dialog.cc
patch
|
blob
|
history
src/wx/dolby_certificate_dialog.h
patch
|
blob
|
history
src/wx/wx_util.cc
patch
|
blob
|
history
src/wx/wx_util.h
patch
|
blob
|
history
diff --git
a/ChangeLog
b/ChangeLog
index 54188c26a4f9f5da4f894bd9db761c4a761de959..d9be8474e864de51a26933094fc8d3050cc92031 100644
(file)
--- a/
ChangeLog
+++ b/
ChangeLog
@@
-1,3
+1,7
@@
+2014-09-03 Carl Hetherington <cth@carlh.net>
+
+ * Fix server certificate downloads on OS X (#376).
+
2014-09-02 Carl Hetherington <cth@carlh.net>
* Improve behaviour of batch converter window when it is shrunk (#338).
2014-09-02 Carl Hetherington <cth@carlh.net>
* Improve behaviour of batch converter window when it is shrunk (#338).
diff --git
a/src/wx/dolby_certificate_dialog.cc
b/src/wx/dolby_certificate_dialog.cc
index a05a3bbc79ff58b73caecc48a70e1afb67bc0038..5e094844de59697771c0af68827733ceddebf983 100644
(file)
--- a/
src/wx/dolby_certificate_dialog.cc
+++ b/
src/wx/dolby_certificate_dialog.cc
@@
-21,6
+21,7
@@
#include <curl/curl.h>
#include "lib/compose.hpp"
#include "lib/internet.h"
#include <curl/curl.h>
#include "lib/compose.hpp"
#include "lib/internet.h"
+#include "lib/ui_signaller.h"
#include "dolby_certificate_dialog.h"
#include "wx_util.h"
#include "dolby_certificate_dialog.h"
#include "wx_util.h"
@@
-74,8
+75,17
@@
DolbyCertificateDialog::setup_countries ()
_country->Append (_("Fetching..."));
_country->SetSelection (0);
_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<string> const countries = get_dir ("");
_country->Clear ();
for (list<string>::const_iterator i = countries.begin(); i != countries.end(); ++i) {
list<string> const countries = get_dir ("");
_country->Clear ();
for (list<string>::const_iterator i = countries.begin(); i != countries.end(); ++i) {
@@
-89,8
+99,16
@@
DolbyCertificateDialog::country_selected ()
_cinema->Clear ();
_cinema->Append (_("Fetching..."));
_cinema->SetSelection (0);
_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<string> const cinemas = get_dir (wx_to_std (_country->GetStringSelection()));
_cinema->Clear ();
for (list<string>::const_iterator i = cinemas.begin(); i != cinemas.end(); ++i) {
list<string> const cinemas = get_dir (wx_to_std (_country->GetStringSelection()));
_cinema->Clear ();
for (list<string>::const_iterator i = cinemas.begin(); i != cinemas.end(); ++i) {
@@
-104,8
+122,16
@@
DolbyCertificateDialog::cinema_selected ()
_serial->Clear ();
_serial->Append (_("Fetching..."));
_serial->SetSelection (0);
_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<string> const zips = get_dir (dir);
string const dir = String::compose ("%1/%2", wx_to_std (_country->GetStringSelection()), wx_to_std (_cinema->GetStringSelection()));
list<string> const zips = get_dir (dir);
@@
-129,8
+155,17
@@
void
DolbyCertificateDialog::download ()
{
_message->SetLabel (_("Downloading certificate"));
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 (
string const zip = string_client_data (_serial->GetClientObject (_serial->GetSelection ()));
string const file = String::compose (
diff --git
a/src/wx/dolby_certificate_dialog.h
b/src/wx/dolby_certificate_dialog.h
index 194150363cb11e8504c464ab8a6f187678f1dee4..e9bbffda0ccadb8105d669dd6c56397478f16dba 100644
(file)
--- a/
src/wx/dolby_certificate_dialog.h
+++ b/
src/wx/dolby_certificate_dialog.h
@@
-27,9
+27,13
@@
public:
private:
void download ();
private:
void download ();
+ void finish_download ();
void setup_countries ();
void setup_countries ();
+ void finish_setup_countries ();
void country_selected ();
void country_selected ();
+ void finish_country_selected ();
void cinema_selected ();
void cinema_selected ();
+ void finish_cinema_selected ();
void serial_selected ();
std::list<std::string> get_dir (std::string) const;
void serial_selected ();
std::list<std::string> get_dir (std::string) const;
diff --git
a/src/wx/wx_util.cc
b/src/wx/wx_util.cc
index 218a786b2a8f52dd57237416fb5406867e0726ad..23a85534a2123fbbad1fb58c8ec5e1f43b52618c 100644
(file)
--- a/
src/wx/wx_util.cc
+++ b/
src/wx/wx_util.cc
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012
-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
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
@@
-312,14
+312,6
@@
wx_get (wxSpinCtrlDouble* w)
return w->GetValue ();
}
return w->GetValue ();
}
-void
-run_gui_loop ()
-{
- while (wxTheApp->Pending ()) {
- wxTheApp->Dispatch ();
- }
-}
-
/** @param s String of the form Context|String
* @return translation, or String if no translation is available.
*/
/** @param s String of the form Context|String
* @return translation, or String if no translation is available.
*/
diff --git
a/src/wx/wx_util.h
b/src/wx/wx_util.h
index 6dfc0bf5c5bbb9b4dcf3ef017f8d9af9ed45b5e9..f0e20be9598b015cb13fb8700220d0dfc3308d18 100644
(file)
--- a/
src/wx/wx_util.h
+++ b/
src/wx/wx_util.h
@@
-63,7
+63,6
@@
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 std::string wx_to_std (wxString);
extern wxString std_to_wx (std::string);
extern void dcpomatic_setup_i18n ();
-extern void run_gui_loop ();
extern wxString context_translation (wxString);
/** @class ThreadedStaticText
extern wxString context_translation (wxString);
/** @class ThreadedStaticText