Various fixes

This commit is contained in:
crschnick
2024-10-28 19:14:37 +00:00
parent fd29d31197
commit 69729088c8
4 changed files with 13 additions and 9 deletions

View File

@@ -199,11 +199,12 @@ public class StoreCreationComp extends DialogComp {
}
public static void showCreation(DataStore base, DataStoreCreationCategory category) {
var prov = base != null ? DataStoreProviders.byStore(base) : null;
show(
null,
base != null ? DataStoreProviders.byStore(base) : null,
prov,
base,
dataStoreProvider -> category.equals(dataStoreProvider.getCreationCategory()),
dataStoreProvider -> (category != null && category.equals(dataStoreProvider.getCreationCategory())) || dataStoreProvider.equals(prov),
(e, validated) -> {
try {
DataStorage.get().addStoreEntryIfNotPresent(e);
@@ -436,7 +437,7 @@ public class StoreCreationComp extends DialogComp {
private Region createLayout() {
var layout = new BorderPane();
layout.getStyleClass().add("store-creator");
var providerChoice = new StoreProviderChoiceComp(filter, provider, staticDisplay);
var providerChoice = new StoreProviderChoiceComp(filter, provider);
var showProviders = (!staticDisplay
&& (providerChoice.getProviders().size() > 1
|| providerChoice.getProviders().getFirst().showProviderChoice()))

View File

@@ -36,12 +36,16 @@ public class StoreEntryListComp extends SimpleComp {
StoreViewState.get().getActiveCategory().addListener((observable, oldValue, newValue) -> {
struc.get().setVvalue(0);
});
});
content.apply(struc -> {
// Reset scroll
AppLayoutModel.get().getSelected().addListener((observable, oldValue, newValue) -> {
struc.get().setVvalue(0);
});
// Reset scroll
StoreViewState.get().getFilterString().addListener((observable, oldValue, newValue) -> {
struc.get().setVvalue(0);
});
});
return content.styleClass("store-list-comp");
}

View File

@@ -27,7 +27,6 @@ public class StoreProviderChoiceComp extends Comp<CompStructure<ComboBox<DataSto
Predicate<DataStoreProvider> filter;
Property<DataStoreProvider> provider;
boolean staticDisplay;
public List<DataStoreProvider> getProviders() {
return DataStoreProviders.getAll().stream()
@@ -65,9 +64,7 @@ public class StoreProviderChoiceComp extends Comp<CompStructure<ComboBox<DataSto
return cellFactory.get();
});
cb.setButtonCell(cellFactory.get());
var l = getProviders().stream()
.filter(p -> p.getCreationCategory() != null || staticDisplay)
.toList();
var l = getProviders();
l.forEach(dataStoreProvider -> cb.getItems().add(dataStoreProvider));
if (provider.getValue() == null) {
provider.setValue(l.getFirst());

View File

@@ -400,3 +400,5 @@ virshHypervisor.displayDescription=Connect to a libvirt supported hypervisor dri
virshInstall.displayName=libvirt command-line client
virshInstall.displayDescription=Connect to all available libvirt hypervisors via virsh
addHypervisor=Add hypervisor
serialConsole=Serial console
interactiveTerminal=Interactive terminal