diff options
Diffstat (limited to 'src/wx/self_dkdm_dialog.cc')
| -rw-r--r-- | src/wx/self_dkdm_dialog.cc | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/wx/self_dkdm_dialog.cc b/src/wx/self_dkdm_dialog.cc index a94b56e18..99f414267 100644 --- a/src/wx/self_dkdm_dialog.cc +++ b/src/wx/self_dkdm_dialog.cc @@ -25,6 +25,11 @@ #include "lib/film.h" #include "lib/screen.h" #include <libcxml/cxml.h> +#ifdef DCPOMATIC_USE_OWN_PICKER +#include "dir_picker_ctrl.h" +#else +#include <wx/filepicker.h> +#endif #include <wx/treectrl.h> #include <wx/listctrl.h> #include <wx/stdpaths.h> @@ -38,6 +43,7 @@ using std::cout; using std::vector; using std::make_pair; using boost::shared_ptr; +using boost::bind; SelfDKDMDialog::SelfDKDMDialog (wxWindow* parent, boost::shared_ptr<const Film> film) : wxDialog (parent, wxID_ANY, _("Make DKDM for DCP-o-matic")) @@ -56,6 +62,31 @@ SelfDKDMDialog::SelfDKDMDialog (wxWindow* parent, boost::shared_ptr<const Film> _cpl = new KDMCPLPanel (this, film->cpls ()); vertical->Add (_cpl); + /* Sub-heading: output */ + h = new wxStaticText (this, wxID_ANY, _("Output")); + h->SetFont (subheading_font); + vertical->Add (h, 0, wxALIGN_CENTER_VERTICAL | wxTOP, DCPOMATIC_SIZER_Y_GAP * 2); + + _internal = new wxRadioButton (this, wxID_ANY, _("Save to KDM creator tool's list")); + vertical->Add (_internal, 0, wxALIGN_CENTER_VERTICAL | wxTOP, DCPOMATIC_SIZER_Y_GAP); + + wxBoxSizer* w = new wxBoxSizer (wxHORIZONTAL); + + _write_to = new wxRadioButton (this, wxID_ANY, _("Write to")); + w->Add (_write_to, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, DCPOMATIC_SIZER_GAP); + +#ifdef DCPOMATIC_USE_OWN_PICKER + _folder = new DirPickerCtrl (this); +#else + _folder = new wxDirPickerCtrl (this, wxID_ANY, wxEmptyString, wxDirSelectorPromptStr, wxDefaultPosition, wxSize (300, -1)); +#endif + + _folder->SetPath (wxStandardPaths::Get().GetDocumentsDir()); + + w->Add (_folder, 1, wxEXPAND); + + vertical->Add (w, 0, wxBOTTOM, DCPOMATIC_SIZER_Y_GAP); + /* Make an overall sizer to get a nice border, and put some buttons in */ wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); @@ -71,11 +102,16 @@ SelfDKDMDialog::SelfDKDMDialog (wxWindow* parent, boost::shared_ptr<const Film> SetSizer (overall_sizer); overall_sizer->Layout (); overall_sizer->SetSizeHints (this); + + _internal->Bind (wxEVT_COMMAND_RADIOBUTTON_SELECTED, bind (&SelfDKDMDialog::setup_sensitivity, this)); + _write_to->Bind (wxEVT_COMMAND_RADIOBUTTON_SELECTED, bind (&SelfDKDMDialog::setup_sensitivity, this)); } void SelfDKDMDialog::setup_sensitivity () { + _folder->Enable (_write_to->GetValue ()); + wxButton* ok = dynamic_cast<wxButton *> (FindWindowById (wxID_OK, this)); if (ok) { ok->Enable (_cpl->has_selected ()); @@ -87,3 +123,15 @@ SelfDKDMDialog::cpl () const { return _cpl->cpl (); } + +bool +SelfDKDMDialog::internal () const +{ + return _internal->GetValue (); +} + +boost::filesystem::path +SelfDKDMDialog::directory () const +{ + return wx_to_std (_folder->GetPath ()); +} |
