Various fixes [stage]

This commit is contained in:
crschnick
2025-02-09 14:46:34 +00:00
parent 8940875586
commit bd1fa2bcce
8 changed files with 22 additions and 30 deletions

View File

@@ -48,7 +48,7 @@ public class BrowserClipboard {
List<File> data = (List<File>) clipboard.getData(DataFlavor.javaFileListFlavor);
// Sometimes file data can contain invalid chars. Why?
var files = data.stream()
.filter(file -> file.toString().equals(OsType.getLocal().makeFileSystemCompatible(file.toString())))
.filter(file -> file.toString().chars().noneMatch(value -> Character.isISOControl(value)))
.map(f -> f.toPath()).toList();
if (files.size() == 0) {
return;

View File

@@ -52,8 +52,8 @@ public class OsLogoComp extends SimpleComp {
wrapper.getPersistentState(),
state);
var hide = Bindings.createBooleanBinding(() -> {
return img.get() != null && !wrapper.getLargeCategoryOptimizations().getValue();
}, img, wrapper.getLargeCategoryOptimizations());
return img.get() != null;
}, img);
return new StackComp(List.of(
new SystemStateComp(state).hide(hide),
PrettyImageHelper.ofFixedSize(img, 24, 24).visible(hide)))

View File

@@ -26,7 +26,6 @@ import java.util.stream.Stream;
public class AppExtensionManager {
private static AppExtensionManager INSTANCE;
private final boolean loadedProviders;
private final List<Extension> loadedExtensions = new ArrayList<>();
private final List<ModuleLayer> leafModuleLayers = new ArrayList<>();
private final List<Path> extensionBaseDirectories = new ArrayList<>();
@@ -35,29 +34,22 @@ public class AppExtensionManager {
@Getter
private ModuleLayer extendedLayer;
public AppExtensionManager(boolean loadedProviders) {
this.loadedProviders = loadedProviders;
}
public static void init(boolean loadProviders) throws Exception {
var load = INSTANCE == null || !INSTANCE.loadedProviders && loadProviders;
if (INSTANCE == null) {
INSTANCE = new AppExtensionManager(loadProviders);
INSTANCE.determineExtensionDirectories();
INSTANCE.loadBaseExtension();
INSTANCE.loadAllExtensions();
public static synchronized void init() throws Exception {
if (INSTANCE != null) {
return;
}
if (load) {
try {
ProcessControlProvider.init(INSTANCE.extendedLayer);
ModuleLayerLoader.loadAll(INSTANCE.extendedLayer, t -> {
ErrorEvent.fromThrowable(t).handle();
});
} catch (Throwable t) {
throw ExtensionException.corrupt("Service provider initialization failed", t);
}
INSTANCE = new AppExtensionManager();
INSTANCE.determineExtensionDirectories();
INSTANCE.loadBaseExtension();
INSTANCE.loadAllExtensions();
try {
ProcessControlProvider.init(INSTANCE.extendedLayer);
ModuleLayerLoader.loadAll(INSTANCE.extendedLayer, t -> {
ErrorEvent.fromThrowable(t).handle();
});
} catch (Throwable t) {
throw ExtensionException.corrupt("Service provider initialization failed", t);
}
}

View File

@@ -109,7 +109,7 @@ public abstract class OperationMode {
AppProperties.logSystemProperties();
AppProperties.get().logArguments();
AppDistributionType.init();
AppExtensionManager.init(true);
AppExtensionManager.init();
AppI18n.init();
AppPrefs.initLocal();
AppBeaconServer.setupPort();

View File

@@ -10,7 +10,7 @@ public class GuiErrorHandlerBase {
protected boolean startupGui(Consumer<Throwable> onFail) {
try {
AppProperties.init();
AppExtensionManager.init(false);
AppExtensionManager.init();
PlatformInit.init(true);
} catch (Throwable ex) {
onFail.accept(ex);

View File

@@ -43,7 +43,7 @@ public class TerminalErrorHandler extends GuiErrorHandlerBase implements ErrorHa
private void handleGui(ErrorEvent event) {
try {
AppProperties.init();
AppExtensionManager.init(false);
AppExtensionManager.init();
PlatformInit.init(true);
ErrorHandlerDialog.showAndWait(event);
} catch (Throwable r) {

View File

@@ -40,7 +40,7 @@ public class GitHubUpdater extends UpdateHandler {
() -> {
executeUpdateAndClose();
},
false,
true,
true));
return list;
}

View File

@@ -1 +1 @@
15.0-50
15.0-51