From 229662bd151e7f07192845896f1efb31a9be69dc Mon Sep 17 00:00:00 2001 From: octopus_yan Date: Sat, 21 Sep 2024 19:37:51 +0800 Subject: [PATCH] =?UTF-8?q?pref:=20=E5=BC=80=E5=A7=8B=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E5=90=8E=E8=B7=B3=E8=BD=AC=E4=B8=BB=E7=95=8C=E9=9D=A2=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E4=B8=8B=E8=BD=BD=E8=BF=9B=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/octopusyan/alistgui/controller/RootController.java | 5 +++++ src/main/java/cn/octopusyan/alistgui/util/DownloadUtil.java | 4 ++++ 2 files changed, 9 insertions(+) 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