mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-09-27 02:45:36 +00:00
Show update fail link
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Generated
+3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user