- wxString GetName () const
- {
- return _("Metadata");
- }
-
-#ifdef DCPOMATIC_OSX
- wxBitmap GetLargeIcon () const
- {
- return wxBitmap ("blank", wxBITMAP_TYPE_PNG_RESOURCE);
- }
-#endif
-
- wxWindow* CreateWindow (wxWindow* parent)
- {
- wxPanel* panel = new wxPanel (parent);
- wxBoxSizer* s = new wxBoxSizer (wxVERTICAL);
- panel->SetSizer (s);
-
- wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
- table->AddGrowableCol (1, 1);
- s->Add (table, 1, wxALL | wxEXPAND, 8);
-
- add_label_to_sizer (table, panel, _("Issuer"), true);
- _issuer = new wxTextCtrl (panel, wxID_ANY);
- table->Add (_issuer, 1, wxEXPAND);
-
- add_label_to_sizer (table, panel, _("Creator"), true);
- _creator = new wxTextCtrl (panel, wxID_ANY);
- table->Add (_creator, 1, wxEXPAND);
-
- Config* config = Config::instance ();
-
- _issuer->SetValue (std_to_wx (config->dcp_metadata().issuer));
- _issuer->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&MetadataPage::issuer_changed, this));
- _creator->SetValue (std_to_wx (config->dcp_metadata().creator));
- _creator->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&MetadataPage::creator_changed, this));
-
- return panel;
- }
-
-private:
- wxTextCtrl* _issuer;
- wxTextCtrl* _creator;
-
- void issuer_changed ()
- {
- libdcp::XMLMetadata m = Config::instance()->dcp_metadata ();
- m.issuer = wx_to_std (_issuer->GetValue ());
- Config::instance()->set_dcp_metadata (m);
- }
-
- void creator_changed ()
- {
- libdcp::XMLMetadata m = Config::instance()->dcp_metadata ();
- m.creator = wx_to_std (_creator->GetValue ());
- Config::instance()->set_dcp_metadata (m);
- }
-};