diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-02-10 22:40:16 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-02-10 22:40:16 +0100 |
| commit | eade5cc8657f51d1d768b705936e918f8d1f53ee (patch) | |
| tree | f7aa1c8c21a483b69f3e4c7908c6310fb7af932e /src | |
| parent | 0e18e7acd23ef466cc14a8b2d9a19df4dd991ddc (diff) | |
Also remove now-redundant UTC offset from DKDMRecipient.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/dkdm_recipient.cc | 7 | ||||
| -rw-r--r-- | src/lib/dkdm_recipient.h | 8 | ||||
| -rw-r--r-- | src/wx/recipient_dialog.cc | 43 | ||||
| -rw-r--r-- | src/wx/recipient_dialog.h | 6 | ||||
| -rw-r--r-- | src/wx/recipients_panel.cc | 6 |
5 files changed, 4 insertions, 66 deletions
diff --git a/src/lib/dkdm_recipient.cc b/src/lib/dkdm_recipient.cc index c683151f2..8f3bfea2e 100644 --- a/src/lib/dkdm_recipient.cc +++ b/src/lib/dkdm_recipient.cc @@ -24,7 +24,6 @@ #include "film.h" #include "kdm_with_metadata.h" #include <dcp/raw_convert.h> -#include <dcp/utc_offset.h> using std::make_shared; @@ -40,9 +39,6 @@ DKDMRecipient::DKDMRecipient (cxml::ConstNodePtr node) for (auto i: node->node_children("Email")) { emails.push_back (i->content()); } - - utc_offset_hour = node->number_child<int>("UTCOffsetHour"); - utc_offset_minute = node->number_child<int>("UTCOffsetMinute"); } @@ -54,9 +50,6 @@ DKDMRecipient::as_xml (xmlpp::Element* node) const for (auto i: emails) { node->add_child("Email")->add_child_text(i); } - - node->add_child("UTCOffsetHour")->add_child_text(raw_convert<string>(utc_offset_hour)); - node->add_child("UTCOffsetMinute")->add_child_text(raw_convert<string>(utc_offset_minute)); } diff --git a/src/lib/dkdm_recipient.h b/src/lib/dkdm_recipient.h index 4015a0b7d..3317ae6f9 100644 --- a/src/lib/dkdm_recipient.h +++ b/src/lib/dkdm_recipient.h @@ -33,14 +33,10 @@ public: std::string const& name_, std::string const& notes_, boost::optional<dcp::Certificate> recipient_, - std::vector<std::string> emails_, - int utc_offset_hour_, - int utc_offset_minute_ + std::vector<std::string> emails_ ) : KDMRecipient (name_, notes_, recipient_, boost::none) , emails (emails_) - , utc_offset_hour (utc_offset_hour_) - , utc_offset_minute (utc_offset_minute_) { } @@ -50,8 +46,6 @@ public: void as_xml (xmlpp::Element *) const override; std::vector<std::string> emails; - int utc_offset_hour; - int utc_offset_minute; }; diff --git a/src/wx/recipient_dialog.cc b/src/wx/recipient_dialog.cc index b166f265d..1b38ea2d1 100644 --- a/src/wx/recipient_dialog.cc +++ b/src/wx/recipient_dialog.cc @@ -55,7 +55,7 @@ column (string s) RecipientDialog::RecipientDialog ( - wxWindow* parent, wxString title, string name, string notes, vector<string> emails, int utc_offset_hour, int utc_offset_minute, optional<dcp::Certificate> recipient + wxWindow* parent, wxString title, string name, string notes, vector<string> emails, optional<dcp::Certificate> recipient ) : wxDialog (parent, wxID_ANY, title) , _recipient (recipient) @@ -76,11 +76,6 @@ RecipientDialog::RecipientDialog ( _sizer->Add (_notes, wxGBPosition (r, 1)); ++r; - add_label_to_sizer (_sizer, this, _("UTC offset (time zone)"), true, wxGBPosition (r, 0)); - _utc_offset = new wxChoice (this, wxID_ANY); - _sizer->Add (_utc_offset, wxGBPosition (r, 1)); - ++r; - add_label_to_sizer (_sizer, this, _("Email addresses for KDM delivery"), false, wxGBPosition (r, 0), wxGBSpan (1, 2)); ++r; @@ -128,17 +123,6 @@ RecipientDialog::RecipientDialog ( overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); } - /* Default to UTC */ - size_t sel = get_offsets (_offsets); - for (size_t i = 0; i < _offsets.size(); ++i) { - _utc_offset->Append (_offsets[i].name); - if (_offsets[i].hour == utc_offset_hour && _offsets[i].minute == utc_offset_minute) { - sel = i; - } - } - - _utc_offset->SetSelection (sel); - overall_sizer->Layout (); overall_sizer->SetSizeHints (this); @@ -237,28 +221,3 @@ RecipientDialog::emails () const { return _emails; } - - -int -RecipientDialog::utc_offset_hour () const -{ - int const sel = _utc_offset->GetSelection(); - if (sel < 0 || sel > int (_offsets.size())) { - return 0; - } - - return _offsets[sel].hour; -} - -int -RecipientDialog::utc_offset_minute () const -{ - int const sel = _utc_offset->GetSelection(); - if (sel < 0 || sel > int (_offsets.size())) { - return 0; - } - - return _offsets[sel].minute; -} - - diff --git a/src/wx/recipient_dialog.h b/src/wx/recipient_dialog.h index a46e67af5..61f6b3031 100644 --- a/src/wx/recipient_dialog.h +++ b/src/wx/recipient_dialog.h @@ -44,8 +44,6 @@ public: std::string name = "", std::string notes = "", std::vector<std::string> emails = std::vector<std::string>(), - int utc_offset_hour = 0, - int utc_offset_minute = 0, boost::optional<dcp::Certificate> c = boost::optional<dcp::Certificate>() ); @@ -53,8 +51,6 @@ public: std::string notes () const; boost::optional<dcp::Certificate> recipient () const; std::vector<std::string> emails () const; - int utc_offset_hour () const; - int utc_offset_minute () const; private: void get_recipient_from_file (); @@ -71,8 +67,6 @@ private: wxButton* _get_recipient_from_file; EditableList<std::string, EmailDialog>* _email_list; std::vector<std::string> _emails; - wxChoice* _utc_offset; - std::vector<Offset> _offsets; boost::optional<dcp::Certificate> _recipient; }; diff --git a/src/wx/recipients_panel.cc b/src/wx/recipients_panel.cc index 485a0f94e..04ad0dd6e 100644 --- a/src/wx/recipients_panel.cc +++ b/src/wx/recipients_panel.cc @@ -122,7 +122,7 @@ RecipientsPanel::add_recipient_clicked () { RecipientDialog dialog(GetParent(), _("Add recipient")); if (dialog.ShowModal() == wxID_OK) { - auto r = std::make_shared<DKDMRecipient>(dialog.name(), dialog.notes(), dialog.recipient(), dialog.emails(), dialog.utc_offset_hour(), dialog.utc_offset_minute()); + auto r = std::make_shared<DKDMRecipient>(dialog.name(), dialog.notes(), dialog.recipient(), dialog.emails()); Config::instance()->add_dkdm_recipient (r); add_recipient (r); } @@ -139,15 +139,13 @@ RecipientsPanel::edit_recipient_clicked () auto c = *_selected.begin(); RecipientDialog dialog( - GetParent(), _("Edit recipient"), c.second->name, c.second->notes, c.second->emails, c.second->utc_offset_hour, c.second->utc_offset_minute, c.second->recipient + GetParent(), _("Edit recipient"), c.second->name, c.second->notes, c.second->emails, c.second->recipient ); if (dialog.ShowModal() == wxID_OK) { c.second->name = dialog.name(); c.second->emails = dialog.emails(); c.second->notes = dialog.notes(); - c.second->utc_offset_hour = dialog.utc_offset_hour(); - c.second->utc_offset_minute = dialog.utc_offset_minute(); _targets->SetItemText(c.first, std_to_wx(dialog.name())); Config::instance()->changed (Config::DKDM_RECIPIENTS); } |
