Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions HMCL/src/main/java/org/jackhuang/hmcl/ui/Controllers.java
Original file line number Diff line number Diff line change
Expand Up @@ -609,14 +609,15 @@ public static void showToast(String content) {
public static void onHyperlinkAction(String href) {
if (href.startsWith("hmcl://")) {
switch (href) {
case "hmcl://settings/feedback":
case "hmcl://settings/feedback" -> {
Controllers.getSettingsPage().showFeedback();
Controllers.navigate(Controllers.getSettingsPage());
break;
case "hmcl://game/launch":
}
case "hmcl://game/launch" -> {
Profile profile = Profiles.getSelectedProfile();
Versions.launch(profile, profile.getSelectedVersion(), LauncherHelper::setKeep);
break;
}
case "hmcl://update/switch-channel/stable" -> getRootPage().getMainPage().onSwitchToStableChannel();
}
} else {
FXUtils.openLink(href);
Expand Down
19 changes: 19 additions & 0 deletions HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.beans.property.*;
import javafx.beans.value.ChangeListener;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.EventHandler;
Expand Down Expand Up @@ -62,6 +63,7 @@
import org.jackhuang.hmcl.ui.versions.GameListPopupMenu;
import org.jackhuang.hmcl.ui.versions.Versions;
import org.jackhuang.hmcl.upgrade.RemoteVersion;
import org.jackhuang.hmcl.upgrade.UpdateChannel;
import org.jackhuang.hmcl.upgrade.UpdateChecker;
import org.jackhuang.hmcl.upgrade.UpdateHandler;
import org.jackhuang.hmcl.util.*;
Expand Down Expand Up @@ -366,6 +368,23 @@ private void closeUpdateBubble() {
showUpdate.set(false);
}

public void onSwitchToStableChannel() {
Controllers.confirm(i18n("update.switch_to_stable.confirm"), i18n("update.switch_to_stable.title"), () -> {
UpdateChecker.requestCheckUpdate(UpdateChannel.STABLE, config().acceptPreviewUpdateProperty().get());
Holder<ChangeListener<Boolean>> holder = new Holder<>();
holder.value = (observable, old, now) -> {
if (!now) {
UpdateChecker.checkingUpdateProperty().removeListener(holder.value);
RemoteVersion target = UpdateChecker.getLatestVersion();
if (target != null) {
UpdateHandler.updateFrom(target);
}
}
};
UpdateChecker.checkingUpdateProperty().addListener(holder.value);
}, null);
}

@Override
public ReadOnlyObjectWrapper<State> stateProperty() {
return state;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ public static void requestCheckUpdate(UpdateChannel channel, boolean preview) {

RemoteVersion finalResult = result;
Platform.runLater(() -> {
checkingUpdate.set(false);
if (finalResult != null) {
latestVersion.set(finalResult);
}
checkingUpdate.set(false);
});
}, "Update Checker", true);
});
Expand Down
6 changes: 4 additions & 2 deletions HMCL/src/main/resources/assets/lang/I18N.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1634,14 +1634,14 @@ update=Update
update.accept=Update
update.changelog=Changelog
update.channel.dev=Beta
update.channel.dev.hint=You are currently using a Beta channel build of the launcher. While it may include some extra features, it is also sometimes less stable than the Stable channel builds.\n\
update.channel.dev.hint=You are currently using a Beta channel build of the launcher. While it may include some extra features, it is also sometimes less stable than the Stable channel builds. <a href="hmcl://update/switch-channel/stable">switch to Stable channel</a>\n\
\n\
If you encounter any bugs or problems, please submit feedback via the channels provided on the <a href="hmcl://settings/feedback">Feedback</a> page.\n\
\n\
Follow <a href="https://space.bilibili.com/1445341">@huanghongxun</a> on Bilibili to stay up to date on important HMCL news, or <a href="https://space.bilibili.com/20314891">@Glavo</a> to learn about HMCL development progress.
update.channel.dev.title=Beta Channel Notice
update.channel.nightly=Nightly
update.channel.nightly.hint=You are currently using a Nightly channel build of the launcher. While it may include some extra features, it is also always less stable than the other channel builds.\n\
update.channel.nightly.hint=You are currently using a Nightly channel build of the launcher. While it may include some extra features, it is also always less stable than the other channel builds. <a href="hmcl://update/switch-channel/stable">switch to Stable channel</a>\n\
\n\
If you encounter any bugs or problems, please submit feedback via the channels provided on the <a href="hmcl://settings/feedback">Feedback</a> page.\n\
\n\
Expand All @@ -1660,6 +1660,8 @@ update.note.stable=Suitable for users who prioritize software stability.\nNew fe
update.note.dev=Suitable for users who want to experience new features first.\nThe development version includes the latest features and bug fixes,\nbut may also have more issues due to insufficient testing.
update.latest=This is the latest version
update.no_browser=Cannot open in system browser. But we copied the link to your clipboard, and you can open it manually.
update.switch_to_stable.confirm=Switch to stable channel?\nThis will download and install the latest stable version.
update.switch_to_stable.title=Switch to Stable Channel
update.tooltip=Update
update.preview=Preview HMCL releases early
update.preview.subtitle=Enable this option to receive new versions of HMCL early for testing before their official release.
Expand Down
6 changes: 4 additions & 2 deletions HMCL/src/main/resources/assets/lang/I18N_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1419,12 +1419,12 @@ update=啟動器更新
update.accept=更新
update.changelog=更新日誌
update.channel.dev=開發版
update.channel.dev.hint=你正在使用 HMCL 開發版。開發版包含一些未在穩定版中包含的測試性功能,僅用於體驗新功能。開發版功能未受充分驗證,使用起來可能不穩定!\n\
update.channel.dev.hint=你正在使用 HMCL 開發版。開發版包含一些未在穩定版中包含的測試性功能,僅用於體驗新功能。開發版功能未受充分驗證,使用起來可能不穩定!<a href="hmcl://update/switch-channel/stable">切換至穩定版</a>\n\
\n\
如果你遇到了使用問題,可以透過設定中 <a href="hmcl://settings/feedback">回報頁面</a> 提供的管道進行回報。歡迎關注 Bilibili <a href="https://space.bilibili.com/1445341">@huanghongxun</a> 以關注 HMCL 的重要動態,或關注 <a href="https://space.bilibili.com/20314891">@Glavo</a> 以瞭解 HMCL 的開發進展。
update.channel.dev.title=開發版提示
update.channel.nightly=預覽版
update.channel.nightly.hint=你正在使用 HMCL 預覽版。預覽版更新較為頻繁,包含一些未在穩定版和開發版中包含的測試性功能,僅用於體驗新功能。預覽版功能未受充分驗證,使用起來可能不穩定!\n\
update.channel.nightly.hint=你正在使用 HMCL 預覽版。預覽版更新較為頻繁,包含一些未在穩定版和開發版中包含的測試性功能,僅用於體驗新功能。預覽版功能未受充分驗證,使用起來可能不穩定!<a href="hmcl://update/switch-channel/stable">切換至穩定版</a>\n\
\n\
如果你遇到了使用問題,可以透過設定中 <a href="hmcl://settings/feedback">回報頁面</a> 提供的管道進行回報。歡迎關注 Bilibili <a href="https://space.bilibili.com/1445341">@huanghongxun</a> 以關注 HMCL 的重要動態,或關注 <a href="https://space.bilibili.com/20314891">@Glavo</a> 以瞭解 HMCL 的開發進展。
update.channel.nightly.title=預覽版提示
Expand All @@ -1441,6 +1441,8 @@ update.note.stable=適合優先追求軟體穩定性的使用者使用。\n新
update.note.dev=適合希望優先體驗新功能的使用者使用。\n開發版會包含最新功能和錯誤修復,但未經充分測試,可能會存在更多問題。
update.latest=目前版本為最新版本
update.no_browser=無法開啟瀏覽器。網址已經複製到剪貼簿了,你可以手動複製網址開啟頁面。
update.switch_to_stable.confirm=是否切換到穩定版?\n這將會下載並安裝最新的穩定版本。
update.switch_to_stable.title=切換至穩定版
update.tooltip=更新
update.preview=提前測試 HMCL 預覽版本
update.preview.subtitle=啟用此選項,你將可以提前取得 HMCL 的新版本,以便在正式發布前進行測試。
Expand Down
6 changes: 4 additions & 2 deletions HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1424,12 +1424,12 @@ update=启动器更新
update.accept=更新
update.changelog=更新日志
update.channel.dev=开发版
update.channel.dev.hint=你正在使用 HMCL 开发版。开发版包含一些未在稳定版中包含的测试性功能,仅用于体验新功能。开发版功能未受充分验证,使用起来可能不稳定!<a href="https://hmcl.huangyuhui.net/download">下载稳定版</a>\n\
update.channel.dev.hint=你正在使用 HMCL 开发版。开发版包含一些未在稳定版中包含的测试性功能,仅用于体验新功能。开发版功能未受充分验证,使用起来可能不稳定!<a href="hmcl://update/switch-channel/stable">切换至稳定版</a>\n\
\n\
如果你使用时遇到了问题,可以通过设置中<a href="hmcl://settings/feedback">反馈页面</a>提供的渠道进行反馈。欢迎关注 B 站账号 <a href="https://space.bilibili.com/1445341">@huanghongxun</a> 以关注 HMCL 的重要动态,或关注 <a href="https://space.bilibili.com/20314891">@Glavo</a> 以了解 HMCL 的开发进展。
update.channel.dev.title=开发版提示
update.channel.nightly=预览版
update.channel.nightly.hint=你正在使用 HMCL 预览版。预览版更新较为频繁,包含一些未在稳定版和开发版中包含的测试性功能,仅用于体验新功能。预览版功能未受充分验证,使用起来可能不稳定!<a href="https://hmcl.huangyuhui.net/download">下载稳定版</a>\n\
update.channel.nightly.hint=你正在使用 HMCL 预览版。预览版更新较为频繁,包含一些未在稳定版和开发版中包含的测试性功能,仅用于体验新功能。预览版功能未受充分验证,使用起来可能不稳定!<a href="hmcl://update/switch-channel/stable">切换至稳定版</a>\n\
\n\
如果你使用时遇到了问题,可以通过设置中<a href="hmcl://settings/feedback">反馈页面</a>提供的渠道进行反馈。欢迎关注 B 站账号 <a href="https://space.bilibili.com/1445341">@huanghongxun</a> 以关注 HMCL 的重要动态,或关注 <a href="https://space.bilibili.com/20314891">@Glavo</a> 以了解 HMCL 的开发进展。
update.channel.nightly.title=预览版提示
Expand All @@ -1446,6 +1446,8 @@ update.note.stable=适合优先追求软件稳定性的用户使用。\n新功
update.note.dev=适合希望优先体验新功能的用户使用。\n包含最新功能和错误修复,但未经充分测试,可能会存在更多问题。
update.latest=当前版本为最新版本
update.no_browser=无法打开浏览器。网址已经复制到剪贴板,你可以手动粘贴网址打开页面。
update.switch_to_stable.confirm=是否切换到稳定版?\n这将会下载并安装最新的稳定版本。
update.switch_to_stable.title=切换至稳定版
update.tooltip=更新
update.preview=提前预览 HMCL 版本
update.preview.subtitle=启用此选项,你将可以提前获取 HMCL 的新版本,以便在正式发布前进行测试。
Expand Down