Fixes #4930
This commit is contained in:
@@ -1314,6 +1314,8 @@ ControlSpotPanel::SpotRow* ControlSpotPanel::getSpot(int id)
|
||||
{
|
||||
printf("getSpot: %d\n", id);
|
||||
|
||||
MyMutex::MyLock lock(mTreeview);
|
||||
|
||||
SpotRow* r = new SpotRow();
|
||||
|
||||
Gtk::TreeModel::Children children = treemodel_->children();
|
||||
@@ -1352,6 +1354,8 @@ ControlSpotPanel::SpotRow* ControlSpotPanel::getSpot(int id)
|
||||
|
||||
std::vector<int>* ControlSpotPanel::getSpotIdList()
|
||||
{
|
||||
MyMutex::MyLock lock(mTreeview);
|
||||
|
||||
std::vector<int>* r = new std::vector<int>();
|
||||
|
||||
Gtk::TreeModel::Children children = treemodel_->children();
|
||||
@@ -1369,6 +1373,8 @@ int ControlSpotPanel::getSelectedSpot()
|
||||
{
|
||||
printf("getSelectedSpot\n");
|
||||
|
||||
MyMutex::MyLock lock(mTreeview);
|
||||
|
||||
const auto s = treeview_.get_selection();
|
||||
|
||||
// Check if treeview has row, otherwise return 0
|
||||
@@ -1387,6 +1393,8 @@ void ControlSpotPanel::setSelectedSpot(int id)
|
||||
{
|
||||
printf("setSelectedSpot: %d\n", id);
|
||||
|
||||
MyMutex::MyLock lock(mTreeview);
|
||||
|
||||
disableParamlistener(true);
|
||||
|
||||
Gtk::TreeModel::Children children = treemodel_->children();
|
||||
@@ -1407,6 +1415,8 @@ void ControlSpotPanel::setSelectedSpot(int id)
|
||||
|
||||
int ControlSpotPanel::getNewId()
|
||||
{
|
||||
MyMutex::MyLock lock(mTreeview);
|
||||
|
||||
// Looking for maximum used id
|
||||
int max_row_id = 0;
|
||||
Gtk::TreeModel::Children children = treemodel_->children();
|
||||
@@ -1428,6 +1438,8 @@ void ControlSpotPanel::addControlSpot(SpotRow* newSpot)
|
||||
{
|
||||
printf("addControlSpot: %d\n", newSpot->id);
|
||||
|
||||
MyMutex::MyLock lock(mTreeview);
|
||||
|
||||
disableParamlistener(true);
|
||||
Gtk::TreeModel::Row row = * (treemodel_->append());
|
||||
row[spots_.id] = newSpot->id;
|
||||
@@ -1462,6 +1474,8 @@ int ControlSpotPanel::updateControlSpot(SpotRow* spot)
|
||||
{
|
||||
printf("updateControlSpot: %d\n", spot->id);
|
||||
|
||||
MyMutex::MyLock lock(mTreeview);
|
||||
|
||||
disableParamlistener(true);
|
||||
|
||||
Gtk::TreeModel::Children children = treemodel_->children();
|
||||
@@ -1506,6 +1520,8 @@ void ControlSpotPanel::deleteControlSpot(int id)
|
||||
{
|
||||
printf("deleteControlSpot: %d\n", id);
|
||||
|
||||
MyMutex::MyLock lock(mTreeview);
|
||||
|
||||
disableParamlistener(true);
|
||||
|
||||
Gtk::TreeModel::Children children = treemodel_->children();
|
||||
@@ -1517,6 +1533,7 @@ void ControlSpotPanel::deleteControlSpot(int id)
|
||||
if (row[spots_.id] == id) {
|
||||
deleteControlSpotCurve(row);
|
||||
treemodel_->erase(iter);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user