From 7fc7e6a0969e67e26c8adc4bbbc56bcfc948bf16 Mon Sep 17 00:00:00 2001 From: crschnick Date: Tue, 26 Aug 2025 15:34:58 +0000 Subject: [PATCH] Reformat --- .../BrowserFileChooserSessionComp.java | 8 ++++--- .../browser/file/BrowserFileListNameCell.java | 6 +++-- .../file/BrowserFileSystemTabComp.java | 18 +++++--------- .../file/BrowserFileSystemTabModel.java | 6 +++-- .../file/BrowserFileTransferOperation.java | 12 ++-------- .../file/BrowserQuickAccessContextMenu.java | 1 - .../menu/impl/compress/TarActionProvider.java | 4 +--- .../ContextualFileReferenceChoiceComp.java | 5 ++-- .../app/comp/base/IntegratedTextAreaComp.java | 1 - .../java/io/xpipe/app/ext/FileSystem.java | 4 ++-- .../io/xpipe/app/ext/HostAddressChoice.java | 6 +++-- .../hub/action/impl/CloneHubLeafProvider.java | 2 -- .../io/xpipe/app/hub/comp/OsLogoComp.java | 2 +- .../app/hub/comp/StoreCategoryConfigComp.java | 6 ----- .../xpipe/app/hub/comp/StoreEntryWrapper.java | 8 +++++-- .../java/io/xpipe/app/prefs/AppPrefs.java | 6 ++--- .../xpipe/app/prefs/FileBrowserCategory.java | 3 +-- .../io/xpipe/app/prefs/IconsCategory.java | 2 +- .../app/pwman/BitwardenPasswordManager.java | 23 +++++++++++------- .../app/pwman/EnpassPasswordManager.java | 5 +++- .../io/xpipe/app/storage/DataStoreColor.java | 2 +- .../xpipe/app/terminal/TerminalLauncher.java | 4 +--- .../app/terminal/WindowsTerminalType.java | 24 ++++++++++++------- .../io/xpipe/app/util/ScanDialogBase.java | 1 - .../java/io/xpipe/app/util/ShellTemp.java | 5 +++- .../base/identity/ssh/KeyFileStrategy.java | 5 +++- .../ext/base/script/SimpleScriptStore.java | 3 ++- 27 files changed, 88 insertions(+), 84 deletions(-) diff --git a/app/src/main/java/io/xpipe/app/browser/BrowserFileChooserSessionComp.java b/app/src/main/java/io/xpipe/app/browser/BrowserFileChooserSessionComp.java index 77ddacaff..90e3ae960 100644 --- a/app/src/main/java/io/xpipe/app/browser/BrowserFileChooserSessionComp.java +++ b/app/src/main/java/io/xpipe/app/browser/BrowserFileChooserSessionComp.java @@ -55,8 +55,9 @@ public class BrowserFileChooserSessionComp extends ModalOverlayContentComp { model.setOnFinish(fileStores -> { file.accept(fileStores.size() > 0 ? fileStores.getFirst() : null); }); - var comp = - new BrowserFileChooserSessionComp(model, filter).styleClass("browser").styleClass("chooser"); + var comp = new BrowserFileChooserSessionComp(model, filter) + .styleClass("browser") + .styleClass("chooser"); var selection = new SimpleStringProperty(); model.getFileSelection().addListener((ListChangeListener) c -> { selection.set( @@ -90,7 +91,8 @@ public class BrowserFileChooserSessionComp extends ModalOverlayContentComp { protected Region createSimple() { Predicate applicable = storeEntryWrapper -> { return (storeEntryWrapper.getEntry().getStore() instanceof ShellStore) - && storeEntryWrapper.getEntry().getValidity().isUsable() && filter.test(storeEntryWrapper.getEntry()); + && storeEntryWrapper.getEntry().getValidity().isUsable() + && filter.test(storeEntryWrapper.getEntry()); }; BiConsumer action = (w, busy) -> { ThreadHelper.runFailableAsync(() -> { diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListNameCell.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListNameCell.java index b1d3149c9..699211d36 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListNameCell.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListNameCell.java @@ -116,8 +116,10 @@ class BrowserFileListNameCell extends TableCell { if (!typedSelection.get().isEmpty()) { var selection = typedSelection.get() + " "; - var found = fileList.getShown().getValue().stream().filter( - browserEntry -> browserEntry.getFileName().toLowerCase().startsWith(selection)).findFirst(); + var found = fileList.getShown().getValue().stream() + .filter(browserEntry -> + browserEntry.getFileName().toLowerCase().startsWith(selection)) + .findFirst(); // Ugly fix to prevent space from showing the menu when there is a file matching // Due to the table view input map, these events always get sent and consumed, not allowing us to // differentiate between these cases diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileSystemTabComp.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileSystemTabComp.java index c559c63d0..3cc2395c6 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileSystemTabComp.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileSystemTabComp.java @@ -14,10 +14,8 @@ import io.xpipe.app.util.InputHelper; import io.xpipe.app.util.PlatformThread; import io.xpipe.core.FilePath; -import javafx.application.Platform; import javafx.beans.binding.Bindings; import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.value.ObservableValue; import javafx.geometry.Pos; import javafx.scene.control.Button; import javafx.scene.control.MenuButton; @@ -229,19 +227,15 @@ public class BrowserFileSystemTabComp extends SimpleComp { // Not perfect, but covers most of the cases of small directories var showOverview = new SimpleBooleanProperty(true); model.getCurrentPath().subscribe(path -> { - GlobalTimer.delay(() -> { - showOverview.setValue(path == null); - }, Duration.ofMillis(250)); + GlobalTimer.delay( + () -> { + showOverview.setValue(path == null); + }, + Duration.ofMillis(250)); }); var home = new BrowserOverviewComp(model).styleClass("browser-overview"); - var stack = new MultiContentComp( - Map.of( - home, - showOverview, - fileList, - showOverview.not()), - false); + var stack = new MultiContentComp(Map.of(home, showOverview, fileList, showOverview.not()), false); var r = stack.styleClass("browser-content-container").createRegion(); r.focusedProperty().addListener((observable, oldValue, newValue) -> { if (newValue) { diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileSystemTabModel.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileSystemTabModel.java index d2a0f9e64..8cb3225e6 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileSystemTabModel.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileSystemTabModel.java @@ -29,8 +29,8 @@ import javafx.beans.property.*; import javafx.beans.value.ObservableValue; import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import javafx.scene.control.SelectionMode; + import lombok.Getter; import lombok.NonNull; @@ -236,7 +236,9 @@ public final class BrowserFileSystemTabModel extends BrowserStoreSessionTab o.getPath().equals(fe.resolved().getPath()))) { + if (fe.getKind() == FileKind.LINK + && entries.stream() + .anyMatch(o -> o.getPath().equals(fe.resolved().getPath()))) { all.add(fe); } } diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileTransferOperation.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileTransferOperation.java index 9b9af80cf..0ac8094c8 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileTransferOperation.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileTransferOperation.java @@ -312,11 +312,7 @@ public class BrowserFileTransferOperation { return false; } - var rel = fileEntry - .getPath() - .relativize(baseRelative) - .toUnix() - .toString(); + var rel = fileEntry.getPath().relativize(baseRelative).toUnix().toString(); flatFiles.put(fileEntry, rel); if (fileEntry.getKind() == FileKind.FILE) { // This one is up-to-date and does not need to be recalculated @@ -333,11 +329,7 @@ public class BrowserFileTransferOperation { return; } - var rel = fileEntry - .getPath() - .relativize(baseRelative) - .toUnix() - .toString(); + var rel = fileEntry.getPath().relativize(baseRelative).toUnix().toString(); flatFiles.put(fileEntry, rel); if (fileEntry.getKind() == FileKind.FILE) { // This one is up-to-date and does not need to be recalculated diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserQuickAccessContextMenu.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserQuickAccessContextMenu.java index 9402712ca..8a1a74e7a 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserQuickAccessContextMenu.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserQuickAccessContextMenu.java @@ -12,7 +12,6 @@ import io.xpipe.core.FileKind; import javafx.application.Platform; import javafx.beans.property.SimpleBooleanProperty; -import javafx.collections.ObservableList; import javafx.geometry.Side; import javafx.scene.Node; import javafx.scene.control.ContextMenu; diff --git a/app/src/main/java/io/xpipe/app/browser/menu/impl/compress/TarActionProvider.java b/app/src/main/java/io/xpipe/app/browser/menu/impl/compress/TarActionProvider.java index 0271d34bf..1a7edb8fe 100644 --- a/app/src/main/java/io/xpipe/app/browser/menu/impl/compress/TarActionProvider.java +++ b/app/src/main/java/io/xpipe/app/browser/menu/impl/compress/TarActionProvider.java @@ -32,9 +32,7 @@ public class TarActionProvider implements BrowserActionProvider { public void executeImpl() throws Exception { var sc = model.getFileSystem().getShell().orElseThrow(); var args = "c" + (gz ? "z" : "") + "f"; - var tar = CommandBuilder.of() - .add("tar", args) - .addFile(target); + var tar = CommandBuilder.of().add("tar", args).addFile(target); var base = model.getCurrentDirectory().getPath(); if (directoryContentOnly) { diff --git a/app/src/main/java/io/xpipe/app/comp/base/ContextualFileReferenceChoiceComp.java b/app/src/main/java/io/xpipe/app/comp/base/ContextualFileReferenceChoiceComp.java index a4facd8f7..154d119e3 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/ContextualFileReferenceChoiceComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/ContextualFileReferenceChoiceComp.java @@ -8,7 +8,6 @@ import io.xpipe.app.core.AppLayoutModel; import io.xpipe.app.core.window.AppDialog; import io.xpipe.app.ext.FileSystemStore; import io.xpipe.app.ext.ProcessControlProvider; -import io.xpipe.app.hub.comp.StoreEntryWrapper; import io.xpipe.app.issue.ErrorEventFactory; import io.xpipe.app.prefs.AppPrefs; import io.xpipe.app.storage.ContextualFileReference; @@ -55,8 +54,8 @@ public class ContextualFileReferenceChoiceComp extends Comp> Property> fileSystem, Property filePath, ContextualFileReferenceSync sync, - List previousFileReferences, Predicate filter - ) { + List previousFileReferences, + Predicate filter) { this.sync = sync; this.previousFileReferences = previousFileReferences; this.filter = filter; diff --git a/app/src/main/java/io/xpipe/app/comp/base/IntegratedTextAreaComp.java b/app/src/main/java/io/xpipe/app/comp/base/IntegratedTextAreaComp.java index 2b79ace55..b6b3f854c 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/IntegratedTextAreaComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/IntegratedTextAreaComp.java @@ -5,7 +5,6 @@ import io.xpipe.app.comp.CompStructure; import io.xpipe.app.ext.ShellStore; import io.xpipe.app.ext.StatefulDataStore; import io.xpipe.app.process.ShellScript; -import io.xpipe.app.process.ShellStoreState; import io.xpipe.app.process.SystemState; import io.xpipe.app.storage.DataStoreEntryRef; import io.xpipe.app.util.FileOpener; diff --git a/app/src/main/java/io/xpipe/app/ext/FileSystem.java b/app/src/main/java/io/xpipe/app/ext/FileSystem.java index fe1ea7d54..af95756a0 100644 --- a/app/src/main/java/io/xpipe/app/ext/FileSystem.java +++ b/app/src/main/java/io/xpipe/app/ext/FileSystem.java @@ -10,7 +10,6 @@ import java.io.OutputStream; import java.util.ArrayList; import java.util.List; import java.util.Optional; -import java.util.function.Consumer; import java.util.function.Predicate; import java.util.stream.Stream; @@ -58,7 +57,8 @@ public interface FileSystem extends Closeable, AutoCloseable { return all; } - default void traverseFilesRecursively(FileSystem system, FilePath file, Predicate visitor) throws Exception { + default void traverseFilesRecursively(FileSystem system, FilePath file, Predicate visitor) + throws Exception { List base; try (var filesStream = listFiles(system, file)) { base = filesStream.toList(); diff --git a/app/src/main/java/io/xpipe/app/ext/HostAddressChoice.java b/app/src/main/java/io/xpipe/app/ext/HostAddressChoice.java index 3c3306926..268f020f7 100644 --- a/app/src/main/java/io/xpipe/app/ext/HostAddressChoice.java +++ b/app/src/main/java/io/xpipe/app/ext/HostAddressChoice.java @@ -4,8 +4,8 @@ import io.xpipe.app.util.OptionsBuilder; import javafx.beans.property.*; import javafx.collections.FXCollections; - import javafx.collections.ListChangeListener; + import lombok.Builder; import lombok.Value; @@ -35,7 +35,9 @@ public class HostAddressChoice { } else { options.name(translationKey); } - options.addComp(new HostAddressChoiceComp(val, list, allowMutation)).addProperty(val).addProperty(sizeProp); + options.addComp(new HostAddressChoiceComp(val, list, allowMutation)) + .addProperty(val) + .addProperty(sizeProp); options.bind( () -> { var fullList = new ArrayList<>(list); diff --git a/app/src/main/java/io/xpipe/app/hub/action/impl/CloneHubLeafProvider.java b/app/src/main/java/io/xpipe/app/hub/action/impl/CloneHubLeafProvider.java index 7f8ad2678..955a5b33c 100644 --- a/app/src/main/java/io/xpipe/app/hub/action/impl/CloneHubLeafProvider.java +++ b/app/src/main/java/io/xpipe/app/hub/action/impl/CloneHubLeafProvider.java @@ -49,8 +49,6 @@ public class CloneHubLeafProvider implements HubLeafProvider { return "cloneStore"; } - - @Jacksonized @SuperBuilder public static class Action extends StoreAction { diff --git a/app/src/main/java/io/xpipe/app/hub/comp/OsLogoComp.java b/app/src/main/java/io/xpipe/app/hub/comp/OsLogoComp.java index 600677978..f4546b999 100644 --- a/app/src/main/java/io/xpipe/app/hub/comp/OsLogoComp.java +++ b/app/src/main/java/io/xpipe/app/hub/comp/OsLogoComp.java @@ -6,8 +6,8 @@ import io.xpipe.app.comp.base.StackComp; import io.xpipe.app.core.AppResources; import io.xpipe.app.process.SystemState; import io.xpipe.core.FilePath; - import io.xpipe.core.OsType; + import javafx.beans.binding.Bindings; import javafx.beans.value.ObservableValue; import javafx.scene.layout.Region; diff --git a/app/src/main/java/io/xpipe/app/hub/comp/StoreCategoryConfigComp.java b/app/src/main/java/io/xpipe/app/hub/comp/StoreCategoryConfigComp.java index 2e0d8ba9f..bb23cbdb2 100644 --- a/app/src/main/java/io/xpipe/app/hub/comp/StoreCategoryConfigComp.java +++ b/app/src/main/java/io/xpipe/app/hub/comp/StoreCategoryConfigComp.java @@ -5,7 +5,6 @@ import io.xpipe.app.comp.base.ChoiceComp; import io.xpipe.app.comp.base.ModalButton; import io.xpipe.app.comp.base.ModalOverlay; import io.xpipe.app.core.AppI18n; -import io.xpipe.app.core.AppTheme; import io.xpipe.app.ext.DataStore; import io.xpipe.app.storage.DataStorage; import io.xpipe.app.storage.DataStoreCategoryConfig; @@ -14,19 +13,14 @@ import io.xpipe.app.storage.DataStoreEntry; import io.xpipe.app.util.OptionsBuilder; import javafx.beans.property.Property; -import javafx.beans.property.SimpleIntegerProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.beans.value.ObservableValue; import javafx.scene.control.ListCell; import javafx.scene.control.ScrollPane; import javafx.scene.layout.Region; -import javafx.scene.layout.StackPane; -import javafx.scene.paint.Color; -import javafx.scene.shape.Rectangle; import lombok.AllArgsConstructor; -import java.util.Arrays; import java.util.LinkedHashMap; import java.util.function.Supplier; diff --git a/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryWrapper.java b/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryWrapper.java index ce469683d..09a1a02d6 100644 --- a/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryWrapper.java +++ b/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryWrapper.java @@ -211,7 +211,9 @@ public class StoreEntryWrapper { if (storeChanged || !information.isBound()) { information.unbind(); shownInformation.unbind(); - if (entry.getValidity().isUsable() || (entry.getValidity() != DataStoreEntry.Validity.LOAD_FAILED && entry.getProvider().showIncompleteInfo())) { + if (entry.getValidity().isUsable() + || (entry.getValidity() != DataStoreEntry.Validity.LOAD_FAILED + && entry.getProvider().showIncompleteInfo())) { var section = StoreViewState.get().getSectionForWrapper(this); if (section.isPresent()) { try { @@ -220,7 +222,9 @@ public class StoreEntryWrapper { shownInformation.bind(Bindings.createStringBinding( () -> { // Might have changed validity meanwhile - var showInfo = entry.getValidity().isUsable() || (entry.getValidity() != DataStoreEntry.Validity.LOAD_FAILED && entry.getProvider().showIncompleteInfo()); + var showInfo = entry.getValidity().isUsable() + || (entry.getValidity() != DataStoreEntry.Validity.LOAD_FAILED + && entry.getProvider().showIncompleteInfo()); if (!showInfo) { return null; } diff --git a/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java b/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java index 8990e20c4..304695560 100644 --- a/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java +++ b/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java @@ -666,9 +666,9 @@ public final class AppPrefs { if (OsType.getLocal() == OsType.MACOS && AppProperties.get() - .getCanonicalVersion() - .map(appVersion -> appVersion.getMajor() == 18) - .orElse(false)) { + .getCanonicalVersion() + .map(appVersion -> appVersion.getMajor() == 18) + .orElse(false)) { useSystemFont.set(false); } diff --git a/app/src/main/java/io/xpipe/app/prefs/FileBrowserCategory.java b/app/src/main/java/io/xpipe/app/prefs/FileBrowserCategory.java index 61606eeb5..60fc68553 100644 --- a/app/src/main/java/io/xpipe/app/prefs/FileBrowserCategory.java +++ b/app/src/main/java/io/xpipe/app/prefs/FileBrowserCategory.java @@ -3,7 +3,6 @@ package io.xpipe.app.prefs; import io.xpipe.app.comp.Comp; import io.xpipe.app.comp.base.ContextualFileReferenceChoiceComp; import io.xpipe.app.storage.DataStorage; -import io.xpipe.app.storage.DataStoreEntry; import io.xpipe.app.util.LabelGraphic; import io.xpipe.app.util.OptionsBuilder; @@ -42,7 +41,7 @@ public class FileBrowserCategory extends AppPrefsCategory { prefs.downloadsDirectory, null, List.of(), - e -> e.equals(DataStorage.get().local())) + e -> e.equals(DataStorage.get().local())) .maxWidth(getCompWidth()), prefs.downloadsDirectory) .pref(prefs.pinLocalMachineOnStartup) diff --git a/app/src/main/java/io/xpipe/app/prefs/IconsCategory.java b/app/src/main/java/io/xpipe/app/prefs/IconsCategory.java index ba5534c5a..12bb7118b 100644 --- a/app/src/main/java/io/xpipe/app/prefs/IconsCategory.java +++ b/app/src/main/java/io/xpipe/app/prefs/IconsCategory.java @@ -122,7 +122,7 @@ public class IconsCategory extends AppPrefsCategory { dir, null, List.of(), - en -> en.equals(DataStorage.get().local())) + en -> en.equals(DataStorage.get().local())) .prefWidth(350)); modal.withDefaultButtons(() -> { if (dir.get() == null) { diff --git a/app/src/main/java/io/xpipe/app/pwman/BitwardenPasswordManager.java b/app/src/main/java/io/xpipe/app/pwman/BitwardenPasswordManager.java index e05319bb8..0444eb525 100644 --- a/app/src/main/java/io/xpipe/app/pwman/BitwardenPasswordManager.java +++ b/app/src/main/java/io/xpipe/app/pwman/BitwardenPasswordManager.java @@ -10,11 +10,9 @@ import io.xpipe.app.terminal.TerminalLaunch; import io.xpipe.app.util.*; import io.xpipe.core.InPlaceSecretValue; import io.xpipe.core.JacksonMapper; - -import com.fasterxml.jackson.annotation.JsonTypeName; import io.xpipe.core.OsType; -import java.nio.file.Files; +import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeName("bitwarden") public class BitwardenPasswordManager implements PasswordManager { @@ -28,7 +26,10 @@ public class BitwardenPasswordManager implements PasswordManager { if (moveAppDir()) { SHELL.view().unsetEnvironmentVariable("BW_SESSION"); - SHELL.view().setEnvironmentVariable("BITWARDENCLI_APPDATA_DIR", AppCache.getBasePath().toString()); + SHELL.view() + .setEnvironmentVariable( + "BITWARDENCLI_APPDATA_DIR", + AppCache.getBasePath().toString()); } } SHELL.start(); @@ -37,7 +38,9 @@ public class BitwardenPasswordManager implements PasswordManager { private static boolean moveAppDir() throws Exception { var path = SHELL.view().findProgram("bw"); - return OsType.getLocal() != OsType.LINUX || path.isEmpty() || !path.get().toString().contains("snap"); + return OsType.getLocal() != OsType.LINUX + || path.isEmpty() + || !path.get().toString().contains("snap"); } @Override @@ -58,10 +61,12 @@ public class BitwardenPasswordManager implements PasswordManager { // Check for data file as bw seemingly breaks if it doesn't exist yet if (r[1].contains("You are not logged in")) { var script = ShellScript.lines( - moveAppDir() ? LocalShell.getDialect() - .getSetEnvironmentVariableCommand( - "BITWARDENCLI_APPDATA_DIR", - AppCache.getBasePath().toString()) : null, + moveAppDir() + ? LocalShell.getDialect() + .getSetEnvironmentVariableCommand( + "BITWARDENCLI_APPDATA_DIR", + AppCache.getBasePath().toString()) + : null, sc.getShellDialect().getEchoCommand("Log in into your Bitwarden account from the CLI:", false), "bw login --quiet", sc.getShellDialect() diff --git a/app/src/main/java/io/xpipe/app/pwman/EnpassPasswordManager.java b/app/src/main/java/io/xpipe/app/pwman/EnpassPasswordManager.java index b056f1517..b20dee556 100644 --- a/app/src/main/java/io/xpipe/app/pwman/EnpassPasswordManager.java +++ b/app/src/main/java/io/xpipe/app/pwman/EnpassPasswordManager.java @@ -52,7 +52,10 @@ public class EnpassPasswordManager implements PasswordManager { public static OptionsBuilder createOptions(Property p) { var prop = new SimpleObjectProperty<>(p.getValue().getVaultPath()); var comp = new ContextualFileReferenceChoiceComp( - new SimpleObjectProperty<>(DataStorage.get().local().ref()), prop, null, List.of(), + new SimpleObjectProperty<>(DataStorage.get().local().ref()), + prop, + null, + List.of(), e -> e.equals(DataStorage.get().local())); comp.apply(struc -> { var text = (TextField) struc.get().getChildren().getFirst(); diff --git a/app/src/main/java/io/xpipe/app/storage/DataStoreColor.java b/app/src/main/java/io/xpipe/app/storage/DataStoreColor.java index 114380b18..736c58ecc 100644 --- a/app/src/main/java/io/xpipe/app/storage/DataStoreColor.java +++ b/app/src/main/java/io/xpipe/app/storage/DataStoreColor.java @@ -4,9 +4,9 @@ import javafx.scene.Node; import javafx.scene.layout.Region; import javafx.scene.layout.StackPane; import javafx.scene.paint.Color; +import javafx.scene.shape.Rectangle; import com.fasterxml.jackson.annotation.JsonProperty; -import javafx.scene.shape.Rectangle; import lombok.Getter; import java.util.ArrayList; diff --git a/app/src/main/java/io/xpipe/app/terminal/TerminalLauncher.java b/app/src/main/java/io/xpipe/app/terminal/TerminalLauncher.java index b8f748042..9f2915fe9 100644 --- a/app/src/main/java/io/xpipe/app/terminal/TerminalLauncher.java +++ b/app/src/main/java/io/xpipe/app/terminal/TerminalLauncher.java @@ -198,9 +198,7 @@ public class TerminalLauncher { .add("terminal-register", "--request", request.toString()) .buildFull(LocalShell.getShell()); var bellLine = "printf \"\\a\""; - var lines = ShellScript.lines( - registerLine, - OsType.getLocal() != OsType.WINDOWS ? bellLine : null); + var lines = ShellScript.lines(registerLine, OsType.getLocal() != OsType.WINDOWS ? bellLine : null); return lines.toString(); } diff --git a/app/src/main/java/io/xpipe/app/terminal/WindowsTerminalType.java b/app/src/main/java/io/xpipe/app/terminal/WindowsTerminalType.java index d2299ee16..e57475b97 100644 --- a/app/src/main/java/io/xpipe/app/terminal/WindowsTerminalType.java +++ b/app/src/main/java/io/xpipe/app/terminal/WindowsTerminalType.java @@ -51,7 +51,10 @@ public interface WindowsTerminalType extends ExternalTerminalType, TrackableTerm var spaces = configuration.getScriptFile().toString().contains(" "); cmd.add(configuration .getScriptDialect() - .getOpenScriptCommand(spaces ? configuration.getScriptFile().getFileName() : configuration.getScriptFile().toString())); + .getOpenScriptCommand( + spaces + ? configuration.getScriptFile().getFileName() + : configuration.getScriptFile().toString())); return cmd; } @@ -138,11 +141,13 @@ public interface WindowsTerminalType extends ExternalTerminalType, TrackableTerm if (spaces) { var wd = sc.view().pwd(); - sc.command(CommandBuilder.of().addFile(exec).add(toCommand(configuration))).withWorkingDirectory( - configuration.getScriptFile().getParent()).execute(); + sc.command(CommandBuilder.of().addFile(exec).add(toCommand(configuration))) + .withWorkingDirectory(configuration.getScriptFile().getParent()) + .execute(); sc.view().cd(wd); } else { - sc.command(CommandBuilder.of().addFile(exec).add(toCommand(configuration))).execute(); + sc.command(CommandBuilder.of().addFile(exec).add(toCommand(configuration))) + .execute(); } } } @@ -197,7 +202,8 @@ public interface WindowsTerminalType extends ExternalTerminalType, TrackableTerm .execute(); sc.view().cd(wd); } else { - sc.command(CommandBuilder.of().addFile(exec).add(toCommand(configuration))).execute(); + sc.command(CommandBuilder.of().addFile(exec).add(toCommand(configuration))) + .execute(); } } } @@ -248,11 +254,13 @@ public interface WindowsTerminalType extends ExternalTerminalType, TrackableTerm if (spaces) { var wd = sc.view().pwd(); - sc.command(CommandBuilder.of().addFile(exec).add(toCommand(configuration))).withWorkingDirectory( - configuration.getScriptFile().getParent()).execute(); + sc.command(CommandBuilder.of().addFile(exec).add(toCommand(configuration))) + .withWorkingDirectory(configuration.getScriptFile().getParent()) + .execute(); sc.view().cd(wd); } else { - sc.command(CommandBuilder.of().addFile(exec).add(toCommand(configuration))).execute(); + sc.command(CommandBuilder.of().addFile(exec).add(toCommand(configuration))) + .execute(); } } } diff --git a/app/src/main/java/io/xpipe/app/util/ScanDialogBase.java b/app/src/main/java/io/xpipe/app/util/ScanDialogBase.java index 9aaf2abd6..71f933482 100644 --- a/app/src/main/java/io/xpipe/app/util/ScanDialogBase.java +++ b/app/src/main/java/io/xpipe/app/util/ScanDialogBase.java @@ -12,7 +12,6 @@ import io.xpipe.app.storage.DataStoreEntryRef; import javafx.beans.binding.Bindings; import javafx.beans.property.*; -import javafx.beans.value.ObservableBooleanValue; import javafx.collections.FXCollections; import javafx.collections.ListChangeListener; import javafx.collections.ObservableList; diff --git a/app/src/main/java/io/xpipe/app/util/ShellTemp.java b/app/src/main/java/io/xpipe/app/util/ShellTemp.java index 73153d3df..4be50921e 100644 --- a/app/src/main/java/io/xpipe/app/util/ShellTemp.java +++ b/app/src/main/java/io/xpipe/app/util/ShellTemp.java @@ -101,7 +101,10 @@ public class ShellTemp { "-Force")) .executeAndCheck(); } else { - sc.command(CommandBuilder.of().add("rm", "-f").add("\"" + prefix.toString() + "\"*").add("2>/dev/null")) + sc.command(CommandBuilder.of() + .add("rm", "-f") + .add("\"" + prefix.toString() + "\"*") + .add("2>/dev/null")) .executeAndCheck(); } } diff --git a/ext/base/src/main/java/io/xpipe/ext/base/identity/ssh/KeyFileStrategy.java b/ext/base/src/main/java/io/xpipe/ext/base/identity/ssh/KeyFileStrategy.java index 3d53c0834..0af18b3b6 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/identity/ssh/KeyFileStrategy.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/identity/ssh/KeyFileStrategy.java @@ -71,7 +71,10 @@ public class KeyFileStrategy implements SshIdentityStrategy { .description("locationDescription") .addComp( new ContextualFileReferenceChoiceComp( - config.getProxy(), keyPath, config.isAllowKeyFileSync() ? sync : null, List.of(), + config.getProxy(), + keyPath, + config.isAllowKeyFileSync() ? sync : null, + List.of(), e -> e.equals(DataStorage.get().local())), keyPath) .nonNull() diff --git a/ext/base/src/main/java/io/xpipe/ext/base/script/SimpleScriptStore.java b/ext/base/src/main/java/io/xpipe/ext/base/script/SimpleScriptStore.java index b97eef086..a6b4242c1 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/script/SimpleScriptStore.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/script/SimpleScriptStore.java @@ -60,7 +60,8 @@ public class SimpleScriptStore extends ScriptStore implements SelfReferentialSto shellControl.getShellDialect().getNewLine().getNewLineString())); var targetType = shellControl.getOriginalShellDialect(); var script = ScriptHelper.createExecScript(targetType, shellControl, fixedCommands); - return targetType.sourceScriptCommand(shellControl, script.toString()) + " " + targetType.getCatchAllVariable(); + return targetType.sourceScriptCommand(shellControl, script.toString()) + " " + + targetType.getCatchAllVariable(); } return null;