diff options
author | yonideshi <finarfinek@gmail.com> | 2016-03-19 15:33:00 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-03-26 18:39:52 +0100 |
commit | 35e4c9936d01064b02b367becfc34eb8fce9eb54 (patch) | |
tree | faf1bb12ed135f4651d89556e6de402cb8217f5e /gtk2_ardour/editor_regions.cc | |
parent | 9853d2a911701c24ea4f9b26649b0a127e9872e3 (diff) |
Renaming issue in regions list
Diffstat (limited to 'gtk2_ardour/editor_regions.cc')
-rw-r--r-- | gtk2_ardour/editor_regions.cc | 32 |
1 files 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> 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<TreeModel>& 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> 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> 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 */ |