From 35e4c9936d01064b02b367becfc34eb8fce9eb54 Mon Sep 17 00:00:00 2001 From: yonideshi Date: Sat, 19 Mar 2016 15:33:00 +0100 Subject: Renaming issue in regions list --- gtk2_ardour/editor_regions.cc | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/gtk2_ardour/editor_regions.cc b/gtk2_ardour/editor_regions.cc index 63b96f1e64..9a6449b9ed 100644 --- a/gtk2_ardour/editor_regions.cc +++ b/gtk2_ardour/editor_regions.cc @@ -379,15 +379,7 @@ EditorRegions::add_region (boost::shared_ptr region) str = region->name(); } - if (region->n_channels() > 1) { - std::stringstream foo; - foo << region->n_channels (); - str += " ["; - str += foo.str(); - str += "]"; - } - - row[_columns.name] = str; + populate_row_name (region, row); row[_columns.region] = region; row[_columns.property_toggles_visible] = false; @@ -1281,7 +1273,7 @@ EditorRegions::selection_filter (const RefPtr& model, const TreeModel } void -EditorRegions::name_editing_started (CellEditable* ce, const Glib::ustring&) +EditorRegions::name_editing_started (CellEditable* ce, const Glib::ustring& path) { name_editable = ce; @@ -1291,6 +1283,15 @@ EditorRegions::name_editing_started (CellEditable* ce, const Glib::ustring&) if (e) { e->set_name (X_("RegionNameEditorEntry")); + + TreeIter iter; + if ((iter = _model->get_iter (path))) { + boost::shared_ptr region = (*iter)[_columns.region]; + + if(region) { + e->set_text(region->name()); + } + } } } @@ -1300,11 +1301,11 @@ EditorRegions::name_edit (const std::string& path, const std::string& new_text) name_editable = 0; boost::shared_ptr region; - TreeIter iter; + TreeIter row_iter; - if ((iter = _model->get_iter (path))) { - region = (*iter)[_columns.region]; - (*iter)[_columns.name] = new_text; + if ((row_iter = _model->get_iter (path))) { + region = (*row_iter)[_columns.region]; + (*row_iter)[_columns.name] = new_text; } /* now mapover everything */ @@ -1318,8 +1319,9 @@ EditorRegions::name_edit (const std::string& path, const std::string& new_text) (*i)->region()->set_name (new_text); } } - } + populate_row_name (region, (*row_iter)); + } } /** @return Region that has been dragged out of the list, or 0 */ -- cgit v1.2.3