Before it sounded like just because we couldn't refer to (e.g.) the audio
we couldn't refer to any part of the DCP.
string why_not;
bool const can_reference = dcp && dcp->can_reference_audio (_parent->film(), why_not);
string why_not;
bool const can_reference = dcp && dcp->can_reference_audio (_parent->film(), why_not);
- setup_refer_button (_reference, _reference_note, dcp, can_reference, why_not);
+ wxString cannot;
+ if (why_not.empty()) {
+ cannot = _("Cannot reference this DCP's audio.");
+ } else {
+ cannot = _("Cannot reference this DCP's audio: ") + std_to_wx(why_not);
+ }
+ setup_refer_button (_reference, _reference_note, dcp, can_reference, cannot);
if (_reference->GetValue ()) {
_gain->wrapped()->Enable (false);
if (_reference->GetValue ()) {
_gain->wrapped()->Enable (false);
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
This file is part of DCP-o-matic.
-ContentSubPanel::setup_refer_button (wxCheckBox* button, wxStaticText* note, shared_ptr<DCPContent> dcp, bool can_reference, string why_not) const
+ContentSubPanel::setup_refer_button (wxCheckBox* button, wxStaticText* note, shared_ptr<DCPContent> dcp, bool can_reference, wxString cannot) const
{
button->Enable (can_reference);
{
button->Enable (can_reference);
if (dcp && !can_reference) {
if (dcp && !can_reference) {
- if (why_not.empty()) {
- s = _("Cannot reference this DCP.");
- } else {
- s = _("Cannot reference this DCP: ") + std_to_wx(why_not);
- }
+ note->SetLabel (cannot);
+ } else {
+ note->SetLabel (wxT(""));
- if (s.IsEmpty() || Config::instance()->interface_complexity() == Config::INTERFACE_SIMPLE) {
+ if (cannot.IsEmpty() || Config::instance()->interface_complexity() == Config::INTERFACE_SIMPLE) {
note->Hide ();
} else {
note->Show ();
note->Hide ();
} else {
note->Show ();
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
This file is part of DCP-o-matic.
- void setup_refer_button (wxCheckBox* button, wxStaticText* note, boost::shared_ptr<DCPContent> dcp, bool can_reference, std::string why_not) const;
+ void setup_refer_button (wxCheckBox* button, wxStaticText* note, boost::shared_ptr<DCPContent> dcp, bool can_reference, wxString cannot) const;
virtual void add_to_grid () = 0;
ContentPanel* _parent;
virtual void add_to_grid () = 0;
ContentPanel* _parent;
string why_not;
bool const can_reference = dcp && dcp->can_reference_text (_parent->film(), _original_type, why_not);
string why_not;
bool const can_reference = dcp && dcp->can_reference_text (_parent->film(), _original_type, why_not);
- setup_refer_button (_reference, _reference_note, dcp, can_reference, why_not);
+ wxString cannot;
+ if (why_not.empty()) {
+ cannot = _("Cannot reference this DCP's subtitles or captions.");
+ } else {
+ cannot = _("Cannot reference this DCP's subtitles or captions: ") + std_to_wx(why_not);
+ }
+ setup_refer_button (_reference, _reference_note, dcp, can_reference, cannot);
bool const reference = _reference->GetValue ();
bool const reference = _reference->GetValue ();
string why_not;
bool const can_reference = dcp && dcp->can_reference_video (_parent->film(), why_not);
string why_not;
bool const can_reference = dcp && dcp->can_reference_video (_parent->film(), why_not);
- setup_refer_button (_reference, _reference_note, dcp, can_reference, why_not);
+ wxString cannot;
+ if (why_not.empty()) {
+ cannot = _("Cannot reference this DCP's video.");
+ } else {
+ cannot = _("Cannot reference this DCP's video: ") + std_to_wx(why_not);
+ }
+ setup_refer_button (_reference, _reference_note, dcp, can_reference, cannot);
bool const enable = !_reference->GetValue() && _use->GetValue();
bool const enable = !_reference->GetValue() && _use->GetValue();