diff --git a/app/src/main/java/io/xpipe/app/browser/fs/OpenFileSystemCache.java b/app/src/main/java/io/xpipe/app/browser/fs/OpenFileSystemCache.java index 48da3cf6c..6553057ab 100644 --- a/app/src/main/java/io/xpipe/app/browser/fs/OpenFileSystemCache.java +++ b/app/src/main/java/io/xpipe/app/browser/fs/OpenFileSystemCache.java @@ -18,7 +18,8 @@ public OpenFileSystemCache(OpenFileSystemModel model) throws Exception { ShellControl sc = model.getFileSystem().getShell().get(); ShellDialect d = sc.getShellDialect(); - username = d.printUsernameCommand(sc).readStdoutOrThrow(); + // If there is no id command, we should still be fine with just assuming root + username = d.printUsernameCommand(sc).readStdoutIfPossible().orElse("root"); } public boolean isRoot() { diff --git a/app/src/main/java/io/xpipe/app/core/AppPreloader.java b/app/src/main/java/io/xpipe/app/core/AppPreloader.java index 84131ebdf..4b0d75a2f 100644 --- a/app/src/main/java/io/xpipe/app/core/AppPreloader.java +++ b/app/src/main/java/io/xpipe/app/core/AppPreloader.java @@ -22,6 +22,6 @@ public void start(Stage primaryStage) { ModuleLayer.boot().findModule("javafx.graphics").orElseThrow(), "com.sun.glass.ui.Application"); var m = c.getDeclaredMethod("setName", String.class); m.invoke(c.getMethod("GetApplication").invoke(null), "XPipe"); - TrackEvent.info("Application preloaded launched"); + TrackEvent.info("Application preloader run"); } } diff --git a/app/src/main/java/io/xpipe/app/fxcomps/impl/ContextualFileReferenceChoiceComp.java b/app/src/main/java/io/xpipe/app/fxcomps/impl/ContextualFileReferenceChoiceComp.java index 816fb97e9..2974b6623 100644 --- a/app/src/main/java/io/xpipe/app/fxcomps/impl/ContextualFileReferenceChoiceComp.java +++ b/app/src/main/java/io/xpipe/app/fxcomps/impl/ContextualFileReferenceChoiceComp.java @@ -1,5 +1,6 @@ package io.xpipe.app.fxcomps.impl; +import atlantafx.base.theme.Styles; import io.xpipe.app.browser.session.BrowserChooserComp; import io.xpipe.app.comp.base.ButtonComp; import io.xpipe.app.core.AppI18n; @@ -15,17 +16,13 @@ import io.xpipe.app.storage.DataStoreEntryRef; import io.xpipe.core.store.FileNames; import io.xpipe.core.store.FileSystemStore; - import javafx.application.Platform; -import javafx.beans.binding.Bindings; import javafx.beans.property.Property; import javafx.beans.property.SimpleObjectProperty; import javafx.beans.value.ObservableValue; import javafx.scene.control.Alert; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; - -import atlantafx.base.theme.Styles; import org.kordamp.ikonli.javafx.FontIcon; import java.nio.file.Files; @@ -84,38 +81,26 @@ public CompStructure createBase() { .styleClass(Styles.CENTER_PILL) .grow(false, true); - var canGitShare = Bindings.createBooleanBinding( - () -> { - if (!AppPrefs.get().enableGitStorage().get() - || filePath.getValue() == null - || ContextualFileReference.of(filePath.getValue()).isInDataDirectory()) { - return false; - } - - return true; - }, - filePath, - AppPrefs.get().enableGitStorage()); var gitShareButton = new ButtonComp(null, new FontIcon("mdi2g-git"), () -> { if (!AppPrefs.get().enableGitStorage().get()) { AppLayoutModel.get().selectSettings(); - AppPrefs.get().selectCategory("synchronization"); + AppPrefs.get().selectCategory("sync"); return; } - if (filePath.getValue() == null - || ContextualFileReference.of(filePath.getValue()).isInDataDirectory()) { + var currentPath = filePath.getValue(); + if (currentPath == null || currentPath.isBlank()) { return; } - if (filePath.getValue() == null || filePath.getValue().isBlank() || !canGitShare.get()) { + if (ContextualFileReference.of(currentPath).isInDataDirectory()) { return; } try { var data = DataStorage.get().getDataDir(); - var f = data.resolve(FileNames.getFileName(filePath.getValue().trim())); - var source = Path.of(filePath.getValue().trim()); + var f = data.resolve(FileNames.getFileName(currentPath.trim())); + var source = Path.of(currentPath.trim()); if (Files.exists(source)) { var shouldCopy = AppWindowHelper.showBlockingAlert(alert -> { alert.setTitle(AppI18n.get("confirmGitShareTitle")); diff --git a/app/src/main/java/io/xpipe/app/util/JsonConfigHelper.java b/app/src/main/java/io/xpipe/app/util/JsonConfigHelper.java index 11546dedf..b716e9ecc 100644 --- a/app/src/main/java/io/xpipe/app/util/JsonConfigHelper.java +++ b/app/src/main/java/io/xpipe/app/util/JsonConfigHelper.java @@ -1,5 +1,6 @@ package io.xpipe.app.util; +import com.fasterxml.jackson.core.JsonParseException; import io.xpipe.app.issue.ErrorEvent; import io.xpipe.core.util.JacksonMapper; @@ -26,8 +27,10 @@ public static JsonNode readRaw(Path in) { var read = o.readTree(Files.readAllBytes(in)); return read; } + } catch (JsonParseException e) { + ErrorEvent.fromThrowable("Unable to parse file " + in, e).expected().build().handle(); } catch (IOException e) { - ErrorEvent.fromThrowable(e).build().handle(); + ErrorEvent.fromThrowable("Unable to parse file " + in, e).build().handle(); } return JsonNodeFactory.instance.missingNode(); } @@ -57,7 +60,7 @@ public static void writeConfig(Path out, JsonNode node) { var newContent = writer.toString(); Files.writeString(out, newContent); } catch (IOException e) { - ErrorEvent.fromThrowable(e).build().handle(); + ErrorEvent.fromThrowable("Unable to write file " + out, e).build().handle(); } } } diff --git a/dist/changelogs/9.2_incremental.md b/dist/changelogs/9.2_incremental.md index 193fe93c7..598c8c1f3 100644 --- a/dist/changelogs/9.2_incremental.md +++ b/dist/changelogs/9.2_incremental.md @@ -33,3 +33,8 @@ The file browser has been reworked to support many new keyboard shortcuts and th - Fix a corrupted PATH leading to cmd or powershell not being able to be started - Fix headless system error message not being printed when application failed to start up - Fix offline licenses not properly applying +- Fix WMClass not being properly set on Linux +- Fix file browser files being dragged into finder creating raw clipboard file +- Fix SSH gateway not updating when choosing key file on another host +- Fix file browser failing to connect if target system did not have id command available +- Fix git share file button not jumping to correct settings menu