From 692592d0efbc1a003a4ac9bc68710a86fed073dc Mon Sep 17 00:00:00 2001 From: crschnick Date: Tue, 15 Jul 2025 21:09:27 +0000 Subject: [PATCH] Cleanup --- .../xpipe/app/action/ActionJacksonMapper.java | 16 +++--- .../java/io/xpipe/app/action/ActionUrls.java | 6 +-- .../xpipe/app/action/SerializableAction.java | 17 ++++-- .../app/browser/BrowserFullSessionModel.java | 1 - .../app/browser/action/BrowserAction.java | 8 +-- .../RunCommandInBrowserActionProvider.java | 2 +- .../browser/file/BrowserFileListNameCell.java | 4 +- .../app/browser/file/BrowserFileOpener.java | 4 +- .../file/BrowserFileSystemTabComp.java | 8 +-- .../file/BrowserFileSystemTabModel.java | 1 - .../file/BrowserFileTransferOperation.java | 3 +- .../browser/menu/BrowserMenuLeafProvider.java | 2 +- .../menu/MultiExecuteMenuProvider.java | 13 +++-- .../browser/menu/impl/BackMenuProvider.java | 2 +- .../menu/impl/ForwardMenuProvider.java | 2 +- .../browser/menu/impl/JavapMenuProvider.java | 12 +++-- .../impl/RefreshDirectoryMenuProvider.java | 2 +- .../io/xpipe/app/comp/base/AppLayoutComp.java | 10 ++-- .../xpipe/app/comp/base/ModalOverlayComp.java | 16 +++--- .../io/xpipe/app/comp/base/OptionsComp.java | 1 - .../main/java/io/xpipe/app/core/AppFont.java | 1 - .../java/io/xpipe/app/core/AppInstance.java | 7 ++- .../main/java/io/xpipe/app/core/AppTheme.java | 4 +- .../app/core/check/AppGnomeScaleDialog.java | 15 ++++-- .../io/xpipe/app/ext/DataStoreProviders.java | 4 +- .../java/io/xpipe/app/ext/ShellSession.java | 3 +- .../app/hub/comp/StoreCreationModel.java | 6 ++- .../xpipe/app/hub/comp/StoreEntryWrapper.java | 3 +- .../java/io/xpipe/app/prefs/AppPrefs.java | 4 +- .../app/prefs/AppPrefsStorageHandler.java | 1 - .../io/xpipe/app/prefs/LinksCategory.java | 6 +-- .../xpipe/app/prefs/TroubleshootCategory.java | 34 +++++++----- .../java/io/xpipe/app/process/ShellView.java | 4 +- .../xpipe/app/storage/DataStoreCategory.java | 2 +- .../io/xpipe/app/storage/DataStoreEntry.java | 5 +- .../io/xpipe/app/storage/StandardStorage.java | 14 ++--- .../app/terminal/GhosttyTerminalType.java | 10 ---- .../terminal/TerminalLaunchConfiguration.java | 52 ++++++++++++------- .../xpipe/app/terminal/TerminalLauncher.java | 8 ++- .../io/xpipe/app/update/AppDownloads.java | 4 +- .../io/xpipe/app/util/DesktopShortcuts.java | 6 ++- .../io/xpipe/app/util/DocumentationLink.java | 3 +- .../java/io/xpipe/app/util/GlobalTimer.java | 1 - app/src/main/java/module-info.java | 6 ++- .../java/io/xpipe/beacon/BeaconServer.java | 5 +- lang/strings/translations_en.properties | 2 +- 46 files changed, 194 insertions(+), 146 deletions(-) diff --git a/app/src/main/java/io/xpipe/app/action/ActionJacksonMapper.java b/app/src/main/java/io/xpipe/app/action/ActionJacksonMapper.java index 613303826..03c0e0205 100644 --- a/app/src/main/java/io/xpipe/app/action/ActionJacksonMapper.java +++ b/app/src/main/java/io/xpipe/app/action/ActionJacksonMapper.java @@ -1,19 +1,17 @@ package io.xpipe.app.action; -import io.xpipe.app.browser.action.BrowserAction; -import io.xpipe.app.browser.action.BrowserActionProvider; import io.xpipe.app.ext.DataStore; import io.xpipe.app.hub.action.*; import io.xpipe.app.issue.ErrorEventFactory; import io.xpipe.app.storage.DataStorage; import io.xpipe.core.JacksonMapper; +import io.xpipe.core.UuidHelper; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; -import io.xpipe.core.UuidHelper; import java.util.ArrayList; @@ -98,14 +96,18 @@ public class ActionJacksonMapper { "Store " + DataStorage.get().getStorePath(entry.get()) + " is incomplete")); } - if (provider instanceof HubLeafProvider l && - (!l.getApplicableClass().isAssignableFrom(entry.get().getStore().getClass()) || !l.isApplicable(entry.get().ref()))) { + if (provider instanceof HubLeafProvider l + && (!l.getApplicableClass() + .isAssignableFrom(entry.get().getStore().getClass()) + || !l.isApplicable(entry.get().ref()))) { throw ErrorEventFactory.expected(new IllegalArgumentException( "Store " + DataStorage.get().getStorePath(entry.get()) + " is not applicable for action type")); } - if (provider instanceof BatchHubProvider h && - (!h.getApplicableClass().isAssignableFrom(entry.get().getStore().getClass()) || !h.isApplicable(entry.get().ref()))) { + if (provider instanceof BatchHubProvider h + && (!h.getApplicableClass() + .isAssignableFrom(entry.get().getStore().getClass()) + || !h.isApplicable(entry.get().ref()))) { throw ErrorEventFactory.expected(new IllegalArgumentException( "Store " + DataStorage.get().getStorePath(entry.get()) + " is not applicable for action type")); } diff --git a/app/src/main/java/io/xpipe/app/action/ActionUrls.java b/app/src/main/java/io/xpipe/app/action/ActionUrls.java index b08931970..57b985542 100644 --- a/app/src/main/java/io/xpipe/app/action/ActionUrls.java +++ b/app/src/main/java/io/xpipe/app/action/ActionUrls.java @@ -1,10 +1,7 @@ package io.xpipe.app.action; -import io.xpipe.app.storage.DataStorage; -import io.xpipe.core.InPlaceSecretValue; import io.xpipe.core.JacksonMapper; import io.xpipe.core.SecretValue; -import io.xpipe.core.UuidHelper; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonNode; @@ -50,7 +47,8 @@ public class ActionUrls { } var json = sa.toNode(); - var parsed = JacksonMapper.getDefault().treeToValue(json, new TypeReference>() {}); + var parsed = + JacksonMapper.getDefault().treeToValue(json, new TypeReference>() {}); Map> requestParams = new LinkedHashMap<>(); for (Map.Entry e : parsed.entrySet()) { diff --git a/app/src/main/java/io/xpipe/app/action/SerializableAction.java b/app/src/main/java/io/xpipe/app/action/SerializableAction.java index b038ee542..96b5441ab 100644 --- a/app/src/main/java/io/xpipe/app/action/SerializableAction.java +++ b/app/src/main/java/io/xpipe/app/action/SerializableAction.java @@ -3,10 +3,10 @@ package io.xpipe.app.action; import io.xpipe.app.storage.DataStorage; import io.xpipe.app.util.DataStoreFormatter; import io.xpipe.core.JacksonMapper; +import io.xpipe.core.UuidHelper; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import io.xpipe.core.UuidHelper; import lombok.experimental.SuperBuilder; import java.util.*; @@ -54,15 +54,22 @@ public abstract class SerializableAction extends AbstractAction { } var name = DataStoreFormatter.camelCaseToName(property.getKey()); - name = Arrays.stream(name.split(" ")).filter(s -> !s.equals("Store")).collect(Collectors.joining(" ")); + name = Arrays.stream(name.split(" ")) + .filter(s -> !s.equals("Store")) + .collect(Collectors.joining(" ")); if (property.getValue().isTextual()) { var value = property.getValue().textValue(); var uuid = UuidHelper.parse(value); if (uuid.isPresent()) { - var refName = DataStorage.get().getStoreEntryIfPresent(uuid.get()).map(e -> e.getName()).or(() -> { - return DataStorage.get().getStoreCategoryIfPresent(uuid.get()).map(c -> c.getName()); - }); + var refName = DataStorage.get() + .getStoreEntryIfPresent(uuid.get()) + .map(e -> e.getName()) + .or(() -> { + return DataStorage.get() + .getStoreCategoryIfPresent(uuid.get()) + .map(c -> c.getName()); + }); map.put(name, refName.orElse(value)); } else { map.put(name, value); diff --git a/app/src/main/java/io/xpipe/app/browser/BrowserFullSessionModel.java b/app/src/main/java/io/xpipe/app/browser/BrowserFullSessionModel.java index 91a2c9688..2e63d6eae 100644 --- a/app/src/main/java/io/xpipe/app/browser/BrowserFullSessionModel.java +++ b/app/src/main/java/io/xpipe/app/browser/BrowserFullSessionModel.java @@ -25,7 +25,6 @@ import javafx.collections.ListChangeListener; import javafx.collections.ObservableMap; import lombok.Getter; -import lombok.SneakyThrows; import java.util.*; diff --git a/app/src/main/java/io/xpipe/app/browser/action/BrowserAction.java b/app/src/main/java/io/xpipe/app/browser/action/BrowserAction.java index 4d20ae1fe..330d6d1d6 100644 --- a/app/src/main/java/io/xpipe/app/browser/action/BrowserAction.java +++ b/app/src/main/java/io/xpipe/app/browser/action/BrowserAction.java @@ -62,12 +62,11 @@ public abstract class BrowserAction extends StoreAction { return true; } - private void validateAutomatedAction() throws Exception { var bap = (BrowserActionProvider) getProvider(); if (!bap.isApplicable(getModel(), getEntries())) { - throw ErrorEventFactory.expected(new IllegalArgumentException( - "Selection is not applicable for action type")); + throw ErrorEventFactory.expected( + new IllegalArgumentException("Selection is not applicable for action type")); } if (files != null) { @@ -86,7 +85,8 @@ public abstract class BrowserAction extends StoreAction { } else { var dir = files.getFirst(); if (!model.getFileSystem().directoryExists(dir)) { - throw ErrorEventFactory.expected(new IllegalArgumentException("File or directory does not exist: " + dir)); + throw ErrorEventFactory.expected( + new IllegalArgumentException("File or directory does not exist: " + dir)); } return dir; } diff --git a/app/src/main/java/io/xpipe/app/browser/action/impl/RunCommandInBrowserActionProvider.java b/app/src/main/java/io/xpipe/app/browser/action/impl/RunCommandInBrowserActionProvider.java index 37ea6c6cb..d61ff28f0 100644 --- a/app/src/main/java/io/xpipe/app/browser/action/impl/RunCommandInBrowserActionProvider.java +++ b/app/src/main/java/io/xpipe/app/browser/action/impl/RunCommandInBrowserActionProvider.java @@ -30,7 +30,7 @@ public class RunCommandInBrowserActionProvider implements BrowserActionProvider } @Override - public void executeImpl() throws Exception { + public void executeImpl() { var builder = CommandBuilder.of().add(command); for (BrowserEntry entry : getEntries()) { builder.addFile(entry.getRawFileEntry().getPath()); 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 359ec8460..514b22486 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 @@ -169,7 +169,9 @@ class BrowserFileListNameCell extends TableCell { var content = textField.getText(); if (content != null && !content.isEmpty()) { var name = FilePath.of(content); - var baseNameEnd = item.getRawFileEntry().getKind() == FileKind.DIRECTORY ? content.length() : name.getBaseName().toString().length(); + var baseNameEnd = item.getRawFileEntry().getKind() == FileKind.DIRECTORY + ? content.length() + : name.getBaseName().toString().length(); textField.selectRange(0, baseNameEnd); } }); diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileOpener.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileOpener.java index 48fb9bca3..a77d5471f 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileOpener.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileOpener.java @@ -208,7 +208,7 @@ public class BrowserFileOpener { } @Override - public void onFinish() throws Exception { + public void onFinish() { model.refreshFileEntriesSync(List.of(entry)); } }; @@ -257,7 +257,7 @@ public class BrowserFileOpener { } @Override - public void onFinish() throws Exception { + public void onFinish() { model.refreshFileEntriesSync(List.of(entry)); } }; 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 8dce1a0c8..12e1d29e4 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 @@ -112,13 +112,7 @@ public class BrowserFileSystemTabComp extends SimpleComp { rightBox.setFillHeight(true); rightBox.getStyleClass().add("button-bar"); - topBar.getChildren() - .setAll( - leftBox, - new Spacer(6), - navBar.get(), - new Spacer(6), - rightBox); + topBar.getChildren().setAll(leftBox, new Spacer(6), navBar.get(), new Spacer(6), rightBox); topBar.setMinWidth(0); if (model.getBrowserModel() instanceof BrowserFullSessionModel fullSessionModel) { 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 0bf2ade2a..6278b921f 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 @@ -30,7 +30,6 @@ import javafx.beans.property.*; import javafx.collections.FXCollections; import javafx.collections.ObservableList; -import javafx.scene.control.SelectionMode; import lombok.Getter; import lombok.NonNull; 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 94d306b69..af29ebf93 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 @@ -165,7 +165,8 @@ public class BrowserFileTransferOperation { handleSingleOnSameFileSystem(file); } else { // Transfers might change the working directory - var currentDir = file.getFileSystem().getShell().orElseThrow().view().pwd(); + var currentDir = + file.getFileSystem().getShell().orElseThrow().view().pwd(); handleSingleAcrossFileSystems(file); file.getFileSystem().getShell().orElseThrow().view().cd(currentDir); } diff --git a/app/src/main/java/io/xpipe/app/browser/menu/BrowserMenuLeafProvider.java b/app/src/main/java/io/xpipe/app/browser/menu/BrowserMenuLeafProvider.java index 1c68e6471..4dff17515 100644 --- a/app/src/main/java/io/xpipe/app/browser/menu/BrowserMenuLeafProvider.java +++ b/app/src/main/java/io/xpipe/app/browser/menu/BrowserMenuLeafProvider.java @@ -25,7 +25,7 @@ import java.util.List; public interface BrowserMenuLeafProvider extends BrowserMenuItemProvider { - default void execute(BrowserFileSystemTabModel model, List entries) throws Exception { + default void execute(BrowserFileSystemTabModel model, List entries) { createAction(model, entries).executeAsync(); } diff --git a/app/src/main/java/io/xpipe/app/browser/menu/MultiExecuteMenuProvider.java b/app/src/main/java/io/xpipe/app/browser/menu/MultiExecuteMenuProvider.java index b449fb032..d6d039a94 100644 --- a/app/src/main/java/io/xpipe/app/browser/menu/MultiExecuteMenuProvider.java +++ b/app/src/main/java/io/xpipe/app/browser/menu/MultiExecuteMenuProvider.java @@ -7,8 +7,8 @@ import io.xpipe.app.prefs.AppPrefs; import io.xpipe.app.process.CommandBuilder; import io.xpipe.app.process.ShellControl; import io.xpipe.app.util.CommandDialog; - import io.xpipe.app.util.ThreadHelper; + import javafx.beans.value.ObservableValue; import java.util.List; @@ -25,7 +25,7 @@ public abstract class MultiExecuteMenuProvider implements BrowserMenuBranchProvi new BrowserMenuLeafProvider() { @Override - public void execute(BrowserFileSystemTabModel model, List entries) throws Exception { + public void execute(BrowserFileSystemTabModel model, List entries) { var sc = model.getFileSystem().getShell().orElseThrow(); for (BrowserEntry entry : entries) { var c = createCommand(sc, model, entry); @@ -61,7 +61,7 @@ public abstract class MultiExecuteMenuProvider implements BrowserMenuBranchProvi new BrowserMenuLeafProvider() { @Override - public void execute(BrowserFileSystemTabModel model, List entries) throws Exception { + public void execute(BrowserFileSystemTabModel model, List entries) { ThreadHelper.runAsync(() -> { var sc = model.getFileSystem().getShell().orElseThrow(); for (BrowserEntry entry : entries) { @@ -86,7 +86,7 @@ public abstract class MultiExecuteMenuProvider implements BrowserMenuBranchProvi new BrowserMenuLeafProvider() { @Override - public void execute(BrowserFileSystemTabModel model, List entries) throws Exception { + public void execute(BrowserFileSystemTabModel model, List entries) { ThreadHelper.runFailableAsync(() -> { var sc = model.getFileSystem().getShell().orElseThrow(); for (BrowserEntry entry : entries) { @@ -95,7 +95,10 @@ public abstract class MultiExecuteMenuProvider implements BrowserMenuBranchProvi continue; } - sc.command(cmd).withWorkingDirectory(model.getCurrentDirectory().getPath()).execute(); + sc.command(cmd) + .withWorkingDirectory( + model.getCurrentDirectory().getPath()) + .execute(); } model.refreshBrowserEntriesSync(entries); }); diff --git a/app/src/main/java/io/xpipe/app/browser/menu/impl/BackMenuProvider.java b/app/src/main/java/io/xpipe/app/browser/menu/impl/BackMenuProvider.java index d2ee1a643..d21b5a690 100644 --- a/app/src/main/java/io/xpipe/app/browser/menu/impl/BackMenuProvider.java +++ b/app/src/main/java/io/xpipe/app/browser/menu/impl/BackMenuProvider.java @@ -5,8 +5,8 @@ import io.xpipe.app.browser.file.BrowserFileSystemTabModel; import io.xpipe.app.browser.menu.BrowserMenuLeafProvider; import io.xpipe.app.core.AppI18n; import io.xpipe.app.util.LabelGraphic; - import io.xpipe.app.util.ThreadHelper; + import javafx.beans.value.ObservableValue; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; diff --git a/app/src/main/java/io/xpipe/app/browser/menu/impl/ForwardMenuProvider.java b/app/src/main/java/io/xpipe/app/browser/menu/impl/ForwardMenuProvider.java index 7059af089..c7e485204 100644 --- a/app/src/main/java/io/xpipe/app/browser/menu/impl/ForwardMenuProvider.java +++ b/app/src/main/java/io/xpipe/app/browser/menu/impl/ForwardMenuProvider.java @@ -5,8 +5,8 @@ import io.xpipe.app.browser.file.BrowserFileSystemTabModel; import io.xpipe.app.browser.menu.BrowserMenuLeafProvider; import io.xpipe.app.core.AppI18n; import io.xpipe.app.util.LabelGraphic; - import io.xpipe.app.util.ThreadHelper; + import javafx.beans.value.ObservableValue; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; diff --git a/app/src/main/java/io/xpipe/app/browser/menu/impl/JavapMenuProvider.java b/app/src/main/java/io/xpipe/app/browser/menu/impl/JavapMenuProvider.java index 911343acf..7ec245138 100644 --- a/app/src/main/java/io/xpipe/app/browser/menu/impl/JavapMenuProvider.java +++ b/app/src/main/java/io/xpipe/app/browser/menu/impl/JavapMenuProvider.java @@ -10,8 +10,8 @@ import io.xpipe.app.browser.menu.FileTypeMenuProvider; import io.xpipe.app.process.CommandBuilder; import io.xpipe.app.process.ShellControl; import io.xpipe.app.util.FileOpener; - import io.xpipe.app.util.ThreadHelper; + import javafx.beans.property.SimpleStringProperty; import javafx.beans.value.ObservableValue; @@ -42,12 +42,16 @@ public class JavapMenuProvider } @Override - public void execute(BrowserFileSystemTabModel model, List entries) throws Exception { + public void execute(BrowserFileSystemTabModel model, List entries) { ThreadHelper.runFailableAsync(() -> { ShellControl sc = model.getFileSystem().getShell().orElseThrow(); for (BrowserEntry entry : entries) { - var command = CommandBuilder.of().add("javap", "-c", "-p").addFile(entry.getRawFileEntry().getPath()); - var out = sc.command(command).withWorkingDirectory(model.getCurrentDirectory().getPath()).readStdoutOrThrow(); + var command = CommandBuilder.of() + .add("javap", "-c", "-p") + .addFile(entry.getRawFileEntry().getPath()); + var out = sc.command(command) + .withWorkingDirectory(model.getCurrentDirectory().getPath()) + .readStdoutOrThrow(); FileOpener.openReadOnlyString(out); } }); diff --git a/app/src/main/java/io/xpipe/app/browser/menu/impl/RefreshDirectoryMenuProvider.java b/app/src/main/java/io/xpipe/app/browser/menu/impl/RefreshDirectoryMenuProvider.java index 2cf9727ac..b31a153ee 100644 --- a/app/src/main/java/io/xpipe/app/browser/menu/impl/RefreshDirectoryMenuProvider.java +++ b/app/src/main/java/io/xpipe/app/browser/menu/impl/RefreshDirectoryMenuProvider.java @@ -5,8 +5,8 @@ import io.xpipe.app.browser.file.BrowserFileSystemTabModel; import io.xpipe.app.browser.menu.BrowserMenuLeafProvider; import io.xpipe.app.core.AppI18n; import io.xpipe.app.util.LabelGraphic; - import io.xpipe.app.util.ThreadHelper; + import javafx.beans.value.ObservableValue; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; diff --git a/app/src/main/java/io/xpipe/app/comp/base/AppLayoutComp.java b/app/src/main/java/io/xpipe/app/comp/base/AppLayoutComp.java index fbbaea2cf..0a7106795 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/AppLayoutComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/AppLayoutComp.java @@ -45,9 +45,13 @@ public class AppLayoutComp extends Comp { multi.styleClass("background"); multi.apply(struc -> { - struc.get().opacityProperty().bind(Bindings.createDoubleBinding(() -> { - return AppPrefs.get().performanceMode().get() ? 1.0 : 0.95; - }, AppPrefs.get().performanceMode())); + struc.get() + .opacityProperty() + .bind(Bindings.createDoubleBinding( + () -> { + return AppPrefs.get().performanceMode().get() ? 1.0 : 0.95; + }, + AppPrefs.get().performanceMode())); }); var pane = new BorderPane(); diff --git a/app/src/main/java/io/xpipe/app/comp/base/ModalOverlayComp.java b/app/src/main/java/io/xpipe/app/comp/base/ModalOverlayComp.java index 7a5ded90a..a368ac8de 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/ModalOverlayComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/ModalOverlayComp.java @@ -6,6 +6,7 @@ import io.xpipe.app.core.AppFontSizes; import io.xpipe.app.core.AppI18n; import io.xpipe.app.core.AppLogs; import io.xpipe.app.util.BooleanScope; +import io.xpipe.app.util.LabelGraphic; import io.xpipe.app.util.PlatformThread; import io.xpipe.core.OsType; @@ -17,7 +18,6 @@ import javafx.beans.property.SimpleDoubleProperty; import javafx.beans.value.ObservableDoubleValue; import javafx.geometry.Pos; import javafx.scene.control.Button; -import javafx.scene.control.Label; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyEvent; import javafx.scene.layout.HBox; @@ -182,12 +182,16 @@ public class ModalOverlayComp extends SimpleComp { content.setSpacing(20); if (newValue.getTitle() != null) { - var l = new Label( + var l = new LabelComp( newValue.getTitle().getValue(), - newValue.getGraphic() != null ? newValue.getGraphic().createGraphicNode() : null); - l.setGraphicTextGap(8); - AppFontSizes.xl(l); - content.getChildren().addFirst(l); + newValue.getGraphic() != null + ? newValue.getGraphic() + : new LabelGraphic.IconGraphic("mdi2i-information-outline")); + l.apply(struc -> { + struc.get().setGraphicTextGap(8); + AppFontSizes.xl(struc.get()); + }); + content.getChildren().addFirst(l.createRegion()); } else { content.getChildren().addFirst(Comp.vspacer(0).createRegion()); } diff --git a/app/src/main/java/io/xpipe/app/comp/base/OptionsComp.java b/app/src/main/java/io/xpipe/app/comp/base/OptionsComp.java index 7edbcdb91..c616ac319 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/OptionsComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/OptionsComp.java @@ -225,7 +225,6 @@ public class OptionsComp extends Comp> { .map(Region::getWidth) .filter(aDouble -> aDouble > 0.0) .max(Double::compareTo) - .map(d -> d) .orElse(Region.USE_COMPUTED_SIZE); }, nameRegions.stream().map(Region::widthProperty).toList().toArray(new Observable[0])); diff --git a/app/src/main/java/io/xpipe/app/core/AppFont.java b/app/src/main/java/io/xpipe/app/core/AppFont.java index ded88c046..e25c1b05d 100644 --- a/app/src/main/java/io/xpipe/app/core/AppFont.java +++ b/app/src/main/java/io/xpipe/app/core/AppFont.java @@ -2,7 +2,6 @@ package io.xpipe.app.core; import io.xpipe.app.issue.ErrorEventFactory; import io.xpipe.app.issue.TrackEvent; -import io.xpipe.core.OsType; import javafx.scene.text.Font; diff --git a/app/src/main/java/io/xpipe/app/core/AppInstance.java b/app/src/main/java/io/xpipe/app/core/AppInstance.java index a92f18ba2..ea340007b 100644 --- a/app/src/main/java/io/xpipe/app/core/AppInstance.java +++ b/app/src/main/java/io/xpipe/app/core/AppInstance.java @@ -5,18 +5,15 @@ import io.xpipe.app.core.mode.OperationMode; import io.xpipe.app.issue.ErrorEventFactory; import io.xpipe.app.issue.TrackEvent; import io.xpipe.app.util.ThreadHelper; -import io.xpipe.beacon.BeaconAuthMethod; import io.xpipe.beacon.BeaconClient; import io.xpipe.beacon.BeaconClientInformation; import io.xpipe.beacon.BeaconServer; import io.xpipe.beacon.api.DaemonFocusExchange; import io.xpipe.beacon.api.DaemonOpenExchange; -import io.xpipe.beacon.api.HandshakeExchange; import io.xpipe.core.OsType; import io.xpipe.core.XPipeInstallation; import java.awt.*; -import java.nio.file.Files; import java.util.List; import java.util.Optional; @@ -28,12 +25,14 @@ public class AppInstance { public static Optional tryEstablishConnection(int port) { try { - return Optional.of(BeaconClient.establishConnection(port, BeaconClientInformation.Daemon.builder().build())); + return Optional.of(BeaconClient.establishConnection( + port, BeaconClientInformation.Daemon.builder().build())); } catch (Exception ex) { ErrorEventFactory.fromThrowable(ex).omit().expected().handle(); return Optional.empty(); } } + private static void checkStart(int attemptCounter) { var port = AppBeaconServer.get().getPort(); var reachable = BeaconServer.isReachable(port); diff --git a/app/src/main/java/io/xpipe/app/core/AppTheme.java b/app/src/main/java/io/xpipe/app/core/AppTheme.java index a3392a0ca..43ed10be2 100644 --- a/app/src/main/java/io/xpipe/app/core/AppTheme.java +++ b/app/src/main/java/io/xpipe/app/core/AppTheme.java @@ -65,7 +65,9 @@ public class AppTheme { AppPrefs.get().theme().subscribe(t -> { Theme.ALL.forEach(theme -> { - root.pseudoClassStateChanged(PseudoClass.getPseudoClass(theme.getCssId()), theme.getCssId().equals(t.getCssId())); + root.pseudoClassStateChanged( + PseudoClass.getPseudoClass(theme.getCssId()), + theme.getCssId().equals(t.getCssId())); }); if (t == null) { return; diff --git a/app/src/main/java/io/xpipe/app/core/check/AppGnomeScaleDialog.java b/app/src/main/java/io/xpipe/app/core/check/AppGnomeScaleDialog.java index 64ef289ed..d25358ca7 100644 --- a/app/src/main/java/io/xpipe/app/core/check/AppGnomeScaleDialog.java +++ b/app/src/main/java/io/xpipe/app/core/check/AppGnomeScaleDialog.java @@ -31,12 +31,17 @@ public class AppGnomeScaleDialog { return; } - var content = AppDialog.dialogText("You are running XPipe on a Wayland system." - + " If you are using a high-dpi display, eue to xwayland limitations, this might result in a blurry window. See the documentation for workarounds if you are affected."); + var content = AppDialog.dialogText( + "You are running XPipe on a Wayland system." + + " If you are using a high-dpi display, eue to xwayland limitations, this might result in a blurry window. See the documentation for workarounds if you are affected."); var modal = ModalOverlay.of("waylandScalingTitle", content); - modal.addButton(new ModalButton("docs", () -> { - DocumentationLink.GNOME_WAYLAND_SCALING.open(); - }, false, false)); + modal.addButton(new ModalButton( + "docs", + () -> { + DocumentationLink.GNOME_WAYLAND_SCALING.open(); + }, + false, + false)); modal.addButton(ModalButton.ok(() -> { AppCache.update("gnomeScaleNoticeShown", true); })); diff --git a/app/src/main/java/io/xpipe/app/ext/DataStoreProviders.java b/app/src/main/java/io/xpipe/app/ext/DataStoreProviders.java index bd4ab23b3..9b3f7304b 100644 --- a/app/src/main/java/io/xpipe/app/ext/DataStoreProviders.java +++ b/app/src/main/java/io/xpipe/app/ext/DataStoreProviders.java @@ -44,7 +44,6 @@ public class DataStoreProviders { return ALL.stream().filter(d -> d.getId().equalsIgnoreCase(id)).findAny(); } - @SuppressWarnings("unchecked") public static Optional byStoreIfPresent(DataStore store) { if (ALL == null) { @@ -57,7 +56,8 @@ public class DataStoreProviders { } public static T byStore(DataStore store) { - return DataStoreProviders.byStoreIfPresent(store).orElseThrow(() -> new IllegalArgumentException("Unknown store class")); + return DataStoreProviders.byStoreIfPresent(store) + .orElseThrow(() -> new IllegalArgumentException("Unknown store class")); } public static List getAll() { diff --git a/app/src/main/java/io/xpipe/app/ext/ShellSession.java b/app/src/main/java/io/xpipe/app/ext/ShellSession.java index 8eeaba791..3177bf51e 100644 --- a/app/src/main/java/io/xpipe/app/ext/ShellSession.java +++ b/app/src/main/java/io/xpipe/app/ext/ShellSession.java @@ -29,7 +29,8 @@ public class ShellSession extends Session { shellControl.start(); var shouldAliveCheck = !shellControl.isLocal(); - var supportsAliveCheck = shellControl.getShellDialect().getDumbMode().supportsAnyPossibleInteraction(); + var supportsAliveCheck = + shellControl.getShellDialect().getDumbMode().supportsAnyPossibleInteraction(); if (shouldAliveCheck && supportsAliveCheck) { startAliveListener(); } diff --git a/app/src/main/java/io/xpipe/app/hub/comp/StoreCreationModel.java b/app/src/main/java/io/xpipe/app/hub/comp/StoreCreationModel.java index c69cec1c0..cb3426213 100644 --- a/app/src/main/java/io/xpipe/app/hub/comp/StoreCreationModel.java +++ b/app/src/main/java/io/xpipe/app/hub/comp/StoreCreationModel.java @@ -114,7 +114,8 @@ public class StoreCreationModel { && store.get().isComplete() && store.get() instanceof ValidatableStore) { if (existingEntry != null) { - return !existingEntry.isFreeze() || !existingEntry.getName().equals(name.getValue()); + return !existingEntry.isFreeze() + || !existingEntry.getName().equals(name.getValue()); } else { return true; } @@ -175,7 +176,8 @@ public class StoreCreationModel { void connect() { var temp = entry.getValue() != null ? entry.getValue() : DataStoreEntry.createTempWrapper(store.getValue()); - var action = OpenTerminalHubMenuLeafProvider.Action.builder().ref(temp.ref()).build(); + var action = + OpenTerminalHubMenuLeafProvider.Action.builder().ref(temp.ref()).build(); action.executeAsync(); } 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 df4ac25d0..b7a7a269e 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 @@ -267,7 +267,8 @@ public class StoreEntryWrapper { } else { return Optional.of(new EditHubLeafProvider()); } - }).orElse(null); + }) + .orElse(null); this.defaultActionProvider.setValue(defaultProvider); var newMajorProviders = ActionProvider.ALL.stream() 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 f30c7412e..e13141893 100644 --- a/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java +++ b/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java @@ -207,8 +207,8 @@ public class AppPrefs { final BooleanProperty disableSshPinCaching = mapLocal(new SimpleBooleanProperty(false), "disableSshPinCaching", Boolean.class, false); - final ObjectProperty language = mapLocal( - new SimpleObjectProperty<>(SupportedLocale.ENGLISH), "language", SupportedLocale.class, false); + final ObjectProperty language = + mapLocal(new SimpleObjectProperty<>(SupportedLocale.ENGLISH), "language", SupportedLocale.class, false); final BooleanProperty requireDoubleClickForConnections = mapLocal(new SimpleBooleanProperty(false), "requireDoubleClickForConnections", Boolean.class, false); diff --git a/app/src/main/java/io/xpipe/app/prefs/AppPrefsStorageHandler.java b/app/src/main/java/io/xpipe/app/prefs/AppPrefsStorageHandler.java index e131ed3f7..00cac6840 100644 --- a/app/src/main/java/io/xpipe/app/prefs/AppPrefsStorageHandler.java +++ b/app/src/main/java/io/xpipe/app/prefs/AppPrefsStorageHandler.java @@ -7,7 +7,6 @@ import io.xpipe.core.JacksonMapper; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.TextNode; diff --git a/app/src/main/java/io/xpipe/app/prefs/LinksCategory.java b/app/src/main/java/io/xpipe/app/prefs/LinksCategory.java index 4d113cfe8..2ea25b255 100644 --- a/app/src/main/java/io/xpipe/app/prefs/LinksCategory.java +++ b/app/src/main/java/io/xpipe/app/prefs/LinksCategory.java @@ -23,9 +23,9 @@ public class LinksCategory extends AppPrefsCategory { null) .addComp( new TileButtonComp("reddit", "redditDescription", "mdi2r-reddit", e -> { - Hyperlinks.open(Hyperlinks.REDDIT); - e.consume(); - }) + Hyperlinks.open(Hyperlinks.REDDIT); + e.consume(); + }) .grow(true, false), null) .addComp( diff --git a/app/src/main/java/io/xpipe/app/prefs/TroubleshootCategory.java b/app/src/main/java/io/xpipe/app/prefs/TroubleshootCategory.java index 4771dd6c3..100a3d5e6 100644 --- a/app/src/main/java/io/xpipe/app/prefs/TroubleshootCategory.java +++ b/app/src/main/java/io/xpipe/app/prefs/TroubleshootCategory.java @@ -25,7 +25,6 @@ import org.apache.commons.io.FileUtils; import java.lang.management.ManagementFactory; import java.nio.file.Files; -import java.nio.file.Path; import javax.management.MBeanServer; public class TroubleshootCategory extends AppPrefsCategory { @@ -159,17 +158,28 @@ public class TroubleshootCategory extends AppPrefsCategory { if (OsType.getLocal() == OsType.MACOS && AppDistributionType.get() == AppDistributionType.NATIVE_INSTALLATION) { b.addComp( - new TileButtonComp("uninstallApplication", "uninstallApplicationDescription", "mdi2d-dump-truck", e -> { - var file = XPipeInstallation.getCurrentInstallationBasePath().resolve("Contents").resolve("Resources").resolve("scripts").resolve("uninstall.sh"); - OperationMode.executeAfterShutdown(() -> { - TerminalLauncher.openDirectFallback("Uninstall", sc -> ShellScript.lines( - "echo \"+ sudo " + file.toString() + "\"", - "sudo " + file.toString(), - ProcessControlProvider.get().getEffectiveLocalDialect().getPauseCommand()) - ); - }); - e.consume(); - }) + new TileButtonComp( + "uninstallApplication", + "uninstallApplicationDescription", + "mdi2d-dump-truck", + e -> { + var file = XPipeInstallation.getCurrentInstallationBasePath() + .resolve("Contents") + .resolve("Resources") + .resolve("scripts") + .resolve("uninstall.sh"); + OperationMode.executeAfterShutdown(() -> { + TerminalLauncher.openDirectFallback( + "Uninstall", + sc -> ShellScript.lines( + "echo \"+ sudo " + file + "\"", + "sudo " + file, + ProcessControlProvider.get() + .getEffectiveLocalDialect() + .getPauseCommand())); + }); + e.consume(); + }) .grow(true, false), null); } diff --git a/app/src/main/java/io/xpipe/app/process/ShellView.java b/app/src/main/java/io/xpipe/app/process/ShellView.java index 7f8132aa7..0fcc7f8a8 100644 --- a/app/src/main/java/io/xpipe/app/process/ShellView.java +++ b/app/src/main/java/io/xpipe/app/process/ShellView.java @@ -154,7 +154,9 @@ public class ShellView { } public FilePath pwd() throws Exception { - return FilePath.of(shellControl.command(shellControl.getShellDialect().getPrintWorkingDirectoryCommand()).readStdoutOrThrow()); + return FilePath.of(shellControl + .command(shellControl.getShellDialect().getPrintWorkingDirectoryCommand()) + .readStdoutOrThrow()); } public void cd(String directory) throws Exception { diff --git a/app/src/main/java/io/xpipe/app/storage/DataStoreCategory.java b/app/src/main/java/io/xpipe/app/storage/DataStoreCategory.java index ddb88e356..7a88f4373 100644 --- a/app/src/main/java/io/xpipe/app/storage/DataStoreCategory.java +++ b/app/src/main/java/io/xpipe/app/storage/DataStoreCategory.java @@ -71,7 +71,7 @@ public class DataStoreCategory extends StorageElement { DataStoreCategoryConfig.empty()); } - public static Optional fromDirectory(Path dir) throws Exception { + public static Optional fromDirectory(Path dir) { ObjectMapper mapper = JacksonMapper.getDefault(); var entryFile = dir.resolve("category.json"); diff --git a/app/src/main/java/io/xpipe/app/storage/DataStoreEntry.java b/app/src/main/java/io/xpipe/app/storage/DataStoreEntry.java index 511682dac..039f73227 100644 --- a/app/src/main/java/io/xpipe/app/storage/DataStoreEntry.java +++ b/app/src/main/java/io/xpipe/app/storage/DataStoreEntry.java @@ -112,7 +112,8 @@ public class DataStoreEntry extends StorageElement { this.categoryUuid = categoryUuid; this.store = store; this.storeNode = storeNode; - this.provider = store != null ? DataStoreProviders.byStoreIfPresent(store).orElse(null) : null; + this.provider = + store != null ? DataStoreProviders.byStoreIfPresent(store).orElse(null) : null; this.validity = this.provider != null ? validity : Validity.LOAD_FAILED; this.storePersistentStateNode = storePersistentState; this.notes = notes; @@ -199,7 +200,7 @@ public class DataStoreEntry extends StorageElement { return "icons/" + icon + ".svg"; } - public static Optional fromDirectory(Path dir) throws Exception { + public static Optional fromDirectory(Path dir) { ObjectMapper mapper = JacksonMapper.getDefault(); var entryFile = dir.resolve("entry.json"); diff --git a/app/src/main/java/io/xpipe/app/storage/StandardStorage.java b/app/src/main/java/io/xpipe/app/storage/StandardStorage.java index 4004a7afd..6d421fd44 100644 --- a/app/src/main/java/io/xpipe/app/storage/StandardStorage.java +++ b/app/src/main/java/io/xpipe/app/storage/StandardStorage.java @@ -157,11 +157,8 @@ public class StandardStorage extends DataStorage { } addStoreCategory(c.get()); - } catch (IOException ex) { - // IO exceptions are not expected - exception.set(new IOException("Unable to load data from " + path + ". Is it corrupted?", ex)); - directoriesToKeep.add(path); - } catch (Exception ex) { + } // IO exceptions are not expected + catch (Exception ex) { // Data corruption and schema changes are expected ErrorEventFactory.fromThrowable(ex) .expected() @@ -214,11 +211,8 @@ public class StandardStorage extends DataStorage { laterAddedEntries.add(entry.get()); storeEntries.put(entry.get(), entry.get()); - } catch (IOException ex) { - // IO exceptions are not expected - exception.set(new IOException("Unable to load data from " + path + ". Is it corrupted?", ex)); - directoriesToKeep.add(path); - } catch (Exception ex) { + } // IO exceptions are not expected + catch (Exception ex) { // Data corruption and schema changes are expected // We only keep invalid entries in developer mode as there's no point in keeping them in diff --git a/app/src/main/java/io/xpipe/app/terminal/GhosttyTerminalType.java b/app/src/main/java/io/xpipe/app/terminal/GhosttyTerminalType.java index 483f15ec5..c75171e57 100644 --- a/app/src/main/java/io/xpipe/app/terminal/GhosttyTerminalType.java +++ b/app/src/main/java/io/xpipe/app/terminal/GhosttyTerminalType.java @@ -1,19 +1,9 @@ package io.xpipe.app.terminal; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import io.xpipe.app.ext.ProcessControlProvider; -import io.xpipe.app.issue.ErrorEventFactory; import io.xpipe.app.prefs.AppPrefs; import io.xpipe.app.prefs.ExternalApplicationType; import io.xpipe.app.process.CommandBuilder; -import io.xpipe.app.process.ShellControl; -import io.xpipe.app.process.ShellDialects; -import io.xpipe.app.util.CommandSupport; import io.xpipe.app.util.LocalShell; -import io.xpipe.app.util.ShellTemp; -import io.xpipe.app.util.ThreadHelper; -import io.xpipe.core.FilePath; -import io.xpipe.core.XPipeInstallation; public interface GhosttyTerminalType extends ExternalTerminalType, TrackableTerminalType { diff --git a/app/src/main/java/io/xpipe/app/terminal/TerminalLaunchConfiguration.java b/app/src/main/java/io/xpipe/app/terminal/TerminalLaunchConfiguration.java index cded9dda4..73fab62b1 100644 --- a/app/src/main/java/io/xpipe/app/terminal/TerminalLaunchConfiguration.java +++ b/app/src/main/java/io/xpipe/app/terminal/TerminalLaunchConfiguration.java @@ -92,9 +92,7 @@ public class TerminalLaunchConfiguration { Stop-Transcript > $Out-Null echo 'Transcript stopped, output file is "sessions\\%s"' """ - .formatted(logFile.getFileName(), - logFile, - launcherScript, logFile.getFileName()); + .formatted(logFile.getFileName(), logFile, launcherScript, logFile.getFileName()); var config = new TerminalLaunchConfiguration( entry != null ? color : null, adjustedTitle, @@ -104,20 +102,27 @@ public class TerminalLaunchConfiguration { ShellDialects.POWERSHELL); return config; } else { - var found = sc.command(sc.getShellDialect().getWhichCommand("script")) - .executeAndCheck(); + var found = + sc.command(sc.getShellDialect().getWhichCommand("script")).executeAndCheck(); if (!found) { var suffix = sc.getOsType() == OsType.MACOS ? "This command is available in the util-linux package which can be installed via homebrew." : "This command is available in the util-linux package."; - throw ErrorEventFactory.expected(new IllegalStateException( - "Logging requires the script command to be installed. " + suffix)); + throw ErrorEventFactory.expected( + new IllegalStateException("Logging requires the script command to be installed. " + suffix)); } var launcherScript = ScriptHelper.createExecScript( - LocalShell.getShell(), LocalShell.getShell().getShellDialect().terminalLauncherScript(request, adjustedTitle, alwaysPromptRestart)); - var command = sc == LocalShell.getShell() ? launcherScript : - LocalShell.getShell().getShellDialect().getOpenScriptCommand(launcherScript.toString()).buildFull(LocalShell.getShell()); + LocalShell.getShell(), + LocalShell.getShell() + .getShellDialect() + .terminalLauncherScript(request, adjustedTitle, alwaysPromptRestart)); + var command = sc == LocalShell.getShell() + ? launcherScript + : LocalShell.getShell() + .getShellDialect() + .getOpenScriptCommand(launcherScript.toString()) + .buildFull(LocalShell.getShell()); var content = sc.getOsType() == OsType.MACOS || sc.getOsType() == OsType.BSD ? """ echo "Transcript started, output file is sessions/%s" @@ -126,7 +131,15 @@ public class TerminalLaunchConfiguration { cat "%s" | perl -pe 's/\\e([^\\[\\]]|\\[.*?[a-zA-Z]|\\].*?\\a)/\\n/g' | perl -0 -pe 's/\\n+/\\n/g' | col -b > "%s.new" mv -f "%s.new" "%s" """ - .formatted(logFile.getFileName(), logFile, command, logFile.getFileName(), logFile, logFile, logFile, logFile) + .formatted( + logFile.getFileName(), + logFile, + command, + logFile.getFileName(), + logFile, + logFile, + logFile, + logFile) : """ echo "Transcript started, output file is sessions/%s" script --quiet --command '%s' "%s" @@ -134,14 +147,17 @@ public class TerminalLaunchConfiguration { cat "%s" | perl -pe 's/\\e([^\\[\\]]|\\[.*?[a-zA-Z]|\\].*?\\a)/\\n/g' | perl -0 -pe 's/\\n+/\\n/g' | col -b > "%s.new" mv -f "%s.new" "%s" """ - .formatted(logFile.getFileName(), command, logFile, logFile.getFileName(), logFile, logFile, logFile, logFile); + .formatted( + logFile.getFileName(), + command, + logFile, + logFile.getFileName(), + logFile, + logFile, + logFile, + logFile); var config = new TerminalLaunchConfiguration( - entry != null ? color : null, - adjustedTitle, - cleanTitle, - preferTabs, - content, - sc.getShellDialect()); + entry != null ? color : null, adjustedTitle, cleanTitle, preferTabs, content, sc.getShellDialect()); config.scriptFile = ScriptHelper.createExecScript(sc.getShellDialect(), sc, content); return config; } 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 44969d05a..cea80a39d 100644 --- a/app/src/main/java/io/xpipe/app/terminal/TerminalLauncher.java +++ b/app/src/main/java/io/xpipe/app/terminal/TerminalLauncher.java @@ -139,8 +139,12 @@ public class TerminalLauncher { } public static void open( - DataStoreEntry entry, String title, FilePath directory, ProcessControl cc, UUID request, boolean preferTabs) - throws Exception { + DataStoreEntry entry, + String title, + FilePath directory, + ProcessControl cc, + UUID request, + boolean preferTabs) { var type = AppPrefs.get().terminalType().getValue(); if (type == null) { throw ErrorEventFactory.expected(new IllegalStateException(AppI18n.get("noTerminalSet"))); diff --git a/app/src/main/java/io/xpipe/app/update/AppDownloads.java b/app/src/main/java/io/xpipe/app/update/AppDownloads.java index ba45c89a9..7b4b98c33 100644 --- a/app/src/main/java/io/xpipe/app/update/AppDownloads.java +++ b/app/src/main/java/io/xpipe/app/update/AppDownloads.java @@ -79,7 +79,9 @@ public class AppDownloads { req.put("first", first); req.put("license", LicenseProvider.get().getLicenseId()); req.put("dist", AppDistributionType.get().getId()); - req.put("lang", AppPrefs.get() != null ? AppPrefs.get().language().getValue().getId() : null); + req.put( + "lang", + AppPrefs.get() != null ? AppPrefs.get().language().getValue().getId() : null); var url = URI.create("https://api.xpipe.io/version"); var builder = HttpRequest.newBuilder(); diff --git a/app/src/main/java/io/xpipe/app/util/DesktopShortcuts.java b/app/src/main/java/io/xpipe/app/util/DesktopShortcuts.java index f82c218aa..152f4e49f 100644 --- a/app/src/main/java/io/xpipe/app/util/DesktopShortcuts.java +++ b/app/src/main/java/io/xpipe/app/util/DesktopShortcuts.java @@ -87,8 +87,10 @@ public class DesktopShortcuts { """); - pc.command("cp \"" + icon + "\" \"" + base + "/Contents/Resources/xpipe.icns\"").execute(); - pc.command("cp \"" + assets + "\" \"" + base + "/Contents/Resources/Assets.car\"").execute(); + pc.command("cp \"" + icon + "\" \"" + base + "/Contents/Resources/xpipe.icns\"") + .execute(); + pc.command("cp \"" + assets + "\" \"" + base + "/Contents/Resources/Assets.car\"") + .execute(); } return base; } diff --git a/app/src/main/java/io/xpipe/app/util/DocumentationLink.java b/app/src/main/java/io/xpipe/app/util/DocumentationLink.java index faf5093e5..7175692b1 100644 --- a/app/src/main/java/io/xpipe/app/util/DocumentationLink.java +++ b/app/src/main/java/io/xpipe/app/util/DocumentationLink.java @@ -89,7 +89,8 @@ public enum DocumentationLink { } public static String getRoot() { - var ptbDocs = AppProperties.get().isDevelopmentEnvironment() || AppProperties.get().isStaging(); + var ptbDocs = AppProperties.get().isDevelopmentEnvironment() + || AppProperties.get().isStaging(); return ptbDocs ? "https://docs-ptb.xpipe.io" : "https://docs.xpipe.io"; } } diff --git a/app/src/main/java/io/xpipe/app/util/GlobalTimer.java b/app/src/main/java/io/xpipe/app/util/GlobalTimer.java index c125022ad..55621c864 100644 --- a/app/src/main/java/io/xpipe/app/util/GlobalTimer.java +++ b/app/src/main/java/io/xpipe/app/util/GlobalTimer.java @@ -1,7 +1,6 @@ package io.xpipe.app.util; import io.xpipe.app.issue.ErrorEventFactory; -import io.xpipe.core.FailableRunnable; import java.time.Duration; import java.util.Timer; diff --git a/app/src/main/java/module-info.java b/app/src/main/java/module-info.java index 2c69fd9c0..77ff48124 100644 --- a/app/src/main/java/module-info.java +++ b/app/src/main/java/module-info.java @@ -121,7 +121,8 @@ open module io.xpipe.app { uses ShellDialect; provides ActionProvider with - XPipeUrlProvider, OpenTerminalHubMenuLeafProvider, + XPipeUrlProvider, + OpenTerminalHubMenuLeafProvider, EditHubLeafProvider, CloneHubLeafProvider, DownloadMenuProvider, @@ -142,7 +143,8 @@ open module io.xpipe.app { ScanHubLeafProvider, BrowseHubLeafProvider, RefreshActionProvider, - ToggleActionProvider, OpenTerminalInDirectoryMenuProvider, + ToggleActionProvider, + OpenTerminalInDirectoryMenuProvider, OpenNativeFileDetailsMenuProvider, BrowseInNativeManagerActionProvider, ApplyFileEditActionProvider, diff --git a/beacon/src/main/java/io/xpipe/beacon/BeaconServer.java b/beacon/src/main/java/io/xpipe/beacon/BeaconServer.java index c0e7bd5e7..6948a3d60 100644 --- a/beacon/src/main/java/io/xpipe/beacon/BeaconServer.java +++ b/beacon/src/main/java/io/xpipe/beacon/BeaconServer.java @@ -5,6 +5,7 @@ import io.xpipe.core.FilePath; import io.xpipe.core.OsType; import io.xpipe.core.XPipeDaemonMode; import io.xpipe.core.XPipeInstallation; + import lombok.SneakyThrows; import java.io.BufferedReader; @@ -22,7 +23,7 @@ public class BeaconServer { @SneakyThrows public static boolean isReachable(int port) { - var local = Inet4Address.getByAddress(new byte[]{0x7f, 0x00, 0x00, 0x01}); + var local = Inet4Address.getByAddress(new byte[] {0x7f, 0x00, 0x00, 0x01}); try (var socket = new Socket()) { InetSocketAddress adress = new InetSocketAddress(local, port); @@ -36,7 +37,7 @@ public class BeaconServer { // To be sure, check that the socket is indeed occupied try (var ignored = new ServerSocket(port, 0, local)) { return false; - } catch (Exception e) { + } catch (Exception e) { return true; } } diff --git a/lang/strings/translations_en.properties b/lang/strings/translations_en.properties index da5516f90..75ee835a1 100644 --- a/lang/strings/translations_en.properties +++ b/lang/strings/translations_en.properties @@ -110,7 +110,7 @@ browserWelcomeEmptyContent=You can choose on the left which systems to open in t browserWelcomeEmptyButton=Open local file browser browserWelcomeSystems=You were recently connected to the following systems: browserWelcomeDocsHeader=Documentation -browserWelcomeDocsContent=If you prefer a more guided approach to familiarizing yourself with XPipe, check out the documentation website. +browserWelcomeDocsContent=If you prefer a more guided approach to familiarizing yourself with XPipe, check out the documentation website. browserWelcomeDocsButton=Open documentation hostFeatureUnsupported=$FEATURE$ is not installed on the host missingStore=$NAME$ does not exist