Small fixes

This commit is contained in:
crschnick 2024-02-19 20:42:06 +00:00
parent a3cb5f2f42
commit 3d92027a0d
8 changed files with 88 additions and 34 deletions

View file

@ -18,6 +18,7 @@ import javafx.scene.layout.Region;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import java.util.List;
import java.util.function.Function;
public abstract class DialogComp extends Comp<CompStructure<Region>> {
@ -50,6 +51,7 @@ public abstract class DialogComp extends Comp<CompStructure<Region>> {
buttons.setSpacing(5);
buttons.setAlignment(Pos.CENTER_RIGHT);
buttons.getChildren().addAll(customButtons().stream().map(buttonComp -> buttonComp.createRegion()).toList());
var nextButton = new ButtonComp(AppI18n.observable("finishStep"), null, this::finish)
.apply(struc -> struc.get().setDefaultButton(true))
.styleClass(Styles.ACCENT)
@ -58,15 +60,13 @@ public abstract class DialogComp extends Comp<CompStructure<Region>> {
return buttons;
}
protected List<Comp<?>> customButtons() {
return List.of();
}
@Override
public CompStructure<Region> createBase() {
var entryR = content().createRegion();
entryR.getStyleClass().add("dialog-content");
var sp = new ScrollPane(entryR);
sp.setFitToWidth(true);
entryR.minHeightProperty().bind(sp.heightProperty());
var sp = scrollPane(content()).createRegion();
VBox vbox = new VBox();
vbox.getChildren().addAll(sp, createStepNavigation());
vbox.getStyleClass().add("dialog-comp");
@ -83,6 +83,17 @@ public abstract class DialogComp extends Comp<CompStructure<Region>> {
public abstract Comp<?> content();
protected Comp<?> scrollPane(Comp<?> content) {
var entry = content().styleClass("dialog-content");
return Comp.of(() -> {
var entryR = entry.createRegion();
var sp = new ScrollPane(entryR);
sp.setFitToWidth(true);
entryR.minHeightProperty().bind(sp.heightProperty());
return sp;
});
}
public Comp<?> bottom() {
return null;
}

View file

@ -7,15 +7,12 @@ import io.xpipe.app.core.AppI18n;
import io.xpipe.app.fxcomps.Comp;
import io.xpipe.app.fxcomps.SimpleComp;
import io.xpipe.app.fxcomps.util.PlatformThread;
import io.xpipe.app.fxcomps.util.Shortcuts;
import javafx.application.Platform;
import javafx.beans.property.Property;
import javafx.geometry.Insets;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonBar;
import javafx.scene.control.Label;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyCodeCombination;
import javafx.scene.layout.Region;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
@ -62,7 +59,7 @@ public class ModalOverlayComp extends SimpleComp {
if (newValue.finishKey != null) {
var finishButton = new Button(AppI18n.get(newValue.finishKey));
Shortcuts.addShortcut(finishButton, new KeyCodeCombination(KeyCode.ENTER));
finishButton.setDefaultButton(true);
Styles.toggleStyleClass(finishButton, Styles.FLAT);
finishButton.setOnAction(event -> {
newValue.onFinish.run();

View file

@ -1,6 +1,7 @@
package io.xpipe.app.comp.store;
import atlantafx.base.controls.Spacer;
import io.xpipe.app.comp.base.ButtonComp;
import io.xpipe.app.comp.base.DialogComp;
import io.xpipe.app.comp.base.ErrorOverlayComp;
import io.xpipe.app.comp.base.PopupMenuButtonComp;
@ -14,7 +15,6 @@ import io.xpipe.app.fxcomps.util.SimpleChangeListener;
import io.xpipe.app.issue.ErrorEvent;
import io.xpipe.app.issue.ExceptionConverter;
import io.xpipe.app.issue.TrackEvent;
import io.xpipe.app.prefs.AppPrefs;
import io.xpipe.app.storage.DataStorage;
import io.xpipe.app.storage.DataStoreEntry;
import io.xpipe.app.util.*;
@ -26,9 +26,7 @@ import javafx.beans.property.*;
import javafx.beans.value.ObservableValue;
import javafx.geometry.Insets;
import javafx.geometry.Orientation;
import javafx.scene.control.Alert;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.Separator;
import javafx.scene.control.*;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.Region;
import javafx.scene.layout.VBox;
@ -56,6 +54,7 @@ public class StoreCreationComp extends DialogComp {
BooleanProperty finished = new SimpleBooleanProperty();
ObservableValue<DataStoreEntry> entry;
BooleanProperty changedSinceError = new SimpleBooleanProperty();
BooleanProperty skippable = new SimpleBooleanProperty();
StringProperty name;
DataStoreEntry existingEntry;
boolean staticDisplay;
@ -186,6 +185,17 @@ public class StoreCreationComp extends DialogComp {
stage, con, prop, store, filter, initialName, existingEntry, staticDisplay));
}
@Override
protected List<Comp<?>> customButtons() {
return List.of(new ButtonComp(AppI18n.observable("skip"), null, () -> {
if (showInvalidConfirmAlert()) {
commit();
} else {
finish();
}
}).visible(skippable));
}
@Override
protected ObservableValue<Boolean> busy() {
return busy;
@ -223,8 +233,12 @@ public class StoreCreationComp extends DialogComp {
return AppWindowHelper.showBlockingAlert(alert -> {
alert.setTitle(AppI18n.get("confirmInvalidStoreTitle"));
alert.setHeaderText(AppI18n.get("confirmInvalidStoreHeader"));
alert.setContentText(AppI18n.get("confirmInvalidStoreContent"));
alert.getDialogPane().setContent(AppWindowHelper.alertContentText(
AppI18n.get("confirmInvalidStoreContent")));
alert.setAlertType(Alert.AlertType.CONFIRMATION);
alert.getButtonTypes().clear();
alert.getButtonTypes().add(new ButtonType("Retry", ButtonBar.ButtonData.CANCEL_CLOSE));
alert.getButtonTypes().add(new ButtonType("Skip", ButtonBar.ButtonData.OK_DONE));
})
.map(b -> b.getButtonData().isDefaultButton())
.orElse(false);
@ -271,13 +285,6 @@ public class StoreCreationComp extends DialogComp {
return;
}
if (messageProp.getValue() != null && !changedSinceError.get()) {
if (AppPrefs.get().developerMode().getValue() && showInvalidConfirmAlert()) {
commit();
return;
}
}
if (!validator.getValue().validate()) {
var msg = validator
.getValue()
@ -302,6 +309,13 @@ public class StoreCreationComp extends DialogComp {
entry.getValue().validateOrThrow();
commit();
} catch (Throwable ex) {
if (ex instanceof ValidationException) {
ErrorEvent.unreportable(ex);
skippable.set(false);
} else {
skippable.set(true);
}
var newMessage = ExceptionConverter.convertMessage(ex);
// Temporary fix for equal error message not showing up again
if (Objects.equals(newMessage, messageProp.getValue())) {
@ -309,9 +323,7 @@ public class StoreCreationComp extends DialogComp {
}
messageProp.setValue(newMessage);
changedSinceError.setValue(false);
if (ex instanceof ValidationException) {
ErrorEvent.unreportable(ex);
}
ErrorEvent.fromThrowable(ex).omit().handle();
} finally {
DataStorage.get().removeStoreEntryInProgress(entry.getValue());
@ -319,11 +331,15 @@ public class StoreCreationComp extends DialogComp {
});
}
@Override
protected Comp<?> scrollPane(Comp<?> content) {
var back = super.scrollPane(content);
return new ErrorOverlayComp(back, messageProp);
}
@Override
public Comp<?> content() {
var back = Comp.of(this::createLayout);
var message = new ErrorOverlayComp(back, messageProp);
return message;
return Comp.of(this::createLayout);
}
private Region createLayout() {

View file

@ -18,6 +18,7 @@ import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.nio.file.FileSystemException;
import java.nio.file.Files;
import java.nio.file.InvalidPathException;
import java.util.stream.Collectors;
public class SentryErrorHandler implements ErrorHandler {
@ -116,6 +117,12 @@ public class SentryErrorHandler implements ErrorHandler {
otherField.set(copy, null);
}
if (copy instanceof InvalidPathException) {
var inputField = InvalidPathException.class.getDeclaredField("input");
inputField.setAccessible(true);
inputField.set(copy, "");
}
var causeField = Throwable.class.getDeclaredField("cause");
causeField.setAccessible(true);
causeField.set(copy, adjustCopy(throwable.getCause(), true));

View file

@ -54,6 +54,7 @@ addAutomatically=Search Automatically ...
addOther=Add Other ...
addStreamTitle=Add Stream Store
addConnection=Add Connection
skip=Skip
addConnections=New
selectType=Select Type
selectTypeDescription=Select connection type
@ -69,6 +70,6 @@ dragAndDropFilesHere=Or just drag and drop a file here
confirmDsCreationAbortTitle=Confirm abort
confirmDsCreationAbortHeader=Do you want to abort the data source creation?
confirmDsCreationAbortContent=Any data source creation progress will be lost.
confirmInvalidStoreTitle=Confirm invalid data store
confirmInvalidStoreHeader=Do you want to add this data store anyway?
confirmInvalidStoreContent=You can use this store even if it could not be validated.
confirmInvalidStoreTitle=Failed connection
confirmInvalidStoreHeader=Do you want to skip connection validation?
confirmInvalidStoreContent=You can add this connection even if it could not be validated and fix the connection problems later on.

View file

@ -91,6 +91,10 @@ project.ext {
"-Dapple.awt.application.appearance=system"
]
useBundledJavaFx = fullVersion && !(platformName == 'linux' && arch == 'arm64')
announce = System.getenv('SKIP_ANNOUNCEMENT') == null || !Boolean.parseBoolean(System.getenv('SKIP_ANNOUNCEMENT'))
changelogFile = file("$projectDir/changelogs/${rootProject.versionString}.md").exists() ?
file("$projectDir/changelogs/${rootProject.versionString}.md") :
file("$projectDir/changelogs/${rootProject.canonicalVersionString}.md")
}
if (org.gradle.internal.os.OperatingSystem.current() == org.gradle.internal.os.OperatingSystem.LINUX) {

18
dist/changelogs/8.0-5.md vendored Normal file
View file

@ -0,0 +1,18 @@
## Temporary containers
You can now run a temporary docker container using a specified image that will get automatically removed once it is stopped. The container will keep running even if the image does not have any command specified that will run.
This can be useful if you quickly want to set up a certain environment by using a certain container image, e.g. a simple `ubuntu` image. You can then enter the container as normal in XPipe, perform your operations, and stop the container once it's no longer needed. It is then removed automatically.
## macOS tray and dock handling
Due to some confusion, XPipe will no longer use the system tray in macOS as an option when minimizing. It will instead conform to the usual macOS app handling that allows to reopen the window by clicking on the dock icon.
## Other changes
- Add option to skip connection validation
- Introduce new changelog implementation that will be able to display the changelog relevant when upgrading from you current version, including all intermediate versions
- Auto expand connections display when a new child is added
- Fix opnsense and PFsense systems not working
- Fix elevation not working in some cases and throwing errors
- Fix debug mode not working

View file

@ -2,7 +2,7 @@ This is update is primarily focused on internal reworks. It includes many change
The versioning scheme has also been changed to simplify version numbers. So we are going straight from 1.7 to 8.0!
If you're interested, make sure to check out the PTB repository at https://github.com/xpipe-io/xpipe-ptb to download an early version. The regular releases and PTB releases are designed to not interfere with each other and can therefore be installed and used side by side. They work on separate configuration data. If you are planning to use the PTB version, please don't try to link it up to your existing xpipe git vault though if you're using that feature. You can use a separate repository for that. It is intended to start out from zero with the connections in this PTB version to have a good coverage of all the workflows. Also, please don't use this test version for your production environments as it is not considered stable yet.
If you're interested, make sure to check out the public test build repository at https://github.com/xpipe-io/xpipe-ptb to download an early version. The regular releases and PTB releases are designed to not interfere with each other and can therefore be installed and used side by side. They work on separate configuration data. If you are planning to use the PTB version, please don't try to link it up to your existing xpipe git vault though if you're using that feature. You can use a separate repository for that. It is intended to start out from zero with the connections in this PTB version to have a good coverage of all the workflows. Also, please don't use this test version for your production environments as it is not considered stable yet.
Judging from experience, there will be broken features initially. It will definitely take a while until XPipe 8.0 will be fully released. You can help the development effort by testing the PTB version and reporting any issues that you can find.
@ -22,7 +22,7 @@ The git installation on Windows comes with its own posix environment, which some
## File browser improvements
The file browser has been reworked in terms of performance and reliability. Transferring many files should now be faster. Any errors that can a curr are now handled better.
The file browser has been reworked in terms of performance and reliability. Transferring many files should now be faster. Any errors that can occur are now handled better.
In terms of the interface, there is also now a progress indicator for files being transferred. For any file conflicts, there is now a new dialog to choose how to resolve any conflict when copying or moving files.