Various small fixes

This commit is contained in:
crschnick 2024-09-27 17:21:52 +00:00
parent d940e99068
commit f5e63fdf52
6 changed files with 31 additions and 3 deletions

View file

@ -178,7 +178,7 @@ public class BrowserTransferModel {
if (Files.isDirectory(file)) {
FileUtils.moveDirectory(file.toFile(), target.toFile());
} else {
FileUtils.moveFile(file.toFile(), target.toFile(), StandardCopyOption.REPLACE_EXISTING);
Files.move(file, target, StandardCopyOption.REPLACE_EXISTING);
}
}
DesktopHelper.browseFileInDirectory(downloads.resolve(files.getFirst().getFileName()));

View file

@ -72,6 +72,11 @@ public class StoreIconChoiceDialogComp extends SimpleComp {
});
}
@Override
protected Comp<?> pane(Comp<?> content) {
return content;
}
@Override
public Comp<?> bottom() {
var clear = new ButtonComp(AppI18n.observable("clear"), () -> {

View file

@ -0,0 +1,21 @@
package io.xpipe.app.core.check;
import io.xpipe.app.prefs.AppPrefs;
import io.xpipe.app.util.PlatformState;
import javafx.application.ConditionalFeature;
import javafx.application.Platform;
public class AppGpuCheck {
public static void check() {
if (PlatformState.getCurrent() != PlatformState.RUNNING) {
return;
}
if (Platform.isSupported(ConditionalFeature.SCENE3D)) {
return;
}
AppPrefs.get().performanceMode.setValue(true);
}
}

View file

@ -3,6 +3,7 @@ package io.xpipe.app.core.mode;
import io.xpipe.app.comp.store.StoreViewState;
import io.xpipe.app.core.*;
import io.xpipe.app.core.check.AppFontLoadingCheck;
import io.xpipe.app.core.check.AppGpuCheck;
import io.xpipe.app.issue.TrackEvent;
import io.xpipe.app.prefs.AppPrefs;
import io.xpipe.app.resources.AppImages;
@ -33,6 +34,7 @@ public abstract class PlatformMode extends OperationMode {
var imageThread = ThreadHelper.runFailableAsync(() -> {
AppImages.init();
});
AppGpuCheck.check();
AppFont.init();
AppTheme.init();
AppStyle.init();

View file

@ -42,7 +42,7 @@ public class AppPrefs {
mapVaultSpecific(new SimpleBooleanProperty(false), "dontAutomaticallyStartVmSshServer", Boolean.class);
final BooleanProperty dontAcceptNewHostKeys =
mapVaultSpecific(new SimpleBooleanProperty(false), "dontAcceptNewHostKeys", Boolean.class);
final BooleanProperty performanceMode = map(
public final BooleanProperty performanceMode = map(
new SimpleBooleanProperty(),
"performanceMode",
Boolean.class);

View file

@ -88,7 +88,7 @@ public interface ExternalPasswordManager extends PrefsChoiceValue {
Marshal.Copy(credMem.credentialBlob, passwordBytes, 0, credMem.credentialBlobSize);
return Encoding.Unicode.GetString(passwordBytes);
} else {
throw new Exception("Failed to retrieve credentials for target: " + target);
throw new Exception("No credentials found for target: " + target);
}
}
}