+
+void
+SaveTemplateDialog::check (wxCommandEvent& ev)
+{
+ bool ok = true;
+
+ if (_name->GetValue().IsEmpty()) {
+ error_dialog (this, _("Template names must not be empty."));
+ ok = false;
+ } else if (Config::instance()->existing_template (wx_to_std (_name->GetValue ()))) {
+ ok = confirm_dialog (this, _("There is already a template with this name. Do you want to overwrite it?"));
+ }
+
+ if (ok) {
+ ev.Skip ();
+ }
+}