if (_desc_dirty && _current_selection) {
ArdourDialog dlg (_("Description not saved"), true);
const string name = _current_selection->get_value (_template_columns.name);
if (_desc_dirty && _current_selection) {
ArdourDialog dlg (_("Description not saved"), true);
const string name = _current_selection->get_value (_template_columns.name);
"Do you want to save it?"), name));
dlg.get_vbox()->pack_start (msg);
msg.show ();
"Do you want to save it?"), name));
dlg.get_vbox()->pack_start (msg);
msg.show ();
XMLNode* desc = new XMLNode (X_("description"));
XMLNode* dn = new XMLNode (X_("content"), desc_txt);
desc->add_child_nocopy (*dn);
XMLNode* desc = new XMLNode (X_("description"));
XMLNode* dn = new XMLNode (X_("content"), desc_txt);
desc->add_child_nocopy (*dn);
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
dialog.add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
FileFilter archive_filter;
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
dialog.add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
FileFilter archive_filter;
if (g_file_test (filename.c_str(), G_FILE_TEST_EXISTS)) {
ArdourDialog dlg (_("File exists"), true);
if (g_file_test (filename.c_str(), G_FILE_TEST_EXISTS)) {
ArdourDialog dlg (_("File exists"), true);
dialog.add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
FileFilter archive_filter;
dialog.add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
FileFilter archive_filter;
const string old_name = item->get_value (_template_columns.name);
const string new_name = string (new_name_);
const string old_name = item->get_value (_template_columns.name);
const string new_name = string (new_name_);
const string old_filepath = item->get_value (_template_columns.path);
const string new_filepath = Glib::build_filename (user_route_template_directory(), new_name+".template");
const string old_filepath = item->get_value (_template_columns.path);
const string new_filepath = Glib::build_filename (user_route_template_directory(), new_name+".template");
XMLTree tree;
if (!tree.read (old_filepath)) {
error << string_compose (_("Could not parse template file \"%1\"."), old_filepath) << endmsg;
XMLTree tree;
if (!tree.read (old_filepath)) {
error << string_compose (_("Could not parse template file \"%1\"."), old_filepath) << endmsg;