projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix font ID allocation from DCP when there are subs and ccaps using the same IDs...
[dcpomatic.git]
/
src
/
wx
/
download_certificate_dialog.cc
diff --git
a/src/wx/download_certificate_dialog.cc
b/src/wx/download_certificate_dialog.cc
index 45b34c7030540162919a82e6cd94ebd51022727a..8f4720252f09975d0854b3cd614c682699335335 100644
(file)
--- a/
src/wx/download_certificate_dialog.cc
+++ b/
src/wx/download_certificate_dialog.cc
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2014-20
18
Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-20
22
Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
This file is part of DCP-o-matic.
@@
-18,21
+18,26
@@
*/
*/
-#include "dolby_doremi_certificate_panel.h"
+
#include "barco_alchemy_certificate_panel.h"
#include "christie_certificate_panel.h"
#include "barco_alchemy_certificate_panel.h"
#include "christie_certificate_panel.h"
-#include "gdc_certificate_panel.h"
+#include "dcpomatic_button.h"
+#include "dolby_doremi_certificate_panel.h"
#include "download_certificate_dialog.h"
#include "download_certificate_dialog.h"
+#include "gdc_certificate_panel.h"
+#include "qube_certificate_panel.h"
#include "static_text.h"
#include "wx_util.h"
#include "static_text.h"
#include "wx_util.h"
-#include "dcpomatic_button.h"
+
+using std::string;
using boost::optional;
using boost::optional;
+
DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent)
: wxDialog (parent, wxID_ANY, _("Download certificate"))
{
DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent)
: wxDialog (parent, wxID_ANY, _("Download certificate"))
{
-
wxBoxSizer*
sizer = new wxBoxSizer (wxVERTICAL);
+
auto
sizer = new wxBoxSizer (wxVERTICAL);
_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);
@@
-42,7
+47,7
@@
DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent)
_message = new StaticText (this, wxT (""));
sizer->Add (_message, 0, wxALL, DCPOMATIC_SIZER_GAP);
_message = new StaticText (this, wxT (""));
sizer->Add (_message, 0, wxALL, DCPOMATIC_SIZER_GAP);
-
wxFont
font = _message->GetFont();
+
auto
font = _message->GetFont();
font.SetStyle (wxFONTSTYLE_ITALIC);
font.SetPointSize (font.GetPointSize() - 1);
_message->SetFont (font);
font.SetStyle (wxFONTSTYLE_ITALIC);
font.SetPointSize (font.GetPointSize() - 1);
_message->SetFont (font);
@@
-51,12
+56,14
@@
DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent)
_pages.push_back (new BarcoAlchemyCertificatePanel (this));
_pages.push_back (new ChristieCertificatePanel (this));
_pages.push_back (new GDCCertificatePanel (this));
_pages.push_back (new BarcoAlchemyCertificatePanel (this));
_pages.push_back (new ChristieCertificatePanel (this));
_pages.push_back (new GDCCertificatePanel (this));
+ _pages.push_back (new QubeCertificatePanel (this, N_("QXI")));
+ _pages.push_back (new QubeCertificatePanel (this, N_("QXPD")));
-
BOOST_FOREACH (DownloadCertificatePanel* i,
_pages) {
+
for (auto i:
_pages) {
_notebook->AddPage (i, i->name(), true);
}
_notebook->AddPage (i, i->name(), true);
}
-
wxSizer*
buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
+
auto
buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
if (buttons) {
sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
}
if (buttons) {
sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
}
@@
-69,41
+76,58
@@
DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent)
_notebook->SetSelection (0);
_notebook->SetSelection (0);
+ SetMinSize (wxSize(640, -1));
+
setup_sensitivity ();
}
setup_sensitivity ();
}
+
DownloadCertificateDialog::~DownloadCertificateDialog ()
{
_notebook->Unbind (wxEVT_NOTEBOOK_PAGE_CHANGED, &DownloadCertificateDialog::page_changed, this);
}
DownloadCertificateDialog::~DownloadCertificateDialog ()
{
_notebook->Unbind (wxEVT_NOTEBOOK_PAGE_CHANGED, &DownloadCertificateDialog::page_changed, this);
}
+
void
DownloadCertificateDialog::download ()
{
_pages[_notebook->GetSelection()]->download ();
}
void
DownloadCertificateDialog::download ()
{
_pages[_notebook->GetSelection()]->download ();
}
+
dcp::Certificate
DownloadCertificateDialog::certificate () const
{
dcp::Certificate
DownloadCertificateDialog::certificate () const
{
-
optional<dcp::Certificate>
c = _pages[_notebook->GetSelection()]->certificate ();
+
auto
c = _pages[_notebook->GetSelection()]->certificate ();
DCPOMATIC_ASSERT (c);
DCPOMATIC_ASSERT (c);
- return
c.get ()
;
+ return
*c
;
}
}
+
+string
+DownloadCertificateDialog::url () const
+{
+ auto u = _pages[_notebook->GetSelection()]->url();
+ DCPOMATIC_ASSERT (u);
+ return *u;
+}
+
+
void
DownloadCertificateDialog::setup_sensitivity ()
{
void
DownloadCertificateDialog::setup_sensitivity ()
{
-
DownloadCertificatePanel*
p = _pages[_notebook->GetSelection()];
+
auto
p = _pages[_notebook->GetSelection()];
_download->Enable (p->ready_to_download ());
_download->Enable (p->ready_to_download ());
-
wxButton*
ok = dynamic_cast<wxButton *> (FindWindowById (wxID_OK, this));
+
auto
ok = dynamic_cast<wxButton *> (FindWindowById (wxID_OK, this));
if (ok) {
ok->Enable (static_cast<bool>(p->certificate ()));
}
}
if (ok) {
ok->Enable (static_cast<bool>(p->certificate ()));
}
}
+
void
void
-DownloadCertificateDialog::page_changed (wxNotebookEvent
&
)
+DownloadCertificateDialog::page_changed (wxNotebookEvent
& ev
)
{
setup_sensitivity ();
{
setup_sensitivity ();
+ ev.Skip ();
}
}