diff --git a/src/main/java/cn/octopusyan/alistgui/controller/RootController.java b/src/main/java/cn/octopusyan/alistgui/controller/RootController.java index 89f5b93..99c85e5 100644 --- a/src/main/java/cn/octopusyan/alistgui/controller/RootController.java +++ b/src/main/java/cn/octopusyan/alistgui/controller/RootController.java @@ -143,6 +143,11 @@ public class RootController extends BaseController { Context.openUrl("https://github.com/alist-org/alist"); } + public void showTab(int index) { + if (index < 0 || index > 2) return; + tabPane.getSelectionModel().select(index); + } + public void showModal(Node node, boolean persistent) { modalPane.show(node); modalPane.setPersistent(persistent); diff --git a/src/main/java/cn/octopusyan/alistgui/util/DownloadUtil.java b/src/main/java/cn/octopusyan/alistgui/util/DownloadUtil.java index e9db4f4..d74543d 100644 --- a/src/main/java/cn/octopusyan/alistgui/util/DownloadUtil.java +++ b/src/main/java/cn/octopusyan/alistgui/util/DownloadUtil.java @@ -5,6 +5,8 @@ import cn.hutool.core.util.CharsetUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.ZipUtil; import cn.octopusyan.alistgui.config.Constants; +import cn.octopusyan.alistgui.config.Context; +import cn.octopusyan.alistgui.controller.RootController; import cn.octopusyan.alistgui.manager.ConsoleLog; import cn.octopusyan.alistgui.model.upgrade.AList; import cn.octopusyan.alistgui.model.upgrade.Gui; @@ -43,6 +45,8 @@ public class DownloadUtil { @Override public void onRunning() { // 不展示进度条 + RootController root = (RootController) Context.getControllers().get(RootController.class.getSimpleName()); + root.showTab(0); } @Override