From 541c144f5e9bd27112869e5dc40c80ebfe3c5799 Mon Sep 17 00:00:00 2001 From: crschnick Date: Mon, 26 May 2025 12:10:35 +0000 Subject: [PATCH] Show update fail link --- .../app/update/UpdateChangelogAlert.java | 26 ++++++++++++++----- lang/strings/translations_en.properties | 3 +++ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/io/xpipe/app/update/UpdateChangelogAlert.java b/app/src/main/java/io/xpipe/app/update/UpdateChangelogAlert.java index 78c769e98..5bd8a3778 100644 --- a/app/src/main/java/io/xpipe/app/update/UpdateChangelogAlert.java +++ b/app/src/main/java/io/xpipe/app/update/UpdateChangelogAlert.java @@ -4,7 +4,9 @@ import io.xpipe.app.comp.Comp; import io.xpipe.app.comp.base.MarkdownComp; import io.xpipe.app.comp.base.ModalButton; import io.xpipe.app.comp.base.ModalOverlay; +import io.xpipe.app.core.AppI18n; import io.xpipe.app.core.window.AppDialog; +import io.xpipe.app.issue.ErrorAction; import io.xpipe.app.issue.ErrorEvent; import io.xpipe.app.util.Hyperlinks; @@ -15,14 +17,24 @@ public class UpdateChangelogAlert { public static void showIfNeeded() { var update = AppDistributionType.get().getUpdateHandler().getPerformedUpdate(); if (update != null && !AppDistributionType.get().getUpdateHandler().isUpdateSucceeded()) { - ErrorEvent.fromMessage( - """ - Update installation did not succeed. + ErrorEvent.fromMessage(AppI18n.get("updateFail")) + .customAction(new ErrorAction() { + @Override + public String getName() { + return AppI18n.get("updateFailAction"); + } - Note that you can also install the latest version manually from %s - if there are any problems with the automatic update installation. - """ - .formatted(Hyperlinks.GITHUB_LATEST)) + @Override + public String getDescription() { + return AppI18n.get("updateFailActionDescription"); + } + + @Override + public boolean handle(ErrorEvent event) { + Hyperlinks.open(Hyperlinks.GITHUB_LATEST); + return true; + } + }) .handle(); return; } diff --git a/lang/strings/translations_en.properties b/lang/strings/translations_en.properties index 4d1aea6fc..95f892e19 100644 --- a/lang/strings/translations_en.properties +++ b/lang/strings/translations_en.properties @@ -1449,3 +1449,6 @@ unsetReadOnly=Unset read-only readOnlyStoreError=This entry is marked as read-only. Choose a different name to save your changes to a new copy. categoryReadOnly=Read-only connection configuration categoryReadOnlyDescription=Marks connection configurations as read-only. This means that no existing connection entry configuration in it can be modified. New connections can be added though. +updateFail=Update installation did not succeed +updateFailAction=Install update manually +updateFailActionDescription=Check out the latest releases at GitHub