Various small improvements

This commit is contained in:
crschnick 2023-06-04 15:04:14 +00:00
parent ae65f12d81
commit e92ded1c71
7 changed files with 44 additions and 30 deletions

View file

@ -52,7 +52,7 @@ bash <(curl -sL https://raw.githubusercontent.com/xpipe-io/xpipe/master/get-xpip
## Features
### Flexible remote file browser
### Powerful remote file browser
- Interact with the file system of any remote system using a workflow optimized for professionals
- Quickly open a terminal into any directory
@ -68,6 +68,7 @@ bash <(curl -sL https://raw.githubusercontent.com/xpipe-io/xpipe/master/get-xpip
- Securely stores all information exclusively on your computer and encrypts all secret information. See
the [security page](/SECURITY.md) for more information
- Create custom desktop shortcuts to automatically open specific remote connections in your terminal
- Don't worry about encoding issues on Windows systems, all shells are launched in UTF8 mode by default
![Connection manager](https://user-images.githubusercontent.com/72509152/230098966-000596ca-8167-4cb8-8ada-f6b3a7d482e2.png)

View file

@ -7,6 +7,8 @@ import io.xpipe.app.fxcomps.SimpleComp;
import io.xpipe.app.fxcomps.impl.IconButtonComp;
import io.xpipe.app.fxcomps.impl.PrettyImageComp;
import io.xpipe.app.fxcomps.util.PlatformThread;
import io.xpipe.app.util.BusyProperty;
import io.xpipe.app.util.ThreadHelper;
import io.xpipe.core.store.DataStore;
import io.xpipe.core.store.ShellStore;
import javafx.application.Platform;
@ -112,12 +114,20 @@ final class BrowserBookmarkList extends SimpleComp {
mouseEvent.consume();
});
addEventHandler(MouseEvent.MOUSE_CLICKED, event -> {
if (getItem() == null || event.getButton() != MouseButton.PRIMARY || (!getItem().getState().getValue().isUsable()) || !(getItem().getEntry()
.getStore() instanceof ShellStore fileSystem)) {
if (getItem() == null
|| event.getButton() != MouseButton.PRIMARY
|| (!getItem().getState().getValue().isUsable())) {
return;
}
model.openFileSystemAsync(null, fileSystem, null, busy);
ThreadHelper.runFailableAsync(() -> {
BusyProperty.execute(busy, () -> {
getItem().refreshIfNeeded();
});
if (getItem().getEntry().getStore() instanceof ShellStore fileSystem) {
model.openFileSystemAsync(null, fileSystem, null, busy);
}
});
event.consume();
});
var icon = new SimpleObjectProperty<String>("mdal-keyboard_arrow_right");
@ -128,15 +138,13 @@ final class BrowserBookmarkList extends SimpleComp {
icon.set("mdal-keyboard_arrow_right");
}
});
var button = new IconButtonComp(icon,
() -> {
getTreeItem().setExpanded(!getTreeItem().isExpanded());
})
var button = new IconButtonComp(icon, () -> {
getTreeItem().setExpanded(!getTreeItem().isExpanded());
})
.apply(struc -> struc.get().setPrefWidth(25))
.grow(false, true)
.styleClass("expand-button")
.apply(struc -> struc.get().setFocusTraversable(false));
setDisclosureNode(button.createRegion());
}
@ -158,7 +166,8 @@ final class BrowserBookmarkList extends SimpleComp {
.getDisplayIconFileName(item.getEntry().getStore()));
setGraphic(imageView);
setFocusTraversable(true);
setAccessibleText(item.getName() + " " + item.getEntry().getProvider().getDisplayName());
setAccessibleText(
item.getName() + " " + item.getEntry().getProvider().getDisplayName());
}
}
}

View file

@ -80,8 +80,8 @@ public class GuiDsStoreCreator extends MultiStepComp.Step<CompStructure<?>> {
});
this.apply(r -> {
r.get().setPrefWidth(AppFont.em(36));
r.get().setPrefHeight(AppFont.em(42));
r.get().setPrefWidth(AppFont.em(40));
r.get().setPrefHeight(AppFont.em(45));
});
this.validator.addListener((observable, oldValue, newValue) -> {

View file

@ -8,14 +8,13 @@ import io.xpipe.app.ext.ActionProvider;
import io.xpipe.app.fxcomps.Comp;
import io.xpipe.app.fxcomps.SimpleComp;
import io.xpipe.app.fxcomps.SimpleCompStructure;
import io.xpipe.app.fxcomps.augment.GrowAugment;
import io.xpipe.app.fxcomps.augment.ContextMenuAugment;
import io.xpipe.app.fxcomps.augment.GrowAugment;
import io.xpipe.app.fxcomps.impl.*;
import io.xpipe.app.fxcomps.util.PlatformThread;
import io.xpipe.app.fxcomps.util.SimpleChangeListener;
import io.xpipe.app.prefs.AppPrefs;
import io.xpipe.app.storage.DataStorage;
import io.xpipe.app.storage.DataStoreEntry;
import io.xpipe.app.util.DesktopHelper;
import io.xpipe.app.util.ThreadHelper;
import javafx.beans.binding.Bindings;
@ -156,16 +155,8 @@ public class StoreEntryComp extends SimpleComp {
button.setOnAction(event -> {
event.consume();
ThreadHelper.runFailableAsync(() -> {
var found = entry.getDefaultActionProvider().getValue();
if (entry.getState().getValue().equals(DataStoreEntry.State.COMPLETE_BUT_INVALID) || found == null) {
entry.getEntry().refresh(true);
entry.getExpanded().set(true);
}
if (found != null) {
entry.getEntry().updateLastUsed();
found.createAction(entry.getEntry().getStore().asNeeded()).execute();
}
entry.refreshIfNeeded();
entry.executeDefaultAction();
});
});

View file

@ -163,6 +163,24 @@ public class StoreEntryWrapper implements StorageFilter.Filterable {
});
}
public void refreshIfNeeded() throws Exception {
var found = getDefaultActionProvider().getValue();
if (entry.getState().equals(DataStoreEntry.State.COMPLETE_BUT_INVALID) || found == null) {
getEntry().refresh(true);
PlatformThread.runLaterIfNeeded(() -> {
expanded.set(true);
});
}
}
public void executeDefaultAction() throws Exception {
var found = getDefaultActionProvider().getValue();
if (found != null) {
entry.updateLastUsed();
found.createAction(entry.getStore().asNeeded()).execute();
}
}
public void toggleExpanded() {
this.expanded.set(!expanded.getValue());
}

View file

@ -2,7 +2,6 @@ package io.xpipe.app.ext;
import io.xpipe.app.core.AppI18n;
import io.xpipe.core.dialog.Dialog;
import io.xpipe.core.source.CollectionDataSource;
import io.xpipe.core.store.DataStore;
import io.xpipe.core.store.FileSystem;
import io.xpipe.core.store.ShellStore;
@ -14,10 +13,6 @@ import java.util.List;
public interface DataStoreProvider {
default CollectionDataSource<?> createAssociatedContainer(DataStore store) {
return null;
}
default ModuleInstall getRequiredAdditionalInstallation() {
return null;
}

View file

@ -36,7 +36,7 @@ clean=Clean
refresh=Refresh
addDatabase=Add Database ...
addHost=Add Host ...
addShell=Add Shell ...
addShell=Add Environment ...
addCommand=Add Command ...
addOther=Add Other ...
addStreamTitle=Add Stream Store