When deleting spot, selects the remaining one just before, fixes #5269

This commit is contained in:
Pandagrapher
2019-04-23 17:19:28 +02:00
parent 4cc2a34323
commit 13cad6cf73
3 changed files with 21 additions and 8 deletions

View File

@@ -1718,28 +1718,32 @@ int ControlSpotPanel::getSelectedSpot()
return id;
}
void ControlSpotPanel::setSelectedSpot(const int id)
bool ControlSpotPanel::setSelectedSpot(const int id)
{
// printf("setSelectedSpot: %d\n", id);
MyMutex::MyLock lock(mTreeview);
disableParamlistener(true);
const Gtk::TreeModel::Children children = treemodel_->children();
for (auto iter = children.begin(); iter != children.end(); iter++) {
const Gtk::TreeModel::Row row = *iter;
if (row[spots_.id] == id) {
disableParamlistener(true);
treeview_->set_cursor(treemodel_->get_path(row));
load_ControlSpot_param();
updateParamVisibility();
updateCurveOpacity(row);
disableParamlistener(false);
return true;
}
}
disableParamlistener(false);
return false;
}
int ControlSpotPanel::getNewId()