Add set_recipient_file().
authorCarl Hetherington <cth@carlh.net>
Mon, 16 Jan 2023 19:53:44 +0000 (20:53 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 16 Jan 2023 19:53:44 +0000 (20:53 +0100)
src/wx/screen_dialog.cc
src/wx/screen_dialog.h

index bc39193fba395d790f11a95594e52c18e745a864..55be806d8708b398ed2c3d800f0059d6561364e5 100644 (file)
@@ -154,8 +154,8 @@ ScreenDialog::ScreenDialog (
        ++r;
 
        add_label_to_sizer (_sizer, this, _("Filename"), true, wxGBPosition(r, 0));
-       checked_set (_recipient_file, recipient_file.get_value_or(""));
        _recipient_file = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(600, -1), wxST_ELLIPSIZE_MIDDLE | wxST_NO_AUTORESIZE);
+       set_recipient_file(recipient_file.get_value_or(""));
        _sizer->Add (_recipient_file, wxGBPosition(r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_Y_GAP);
        ++r;
 
@@ -249,7 +249,7 @@ ScreenDialog::load_recipient (boost::filesystem::path file)
                        return;
                }
                set_recipient (c.leaf ());
-               checked_set (_recipient_file, file.string());
+               set_recipient_file(file.string());
        } catch (dcp::MiscError& e) {
                error_dialog (this, _("Could not read certificate file."), std_to_wx(e.what()));
        }
@@ -274,7 +274,7 @@ ScreenDialog::download_recipient ()
        auto dialog = make_wx<DownloadCertificateDialog>(this);
        if (dialog->ShowModal() == wxID_OK) {
                set_recipient(dialog->certificate());
-               checked_set(_recipient_file, dialog->url());
+               set_recipient_file(dialog->url());
        }
        setup_sensitivity ();
 }
@@ -300,3 +300,11 @@ ScreenDialog::set_recipient (optional<dcp::Certificate> r)
                _sizer->Layout ();
        }
 }
+
+
+void
+ScreenDialog::set_recipient_file(string file)
+{
+       checked_set(_recipient_file, file);
+}
+
index 51721866972bb2779152f130be3a9c2e98935937..e623f3889fab40a772df8be44a8a36a622ff91cd 100644 (file)
@@ -60,6 +60,7 @@ private:
        void download_recipient ();
        void setup_sensitivity ();
        void set_recipient (boost::optional<dcp::Certificate>);
+       void set_recipient_file(std::string file);
 
        void set_trusted_devices (std::vector<TrustedDevice> d) {
                _trusted_devices = d;