Small fixes

This commit is contained in:
crschnick
2025-04-23 15:17:51 +00:00
parent f02ce839d5
commit 5595713dc8
3 changed files with 32 additions and 25 deletions
@@ -98,31 +98,34 @@ public class ContextualFileReferenceChoiceComp extends Comp<CompStructure<HBox>>
}
try {
var source = Path.of(currentPath.toString());
var target = sync.getTargetLocation().apply(source);
if (Files.exists(source)) {
var shouldCopy = AppWindowHelper.showConfirmationAlert(
"confirmGitShareTitle", "confirmGitShareHeader", "confirmGitShareContent");
if (!shouldCopy) {
return;
}
var handler = DataStorageSyncHandler.getInstance();
var syncedTarget = handler.addDataFile(
source, target, sync.getPerUser().test(source));
var pubSource = Path.of(source + ".pub");
if (Files.exists(pubSource)) {
var pubTarget = sync.getTargetLocation().apply(pubSource);
DataStorageSyncHandler.getInstance()
.addDataFile(
pubSource, pubTarget, sync.getPerUser().test(pubSource));
}
Platform.runLater(() -> {
filePath.setValue(FilePath.of(syncedTarget));
});
var source = currentPath.asLocalPath();
if (!Files.exists(source)) {
ErrorEvent.fromMessage("Unable to resolve local file path " + source).expected().handle();
return;
}
var target = sync.getTargetLocation().apply(source);
var shouldCopy = AppWindowHelper.showConfirmationAlert(
"confirmGitShareTitle", "confirmGitShareHeader", "confirmGitShareContent");
if (!shouldCopy) {
return;
}
var handler = DataStorageSyncHandler.getInstance();
var syncedTarget = handler.addDataFile(
source, target, sync.getPerUser().test(source));
var pubSource = Path.of(source + ".pub");
if (Files.exists(pubSource)) {
var pubTarget = sync.getTargetLocation().apply(pubSource);
DataStorageSyncHandler.getInstance()
.addDataFile(
pubSource, pubTarget, sync.getPerUser().test(pubSource));
}
Platform.runLater(() -> {
filePath.setValue(FilePath.of(syncedTarget));
});
} catch (Exception e) {
ErrorEvent.fromThrowable(e).handle();
}
@@ -3,6 +3,7 @@ package io.xpipe.app.icon;
import io.xpipe.app.core.AppProperties;
import io.xpipe.app.issue.ErrorEvent;
import io.xpipe.app.prefs.AppPrefs;
import io.xpipe.app.prefs.SupportedLocale;
import io.xpipe.app.resources.AppImages;
import io.xpipe.app.storage.DataStorage;
import io.xpipe.core.util.ValidationException;
@@ -26,8 +27,10 @@ public class SystemIconManager {
.path(DataStorage.getStorageDirectory().resolve("icons"))
.id("custom")
.build());
// For chinese users, GitHub link might be unreliable
// So use an alternative chinese mirror they can use
all.add(SystemIconSource.GitRepository.builder()
.remote("https://github.com/selfhst/icons")
.remote(AppPrefs.get().language().getValue() == SupportedLocale.CHINESE ? "https://gitcode.com/gh_mirrors/icons13/icons" : "https://github.com/selfhst/icons")
.id("selfhst")
.build());
for (var pref : prefs) {
+1
View File
@@ -91,4 +91,5 @@ The application window will now hide any unnecessary sidebars when being resized
- Fix some launched applications exiting on Windows if XPipe is closed
- Fix powershell profile modules potentially breaking powershell shell environments
- Fix terminal launch failing on Windows when connection name contained some special characters
- Fix selfhst icons not reliably working for chinese users
- Fix application restart after update not applying current workspace directory