From 288d2cf3803059059e9be162f00320ee4f43eb42 Mon Sep 17 00:00:00 2001 From: crschnick Date: Wed, 19 Aug 2026 14:12:03 +0000 Subject: [PATCH] Rework --- .../xpipe/app/hub/entry/StoreEntryComp.java | 4 +++- .../app/hub/entry/StoreIconChoiceComp.java | 21 +++++++++++-------- .../app/secret/DataStorageAccessHandler.java | 2 ++ .../ext/base/identity/IdentitySelectComp.java | 7 ++++++- lang/strings/translations_en.properties | 8 +++++-- 5 files changed, 29 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/io/xpipe/app/hub/entry/StoreEntryComp.java b/app/src/main/java/io/xpipe/app/hub/entry/StoreEntryComp.java index b60dc54e6..b1d4feeb7 100644 --- a/app/src/main/java/io/xpipe/app/hub/entry/StoreEntryComp.java +++ b/app/src/main/java/io/xpipe/app/hub/entry/StoreEntryComp.java @@ -18,6 +18,7 @@ import io.xpipe.app.platform.*; import io.xpipe.app.prefs.AppPrefs; import io.xpipe.app.storage.DataStoreColor; import io.xpipe.app.storage.DataStoreEntry; +import io.xpipe.app.store.DataStoreCreationCategory; import io.xpipe.app.util.*; import javafx.beans.binding.Bindings; @@ -269,7 +270,8 @@ public abstract class StoreEntryComp extends SimpleRegionBuilder { protected BaseRegionBuilder createScopeIcon() { var button = new IconButtonComp("mdi2a-account"); button.style("user-icon"); - button.describe(d -> d.nameKey("restrictedConnection")); + var identity = getWrapper().getEntry().getProvider() != null && getWrapper().getEntry().getProvider().getCreationCategory() == DataStoreCreationCategory.IDENTITY; + button.describe(d -> d.nameKey(identity ? "restrictedIdentity" : "restrictedConnection")); button.apply(struc -> { AppFontSizes.base(struc); }); diff --git a/app/src/main/java/io/xpipe/app/hub/entry/StoreIconChoiceComp.java b/app/src/main/java/io/xpipe/app/hub/entry/StoreIconChoiceComp.java index a86f32b97..326f3dcc6 100644 --- a/app/src/main/java/io/xpipe/app/hub/entry/StoreIconChoiceComp.java +++ b/app/src/main/java/io/xpipe/app/hub/entry/StoreIconChoiceComp.java @@ -13,6 +13,7 @@ import io.xpipe.app.util.ThreadHelper; import javafx.beans.binding.Bindings; import javafx.beans.property.*; +import javafx.beans.value.ObservableBooleanValue; import javafx.geometry.Pos; import javafx.scene.control.*; import javafx.scene.input.MouseButton; @@ -70,19 +71,26 @@ public class StoreIconChoiceComp extends ModalOverlayContentComp { @Override protected Region createSimple() { + var empty = new SimpleBooleanProperty(true); + busy.subscribe(v -> { + if (empty.get() && SystemIconManager.hasLoadedAnyImages()) { + empty.set(false); + } + }); + var table = new TableView>(); table.visibleProperty().bind(PlatformThread.sync(busy.not())); initTable(table); filter.addListener((observable, oldValue, newValue) -> updateData(table, newValue)); busy.addListener((observable, oldValue, newValue) -> { - if (oldValue && !newValue) { + if (oldValue && !newValue && !empty.get()) { PlatformThread.runLaterIfNeeded(() -> { updateData(table, filter.getValue()); }); } }); - var loading = createLoadingPane(); + var loading = createLoadingPane(empty); var stack = new StackPane(); stack.getChildren().addAll(table, loading); @@ -118,12 +126,7 @@ public class StoreIconChoiceComp extends ModalOverlayContentComp { } } - private Region createLoadingPane() { - var empty = new SimpleBooleanProperty(!SystemIconManager.hasLoadedAnyImages()); - busy.addListener((observable, oldValue, newValue) -> { - empty.set(false); - }); - + private Region createLoadingPane(ObservableBooleanValue empty) { var refreshButton = new ButtonComp( Bindings.createStringBinding( () -> { @@ -149,7 +152,7 @@ public class StoreIconChoiceComp extends ModalOverlayContentComp { var text = new LabelComp(Bindings.createStringBinding( () -> { - return empty.get() + return empty.get() && !busy.get() ? AppI18n.get("refreshIconsIntroDescription") : AppI18n.get("refreshIconsDescription"); }, diff --git a/app/src/main/java/io/xpipe/app/secret/DataStorageAccessHandler.java b/app/src/main/java/io/xpipe/app/secret/DataStorageAccessHandler.java index 39908906f..1bee72623 100644 --- a/app/src/main/java/io/xpipe/app/secret/DataStorageAccessHandler.java +++ b/app/src/main/java/io/xpipe/app/secret/DataStorageAccessHandler.java @@ -28,6 +28,8 @@ public interface DataStorageAccessHandler { Optional getEncryptionPrincipal(UUID uuid); + Optional getEncryptionPrincipal(String name); + Set getCurrentEncryptionPrincipals(); Set getAllEncryptionPrincipals(); diff --git a/ext/base/src/main/java/io/xpipe/ext/base/identity/IdentitySelectComp.java b/ext/base/src/main/java/io/xpipe/ext/base/identity/IdentitySelectComp.java index 83ce996bf..3aab4ed68 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/identity/IdentitySelectComp.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/identity/IdentitySelectComp.java @@ -126,7 +126,12 @@ public class IdentitySelectComp extends RegionBuilder { return; } - StoreCreationDialog.showEdit(id.get(), id.get().getStore(), true, false, ignored -> {}); + StoreCreationDialog.showEdit(id.get(), id.get().getStore(), true, false, ignored -> { + PlatformThread.runLaterIfNeeded(() -> { + selectedReference.set(null); + selectedReference.set(id); + }); + }); } @Override diff --git a/lang/strings/translations_en.properties b/lang/strings/translations_en.properties index 9fb6f6172..5cb7478e3 100644 --- a/lang/strings/translations_en.properties +++ b/lang/strings/translations_en.properties @@ -19,7 +19,9 @@ addScript=Script ... addHost=Remote Host ... addShell=Shell Environment ... addCommand=Command ... -addAutomatically=Search automatically ... +#force +#context: Verb, to find what is available +addAutomatically=Find available ... addOther=Other ... connectionAdd=Add connection connectionEdit=Edit connection @@ -106,7 +108,8 @@ saveDirectoryTitle=Save directory unknown=Unknown scanAlertTitle=Add connections scanAlertChoiceHeader=Target -scanAlertChoiceHeaderDescription=The system to search for available connections +#force +scanAlertChoiceHeaderDescription=The system to search for available subconnections scanAlertHeader=Connection types scanAlertHeaderDescription=Select connection types you want to add for the system noInformationAvailable=No information available @@ -1262,6 +1265,7 @@ openApiDocs=API documentation openApiDocsDescription=The HTTP API documentation is available online, including an OpenAPI .yaml specification. You can open it in your web browser or your preferred HTTP client. openApiDocsButton=Open docs pythonApi=Python API +restrictedIdentity=This identity and associated connections are access restricted and not available to all users restrictedConnection=This connection and all its children are access restricted and not available to all users developerPrintInitFiles=Print init file execution developerPrintInitFilesDescription=Print all shell init scripts that are run when a terminal is launched.