summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-08-24 11:16:24 +0100
committerCarl Hetherington <cth@carlh.net>2016-08-24 11:16:24 +0100
commit3412af70b950dcdc604413ef05c26becda6da789 (patch)
treeb901f89335ec7e06531b475dbb45ff1ee7087e28 /src/wx
parenta26b6e9e392a1ac342a19e0d33d92865819c6ded (diff)
Bump libdcp for new method.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/new_film_dialog.cc27
-rw-r--r--src/wx/new_film_dialog.h5
-rw-r--r--src/wx/wscript1
3 files changed, 32 insertions, 1 deletions
diff --git a/src/wx/new_film_dialog.cc b/src/wx/new_film_dialog.cc
index 04b9e1057..4883810d0 100644
--- a/src/wx/new_film_dialog.cc
+++ b/src/wx/new_film_dialog.cc
@@ -46,6 +46,10 @@ NewFilmDialog::NewFilmDialog (wxWindow* parent)
_folder = new wxDirPickerCtrl (this, wxID_ANY, wxEmptyString, wxDirSelectorPromptStr, wxDefaultPosition, wxSize (300, -1));
#endif
+ _use_template = new wxCheckButton (this, wxID_ANY, _("From template"));
+ add (_use_template);
+ _template_name = new wxChoice (this, wxID_ANY);
+
if (!_directory) {
_directory = Config::instance()->default_directory_or (wx_to_std (wxStandardPaths::Get().GetDocumentsDir()));
}
@@ -54,10 +58,23 @@ NewFilmDialog::NewFilmDialog (wxWindow* parent)
add (_folder);
_name->SetFocus ();
+ _template_name->Enable (false);
+
+ BOOST_FOREACH (string i, Config::instance()->template_names ()) {
+ _template_name->Append (std_to_wx (i));
+ }
+
+ _use_template->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, bind (&NewFilmDialog::use_template_clicked, this));
layout ();
}
+void
+NewFilmDialog::use_template_clicked ()
+{
+ _template_name->Enable (_use_template->GetValue ());
+}
+
NewFilmDialog::~NewFilmDialog ()
{
_directory = wx_to_std (_folder->GetPath ());
@@ -71,3 +88,13 @@ NewFilmDialog::get_path () const
p /= wx_to_std (_name->GetValue ());
return p;
}
+
+optional<string>
+NewFilmDialog::template_name () const
+{
+ if (!_use_template->GetValue ()) {
+ return optional<string> ();
+ }
+
+ return wx_to_std (_template_name->GetValue ());
+}
diff --git a/src/wx/new_film_dialog.h b/src/wx/new_film_dialog.h
index 6dc83d815..4096b4303 100644
--- a/src/wx/new_film_dialog.h
+++ b/src/wx/new_film_dialog.h
@@ -31,7 +31,8 @@ public:
NewFilmDialog (wxWindow *);
~NewFilmDialog ();
- boost::filesystem::path get_path () const;
+ boost::filesystem::path path () const;
+ boost::optional<std::string> template_name () const;
private:
wxTextCtrl* _name;
@@ -40,5 +41,7 @@ private:
#else
wxDirPickerCtrl* _folder;
#endif
+ wxCheckButton* _use_template;
+ wxChoice* _template_name;
static boost::optional<boost::filesystem::path> _directory;
};
diff --git a/src/wx/wscript b/src/wx/wscript
index ee77e6c20..1f9aed6b3 100644
--- a/src/wx/wscript
+++ b/src/wx/wscript
@@ -75,6 +75,7 @@ sources = """
repeat_dialog.cc
report_problem_dialog.cc
rgba_colour_picker.cc
+ save_template_dialog.cc
screen_dialog.cc
screens_panel.cc
self_dkdm_dialog.cc