13
0

region list patch 4 from chris goddard

git-svn-id: svn://localhost/ardour2/branches/3.0@3868 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2008-10-05 10:44:15 +00:00
parent 4c6ec2a5a3
commit 14a40f32f6

View File

@ -276,30 +276,21 @@ Editor::region_list_region_changed (Change what_changed, boost::weak_ptr<Region>
void void
Editor::region_list_selection_changed() Editor::region_list_selection_changed()
{ {
bool selected = false;
if (region_list_display.get_selection()->count_selected_rows() > 0) { if (region_list_display.get_selection()->count_selected_rows() > 0) {
selected = true;
}
if (selected) {
TreeView::Selection::ListHandle_Path rows = region_list_display.get_selection()->get_selected_rows ();
TreeIter iter; TreeIter iter;
TreeView::Selection::ListHandle_Path rows = region_list_display.get_selection()->get_selected_rows ();
deselect_all();
for (TreeView::Selection::ListHandle_Path::iterator i = rows.begin(); i != rows.end(); ++i) { for (TreeView::Selection::ListHandle_Path::iterator i = rows.begin(); i != rows.end(); ++i) {
if (iter = region_list_model->get_iter (*i)) { if (iter = region_list_model->get_iter (*i)) { // they could have clicked on a row that is just a placeholder, like "Hidden"
boost::shared_ptr<Region> r = (*iter)[region_list_columns.region]; boost::shared_ptr<Region> region = (*iter)[region_list_columns.region];
/* they could have clicked on a row that is just a placeholder, like "Hidden" */ if (region) {
set_selected_regionview_from_region_list (region, Selection::Add);
if (r) {
/* just set the first selected region (in fact, the selection model might be SINGLE, which
means there can only be one.
*/
set_selected_regionview_from_region_list (r, Selection::Set);
} }
} }
} }
@ -382,7 +373,7 @@ Editor::update_region_row (boost::shared_ptr<Region> region)
} }
} }
} }
cerr << "Returning - No match\n\n"; cerr << "Returning - No match\n";
} }
bool bool
@ -426,9 +417,8 @@ Editor::update_all_region_rows ()
boost::shared_ptr<Region> region = (*i)[region_list_columns.region]; boost::shared_ptr<Region> region = (*i)[region_list_columns.region];
cerr << "level 1 : Updating " << region->name() << "\n";
if (!region->automatic()) { if (!region->automatic()) {
cerr << "level 1 : Updating " << region->name() << "\n";
populate_row(region, (*i)); populate_row(region, (*i));
} }
@ -448,9 +438,8 @@ Editor::update_all_region_subrows (TreeModel::Row const &parent_row, int level)
boost::shared_ptr<Region> region = (*i)[region_list_columns.region]; boost::shared_ptr<Region> region = (*i)[region_list_columns.region];
cerr << "level " << level << " : Updating " << region->name() << "\n";
if (!region->automatic()) { if (!region->automatic()) {
cerr << "level " << level << " : Updating " << region->name() << "\n";
populate_row(region, (*i)); populate_row(region, (*i));
} }
@ -803,7 +792,9 @@ Editor::region_list_display_button_press (GdkEventButton *ev)
} }
if (region == 0) { if (region == 0) {
cerr << "\tno region, event not handled\n"; region_list_display.get_selection()->unselect_all();
deselect_all();
cerr << "\tSelection cleared\n";
return false; return false;
} }