/*
- Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
#include "wx_util.h"
#include "film_name_location_dialog.h"
+#include "check_box.h"
#ifdef DCPOMATIC_USE_OWN_PICKER
#include "dir_picker_ctrl.h"
#endif
#include "lib/compose.hpp"
#include <wx/stdpaths.h>
#include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
using namespace std;
using namespace boost;
add (_folder);
if (offer_templates) {
- _use_template = new wxCheckBox (this, wxID_ANY, _("From template"));
+ _use_template = new CheckBox (this, _("From template"));
add (_use_template);
_template_name = new wxChoice (this, wxID_ANY);
add (_template_name);
if (offer_templates) {
_template_name->Enable (false);
- BOOST_FOREACH (string i, Config::instance()->templates ()) {
+ for (auto i: Config::instance()->templates ()) {
_template_name->Append (std_to_wx (i));
}
}
layout ();
+
+ _name->Bind (wxEVT_TEXT, bind(&FilmNameLocationDialog::setup_sensitivity, this));
+ setup_sensitivity ();
+}
+
+
+void
+FilmNameLocationDialog::setup_sensitivity ()
+{
+ wxButton* ok = dynamic_cast<wxButton *>(FindWindowById(wxID_OK, this));
+ if (ok) {
+ ok->Enable (!_name->GetValue().IsEmpty());
+ }
}
+
void
FilmNameLocationDialog::use_template_clicked ()
{