projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7459697
)
Shift some more stuff around.
author
Carl Hetherington
<cth@carlh.net>
Tue, 14 Aug 2018 23:23:17 +0000
(
00:23
+0100)
committer
Carl Hetherington
<cth@carlh.net>
Wed, 15 Aug 2018 09:57:06 +0000
(10:57 +0100)
src/wx/dolby_doremi_certificate_panel.cc
patch
|
blob
|
history
src/wx/dolby_doremi_certificate_panel.h
patch
|
blob
|
history
src/wx/download_certificate_dialog.cc
patch
|
blob
|
history
src/wx/download_certificate_panel.cc
patch
|
blob
|
history
src/wx/download_certificate_panel.h
patch
|
blob
|
history
diff --git
a/src/wx/dolby_doremi_certificate_panel.cc
b/src/wx/dolby_doremi_certificate_panel.cc
index 5a0ce028e646298e50768ae97a34357da82b21e5..f0f0a2601e219d6d97a74df045d644dad3a51662 100644
(file)
--- a/
src/wx/dolby_doremi_certificate_panel.cc
+++ b/
src/wx/dolby_doremi_certificate_panel.cc
@@
-38,16
+38,10
@@
using boost::function;
using boost::optional;
using dcp::raw_convert;
using boost::optional;
using dcp::raw_convert;
-DolbyDoremiCertificatePanel::DolbyDoremiCertificatePanel (wxWindow* parent, DownloadCertificateDialog* dialog)
- : DownloadCertificatePanel (parent, dialog)
+DolbyDoremiCertificatePanel::DolbyDoremiCertificatePanel (wxWindow* parent,
wxStaticText* message,
DownloadCertificateDialog* dialog)
+ : DownloadCertificatePanel (parent,
message,
dialog)
{
{
- add_label_to_sizer (_table, this, _("Serial number"), true);
- _serial = new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, wxSize (300, -1));
- _table->Add (_serial, 1, wxEXPAND);
- _serial->Bind (wxEVT_TEXT, boost::bind (&DownloadCertificateDialog::setup_sensitivity, _dialog));
-
- layout ();
}
static void
}
static void
@@
-145,14
+139,13
@@
try_cp850 (list<string>& urls, list<string>& files, string prefix, string serial
}
void
}
void
-DolbyDoremiCertificatePanel::do_download (
wxStaticText* message
)
+DolbyDoremiCertificatePanel::do_download (
string serial
)
{
/* Try dcp2000, imb and ims prefixes (see mantis #375) */
string const prefix = "ftp://anonymous@ftp.cinema.dolby.com/Certificates/";
list<string> urls;
list<string> files;
{
/* Try dcp2000, imb and ims prefixes (see mantis #375) */
string const prefix = "ftp://anonymous@ftp.cinema.dolby.com/Certificates/";
list<string> urls;
list<string> files;
- string const serial = wx_to_std (_serial->GetValue());
bool starts_with_digit = false;
optional<char> starting_char;
bool starts_with_digit = false;
optional<char> starting_char;
@@
-191,10
+184,10
@@
DolbyDoremiCertificatePanel::do_download (wxStaticText* message)
}
if (ok) {
}
if (ok) {
- message->SetLabel (_("Certificate downloaded"));
+
_
message->SetLabel (_("Certificate downloaded"));
_dialog->setup_sensitivity ();
} else {
_dialog->setup_sensitivity ();
} else {
- message->SetLabel (wxT (""));
+
_
message->SetLabel (wxT (""));
string s;
BOOST_FOREACH (string e, errors) {
string s;
BOOST_FOREACH (string e, errors) {
@@
-205,12
+198,6
@@
DolbyDoremiCertificatePanel::do_download (wxStaticText* message)
}
}
}
}
-bool
-DolbyDoremiCertificatePanel::ready_to_download () const
-{
- return !_serial->IsEmpty ();
-}
-
wxString
DolbyDoremiCertificatePanel::name () const
{
wxString
DolbyDoremiCertificatePanel::name () const
{
diff --git
a/src/wx/dolby_doremi_certificate_panel.h
b/src/wx/dolby_doremi_certificate_panel.h
index 2e1e0f54e36a06cb6d5527719a6a0b465df36d32..21f9286218bebb1b58518002d62bca53fc1c497d 100644
(file)
--- a/
src/wx/dolby_doremi_certificate_panel.h
+++ b/
src/wx/dolby_doremi_certificate_panel.h
@@
-23,14
+23,8
@@
class DolbyDoremiCertificatePanel : public DownloadCertificatePanel
{
public:
class DolbyDoremiCertificatePanel : public DownloadCertificatePanel
{
public:
- DolbyDoremiCertificatePanel (wxWindow* parent, DownloadCertificateDialog* dialog);
+ DolbyDoremiCertificatePanel (wxWindow* parent,
wxStaticText* message,
DownloadCertificateDialog* dialog);
- bool ready_to_download () const;
- void do_download (wxStaticText* message);
+ void do_download (std::string serial);
wxString name () const;
wxString name () const;
-
-private:
- void finish_download (std::string serial, wxStaticText* message);
-
- wxTextCtrl* _serial;
};
};
diff --git
a/src/wx/download_certificate_dialog.cc
b/src/wx/download_certificate_dialog.cc
index bccfbb5c24067b9434f74da3926a30b54a676b8c..a2219cd6fec7a865d182d3a003a349a70130fae6 100644
(file)
--- a/
src/wx/download_certificate_dialog.cc
+++ b/
src/wx/download_certificate_dialog.cc
@@
-32,12
+32,6
@@
DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent)
_notebook = new wxNotebook (this, wxID_ANY);
sizer->Add (_notebook, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
_notebook = new wxNotebook (this, wxID_ANY);
sizer->Add (_notebook, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
- _pages.push_back (new DolbyDoremiCertificatePanel (_notebook, this));
-
- BOOST_FOREACH (DownloadCertificatePanel* i, _pages) {
- _notebook->AddPage (i, i->name(), true);
- }
-
_download = new wxButton (this, wxID_ANY, _("Download"));
sizer->Add (_download, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_GAP);
_download = new wxButton (this, wxID_ANY, _("Download"));
sizer->Add (_download, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_GAP);
@@
-48,6
+42,12
@@
DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent)
font.SetPointSize (font.GetPointSize() - 1);
_message->SetFont (font);
font.SetPointSize (font.GetPointSize() - 1);
_message->SetFont (font);
+ _pages.push_back (new DolbyDoremiCertificatePanel (_notebook, _message, this));
+
+ BOOST_FOREACH (DownloadCertificatePanel* i, _pages) {
+ _notebook->AddPage (i, i->name(), true);
+ }
+
wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
if (buttons) {
sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
if (buttons) {
sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
@@
-71,7
+71,7
@@
DownloadCertificateDialog::~DownloadCertificateDialog ()
void
DownloadCertificateDialog::download ()
{
void
DownloadCertificateDialog::download ()
{
- _pages[_notebook->GetSelection()]->download (
_message
);
+ _pages[_notebook->GetSelection()]->download ();
}
dcp::Certificate
}
dcp::Certificate
diff --git
a/src/wx/download_certificate_panel.cc
b/src/wx/download_certificate_panel.cc
index 0c78901eba551e21e9a76fc3b94f1467e09413d2..f9a88a7bbddbcaa823eb3af619a2462f6a554721 100644
(file)
--- a/
src/wx/download_certificate_panel.cc
+++ b/
src/wx/download_certificate_panel.cc
@@
-20,6
+20,7
@@
#include "wx_util.h"
#include "download_certificate_panel.h"
#include "wx_util.h"
#include "download_certificate_panel.h"
+#include "download_certificate_dialog.h"
#include "lib/signal_manager.h"
#include <dcp/util.h>
#include <dcp/exceptions.h>
#include "lib/signal_manager.h"
#include <dcp/util.h>
#include <dcp/exceptions.h>
@@
-28,9
+29,10
@@
using boost::function;
using boost::optional;
using boost::function;
using boost::optional;
-DownloadCertificatePanel::DownloadCertificatePanel (wxWindow* parent, DownloadCertificateDialog* dialog)
+DownloadCertificatePanel::DownloadCertificatePanel (wxWindow* parent,
wxStaticText* message,
DownloadCertificateDialog* dialog)
: wxPanel (parent, wxID_ANY)
, _dialog (dialog)
: wxPanel (parent, wxID_ANY)
, _dialog (dialog)
+ , _message (message)
{
_overall_sizer = new wxBoxSizer (wxVERTICAL);
SetSizer (_overall_sizer);
{
_overall_sizer = new wxBoxSizer (wxVERTICAL);
SetSizer (_overall_sizer);
@@
-39,11
+41,13
@@
DownloadCertificatePanel::DownloadCertificatePanel (wxWindow* parent, DownloadCe
_table->AddGrowableCol (1, 1);
_overall_sizer->Add (_table, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
_table->AddGrowableCol (1, 1);
_overall_sizer->Add (_table, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
-}
-void
-DownloadCertificatePanel::layout ()
-{
+ add_label_to_sizer (_table, this, _("Serial number"), true);
+ _serial = new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, wxSize (300, -1));
+ _table->Add (_serial, 1, wxEXPAND);
+
+ _serial->Bind (wxEVT_TEXT, boost::bind (&DownloadCertificateDialog::setup_sensitivity, _dialog));
+
_overall_sizer->Layout ();
_overall_sizer->SetSizeHints (this);
}
_overall_sizer->Layout ();
_overall_sizer->SetSizeHints (this);
}
@@
-65,12
+69,18
@@
DownloadCertificatePanel::certificate () const
}
void
}
void
-DownloadCertificatePanel::download (
wxStaticText* message
)
+DownloadCertificatePanel::download ()
{
{
- message->SetLabel (_("Downloading certificate"));
+
_
message->SetLabel (_("Downloading certificate"));
/* Hack: without this the SetLabel() above has no visible effect */
wxMilliSleep (200);
/* Hack: without this the SetLabel() above has no visible effect */
wxMilliSleep (200);
- signal_manager->when_idle (boost::bind (&DownloadCertificatePanel::do_download, this, message));
+ signal_manager->when_idle (boost::bind (&DownloadCertificatePanel::do_download, this, wx_to_std(_serial->GetValue())));
+}
+
+bool
+DownloadCertificatePanel::ready_to_download () const
+{
+ return !_serial->IsEmpty ();
}
}
diff --git
a/src/wx/download_certificate_panel.h
b/src/wx/download_certificate_panel.h
index 98e48de39a105f9fe854372d5ddfab1d5edefe00..252474c59802e357151b36a076f047eb6610ec5e 100644
(file)
--- a/
src/wx/download_certificate_panel.h
+++ b/
src/wx/download_certificate_panel.h
@@
-30,25
+30,25
@@
class DownloadCertificateDialog;
class DownloadCertificatePanel : public wxPanel
{
public:
class DownloadCertificatePanel : public wxPanel
{
public:
- DownloadCertificatePanel (wxWindow* parent, DownloadCertificateDialog* dialog);
+ DownloadCertificatePanel (wxWindow* parent,
wxStaticText* message,
DownloadCertificateDialog* dialog);
- virtual bool ready_to_download () const = 0;
- virtual void do_download (wxStaticText* message) = 0;
+ virtual void do_download (std::string serial) = 0;
virtual wxString name () const = 0;
virtual wxString name () const = 0;
- void download (wxStaticText* message);
+ bool ready_to_download () const;
+ void download ();
void load (boost::filesystem::path);
boost::optional<dcp::Certificate> certificate () const;
protected:
void load (boost::filesystem::path);
boost::optional<dcp::Certificate> certificate () const;
protected:
- void layout ();
-
DownloadCertificateDialog* _dialog;
wxFlexGridSizer* _table;
DownloadCertificateDialog* _dialog;
wxFlexGridSizer* _table;
+ wxStaticText* _message;
private:
wxSizer* _overall_sizer;
boost::optional<dcp::Certificate> _certificate;
private:
wxSizer* _overall_sizer;
boost::optional<dcp::Certificate> _certificate;
+ wxTextCtrl* _serial;
};
#endif
};
#endif