Show update fail link

This commit is contained in:
crschnick
2025-05-26 12:10:35 +00:00
parent 22c2b3bea5
commit 541c144f5e
2 changed files with 22 additions and 7 deletions
@@ -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;
}
+3
View File
@@ -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