summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-11-12 00:17:45 +0000
committerCarl Hetherington <carl@carlh.net>2009-11-12 00:17:45 +0000
commit9d0e560a1fffc5fb1453da0194d6e5608f26d220 (patch)
tree7132aa97bf3af66321ebca541d41e39613569fb3 /gtk2_ardour
parent5568bd952494ef3aaa9422218304bbd377de1151 (diff)
Allow route name edit from the right-hand-side editor list.
git-svn-id: svn://localhost/ardour2/branches/3.0@6065 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_routes.cc22
-rw-r--r--gtk2_ardour/editor_routes.h1
2 files changed, 22 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc
index 38a78370ff..24fe0f7c4b 100644
--- a/gtk2_ardour/editor_routes.cc
+++ b/gtk2_ardour/editor_routes.cc
@@ -90,12 +90,17 @@ EditorRoutes::EditorRoutes (Editor* e)
_display.set_headers_visible (true);
_display.set_name ("TrackListDisplay");
- _display.get_selection()->set_mode (SELECTION_NONE);
+ _display.get_selection()->set_mode (SELECTION_SINGLE);
_display.set_reorderable (true);
_display.set_rules_hint (true);
_display.set_size_request (100, -1);
_display.add_object_drag (_columns.route.index(), "routes");
+ CellRendererText* name_cell = dynamic_cast<CellRendererText*> (_display.get_column_cell_renderer (2));
+ assert (name_cell);
+ name_cell->property_editable() = true;
+ name_cell->signal_edited().connect (mem_fun (*this, &EditorRoutes::name_edit));
+
CellRendererToggle* visible_cell = dynamic_cast<CellRendererToggle*>(_display.get_column_cell_renderer (1));
visible_cell->property_activatable() = true;
@@ -847,3 +852,18 @@ EditorRoutes::clear ()
_model->clear ();
_display.set_model (_model);
}
+
+void
+EditorRoutes::name_edit (Glib::ustring const & path, Glib::ustring const & new_text)
+{
+ TreeIter iter = _model->get_iter (path);
+ if (!iter) {
+ return;
+ }
+
+ boost::shared_ptr<Route> route = (*iter)[_columns.route];
+
+ if (route) {
+ route->set_name (new_text);
+ }
+}
diff --git a/gtk2_ardour/editor_routes.h b/gtk2_ardour/editor_routes.h
index 22bff40e35..1086313d08 100644
--- a/gtk2_ardour/editor_routes.h
+++ b/gtk2_ardour/editor_routes.h
@@ -73,6 +73,7 @@ private:
);
void track_list_reorder (Gtk::TreeModel::Path const &, Gtk::TreeModel::iterator const & iter, int* new_order);
bool selection_filter (Glib::RefPtr<Gtk::TreeModel> const &, Gtk::TreeModel::Path const &, bool);
+ void name_edit (Glib::ustring const &, Glib::ustring const &);
struct ModelColumns : public Gtk::TreeModel::ColumnRecord {
ModelColumns() {