forked from j62/ctbrec
1
0
Fork 0

Fix bug: "split bigger than" not being changeable

This commit is contained in:
0xb00bface 2021-01-23 18:48:23 +01:00
parent c44749ac16
commit 844295101e
2 changed files with 1 additions and 5 deletions

View File

@ -290,7 +290,6 @@ public class CtbrecPreferencesStorage implements PreferencesStorage {
ComboBox<Object> comboBox = new ComboBox(listProp);
Field field = Settings.class.getField(setting.getKey());
Object value = field.get(settings);
LOG.debug("{} {} {}", setting.getName(), value, setting.getProperty().getValue());
if (StringUtil.isNotBlank(value.toString())) {
if (setting.getConverter() != null) {
comboBox.getSelectionModel().select(setting.getConverter().convertTo(value));

View File

@ -343,9 +343,7 @@ public class SettingsTab extends Tab implements TabSelectionListener {
private void splitValuesChanged(ObservableValue<?> value, Object oldV, Object newV) {
boolean splitAfterSet = settings.splitRecordingsAfterSecs > 0;
LOG.debug("after {}", settings.splitRecordingsAfterSecs);
boolean splitBiggerThanSet = settings.splitRecordingsBiggerThanBytes > 0;
LOG.debug("bigger {}", settings.splitRecordingsBiggerThanBytes);
if (splitAfterSet && splitBiggerThanSet) {
settings.splitStrategy = TIME_OR_SIZE;
} else if (splitAfterSet) {
@ -355,7 +353,6 @@ public class SettingsTab extends Tab implements TabSelectionListener {
} else {
settings.splitStrategy = DONT;
}
LOG.debug("strats {}", settings.splitStrategy);
saveConfig();
}
@ -587,7 +584,7 @@ public class SettingsTab extends Tab implements TabSelectionListener {
if (getClass() != obj.getClass())
return false;
SplitBiggerThanOption other = (SplitBiggerThanOption) obj;
return value != other.value;
return value == other.value;
}
public static ValueConverter converter() {