mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-04-23 08:00:56 -04:00
Various fixes
This commit is contained in:
@@ -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()))
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user