forked from j62/ctbrec
1
0
Fork 0

Removed buggy optimization for puased checkboxes

This commit is contained in:
0xboobface 2018-12-01 16:52:51 +01:00
parent f0edfb167c
commit 4a8e0e3bea
1 changed files with 5 additions and 16 deletions

View File

@ -32,8 +32,6 @@ import ctbrec.ui.controls.AutoFillTextField;
import ctbrec.ui.controls.Toast;
import javafx.application.Platform;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.concurrent.ScheduledService;
@ -321,21 +319,12 @@ public class RecordedModelsTab extends Tab implements TabSelectionListener {
int index = observableModels.indexOf(updatedModel);
if (index == -1) {
observableModels.add(updatedModel);
updatedModel.getPausedProperty().addListener(new ChangeListener<Boolean>() {
boolean firstChange = true;
@Override
public void changed(ObservableValue<? extends Boolean> obs, Boolean oldV, Boolean newV) {
if(firstChange) {
// don't react to the first change, because that is made by the recorder and not by the user
firstChange = false;
return;
}
updatedModel.getPausedProperty().addListener((obs, oldV, newV) -> {
if (newV) {
pauseRecording(Collections.singletonList(updatedModel));
} else {
resumeRecording(Collections.singletonList(updatedModel));
}
}
});
} else {
// make sure to update the JavaFX online property, so that the table cell is updated