mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-04-26 09:28:26 -04:00
Various fixes [stage]
This commit is contained in:
@@ -3,8 +3,10 @@ package io.xpipe.app.browser.file;
|
||||
import io.xpipe.app.comp.SimpleComp;
|
||||
import io.xpipe.app.platform.PlatformThread;
|
||||
import io.xpipe.app.util.GlobalTimer;
|
||||
import io.xpipe.app.util.ThreadHelper;
|
||||
import io.xpipe.core.FilePath;
|
||||
|
||||
import javafx.application.Platform;
|
||||
import javafx.css.PseudoClass;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.control.Button;
|
||||
@@ -21,6 +23,7 @@ import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class BrowserBreadcrumbBar extends SimpleComp {
|
||||
|
||||
@@ -116,7 +119,16 @@ public class BrowserBreadcrumbBar extends SimpleComp {
|
||||
}
|
||||
|
||||
breadcrumbs.selectedCrumbProperty().addListener((obs, old, val) -> {
|
||||
model.cdAsync(val != null ? val.getValue() : null);
|
||||
ThreadHelper.runAsync(() -> {
|
||||
model.cdSync(val != null ? val.getValue().toString() : null);
|
||||
var now = model.getCurrentPath().getValue();
|
||||
// If we initiated a cd from the navbar, but it was rejected, reflect the changes
|
||||
if (!Objects.equals(now ,val != null ? val.getValue() : null)) {
|
||||
Platform.runLater(() -> {
|
||||
breadcrumbs.setSelectedCrumb(old);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return breadcrumbs;
|
||||
|
||||
@@ -8,14 +8,12 @@ import io.xpipe.app.browser.action.impl.TransferFilesActionProvider;
|
||||
import io.xpipe.app.browser.menu.BrowserMenuItemProvider;
|
||||
import io.xpipe.app.comp.Comp;
|
||||
import io.xpipe.app.core.window.AppMainWindow;
|
||||
import io.xpipe.app.ext.FileEntry;
|
||||
import io.xpipe.app.ext.FileKind;
|
||||
import io.xpipe.app.ext.FileSystem;
|
||||
import io.xpipe.app.ext.FileSystemStore;
|
||||
import io.xpipe.app.ext.ProcessControlProvider;
|
||||
import io.xpipe.app.ext.*;
|
||||
import io.xpipe.app.issue.ErrorEventFactory;
|
||||
import io.xpipe.app.prefs.AppPrefs;
|
||||
import io.xpipe.app.process.*;
|
||||
import io.xpipe.app.storage.DataStorage;
|
||||
import io.xpipe.app.storage.DataStoreEntry;
|
||||
import io.xpipe.app.storage.DataStoreEntryRef;
|
||||
import io.xpipe.app.terminal.*;
|
||||
import io.xpipe.app.util.BooleanScope;
|
||||
@@ -358,6 +356,11 @@ public final class BrowserFileSystemTabModel extends BrowserStoreSessionTab<File
|
||||
return Optional.of(adjustedPath);
|
||||
}
|
||||
|
||||
// Open UNC paths in another tab if needed
|
||||
if (handleUncPath(path)) {
|
||||
return Optional.ofNullable(cps);
|
||||
}
|
||||
|
||||
// Evaluate optional expressions
|
||||
String evaluatedPath;
|
||||
if (customInput) {
|
||||
@@ -434,6 +437,22 @@ public final class BrowserFileSystemTabModel extends BrowserStoreSessionTab<File
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
private boolean handleUncPath(String path) {
|
||||
if (path.startsWith("\\\\") &&
|
||||
getBrowserModel() instanceof BrowserFullSessionModel bm && getFileSystem().getShell()
|
||||
.map(shellControl -> shellControl.getShellDialect()).orElse(null) == ShellDialects.CMD) {
|
||||
var env = ProcessControlProvider.get().subShellEnvironment(getEntry().asNeeded(), ShellDialects.POWERSHELL);
|
||||
var entry = DataStoreEntry.createNew(getName().getValue() + " (PowerShell)", env);
|
||||
entry.setColor(DataStorage.get().getEffectiveColor(getEntry().get()));
|
||||
entry.setCategoryUuid(getEntry().get().getCategoryUuid());
|
||||
bm.openFileSystemAsync(
|
||||
entry.ref(), null, m -> FilePath.of(path), null);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void cdSyncWithoutCheck(FilePath path) {
|
||||
|
||||
// Assume that the path is normalized to improve performance!
|
||||
|
||||
@@ -28,6 +28,8 @@ public abstract class ProcessControlProvider {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
public abstract ShellStore subShellEnvironment(DataStoreEntryRef<ShellStore> s, ShellDialect dialect);
|
||||
|
||||
public abstract BrowserStoreSessionTab<?> createVncSession(
|
||||
BrowserFullSessionModel model, DataStoreEntryRef<VncBaseStore> ref);
|
||||
|
||||
|
||||
1
dist/changelog/19.0.md
vendored
1
dist/changelog/19.0.md
vendored
@@ -71,6 +71,7 @@ There is also now a checkout page for chinese users, which supports common chine
|
||||
- You can now automatically start service tunnels as well when XPipe is launched
|
||||
- Add support to automatically add unsupported SSH MAC type
|
||||
- The nixpkg package now also supports macOS and has been reworked as a flake. If you use XPipe on Nix, take a look at https://github.com/xpipe-io/nixpkg for the changes
|
||||
- The file browser can now automatically open UNC paths when using cmd by opening a new PowerShell tab
|
||||
- Add option to control application behavior on system hibernation
|
||||
- Add possible workaround when default beacon HTTP server port was not usable
|
||||
- Improve reliability of shell session restarts when a connection was interrupted
|
||||
|
||||
Reference in New Issue
Block a user