summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2026-01-04 17:38:47 +0100
committerCarl Hetherington <cth@carlh.net>2026-01-04 20:35:11 +0100
commit0242ba75b62ba245bb1b61086d118520f7477934 (patch)
tree3c132231e346ef66bbd6933f86025c891ca1ee26 /src/wx
parent7fbe131beac98615530926edccf145c968ce89d7 (diff)
WIP: redownload button (#2706).
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/screen_dialog.cc27
-rw-r--r--src/wx/screen_dialog.h2
2 files changed, 27 insertions, 2 deletions
diff --git a/src/wx/screen_dialog.cc b/src/wx/screen_dialog.cc
index a9786696e..066c9854a 100644
--- a/src/wx/screen_dialog.cc
+++ b/src/wx/screen_dialog.cc
@@ -155,9 +155,11 @@ ScreenDialog::ScreenDialog(
_get_recipient_from_file = new Button(this, _("Get from file..."));
_download_recipient = new Button(this, _("Download..."));
+ _redownload_recipient = new Button(this, _("Re-download..."));
auto s = new wxBoxSizer(wxHORIZONTAL);
s->Add(_get_recipient_from_file, 0, wxLEFT | wxRIGHT | wxEXPAND, DCPOMATIC_SIZER_X_GAP);
s->Add(_download_recipient, 0, wxLEFT | wxRIGHT | wxEXPAND, DCPOMATIC_SIZER_X_GAP);
+ s->Add(_redownload_recipient, 0, wxLEFT | wxRIGHT | wxEXPAND, DCPOMATIC_SIZER_X_GAP);
_sizer->Add(s, wxGBPosition(r, 0), wxGBSpan(1, 2));
++r;
@@ -228,6 +230,7 @@ ScreenDialog::ScreenDialog(
_name->Bind(wxEVT_TEXT, boost::bind(&ScreenDialog::setup_sensitivity, this));
_get_recipient_from_file->Bind(wxEVT_BUTTON, boost::bind(&ScreenDialog::get_recipient_from_file, this));
_download_recipient->Bind(wxEVT_BUTTON, boost::bind(&ScreenDialog::download_recipient, this));
+ _redownload_recipient->Bind(wxEVT_BUTTON, boost::bind(&ScreenDialog::redownload_recipient, this));
overall_sizer->Add(_sizer, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
@@ -318,12 +321,32 @@ ScreenDialog::download_recipient()
void
+ScreenDialog::redownload_recipient()
+{
+ auto url = wx_to_std(_recipient_file->GetLabel());
+ optional<string> username;
+ optional<string> password;
+ if (url.find("barco.com") != string::npos) {
+ username = Config::instance()->barco_username();
+ password = Config::instance()->barco_password();
+ } else if (url.find("christiedigital.com") != string::npos) {
+ username = Config::instance()->christie_username();
+ password = Config::instance()->christie_password();
+ } else if (url.find("gdc-tech.com") != string::npos) {
+ username = Config::instance()->gdc_username();
+ password = Config::instance()->gdc_password();
+ }
+}
+
+
+void
ScreenDialog::setup_sensitivity()
{
- auto ok = dynamic_cast<wxButton*>(FindWindowById(wxID_OK, this));
- if (ok) {
+ if (auto ok = dynamic_cast<wxButton*>(FindWindowById(wxID_OK, this))) {
ok->Enable(static_cast<bool>(_recipient) && !_name->GetValue().IsEmpty());
}
+
+ _redownload_recipient->Enable(_recipient_file->GetLabel().Find(char_to_wx("://")) != wxNOT_FOUND);
}
diff --git a/src/wx/screen_dialog.h b/src/wx/screen_dialog.h
index 5f60a0414..0859dc054 100644
--- a/src/wx/screen_dialog.h
+++ b/src/wx/screen_dialog.h
@@ -58,6 +58,7 @@ private:
void get_recipient_from_file();
void load_recipient(boost::filesystem::path);
void download_recipient();
+ void redownload_recipient();
void setup_sensitivity();
void set_recipient(boost::optional<dcp::Certificate>);
void set_recipient_file(std::string file);
@@ -79,6 +80,7 @@ private:
wxStaticText* _not_valid_after;
wxButton* _get_recipient_from_file;
wxButton* _download_recipient;
+ wxButton* _redownload_recipient;
EditableList<TrustedDevice>* _trusted_device_list;
boost::optional<dcp::Certificate> _recipient;