2 Copyright (C) 2010 Paul Davis
3 Author: Johannes Mueller
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef __gtk2_ardour_template_dialog_h__
22 #define __gtk2_ardour_template_dialog_h__
26 #include <gtkmm/liststore.h>
27 #include <gtkmm/treeview.h>
29 #include "ardour_dialog.h"
31 class TemplateDialog : public ArdourDialog
38 void setup_session_templates ();
40 void row_selection_changed ();
41 void render_template_names (Gtk::CellRenderer* rnd, const Gtk::TreeModel::iterator& it);
42 void validate_edit (const Glib::ustring& path_string, const Glib::ustring& new_name);
45 bool key_event (GdkEventKey* ev);
47 void rename_template (Gtk::TreeModel::iterator& item, const Glib::ustring& new_name);
48 void delete_selected_template ();
50 struct SessionTemplateColumns : public Gtk::TreeModel::ColumnRecord {
51 SessionTemplateColumns () {
56 Gtk::TreeModelColumn<std::string> name;
57 Gtk::TreeModelColumn<std::string> path;
60 SessionTemplateColumns _session_template_columns;
61 Glib::RefPtr<Gtk::ListStore> _session_template_model;
63 Gtk::TreeView _session_template_treeview;
64 Gtk::CellRendererText _validating_cellrenderer;
65 Gtk::TreeView::Column _validated_column;
67 Gtk::Button _remove_button;
68 Gtk::Button _rename_button;
71 #endif /* __gtk2_ardour_template_dialog_h__ */