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
This commit is contained in:
parent
5568bd9524
commit
9d0e560a1f
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user