bool skelJointsHistory::changedInLastNUpdates(int _updates, skelJoints * _values) { int _index = getPrevIndex(historyIndex); for(int i = 0; i < _updates; i++) { if(!_values->compareJoints(items[_index]->joints)) return true; _index = getPrevIndex(_index); } return false; }
void MainFrm::navigateThroughTabs(const bool bNext, const int idx) { int curIdx=tabWidget->currentIndex(); tabWidget->blockSignals(true);//lets block the signals to prevent entering the next again... int newIndex=-1; /* bool bEnable=!vTabs.at(idx)->getSample()->bLogBook; for (int i=JUMP+1; i < JUMP+STEP; ++i) tabWidget->setTabEnabled(i,bEnable); if (!bEnable){ vTabs.at(idx)->getSample()->cellId=-1; vTabs.at(idx)->getSample()->vesselTypeId=-1; } */ if (bNext){ if (!getNextIndex(idx,vTabs.at(curIdx)->getSample()->bLogBook,newIndex)){ displayError(tr("Could not navigate to the next tab!"),false); return; } }else{ if (!getPrevIndex(curIdx,vTabs.at(curIdx)->getSample()->bLogBook,newIndex)){ displayError(tr("Could not navigate to the next tab!"),false); return; } } tabWidget->setTabEnabled(newIndex,true); tabWidget->setCurrentIndex(newIndex); tabWidget->blockSignals(false);//and unblock... }